summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-11-07 17:07:49 +0100
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-11-07 17:07:49 +0100
commit4b9cbc645a8e6824996c4c0afef438164e569928 (patch)
treebda7b053e7d622000a1b23ac819ef2f1c1cc4374
parent886877950b1a2b4006d1f5dbe93367c086e213a0 (diff)
parent2f71cb1c9fd3e649a1f0e6f713922a73372f064e (diff)
Merge branch 'master' into upgrade-dependencies
# Conflicts: # README.md
-rw-r--r--README.md3
-rw-r--r--public/index.html36
-rw-r--r--src/components/app/sidebars/elements/LoadChartComponent.js11
-rw-r--r--src/components/experiments/ExperimentListComponent.js32
-rw-r--r--src/containers/experiments/ExperimentListContainer.js1
-rw-r--r--src/reducers/construction-mode.js2
6 files changed, 67 insertions, 18 deletions
diff --git a/README.md b/README.md
index 60094fe8..b1e15aad 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,8 @@ Collaborative Datacenter Simulation and Exploration for Everybody
[![Build Status](https://travis-ci.org/atlarge-research/opendc-frontend.svg?branch=master)](https://travis-ci.org/atlarge-research/opendc-frontend)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
-[![bitHound Overall Score](https://www.bithound.io/github/atlarge-research/opendc-frontend/badges/score.svg)](https://www.bithound.io/github/atlarge-research/opendc-frontend)
+[![bitHound Overall Score](https://www.bithound.io/github/atlarge-research/opendc-frontend/badges/score.svg)](https://www.bithound.io/github/atlarge-research/opendc-frontend)<br/>
+[![Waffle.io - Columns and their card count](https://badge.waffle.io/atlarge-research/opendc-frontend.png?columns=all)](https://waffle.io/atlarge-research/opendc-frontend?utm_source=badge)
The user-facing component of the OpenDC stack, allowing users to build and interact with their own (virtual) datacenters. Built in *React.js* and *Redux*, with the help of `create-react-app`.
diff --git a/public/index.html b/public/index.html
index a076ac66..e88cca42 100644
--- a/public/index.html
+++ b/public/index.html
@@ -4,16 +4,26 @@
<meta charset="utf-8">
<title>OpenDC</title>
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <meta name="theme-color" content="#000000">
-
<!-- Standard meta tags -->
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <meta name="theme-color" content="#00A6D6">
<meta name="description" content="Collaborative Datacenter Simulation and Exploration for Everybody">
- <meta name="author" content="Alexandru Iosup, Leon Overweel, Georgios Andreadis, Matthijs Bijman">
+ <meta name="author" content="@Large Research">
<meta name="keywords" content="OpenDC, Datacenter, Simulation, Simulator, Collaborative, Distributed, Cluster">
+ <link rel="manifest" href="/manifest.json">
+ <link rel="shortcut icon" href="/favicon.ico">
+
+ <!-- Twitter Card data -->
+ <meta name="twitter:card" content="summary">
+ <meta name="twitter:site" content="@LargeResearch">
+ <meta name="twitter:title" content="OpenDC">
+ <meta name="twitter:description" content="Collaborative Datacenter Simulation and Exploration for Everybody">
+ <meta name="twitter:creator" content="@LargeResearch">
+ <meta name="twitter:image" content="http://opendc.org/img/logo.png">
<!-- OpenGraph meta tags -->
- <meta property="og:title" content="OpenDC: Collaborative Datacenter Simulation and Exploration for Everybody">
+ <meta property="og:title" content="OpenDC">
+ <meta property="og:site_name" content="OpenDC">
<meta property="og:type" content="website">
<meta property="og:image" content="http://opendc.org/img/logo.png">
<meta property="og:url" content="http://opendc.org/">
@@ -22,21 +32,31 @@
simulation, and exploratory datacenter performance feedback.">
<meta property="og:locale" content="en_US">
- <link rel="manifest" href="/manifest.json">
- <link rel="shortcut icon" href="/favicon.ico">
-
+ <!-- Google meta tags -->
<meta name="google-signin-client_id" content="%REACT_APP_OAUTH_CLIENT_ID%">
+ <meta name="google-site-verification" content="YIR4LkQTv6WmOdWv8MkeiUKni-0Yu3WHylLp4VvUMig"/>
+ <!-- CDN dependencies -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css"
integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<script src="https://use.fontawesome.com/ece66a2e7c.js"></script>
+
+ <!-- Google Analytics -->
+ <script async src="https://www.googletagmanager.com/gtag/js?id=UA-84285092-3"></script>
+ <script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag() {dataLayer.push(arguments);}
+ gtag('js', new Date());
+ gtag('config', 'UA-84285092-3');
+ </script>
</head>
<body data-spy="scroll" data-target="#navbar">
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
diff --git a/src/components/app/sidebars/elements/LoadChartComponent.js b/src/components/app/sidebars/elements/LoadChartComponent.js
index 6f66010e..5f0d40cb 100644
--- a/src/components/app/sidebars/elements/LoadChartComponent.js
+++ b/src/components/app/sidebars/elements/LoadChartComponent.js
@@ -4,6 +4,7 @@ import SvgSaver from "svgsaver";
import {
VictoryAxis,
VictoryChart,
+ VictoryLabel,
VictoryLine,
VictoryScatter
} from "victory";
@@ -56,9 +57,17 @@ const VictoryChartComponent = ({ data, currentTick, showCurrentTick }) => (
<VictoryScatter data={data} />
{showCurrentTick ? (
<VictoryLine
+ labelComponent={
+ <VictoryLabel renderInPortal angle={90} dy={-5} dx={60} />
+ }
data={[{ x: currentTick + 1, y: 0 }, { x: currentTick + 1, y: 1 }]}
+ labels={point =>
+ point.y === 1
+ ? "Current tick : " + convertSecondsToFormattedTime(currentTick)
+ : ""}
style={{
- data: { stroke: "#00A6D6", strokeWidth: 3 }
+ data: { stroke: "#00A6D6", strokeWidth: 4 },
+ labels: { fill: "#00A6D6" }
}}
/>
) : (
diff --git a/src/components/experiments/ExperimentListComponent.js b/src/components/experiments/ExperimentListComponent.js
index 28c06f29..2f7106e5 100644
--- a/src/components/experiments/ExperimentListComponent.js
+++ b/src/components/experiments/ExperimentListComponent.js
@@ -2,15 +2,30 @@ import PropTypes from "prop-types";
import React from "react";
import ExperimentRowContainer from "../../containers/experiments/ExperimentRowContainer";
-const ExperimentListComponent = ({ experimentIds }) => {
+const ExperimentListComponent = ({ experimentIds, loading }) => {
+ let alert;
+
+ if (loading) {
+ alert = (
+ <div className="alert alert-success">
+ <span className="fa fa-refresh fa-spin mr-2" />
+ <strong>Loading Experiments...</strong>
+ </div>
+ );
+ } else if (experimentIds.length === 0 && !loading) {
+ alert = (
+ <div className="alert alert-info">
+ <span className="fa fa-question-circle mr-2" />
+ <strong>No experiments here yet...</strong> Add some with the button
+ below!
+ </div>
+ );
+ }
+
return (
<div className="vertically-expanding-container">
- {experimentIds.length === 0 ? (
- <div className="alert alert-info">
- <span className="info-icon fa fa-question-circle mr-2" />
- <strong>No experiments here yet...</strong> Add some with the button
- below!
- </div>
+ {alert ? (
+ alert
) : (
<table className="table table-striped">
<thead>
@@ -37,7 +52,8 @@ const ExperimentListComponent = ({ experimentIds }) => {
};
ExperimentListComponent.propTypes = {
- experimentIds: PropTypes.arrayOf(PropTypes.number).isRequired
+ experimentIds: PropTypes.arrayOf(PropTypes.number).isRequired,
+ loading: PropTypes.bool
};
export default ExperimentListComponent;
diff --git a/src/containers/experiments/ExperimentListContainer.js b/src/containers/experiments/ExperimentListContainer.js
index 632942bf..53bb1dad 100644
--- a/src/containers/experiments/ExperimentListContainer.js
+++ b/src/containers/experiments/ExperimentListContainer.js
@@ -7,6 +7,7 @@ const mapStateToProps = state => {
!("experimentIds" in state.objects.simulation[state.currentSimulationId])
) {
return {
+ loading: true,
experimentIds: []
};
}
diff --git a/src/reducers/construction-mode.js b/src/reducers/construction-mode.js
index 4778bd44..f58684e6 100644
--- a/src/reducers/construction-mode.js
+++ b/src/reducers/construction-mode.js
@@ -1,5 +1,6 @@
import { combineReducers } from "redux";
import { OPEN_EXPERIMENT_SUCCEEDED } from "../actions/experiments";
+import { GO_DOWN_ONE_INTERACTION_LEVEL } from "../actions/interaction-level";
import {
CANCEL_NEW_ROOM_CONSTRUCTION_SUCCEEDED,
FINISH_NEW_ROOM_CONSTRUCTION,
@@ -29,6 +30,7 @@ export function inRackConstructionMode(state = false, action) {
return true;
case STOP_RACK_CONSTRUCTION:
case OPEN_EXPERIMENT_SUCCEEDED:
+ case GO_DOWN_ONE_INTERACTION_LEVEL:
return false;
default:
return state;