diff --git a/resources/js/components/Graphics/LatestResults.js b/resources/js/components/Graphics/LatestResults.js index 86534899..f93524ec 100644 --- a/resources/js/components/Graphics/LatestResults.js +++ b/resources/js/components/Graphics/LatestResults.js @@ -92,47 +92,48 @@ export default class LatestResults extends Component { } else { return ( - - -

Latest test results:

- -
diff --git a/resources/js/components/Graphics/Widget.js b/resources/js/components/Graphics/Widget.js index e4bdb18b..0282122c 100644 --- a/resources/js/components/Graphics/Widget.js +++ b/resources/js/components/Graphics/Widget.js @@ -10,26 +10,32 @@ export default class Widget extends Component { title: this.props.title, value: this.props.value, unit: this.props.unit, - icon: this.props.icon + icon: this.props.icon, + avg: this.props.avg, + max: this.props.max } } componentDidUpdate = () => { - if(this.props.title != this.state.title || this.props.value != this.state.value || this.props.unit != this.state.unit || this.props.icon != this.state.icon) { + if(this.props.title != this.state.title || this.props.value != this.state.value || this.props.unit != this.state.unit || this.props.icon != this.state.icon || this.props.avg != this.state.avg || this.props.max != this.state.max) { this.setState({ title: this.props.title, value: this.props.value, unit: this.props.unit, - icon: this.props.icon + icon: this.props.icon, + avg: this.props.avg, + max: this.props.max }); } } render() { - var title = this.props.title; - var value = this.props.value; - var unit = this.props.unit; - var icon = this.props.icon; + var title = this.state.title; + var value = this.state.value; + var unit = this.state.unit; + var icon = this.state.icon; + var max = this.state.max; + var avg = this.state.avg; switch(icon) { case 'ping': @@ -46,14 +52,25 @@ export default class Widget extends Component { return ( -
+
-

{title}

-

{value}

-

{unit}

-
-
- {icon} +
+

{title}

+ {icon} +
+ +
+

{value}

+

{unit} (current)

+
+
+
{avg}
+

{unit} (average)

+
+
+
{max}
+

{unit} (maximum)

+