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.
29 lines
809 B
29 lines
809 B
import React, { Component } from 'react';
|
|
|
|
import { restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
|
|
import WiFiSettingsForm from './WiFiSettingsForm';
|
|
import { WIFI_SETTINGS_ENDPOINT } from '../api';
|
|
import { WiFiSettings } from './types';
|
|
|
|
type WiFiSettingsControllerProps = RestControllerProps<WiFiSettings>;
|
|
|
|
class WiFiSettingsController extends Component<WiFiSettingsControllerProps> {
|
|
|
|
componentDidMount() {
|
|
this.props.loadData();
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<SectionContent title="WiFi Settings">
|
|
<RestFormLoader
|
|
{...this.props}
|
|
render={formProps => <WiFiSettingsForm {...formProps} />}
|
|
/>
|
|
</SectionContent>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
export default restController(WIFI_SETTINGS_ENDPOINT, WiFiSettingsController);
|