Module: check_mk
Branch: master
Commit: 6d922a2677cf51953602256a596b153490d385d4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d922a2677cf51…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 20 16:37:15 2016 +0100
WATO activation: Fixed disabling of new icon buttons during activation
Change-Id: I129cdd94e64895e959d5a6a295b5f5a568cb110b
---
web/htdocs/js/wato.js | 4 ++++
web/htdocs/wato.css | 4 ++++
web/htdocs/wato.py | 6 +++++-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/js/wato.js b/web/htdocs/js/wato.js
index 1134b02..b6f1065 100644
--- a/web/htdocs/js/wato.js
+++ b/web/htdocs/js/wato.js
@@ -651,6 +651,10 @@ function lock_activation_controls(lock)
elements =
elements.concat(Array.prototype.slice.call(document.getElementsByClassName("activate_site"),
0));
for (var i = 0; i < elements.length; i++) {
+ if (lock)
+ add_class(elements[i], "disabled");
+ else
+ remove_class(elements[i], "disabled");
elements[i].disabled = lock ? "disabled" : false;
}
}
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index 2262de1..4105c82 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -892,6 +892,10 @@ div.varname {
/* activation */
+.wato table.data.activation a.disabled {
+ pointer-events: none;
+}
+
.wato table.changes tr.foreign.not_permitted td {
color: #f00;
}
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index cb033bb..2402969 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -4911,13 +4911,17 @@ class ModeActivateChanges(WatoMode, ActivateChanges):
# State
if can_activate_all and need_sync:
html.icon_button(url="javascript:void(0)",
+ id="activate_%s" % site_id,
+ cssclass=["activate_site"],
help=_("This site is not update and needs a replication. Start
it now."),
icon="need_replicate",
onclick="activate_changes(\"site\",
\"%s\")" % site_id, ty="icon")
if can_activate_all and need_restart:
html.icon_button(url="javascript:void(0)",
- help=_("This site needs a restart for activating the
changes. Start it now."),
+ id="activate_%s" % site_id,
+ cssclass=["activate_site"],
+ help=_("This site needs a restart for activating the changes.
Start it now."),
icon="need_restart",
onclick="activate_changes(\"site\",
\"%s\")" % site_id, ty="icon")