From a7e3ad0659592ae7c6fc4d06ff3e8f9d2ac03a4a Mon Sep 17 00:00:00 2001 From: Matthew Nickson Date: Tue, 14 Feb 2023 12:48:47 +0000 Subject: [PATCH] Updated to match current monitor types Signed-off-by: Matthew Nickson --- src/pages/EditMonitor.vue | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index ce7d1cae5..1221446fd 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -777,6 +777,11 @@ message HealthCheckResponse { let friendlyNameRequiredOptions = [ "push", + "sqlserver", + "postgres", + "mysql", + "mongodb", + "redis", ]; for (let i = 100; i <= 999; i++) { @@ -838,7 +843,11 @@ message HealthCheckResponse { this.monitor = res.monitor; // Handling for when friendly name isn't set - if (this.monitor.name === this.monitor.url || this.monitor.name === this.monitor.hostname) { + if ( + this.monitor.name === this.monitor.url + || this.monitor.name === this.monitor.hostname + || this.monitor.name === this.monitor.docker_container + ) { this.monitor.name = ""; } @@ -887,7 +896,26 @@ message HealthCheckResponse { // Check if friendly name has been supplied. If not, use URL // or hostname - this.monitor.name = this.monitor.name || this.monitor.hostname || this.monitor.url; + switch (this.monitor.type) { + case "http": + case "keyword": + case "grpc-keyword": + // Use given name or URL + this.monitor.name = this.monitor.name || this.monitor.url; + break; + case "port": + case "ping": + case "dns": + case "steam": + case "mqtt": + case "radius": + // Use given name or hostname + this.monitor.name = this.monitor.name || this.monitor.hostname; + break; + case "docker": + this.monitor.name = this.monitor.name || this.monitor.docker_container; + break; + } if (!this.isInputValid()) { this.processing = false;