Module: check_mk
Branch: master
Commit: ba3aa91ac6415317efee90cba82b41c511c87323
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ba3aa91ac64153…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 27 17:19:23 2017 +0200
5046 Site specific globals: Highlight setting icon of sites having modified settings
Change-Id: I328cd15e127958cbf7ca6a2364fc627b79976e67
---
.werks/5046 | 10 ++++++++++
web/htdocs/images/button_site_globals.png | Bin 0 -> 3722 bytes
web/htdocs/images/button_site_globals_modified.png | Bin 0 -> 4386 bytes
web/htdocs/wato.py | 11 ++++++++++-
4 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/5046 b/.werks/5046
new file mode 100644
index 0000000..2a1b171
--- /dev/null
+++ b/.werks/5046
@@ -0,0 +1,10 @@
+Title: Site specific globals: Highlight setting icon of sites having modified settings
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1501168736
+Class: feature
+
+
diff --git a/web/htdocs/images/button_site_globals.png
b/web/htdocs/images/button_site_globals.png
new file mode 100644
index 0000000..d3ba9e4
Binary files /dev/null and b/web/htdocs/images/button_site_globals.png differ
diff --git a/web/htdocs/images/button_site_globals_modified.png
b/web/htdocs/images/button_site_globals_modified.png
new file mode 100644
index 0000000..89b9d6f
Binary files /dev/null and b/web/htdocs/images/button_site_globals_modified.png differ
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index e6e4823..d48914b 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9688,7 +9688,16 @@ class ModeDistributedMonitoring(ModeSites):
and (site.get("replication") or config.site_is_local(site_id))) \
or is_wato_slave_site():
globals_url = folder_preserving_link([("mode",
"edit_site_globals"), ("site", site_id)])
- html.icon_button(globals_url, _("Site specific global
configuration"), "configuration")
+
+ has_site_globals = bool(site.get("globals"))
+ title = _("Site specific global configuration")
+ if has_site_globals:
+ icon = "site_globals_modified"
+ title += " (%s)" % (_("%d specific settings") %
len(site.get("globals")))
+ else:
+ icon = "site_globals"
+
+ html.icon_button(globals_url, title, icon)
def _page_basic_settings(self, site_id, site):