Move style divs into respective components
parent
7a8d60796b
commit
732bab640b
|
@ -101,11 +101,16 @@ export const DataSection = React.createClass({
|
|||
const statement = query.rawText || selectStatement(timeRange, query) || `SELECT "fields" FROM "db"."rp"."measurement"`;
|
||||
|
||||
return (
|
||||
<div className="query-editor kapacitor-metric-selector">
|
||||
<div className="query-editor__code">
|
||||
<pre className={classNames("", {"rq-mode": query.rawText})}><code>{statement}</code></pre>
|
||||
<div className="kapacitor-rule-section">
|
||||
<h3 className="rule-section-heading">Select a Metric</h3>
|
||||
<div className="rule-section-body">
|
||||
<div className="query-editor kapacitor-metric-selector">
|
||||
<div className="query-editor__code">
|
||||
<pre className={classNames("", {"rq-mode": query.rawText})}><code>{statement}</code></pre>
|
||||
</div>
|
||||
{this.renderEditor()}
|
||||
</div>
|
||||
</div>
|
||||
{this.renderEditor()}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
|
|
@ -20,24 +20,27 @@ export const ValuesSection = React.createClass({
|
|||
const forcedActiveIndex = TABS.indexOf(_.startCase(rule.trigger));
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Tabs forceActiveIndex={forcedActiveIndex} onSelect={this.handleChooseTrigger}>
|
||||
<TabList isKapacitorTabs="true">
|
||||
{TABS.map(tab => <Tab key={tab}>{tab}</Tab>)}
|
||||
</TabList>
|
||||
<div className="kapacitor-rule-section">
|
||||
<h3 className="rule-section-heading">Values</h3>
|
||||
<div className="rule-section-body">
|
||||
<Tabs forceActiveIndex={forcedActiveIndex} onSelect={this.handleChooseTrigger}>
|
||||
<TabList isKapacitorTabs="true">
|
||||
{TABS.map(tab => <Tab key={tab}>{tab}</Tab>)}
|
||||
</TabList>
|
||||
|
||||
<TabPanels>
|
||||
<TabPanel>
|
||||
<Threshold rule={rule} query={query} onChange={this.handleValuesChange} />
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<Relative rule={rule} onChange={this.handleValuesChange} />
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<Deadman rule={rule} onChange={this.handleValuesChange} />
|
||||
</TabPanel>
|
||||
</TabPanels>
|
||||
</Tabs>
|
||||
<TabPanels>
|
||||
<TabPanel>
|
||||
<Threshold rule={rule} query={query} onChange={this.handleValuesChange} />
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<Relative rule={rule} onChange={this.handleValuesChange} />
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<Deadman rule={rule} onChange={this.handleValuesChange} />
|
||||
</TabPanel>
|
||||
</TabPanels>
|
||||
</Tabs>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
|
|
@ -132,6 +132,8 @@ export const KapacitorRulePage = React.createClass({
|
|||
|
||||
render() {
|
||||
const {rules, queryConfigs, params, kapacitorActions, source} = this.props;
|
||||
const {chooseTrigger, updateRuleValues} = this.props.kapacitorActions;
|
||||
|
||||
const rule = this.isEditing() ? rules[params.ruleID] : rules[DEFAULT_RULE_ID];
|
||||
const query = rule && queryConfigs[rule.queryID];
|
||||
|
||||
|
@ -147,8 +149,13 @@ export const KapacitorRulePage = React.createClass({
|
|||
<div className="row">
|
||||
<div className="col-xs-12">
|
||||
<div className="rule-builder">
|
||||
{this.renderDataSection(query)}
|
||||
{this.renderValuesSection(rule)}
|
||||
<DataSection source={this.props.source} query={query} actions={this.props.queryActions} />
|
||||
<ValuesSection
|
||||
rule={rule}
|
||||
query={queryConfigs[rule.queryID]}
|
||||
onChooseTrigger={chooseTrigger}
|
||||
onUpdateValues={updateRuleValues}
|
||||
/>
|
||||
<RuleGraph source={source} query={query} rule={rule} />
|
||||
<RuleMessage rule={rule} actions={kapacitorActions} enabledAlerts={this.state.enabledAlerts} />
|
||||
</div>
|
||||
|
@ -159,29 +166,6 @@ export const KapacitorRulePage = React.createClass({
|
|||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
renderDataSection(query) {
|
||||
return (
|
||||
<div className="kapacitor-rule-section">
|
||||
<h3 className="rule-section-heading">Select a Metric</h3>
|
||||
<div className="rule-section-body">
|
||||
<DataSection source={this.props.source} query={query} actions={this.props.queryActions} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
renderValuesSection(rule) {
|
||||
const {chooseTrigger, updateRuleValues} = this.props.kapacitorActions;
|
||||
return (
|
||||
<div className="kapacitor-rule-section">
|
||||
<h3 className="rule-section-heading">Values</h3>
|
||||
<div className="rule-section-body">
|
||||
<ValuesSection rule={rule} query={this.props.queryConfigs[rule.queryID]} onChooseTrigger={chooseTrigger} onUpdateValues={updateRuleValues} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
function mapStateToProps(state) {
|
||||
|
|
Loading…
Reference in New Issue