Fork of the excellent esp8266-react - https://github.com/rjwats/esp8266-react
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
809 B

  1. import React, { Component } from 'react';
  2. import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
  3. import { OTA_SETTINGS_ENDPOINT } from '../api';
  4. import OTASettingsForm from './OTASettingsForm';
  5. import { OTASettings } from './types';
  6. type OTASettingsControllerProps = RestControllerProps<OTASettings>;
  7. class OTASettingsController extends Component<OTASettingsControllerProps> {
  8. componentDidMount() {
  9. this.props.loadData();
  10. }
  11. render() {
  12. return (
  13. <SectionContent title="OTA Settings" titleGutter>
  14. <RestFormLoader
  15. {...this.props}
  16. render={formProps => <OTASettingsForm {...formProps} />}
  17. />
  18. </SectionContent>
  19. );
  20. }
  21. }
  22. export default restController(OTA_SETTINGS_ENDPOINT, OTASettingsController);