import React, {Component} from 'react'; import {Box, List, ListItem, ListItemText} from '@material-ui/core'; import {FormButton, restController, RestControllerProps, RestFormLoader, SectionContent} from '../components'; import {ENDPOINT_ROOT} from "../api"; import {GeneralInformaitonState} from "./types"; import RefreshIcon from "@material-ui/icons/Refresh"; import {getRealTimeString, stringifyTime} from "./Time"; // define api endpoint export const GENERALINFORMATION_SETTINGS_ENDPOINT = ENDPOINT_ROOT + "generalinfo"; type GeneralInformationRestControllerProps = RestControllerProps; class GeneralInformation extends Component { componentDidMount() { this.props.loadData(); } render() { return ( ( <> {stringifyTime(props.data.runtime)}
{getRealTimeString(props.data.runtime)}} />
vor {stringifyTime(props.data.lastWaterOutage)}
{getRealTimeString(props.data.lastWaterOutage)} : "noch nie!"} />
vor {stringifyTime(props.data.lastpumptime)}
{getRealTimeString(props.data.lastpumptime)} : "noch nie!"} />
} variant="contained" color="secondary" onClick={this.props.loadData}> Refresh Version: {props.data.version} )} />
); } } export default restController(GENERALINFORMATION_SETTINGS_ENDPOINT, GeneralInformation);