From 010b5a2d59819cda0f56de8ebdb9830ac58b0f97 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Sat, 31 Oct 2015 22:00:50 +0300 Subject: [PATCH] Rough table view --- dashboard/css/app.css | 36 +++++++++++++++++++++++++++++++ dashboard/js/app.jsx | 49 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 75 insertions(+), 10 deletions(-) diff --git a/dashboard/css/app.css b/dashboard/css/app.css index 82d6d68..bd83e71 100644 --- a/dashboard/css/app.css +++ b/dashboard/css/app.css @@ -1,3 +1,5 @@ +* { box-sizing: border-box; } + body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; @@ -9,10 +11,44 @@ body { /*background-color: #ccc;*/ } +.header { + width: 100%; + height: 30px; +} + .header > div { + float: left; + line-height: 30px; + text-align: center; + font-weight: 600; + border-right: #666 1px solid; + } + +.col-name { width: 200px; } +.col-processed { width: 100px; } +.col-errors { width: 100px; } +.col-min { width: 100px; } +.col-median { width: 100px; } +.col-max { width: 100px; } + .daemon { margin-top: 40px; height: 150px; } + .daemon .stats { + width: 100%; + height: 30px; + } + .daemon .stats > div { + float: left; + line-height: 30px; + text-align: right; + padding-right: 5px; + border-right: #666 1px solid; + } + .daemon .stats > div.col-name { + text-align: left; + font-weight: 600; + } .daemon .left-block { float: left; width: 330px; diff --git a/dashboard/js/app.jsx b/dashboard/js/app.jsx index dc5c657..f485fc0 100644 --- a/dashboard/js/app.jsx +++ b/dashboard/js/app.jsx @@ -42,7 +42,41 @@ var Dashboard = React.createClass({ render: function() { return ( -
{this.renderDaemons()}
+
+
+
{this.renderDaemons()}
+
+ ); + } +}); + +var Header = React.createClass({ + render: function() { + return ( +
+
Daemon
+
Processed
+
Errors
+
Min
+
Median
+
Max
+
+ ); + } +}); + +var StatsRow = React.createClass({ + render: function() { + var value = this.props.value; + return ( +
+
{this.props.name}
+
{value.processed}
+
{value.errors}
+
{formatDuration(value.min)}
+
{formatDuration(value.median)}
+
{formatDuration(value.max)}
+
); } }); @@ -52,16 +86,11 @@ var Daemon = React.createClass({ var last = this.props.points[this.props.points.length - 1]; return (
+
-

{this.props.name}

-
-
Processed:
{last.processed}
-
Errors:
{last.errors}
-
Median:
{formatDuration(last.median)}
-
+
-
); } @@ -161,7 +190,7 @@ var BoxPlot = React.createClass({ var LineChart = React.createClass({ render: function() { var points = this.props.points, - maxHeight = 140, + maxHeight = 90, padding = 5, colors = {processed: "#46f", errors: "#f64"}; @@ -200,7 +229,7 @@ var LineChart = React.createClass({ return (
- + {makePath(points, "processed")} {makePath(points, "errors")}