aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/assets/components/Home.jsx
diff options
context:
space:
mode:
authorKurkó Mihály <kurkomisi@users.noreply.github.com>2018-01-15 17:20:00 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-15 17:20:00 +0800
commit938cf4528ab5acbb6013be79a0548956713807a8 (patch)
treef7782996f31b39539d148d5daeea9171415db87c /dashboard/assets/components/Home.jsx
parent81ad8f665d3e7598273958d557c531f800eca50f (diff)
downloaddexon-938cf4528ab5acbb6013be79a0548956713807a8.tar
dexon-938cf4528ab5acbb6013be79a0548956713807a8.tar.gz
dexon-938cf4528ab5acbb6013be79a0548956713807a8.tar.bz2
dexon-938cf4528ab5acbb6013be79a0548956713807a8.tar.lz
dexon-938cf4528ab5acbb6013be79a0548956713807a8.tar.xz
dexon-938cf4528ab5acbb6013be79a0548956713807a8.tar.zst
dexon-938cf4528ab5acbb6013be79a0548956713807a8.zip
dashboard: deep state update, version in footer (#15837)
* dashboard: footer, deep state update * dashboard: resolve asset path * dashboard: remove bundle.js * dashboard: prevent state update on every reconnection * dashboard: fix linter issue * dashboard, cmd: minor UI fix, include commit hash * remove geth binary * dashboard: gitCommit renamed to commit * dashboard: move the geth version to the right, make commit optional * dashboard: commit limited to 7 characters * dashboard: limit commit length on client side * dashboard: run go generate
Diffstat (limited to 'dashboard/assets/components/Home.jsx')
-rw-r--r--dashboard/assets/components/Home.jsx13
1 files changed, 9 insertions, 4 deletions
diff --git a/dashboard/assets/components/Home.jsx b/dashboard/assets/components/Home.jsx
index d3e1004f9..f9fd7bf46 100644
--- a/dashboard/assets/components/Home.jsx
+++ b/dashboard/assets/components/Home.jsx
@@ -22,13 +22,13 @@ import withTheme from 'material-ui/styles/withTheme';
import {LineChart, AreaChart, Area, YAxis, CartesianGrid, Line} from 'recharts';
import ChartGrid from './ChartGrid';
-import type {ChartEntry} from '../types/message';
+import type {ChartEntry} from '../types/content';
export type Props = {
theme: Object,
memory: Array<ChartEntry>,
traffic: Array<ChartEntry>,
- shouldUpdate: Object,
+ shouldUpdate: Object,
};
// Home renders the home content.
class Home extends Component<Props> {
@@ -40,11 +40,16 @@ class Home extends Component<Props> {
}
shouldComponentUpdate(nextProps) {
- return nextProps.shouldUpdate.has('memory') || nextProps.shouldUpdate.has('traffic');
+ return typeof nextProps.shouldUpdate.home !== 'undefined';
}
+ memoryColor: Object;
+ trafficColor: Object;
+
render() {
- const {memory, traffic} = this.props;
+ let {memory, traffic} = this.props;
+ memory = memory.map(({value}) => (value || 0));
+ traffic = traffic.map(({value}) => (value || 0));
return (
<ChartGrid spacing={24}>