feat(ui): add flux task notifications
parent
79eb0fd1e0
commit
07b55ed551
|
@ -19,6 +19,8 @@ import {
|
|||
notifyAlertRuleDeleteFailed,
|
||||
notifyAlertRuleStatusUpdated,
|
||||
notifyAlertRuleStatusUpdateFailed,
|
||||
notifyFluxTaskStatusUpdated,
|
||||
notifyFluxTaskStatusUpdateFailed,
|
||||
notifyTickScriptCreated,
|
||||
notifyTickscriptCreationFailed,
|
||||
notifyTickscriptUpdated,
|
||||
|
@ -244,10 +246,10 @@ export const updateFluxTaskStatus = (kapacitor, task, status) => dispatch => {
|
|||
updateFluxTaskStatusAPI(kapacitor, task, status)
|
||||
.then(() => {
|
||||
dispatch(updateFluxTaskStatusSuccess(task, status))
|
||||
dispatch(notify(notifyAlertRuleStatusUpdated(task.name, status)))
|
||||
dispatch(notify(notifyFluxTaskStatusUpdated(task.name, status)))
|
||||
})
|
||||
.catch(() => {
|
||||
dispatch(notify(notifyAlertRuleStatusUpdateFailed(task.name, status)))
|
||||
dispatch(notify(notifyFluxTaskStatusUpdateFailed(task.name, status)))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -644,6 +644,14 @@ export const notifyAlertRuleStatusUpdated = (
|
|||
message: `${ruleName} ${updatedStatus} successfully.`,
|
||||
})
|
||||
|
||||
export const notifyFluxTaskStatusUpdated = (
|
||||
taskName: string,
|
||||
updatedStatus: string
|
||||
): Notification => ({
|
||||
...defaultSuccessNotification,
|
||||
message: `${taskName} is now ${updatedStatus}.`,
|
||||
})
|
||||
|
||||
export const notifyAlertRuleStatusUpdateFailed = (
|
||||
ruleName: string,
|
||||
updatedStatus: string
|
||||
|
@ -652,6 +660,14 @@ export const notifyAlertRuleStatusUpdateFailed = (
|
|||
message: `${ruleName} could not be ${updatedStatus}.`,
|
||||
})
|
||||
|
||||
export const notifyFluxTaskStatusUpdateFailed = (
|
||||
taskName: string,
|
||||
updatedStatus: string
|
||||
): Notification => ({
|
||||
...defaultSuccessNotification,
|
||||
message: `${taskName} could not be made ${updatedStatus}.`,
|
||||
})
|
||||
|
||||
export const notifyAlertRuleRequiresQuery = (): string =>
|
||||
'Please select a Database, Measurement, and Field.'
|
||||
|
||||
|
|
Loading…
Reference in New Issue