From a71eac0067ad5180e2101eb74bb1187b8a701c29 Mon Sep 17 00:00:00 2001 From: Maksim Kachynski Date: Thu, 12 Jun 2025 01:50:56 +0300 Subject: [PATCH] DEVOPS-000 Fix review comments --- src/pages/EditMonitor.vue | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 67ca6f3dd..9e9cb838d 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -776,7 +776,7 @@
-
+
@@ -787,9 +787,9 @@ {{ $t("Maintenance") }}
-
+
@@ -2035,15 +2035,18 @@ message HealthCheckResponse { } }, + getStatusCode(status) { + const statusMap = { + "up": 1, + "down": 0, + "pending": 2, + "maintenance": 3 + }; + return statusMap[status] ?? 2; + }, + setManualStatus(status) { this.monitor.manual_status = this.getStatusCode(status); - this.$root.getSocket().emit("editMonitor", this.monitor, (res) => { - if (res.ok) { - this.toast.success(this.$t("Success")); - } else { - this.toast.error(res.msg); - } - }); }, }, };