mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-13 03:09:51 +03:00
30 lines
820 B
TypeScript
30 lines
820 B
TypeScript
import React, { Component } from 'react';
|
|
|
|
import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
|
|
import NetworkStatusForm from './NetworkStatusForm';
|
|
import { NETWORK_STATUS_ENDPOINT } from '../api';
|
|
import { NetworkStatus } from './types';
|
|
|
|
type NetworkStatusControllerProps = RestControllerProps<NetworkStatus>;
|
|
|
|
class NetworkStatusController extends Component<NetworkStatusControllerProps> {
|
|
|
|
componentDidMount() {
|
|
this.props.loadData();
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<SectionContent title="Network Status">
|
|
<RestFormLoader
|
|
{...this.props}
|
|
render={formProps => <NetworkStatusForm {...formProps} />}
|
|
/>
|
|
</SectionContent>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
export default restController(NETWORK_STATUS_ENDPOINT, NetworkStatusController);
|