Module: check_mk
Branch: master
Commit: 41feb0e4a3ffd8695c726696c8ea6b4d29f95978
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=41feb0e4a3ffd8…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Nov 7 15:19:50 2011 +0100
WATO: reload after replication only on success
---
web/htdocs/js/wato.js | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/web/htdocs/js/wato.js b/web/htdocs/js/wato.js
index 8ea53f1..4041c5d 100644
--- a/web/htdocs/js/wato.js
+++ b/web/htdocs/js/wato.js
@@ -337,14 +337,12 @@ function update_bulk_moveto(val) {
// | |_| |
// +----------------------------------------------------------------------+
var replication_progress = new Array();
-var num_failedsites = 0;
function wato_do_replication(siteid, est) {
get_url("wato_ajax_replication.py?site=" + siteid,
wato_replication_result, siteid);
replication_progress[siteid] = 20; // 10 of 10 10ths
setTimeout("replication_step('"+siteid+"',"+est+");",
est/10);
- num_failedsites = num_replsites;
}
function replication_step(siteid, est) {
@@ -366,19 +364,18 @@ function wato_replication_result(siteid, code) {
if (code.substr(0, 3) == "OK:") {
oDiv.innerHTML = "<div class='repprogress ok' style='width:
160px;'>" +
code.substr(3) + "</div>";
- num_failedsites--;
+ num_replsites--;
}
else
oDiv.innerHTML = code;
- if (0 == --num_replsites) {
+
+ if (0 == num_replsites) {
setTimeout(wato_replication_finish, 2000);
}
}
function wato_replication_finish() {
parent.frames[1].location.reload(); // reload sidebar
- if (num_failedsites == 0) {
- oDiv = document.getElementById("act_changes_button");
- oDiv.style.display = "none";
- }
+ oDiv = document.getElementById("act_changes_button");
+ oDiv.style.display = "none";
}