Commit c620d4c0 authored by Jérémy Jaouen's avatar Jérémy Jaouen
Browse files

clean Wizard: Poller Front-End part

parent d83569f9
......@@ -31,12 +31,17 @@ class PollerStepOneRoute extends Component {
state = {
error: null,
waitList: null,
defaultCentralIp: null,
};
wizardFormWaitListApi = axios(
'internal.php?object=centreon_configuration_remote&action=getPollerWaitList',
);
wizardFormDefaultCentralApi = axios(
'internal.php?object=centreon_configuration_remote&action=getCentralDefaultIp',
);
getWaitList = () => {
this.wizardFormWaitListApi
.post()
......@@ -48,8 +53,20 @@ class PollerStepOneRoute extends Component {
});
};
getDefaultCentralIp = () => {
this.wizardFormDefaultCentralApi
.post()
.then((response) => {
this.setState({ defaultCentralIp: response.data})
})
.catch(() => {
this.setState({ defaultCentralIp: null });
});
}
componentDidMount = () => {
this.getWaitList();
this.getDefaultCentralIp();
};
handleSubmit = (data) => {
......@@ -60,12 +77,12 @@ class PollerStepOneRoute extends Component {
render() {
const { links } = this;
const { waitList } = this.state;
const { waitList, defaultCentralIp } = this.state;
return (
<BaseWizard>
<ProgressBar links={links} />
<Form
initialValues={{}}
initialValues={{centreon_central_ip: defaultCentralIp}}
waitList={waitList}
onSubmit={this.handleSubmit.bind(this)}
/>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment