mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
36 lines
903 B
TypeScript
36 lines
903 B
TypeScript
import React, { Component } from 'react';
|
|
|
|
import {
|
|
restController,
|
|
RestControllerProps,
|
|
RestFormLoader,
|
|
SectionContent
|
|
} from '../components';
|
|
|
|
import { ENDPOINT_ROOT } from '../api';
|
|
import EMSESPDevicesForm from './EMSESPDevicesForm';
|
|
import { EMSESPDevices } from './EMSESPtypes';
|
|
|
|
export const EMSESP_DEVICES_ENDPOINT = ENDPOINT_ROOT + 'allDevices';
|
|
|
|
type EMSESPDevicesControllerProps = RestControllerProps<EMSESPDevices>;
|
|
|
|
class EMSESPDevicesController extends Component<EMSESPDevicesControllerProps> {
|
|
componentDidMount() {
|
|
this.props.loadData();
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<SectionContent title="Devices & Sensors">
|
|
<RestFormLoader
|
|
{...this.props}
|
|
render={(formProps) => <EMSESPDevicesForm {...formProps} />}
|
|
/>
|
|
</SectionContent>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default restController(EMSESP_DEVICES_ENDPOINT, EMSESPDevicesController);
|