render()

in frontend/src/components/Telemetry.js [357:408]


    render() {
        var versionLabel = (this.props.version === '') ? '?' : this.props.version

        var statusLabel = '?';
        if (this.props.status === 'standby') {
            statusLabel =
            <div>
                {this.props.status}
            </div>;
        } else if (this.props.status === 'charging') {
            statusLabel =
            <div>
                {this.props.status}
            </div>;
            
        } else if (this.props.status === 'working') {
            statusLabel =
            <div>
                {this.props.status}
            </div>;
        }

        var lastReceivedAtLabel = '?';
        if (this.props.lastTelemetryReceivedAt) {
            var d = new Date(this.props.lastTelemetryReceivedAt);
            lastReceivedAtLabel =
            <div>
                {moment(d).format('HH:mm:ss')}
            </div>;
        }

        return (
            <div>
                <Statistic.Group widths='three'>
                    <Statistic color='blue'>
                        <Statistic.Value>{versionLabel}</Statistic.Value>
                        <Statistic.Label>Version</Statistic.Label>
                    </Statistic>
                    <Statistic color='blue'>
                        <Statistic.Value>
                            {statusLabel}
                        </Statistic.Value>
                        <Statistic.Label>Status</Statistic.Label>
                    </Statistic>
                    <Statistic color='blue'>
                        <Statistic.Value>{lastReceivedAtLabel}</Statistic.Value>
                        <Statistic.Label>Last data received at</Statistic.Label>
                    </Statistic>
                </Statistic.Group>
            </div>
        )
    }