Fix kapacitor url update event
parent
ff73d82aa2
commit
099c66e95d
|
@ -5,8 +5,15 @@ import FancyScrollbar from 'shared/components/FancyScrollbar'
|
|||
|
||||
class KapacitorForm extends Component {
|
||||
render() {
|
||||
const {onInputChange, onReset, kapacitor, onSubmit, exists} = this.props
|
||||
const {url: kapaUrl, name, username, password} = kapacitor
|
||||
const {
|
||||
onInputChange,
|
||||
onChangeUrl,
|
||||
onReset,
|
||||
kapacitor,
|
||||
onSubmit,
|
||||
exists,
|
||||
} = this.props
|
||||
const {url, name, username, password} = kapacitor
|
||||
return (
|
||||
<div className="page">
|
||||
<div className="page-header">
|
||||
|
@ -35,9 +42,9 @@ class KapacitorForm extends Component {
|
|||
className="form-control"
|
||||
id="kapaUrl"
|
||||
name="kapaUrl"
|
||||
placeholder={kapaUrl}
|
||||
value={kapaUrl}
|
||||
onChange={onInputChange}
|
||||
placeholder={url}
|
||||
value={url}
|
||||
onChange={onChangeUrl}
|
||||
spellCheck="false"
|
||||
/>
|
||||
</div>
|
||||
|
@ -145,6 +152,7 @@ const {func, shape, string, bool} = PropTypes
|
|||
KapacitorForm.propTypes = {
|
||||
onSubmit: func.isRequired,
|
||||
onInputChange: func.isRequired,
|
||||
onChangeUrl: func.isRequired,
|
||||
onReset: func.isRequired,
|
||||
kapacitor: shape({
|
||||
url: string.isRequired,
|
||||
|
|
|
@ -60,6 +60,10 @@ class KapacitorPage extends Component {
|
|||
})
|
||||
}
|
||||
|
||||
handleChangeUrl = ({value}) => {
|
||||
this.setState({kapacitor: {...this.state.kapacitor, url: value}})
|
||||
}
|
||||
|
||||
handleSubmit = e => {
|
||||
e.preventDefault()
|
||||
const {
|
||||
|
@ -143,6 +147,7 @@ class KapacitorPage extends Component {
|
|||
<KapacitorForm
|
||||
onSubmit={this.handleSubmit}
|
||||
onInputChange={this.handleInputChange}
|
||||
onChangeUrl={this.handleChangeUrl}
|
||||
onReset={this.handleResetToDefaults}
|
||||
kapacitor={kapacitor}
|
||||
source={source}
|
||||
|
|
Loading…
Reference in New Issue