diff --git a/ui/src/hosts/containers/HostPage.js b/ui/src/hosts/containers/HostPage.js index 2602388c8e..4e16ec8973 100644 --- a/ui/src/hosts/containers/HostPage.js +++ b/ui/src/hosts/containers/HostPage.js @@ -7,42 +7,46 @@ import FlashMessages from 'shared/components/FlashMessages'; const RefreshingLineGraph = AutoRefresh(LineGraph); export const HostPage = React.createClass({ + propTypes: { + sources: PropTypes.arrayOf(PropTypes.shape()), + }, + render() { const autoRefreshMs = 15000; const source = this.props.sources[0].links.proxy; const queries = [ - { + { text: `SELECT "usage_user" FROM "telegraf"."default"."cpu" WHERE time > now() - 15m`, - name: 'CPU' + name: 'CPU', }, - { + { text: `SELECT "used_percent" FROM "telegraf"."default"."mem" WHERE time > now() - 15m`, - name: "Memory" + name: "Memory", }, - { + { text: `SELECT "load1" FROM "telegraf"."default"."system" WHERE time > now() - 15m`, - name: "Load" + name: "Load", }, { text: `SELECT "bytes_recv", "bytes_sent" FROM "telegraf"."default"."net" WHERE time > now() - 15m`, - name: "Network" + name: "Network", }, - { + { text: `SELECT "io_time" FROM "telegraf"."default"."diskio" WHERE time > now() - 15m`, - name: "Disk IO" + name: "Disk IO", }, - { + { text: `SELECT "used_percent" FROM "telegraf"."default"."disk" WHERE time > now() - 15m`, - name: "Disk usage" + name: "Disk usage", }, ]; return (
- { + { queries.map((query) => { - const q = Object.assign({}, query, { host: source }); + const q = Object.assign({}, query, {host: source}); return (

{q.name}

@@ -52,7 +56,7 @@ export const HostPage = React.createClass({ />
); - }) + }) }
diff --git a/ui/src/shared/components/LineGraph.js b/ui/src/shared/components/LineGraph.js index 74887afb25..da1fc2d039 100644 --- a/ui/src/shared/components/LineGraph.js +++ b/ui/src/shared/components/LineGraph.js @@ -32,7 +32,7 @@ export default React.createClass({ // If data for this graph is being fetched for the first time, show a graph-wide spinner. if (this.props.isFetchingInitially) { return ( -
+

);