Module: check_mk
Branch: master
Commit: a2758c92b7f2971a8e0517260f4dfccd34e9626f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a2758c92b7f297…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 9 14:58:06 2019 +0200
Reenable help toggle on service discovery page
Change-Id: I8f00c68212a4c89d81f6eca7d5073608d2f56497
---
cmk/gui/htmllib.py | 7 +++++--
cmk/gui/wato/pages/services.py | 4 ++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/cmk/gui/htmllib.py b/cmk/gui/htmllib.py
index 94b4bb3..10b534b 100644
--- a/cmk/gui/htmllib.py
+++ b/cmk/gui/htmllib.py
@@ -1524,15 +1524,18 @@ class html(HTMLGenerator):
def help(self, text):
self.write_html(self.render_help(text))
- # Embed help box, whose visibility is controlled by a global button in the page.
def render_help(self, text):
+ """Embed help box, whose visibility is controlled by a global button in the page."""
if text and text.strip():
- self.have_help = True
+ self.enable_help_toggle()
style = "display: %s;" % ("block" if self.help_visible else "none")
c = self.render_div(text.strip(), class_="help", style=style)
return c
return ""
+ def enable_help_toggle(self):
+ self.have_help = True
+
#
# Debugging, diagnose and logging
#
diff --git a/cmk/gui/wato/pages/services.py b/cmk/gui/wato/pages/services.py
index 4e37754..0fb5979 100644
--- a/cmk/gui/wato/pages/services.py
+++ b/cmk/gui/wato/pages/services.py
@@ -233,6 +233,10 @@ class ModeDiscovery(WatoMode):
("varname", "ignored_checks")]), "check_parameters")
def page(self):
+ # This is needed to make the discovery page show the help toggle
+ # button. The help texts on this page are only added dynamically via
+ # AJAX.
+ html.enable_help_toggle()
self._async_progress_msg_container()
self._service_container()
html.javascript("cmk.service_discovery.start(%s, %s, %s)" %