diff options
Diffstat (limited to 'app/assets/javascripts/monitoring/components/alert_widget.vue')
-rw-r--r-- | app/assets/javascripts/monitoring/components/alert_widget.vue | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/app/assets/javascripts/monitoring/components/alert_widget.vue b/app/assets/javascripts/monitoring/components/alert_widget.vue index 8f9c181258f..bf31b86561a 100644 --- a/app/assets/javascripts/monitoring/components/alert_widget.vue +++ b/app/assets/javascripts/monitoring/components/alert_widget.vue @@ -97,12 +97,12 @@ export default { return Boolean(this.firingAlerts.length); }, firingAlerts() { - return values(this.alertsToManage).filter(alert => + return values(this.alertsToManage).filter((alert) => this.passedAlertThreshold(this.getQueryData(alert), alert), ); }, formattedFiringAlerts() { - return this.firingAlerts.map(alert => this.formatAlertSummary(alert.alert_path)); + return this.firingAlerts.map((alert) => this.formatAlertSummary(alert.alert_path)); }, configuredAlert() { return this.hasAlerts ? values(this.alertsToManage)[0].metricId : ''; @@ -116,13 +116,13 @@ export default { fetchAlertData() { this.isLoading = true; - const queriesWithAlerts = this.relevantQueries.filter(query => query.alert_path); + const queriesWithAlerts = this.relevantQueries.filter((query) => query.alert_path); return Promise.all( - queriesWithAlerts.map(query => + queriesWithAlerts.map((query) => this.service .readAlert(query.alert_path) - .then(alertAttributes => this.setAlert(alertAttributes, query.metricId)), + .then((alertAttributes) => this.setAlert(alertAttributes, query.metricId)), ), ) .then(() => { @@ -141,7 +141,7 @@ export default { }, formatAlertSummary(alertPath) { const alert = this.alertsToManage[alertPath]; - const alertQuery = this.relevantQueries.find(query => query.metricId === alert.metricId); + const alertQuery = this.relevantQueries.find((query) => query.metricId === alert.metricId); return `${alertQuery.label} ${alert.operator} ${alert.threshold}`; }, @@ -150,19 +150,19 @@ export default { switch (operator) { case OPERATORS.greaterThan: - return data.some(value => value > threshold); + return data.some((value) => value > threshold); case OPERATORS.lessThan: - return data.some(value => value < threshold); + return data.some((value) => value < threshold); case OPERATORS.equalTo: - return data.some(value => value === threshold); + return data.some((value) => value === threshold); default: return false; } }, getQueryData(alert) { - const alertQuery = this.relevantQueries.find(query => query.metricId === alert.metricId); + const alertQuery = this.relevantQueries.find((query) => query.metricId === alert.metricId); - return get(alertQuery, 'result[0].values', []).map(value => get(value, '[1]', null)); + return get(alertQuery, 'result[0].values', []).map((value) => get(value, '[1]', null)); }, showModal() { this.$root.$emit('bv::show::modal', this.modalId); @@ -179,7 +179,7 @@ export default { this.isLoading = true; this.service .createAlert(newAlert) - .then(alertAttributes => { + .then((alertAttributes) => { this.setAlert(alertAttributes, prometheus_metric_id); this.isLoading = false; this.hideModal(); @@ -194,7 +194,7 @@ export default { this.isLoading = true; this.service .updateAlert(alert, updatedAlert) - .then(alertAttributes => { + .then((alertAttributes) => { this.setAlert(alertAttributes, this.alertsToManage[alert].metricId); this.isLoading = false; this.hideModal(); |