diff --git a/ui/src/kapacitor/components/HandlerInput.js b/ui/src/kapacitor/components/HandlerInput.js index f0d814c292..1d4ac033a1 100644 --- a/ui/src/kapacitor/components/HandlerInput.js +++ b/ui/src/kapacitor/components/HandlerInput.js @@ -1,4 +1,5 @@ import React, {PropTypes} from 'react' +import _ from 'lodash' const HandlerInput = ({ fieldName, diff --git a/ui/src/kapacitor/components/HandlerOptions.js b/ui/src/kapacitor/components/HandlerOptions.js index 0844f71330..05be22b42c 100644 --- a/ui/src/kapacitor/components/HandlerOptions.js +++ b/ui/src/kapacitor/components/HandlerOptions.js @@ -23,7 +23,13 @@ class HandlerOptions extends Component { } render() { - const {selectedHandler, handleModifyHandler, configLink} = this.props + const { + selectedHandler, + handleModifyHandler, + configLink, + rule, + updateDetails, + } = this.props switch (selectedHandler && selectedHandler.type) { case 'post': return ( @@ -63,6 +69,8 @@ class HandlerOptions extends Component { selectedHandler={selectedHandler} handleModifyHandler={handleModifyHandler} configLink={configLink} + updateDetails={updateDetails} + rule={rule} /> ) case 'alerta': @@ -157,6 +165,8 @@ HandlerOptions.propTypes = { selectedHandler: shape({}).isRequired, handleModifyHandler: func.isRequired, configLink: string, + updateDetails: func, + rule: shape({}), } export default HandlerOptions diff --git a/ui/src/kapacitor/components/KapacitorRule.js b/ui/src/kapacitor/components/KapacitorRule.js index 5167cfdf8c..1849596bc0 100644 --- a/ui/src/kapacitor/components/KapacitorRule.js +++ b/ui/src/kapacitor/components/KapacitorRule.js @@ -183,10 +183,10 @@ class KapacitorRule extends Component { - + diff --git a/ui/src/kapacitor/components/RuleDetailsText.js b/ui/src/kapacitor/components/RuleDetailsText.js new file mode 100644 index 0000000000..e41dbaa8b2 --- /dev/null +++ b/ui/src/kapacitor/components/RuleDetailsText.js @@ -0,0 +1,36 @@ +import React, {Component, PropTypes} from 'react' + +class RuleDetailsText extends Component { + constructor(props) { + super(props) + } + + handleUpdateDetails = e => { + const {rule, updateDetails} = this.props + updateDetails(rule.id, e.target.value) + } + + render() { + const {rule} = this.props + return ( +
+