From 19fc7d31e663d6070ecf33345c3768298e18c2c3 Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Thu, 15 Jun 2023 00:58:45 +0800 Subject: [PATCH] Fix: Remove extra fields on clone --- src/pages/EditMonitor.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 462374d03..55739e54b 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -823,7 +823,6 @@ message HealthCheckResponse { // Only return groups which arent't itself and one of its decendants sortedMonitorList() { let result = Object.values(this.$root.monitorList); - console.log(this.monitor.childrenIDs); // Only groups, not itself, not a decendant result = result.filter( @@ -1035,12 +1034,17 @@ message HealthCheckResponse { if (this.isClone) { /* - * Cloning a monitor will include properties that can not be posted to backend - * as they are not valid columns in the SQLite table. - */ + * Cloning a monitor will include properties that can not be posted to backend + * as they are not valid columns in the SQLite table. + */ this.monitor.id = undefined; // Remove id when cloning as we want a new id this.monitor.includeSensitiveData = undefined; this.monitor.maintenance = undefined; + // group monitor fields + this.monitor.childrenIDs = undefined; + this.monitor.forceInactive = undefined; + this.monitor.pathName = undefined; + this.monitor.name = this.$t("cloneOf", [ this.monitor.name ]); this.$refs.tagsManager.newTags = this.monitor.tags.map((monitorTag) => { return {