diff --git a/client/app/scripts/components/sidebar.js b/client/app/scripts/components/sidebar.js
new file mode 100644
index 0000000000..659b7226e4
--- /dev/null
+++ b/client/app/scripts/components/sidebar.js
@@ -0,0 +1,15 @@
+const React = require('react');
+
+const Sidebar = React.createClass({
+
+ render: function() {
+ return (
+
+ );
+ }
+
+});
+
+module.exports = Sidebar;
diff --git a/client/app/scripts/components/status.js b/client/app/scripts/components/status.js
index d5b726f58f..cea0dc382f 100644
--- a/client/app/scripts/components/status.js
+++ b/client/app/scripts/components/status.js
@@ -14,10 +14,17 @@ const Status = React.createClass({
}
},
+ renderTopologyStats: function(stats) {
+ const statsText = `${stats.node_count} nodes, ${stats.edge_count} connections`;
+ return
;
+ },
+
render: function() {
+ const showStats = this.props.topology && !this.props.errorUrl && !this.props.websocketClosed;
return (
-
- {this.renderConnectionState(this.props.errorUrl, this.props.websocketClosed)}
+
+ {showStats && this.renderTopologyStats(this.props.topology.stats)}
+ {!showStats && this.renderConnectionState(this.props.errorUrl, this.props.websocketClosed)}
);
}
diff --git a/client/app/scripts/components/topology-option-action.js b/client/app/scripts/components/topology-option-action.js
new file mode 100644
index 0000000000..2101bc3078
--- /dev/null
+++ b/client/app/scripts/components/topology-option-action.js
@@ -0,0 +1,22 @@
+const React = require('react');
+
+const AppActions = require('../actions/app-actions');
+
+const TopologyOptionAction = React.createClass({
+
+ onClick: function(ev) {
+ ev.preventDefault();
+ AppActions.changeTopologyOption(this.props.option, this.props.value);
+ },
+
+ render: function() {
+ return (
+
+ {this.props.value}
+
+ );
+ }
+
+});
+
+module.exports = TopologyOptionAction;
diff --git a/client/app/scripts/components/topology-options.js b/client/app/scripts/components/topology-options.js
index 38855a4863..435ad62a78 100644
--- a/client/app/scripts/components/topology-options.js
+++ b/client/app/scripts/components/topology-options.js
@@ -1,40 +1,35 @@
const React = require('react');
const _ = require('lodash');
-const mui = require('material-ui');
-const DropDownMenu = mui.DropDownMenu;
-const AppActions = require('../actions/app-actions');
+const TopologyOptionAction = require('./topology-option-action');
const TopologyOptions = React.createClass({
- componentDidMount: function() {
- this.fixWidth();
- },
-
- onChange: function(ev, index, item) {
- ev.preventDefault();
- AppActions.changeTopologyOption(item.option, item.payload);
+ renderAction: function(action, option) {
+ return (
+
+ );
},
renderOption: function(items) {
- let selected = 0;
- let key;
+ let activeText;
+ const actions = [];
const activeOptions = this.props.activeOptions;
- const menuItems = items.map(function(item, index) {
+ items.forEach(function(item) {
if (activeOptions[item.option] && activeOptions[item.option] === item.value) {
- selected = index;
+ activeText = item.display;
+ } else {
+ actions.push(this.renderAction(item.value, item.option));
}
- key = item.option;
- return {
- option: item.option,
- payload: item.value,
- text: item.display
- };
- });
+ }, this);
return (
-
+
+ {activeText}
+
+ {actions}
+
+
);
},
@@ -51,27 +46,14 @@ const TopologyOptions = React.createClass({
);
return (
-
+
{options.map(function(items) {
return this.renderOption(items);
}, this)}
);
- },
-
- componentDidUpdate: function() {
- this.fixWidth();
- },
-
- fixWidth: function() {
- const containerNode = this.refs.container.getDOMNode();
- _.each(containerNode.childNodes, function(child) {
- // set drop down width to length of current label
- const label = child.getElementsByClassName('mui-menu-label')[0];
- const width = label.getBoundingClientRect().width + 40;
- child.style.width = width + 'px';
- });
}
+
});
module.exports = TopologyOptions;
diff --git a/client/app/styles/main.less b/client/app/styles/main.less
index 1eb64c63d2..0f9627922d 100644
--- a/client/app/styles/main.less
+++ b/client/app/styles/main.less
@@ -1,6 +1,3 @@
-@import "~material-ui/src/less/scaffolding.less";
-@import "~material-ui/src/less/components.less";
-
@font-face {
font-family: "Roboto";
src: url("../../node_modules/materialize-css/font/roboto/Roboto-Regular.woff2"),
@@ -8,7 +5,6 @@
url("../../node_modules/materialize-css/font/roboto/Roboto-Regular.ttf");
}
-
.browsehappy {
margin: 0.2em 0;
background: #ccc;
@@ -32,12 +28,6 @@
@text-darker-color: @primary-color;
@white: @background-secondary-color;
-html, body {
-}
-
-.wrap {
-}
-
/* add this class to truncate text with ellipsis, container needs width */
.truncate {
white-space: nowrap;
@@ -50,6 +40,25 @@ body {
background: linear-gradient(30deg, @background-color 0%, @background-secondary-color 100%);
color: @text-color;
line-height: 150%;
+ font-family: Roboto, Helvetica, Arial, sans-serif;
+ font-size: 13px;
+}
+
+p {
+ line-height: 20px;
+ padding-top: 6px;
+ margin-bottom: 14px;
+ letter-spacing: 0;
+ font-weight: 400;
+ color: @text-color;
+}
+
+h2 {
+ font-size: 34px;
+ line-height: 40px;
+ padding-top: 8px;
+ margin-bottom: 12px;
+ font-weight: 400;
}
#app {
@@ -135,10 +144,6 @@ body {
}
.status {
- float: right;
- margin-top: 14px;
- margin-right: 64px;
-
&-icon {
font-size: 16px;
position: relative;
@@ -269,26 +274,6 @@ body {
}
}
-.mui-paper, .mui-paper-container {
- height: 100%;
-}
-
-.mui-drop-down-menu {
- .mui-menu-control {
- .mui-menu-label {
- font-size: 12px;
- }
-
- .mui-menu-control-underline {
- border-top: none;
- }
-
- .mui-menu-control-bg {
- background-color: transparent;
- }
- }
-}
-
.node-details {
height: 100%;
width: 100%;
@@ -300,7 +285,7 @@ body {
&-label {
color: white;
- margin-bottom: 0;
+ margin: 0;
width: 348px;
&-minor {
@@ -372,3 +357,32 @@ body {
}
+.sidebar {
+ position: fixed;
+ bottom: 16px;
+ left: 24px;
+ width: 16em;
+ font-size: 85%;
+
+ &-item {
+ background-color: darken(@background-color, 8%);
+ border-radius: 2px;
+ padding: 4px 8px;
+ width: 100%;
+ margin-top: 2px;
+
+ &.status {
+ background-color: darken(@background-color, 4%);
+ color: @text-secondary-color;
+ }
+
+ &-action {
+ float: right;
+ text-transform: uppercase;
+ font-weight: bold;
+ color: darken(@weave-orange, 15%);
+ cursor: pointer;
+ }
+ }
+}
+
diff --git a/client/package.json b/client/package.json
index c14726dc49..383cd5b0c9 100644
--- a/client/package.json
+++ b/client/package.json
@@ -15,7 +15,7 @@
"immutable": "^3.7.4",
"keymirror": "^0.1.1",
"lodash": "~3.9.3",
- "material-ui": "~0.7.5",
+ "material-ui": "^0.11.0",
"materialize-css": "^0.96.1",
"object-assign": "^2.0.0",
"page": "^1.6.3",