Module: check_mk
Branch: master
Commit: 83b081a6a1e70b4d74d5c5173f8281bcff793199
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=83b081a6a1e70b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 16 13:36:08 2018 +0100
Moved painter specific function from lib to painter file
Change-Id: I48f3d77886f9271d8416e1aef88bd88bea5f3e22
---
web/htdocs/lib.py | 14 --------------
web/plugins/views/painters.py | 15 +++++++++++++++
2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index 3b2ce37..1f1afca 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -194,20 +194,6 @@ warn_marker = '<b class="stmark
state1">WARN</b>'
crit_marker = '<b class="stmark state2">CRIT</b>'
unknown_marker = '<b class="stmark state3">UNKN</b>'
-def paint_host_list(site, hosts):
- h = ""
- first = True
- for host in hosts:
- if first:
- first = False
- else:
- h += ", "
- link = "view.py?view_name=hoststatus&site=%s&host=%s" %
(html.urlencode(site), html.urlencode(host))
- if html.var("display_options"):
- link += "&display_options=%s" %
html.var("display_options")
- h += "<a href=\"%s\">%s</a></div>" % (link,
host)
- return "", h
-
# There is common code with modules/events.py:format_plugin_output(). Please check
# whether or not that function needs to be changed too
# TODO(lm): Find a common place to unify this functionality.
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 5aee065..37ed04c 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -1760,6 +1760,21 @@ multisite_painters["host_services"] = {
"paint" : lambda row: paint_service_list(row,
"host_services_with_state"),
}
+
+def paint_host_list(site, hosts):
+ h = ""
+ first = True
+ for host in hosts:
+ if first:
+ first = False
+ else:
+ h += ", "
+ link = "view.py?view_name=hoststatus&site=%s&host=%s" %
(html.urlencode(site), html.urlencode(host))
+ if html.var("display_options"):
+ link += "&display_options=%s" %
html.var("display_options")
+ h += "<a href=\"%s\">%s</a></div>" % (link,
host)
+ return "", h
+
multisite_painters["host_parents"] = {
"title" : _("Host's parents"),
"short" : _("Parents"),