2018-02-26 00:11:31 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
import { NTP_SETTINGS_ENDPOINT } from '../constants/Endpoints';
|
2018-03-04 17:36:04 +00:00
|
|
|
import {restComponent} from '../components/RestComponent';
|
2018-02-26 00:11:31 +00:00
|
|
|
import SectionContent from '../components/SectionContent';
|
|
|
|
import NTPSettingsForm from '../forms/NTPSettingsForm';
|
|
|
|
|
|
|
|
class NTPSettings extends Component {
|
|
|
|
|
|
|
|
componentDidMount() {
|
2018-03-04 17:36:04 +00:00
|
|
|
this.props.loadData();
|
2018-02-26 00:11:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2018-03-04 17:36:04 +00:00
|
|
|
const { data, fetched, errorMessage } = this.props;
|
2018-02-26 00:11:31 +00:00
|
|
|
return (
|
|
|
|
<SectionContent title="NTP Settings">
|
2018-03-04 17:36:04 +00:00
|
|
|
<NTPSettingsForm
|
|
|
|
ntpSettings={data}
|
|
|
|
ntpSettingsFetched={fetched}
|
|
|
|
errorMessage={errorMessage}
|
|
|
|
onSubmit={this.props.saveData}
|
|
|
|
onReset={this.props.loadData}
|
|
|
|
handleValueChange={this.props.handleValueChange}
|
|
|
|
/>
|
2018-02-26 00:11:31 +00:00
|
|
|
</SectionContent>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-03-04 17:36:04 +00:00
|
|
|
export default restComponent(NTP_SETTINGS_ENDPOINT, NTPSettings);
|