Add pagerduty2 tab and panel to AlertTabs and show services available to kapacitor

pull/3290/head
Iris Scholten 2018-03-30 15:41:52 -07:00
parent 929a253627
commit 6b821be472
1 changed files with 16 additions and 1 deletions

View File

@ -192,6 +192,18 @@ class AlertTabs extends Component {
/> />
), ),
}, },
pagerduty2: {
type: 'PagerDuty2',
enabled: this.getEnabled(configSections, 'pagerduty2'),
renderComponent: () => (
<PagerDutyConfig
onSave={this.handleSaveConfig('pagerduty2')}
config={this.getSection(configSections, 'pagerduty2')}
onTest={this.handleTestConfig('pagerduty2')}
enabled={this.getEnabled(configSections, 'pagerduty2')}
/>
),
},
pushover: { pushover: {
type: 'Pushover', type: 'Pushover',
enabled: this.getEnabled(configSections, 'pushover'), enabled: this.getEnabled(configSections, 'pushover'),
@ -312,7 +324,10 @@ class AlertTabs extends Component {
{_.reduce( {_.reduce(
configSections, configSections,
(acc, _cur, k) => (acc, _cur, k) =>
supportedConfigs[k] supportedConfigs[k] &&
services.find(service => {
return service.name === _.toLower(supportedConfigs[k].type)
})
? acc.concat( ? acc.concat(
<TabPanel key={supportedConfigs[k].type}> <TabPanel key={supportedConfigs[k].type}>
{supportedConfigs[k].renderComponent()} {supportedConfigs[k].renderComponent()}