From 7f94ac29f461d32236a57442d9cb3dc8865492bd Mon Sep 17 00:00:00 2001 From: Angel98518 Date: Fri, 9 Jan 2026 06:10:06 +0100 Subject: [PATCH] Fix ping monitor interval reset issue Fixes #6657 Problem: When users set a ping monitor interval below the calculated minimum (based on ping configuration) and confirmed the warning, the interval was being reset back to a higher value after saving. This happened because finishUpdateInterval() was automatically adjusting the interval when monitor data was reloaded from the server after save. Solution: Added isLoadingMonitor flag to track when monitor data is being loaded vs when user is actively editing. The automatic interval adjustment in finishUpdateInterval() now skips when: 1. Monitor data is being loaded from server (isLoadingMonitor=true) 2. User has explicitly edited the interval (editedValue=true) This ensures that user-confirmed low intervals are respected and not automatically increased during the save/reload cycle. Changes: - Added isLoadingMonitor flag to component data - Set flag during init() when loading monitor data - Clear flag after monitor data is fully loaded using nextTick() - Updated finishUpdateInterval() to check both flags before auto-adjusting --- src/pages/EditMonitor.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 3e7ac832e..4dea455a5 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -2393,6 +2393,7 @@ export default { confirmed: false, editedValue: false, }, + isLoadingMonitor: false, }; }, @@ -2915,6 +2916,7 @@ message HealthCheckResponse { } } + this.isLoadingMonitor = true; this.monitor = res.monitor; if (this.isClone) { @@ -2958,6 +2960,11 @@ message HealthCheckResponse { this.monitor.timeout = ~~(this.monitor.interval * 8) / 10; } } + + // Reset loading flag after all reactive updates + this.$nextTick(() => { + this.isLoadingMonitor = false; + }); } else { this.$root.toastError(res.msg); } @@ -3314,8 +3321,11 @@ message HealthCheckResponse { // Calculate the minimum required interval based on ping configuration const calculatedPingInterval = this.calculatePingInterval(); - // If the configured interval is too small, adjust it to the minimum required value - if (this.monitor.interval < calculatedPingInterval) { + // Don't auto-adjust interval when: + // 1. Loading monitor data from server (isLoadingMonitor flag) + // 2. User explicitly edited the interval value (editedValue flag) + // This respects the user's choice of low intervals they've confirmed + if (!this.isLoadingMonitor && !this.lowIntervalConfirmation.editedValue && this.monitor.interval < calculatedPingInterval) { this.monitor.interval = calculatedPingInterval; // Notify the user that the interval has been automatically adjusted