diff options
author | Andrejs Verza <andrejs.verza@zabbix.com> | 2022-11-04 19:40:16 +0300 |
---|---|---|
committer | Andrejs Verza <andrejs.verza@zabbix.com> | 2022-11-04 19:40:16 +0300 |
commit | 245cc244cc7b0ea6afe3e50302ef30057bc69f5a (patch) | |
tree | dfb310ee3fd178eaab788a2b2d000d69e5720239 | |
parent | 757603a9c80e0491e100265f49b3078ef60d484d (diff) |
..F....... [ZBXNEXT-7469] implemented dashboard configuration monitoring #3
-rw-r--r-- | ui/js/class.dashboard.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/js/class.dashboard.js b/ui/js/class.dashboard.js index 69189dfd80a..bf682861f11 100644 --- a/ui/js/class.dashboard.js +++ b/ui/js/class.dashboard.js @@ -330,6 +330,8 @@ class CDashboard extends CBaseComponent { clearTimeout(this._configuration_check_timeout_id); } + console.log('start', this._configuration_check_period); + this._configuration_check_time = Date.now() + this._configuration_check_period; this._configuration_check_timeout_id = setTimeout(() => this._checkConfiguration(), this._configuration_check_period @@ -398,7 +400,7 @@ class CDashboard extends CBaseComponent { throw {error: response.error}; } - if (this._configuration_hash !== response.configuration_hash) { + if (response.configuration_hash !== null && this._configuration_hash !== response.configuration_hash) { this.fire(DASHBOARD_EVENT_CONFIGURATION_OUTDATED); } }); @@ -409,7 +411,7 @@ class CDashboard extends CBaseComponent { return; } - if (this._configuration_check_timeout_id - Date.now() < this._configuration_check_steady_period) { + if (this._configuration_check_time - Date.now() < this._configuration_check_steady_period) { clearTimeout(this._configuration_check_timeout_id); this._configuration_check_time = Date.now() + this._configuration_check_steady_period; |