feat: add teams alert handler
parent
b7a913ce77
commit
f60cbbe907
|
@ -0,0 +1,51 @@
|
|||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import HandlerInput from 'src/kapacitor/components/HandlerInput'
|
||||
import HandlerEmpty from 'src/kapacitor/components/HandlerEmpty'
|
||||
const TeamsHandler = ({
|
||||
selectedHandler,
|
||||
handleModifyHandler,
|
||||
onGoToConfig,
|
||||
validationError,
|
||||
}) =>
|
||||
selectedHandler.enabled ? (
|
||||
<div className="endpoint-tab-contents">
|
||||
<div className="endpoint-tab--parameters">
|
||||
<h4 className="u-flex u-jc-space-between">
|
||||
Parameters from Kapacitor Configuration
|
||||
<div className="btn btn-default btn-sm" onClick={onGoToConfig}>
|
||||
<span className="icon cog-thick" />
|
||||
{validationError
|
||||
? 'Exit this Rule and Edit Configuration'
|
||||
: 'Save this Rule and Edit Configuration'}
|
||||
</div>
|
||||
</h4>
|
||||
<div className="faux-form">
|
||||
<HandlerInput
|
||||
selectedHandler={selectedHandler}
|
||||
handleModifyHandler={handleModifyHandler}
|
||||
fieldName="channel-url"
|
||||
fieldDisplay="Channel URL:"
|
||||
placeholder="ex: https://outlook.office.com/webhook/..."
|
||||
fieldColumns="col-md-12"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<HandlerEmpty
|
||||
onGoToConfig={onGoToConfig}
|
||||
validationError={validationError}
|
||||
/>
|
||||
)
|
||||
|
||||
const {func, shape, string} = PropTypes
|
||||
|
||||
TeamsHandler.propTypes = {
|
||||
selectedHandler: shape({}).isRequired,
|
||||
handleModifyHandler: func.isRequired,
|
||||
onGoToConfig: func.isRequired,
|
||||
validationError: string.isRequired,
|
||||
}
|
||||
|
||||
export default TeamsHandler
|
|
@ -16,6 +16,7 @@ import TelegramHandler from './TelegramHandler'
|
|||
import VictoropsHandler from './VictoropsHandler'
|
||||
import ServiceNowHandler from './ServiceNowHandler'
|
||||
import BigPandaHandler from './BigPandaHandler'
|
||||
import TeamsHandler from './TeamsHandler'
|
||||
|
||||
export {
|
||||
PostHandler,
|
||||
|
@ -36,4 +37,5 @@ export {
|
|||
VictoropsHandler,
|
||||
ServiceNowHandler,
|
||||
BigPandaHandler,
|
||||
TeamsHandler,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue