-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added version 1 fields to settings page
- Loading branch information
1 parent
f809f81
commit 48fbbc3
Showing
5 changed files
with
240 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React, { Component } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { Modal, Button, Tab } from 'react-bootstrap'; | ||
import Axios from 'axios'; | ||
|
||
export default class InfluxDBSettings extends Component { | ||
constructor(props) { | ||
super(props) | ||
|
||
this.state = { | ||
data: this.props.data, | ||
} | ||
} | ||
|
||
inputHandler = (name, val) => { | ||
var settings = this.state.data; | ||
var i = 0; | ||
settings.forEach(ele => { | ||
if(ele.obj.name == name) { | ||
ele.obj.value = val; | ||
} | ||
settings[i] = ele; | ||
i++; | ||
}); | ||
this.setState({ | ||
data: settings | ||
}); | ||
} | ||
|
||
render() { | ||
var settings = this.props.generateInputs(this.state.data, this.inputHandler); | ||
|
||
return ( | ||
<Tab.Content> | ||
{settings} | ||
<div className="mt-3"> | ||
<button className="btn btn-primary" onClick={() => { this.props.save(this.state.data, 'healthchecks.io') }}>Save</button> | ||
</div> | ||
</Tab.Content> | ||
); | ||
} | ||
} | ||
|
||
if (document.getElementById('InfluxDBSettings')) { | ||
ReactDOM.render(<InfluxDBSettings />, document.getElementById('InfluxDBSettings')); | ||
} |