Module: check_mk
Branch: master
Commit: fd8674cf085ec3ac35c80505788406b1cdec01aa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fd8674cf085ec3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon May 9 09:41:46 2016 +0200
3569 FIX Dashboard: Fixed wrong links to views in statistics dashlets when using state
filters in dashlet
---
.werks/3569 | 10 ++++++++++
ChangeLog | 1 +
web/plugins/dashboard/dashlets.py | 7 ++++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/3569 b/.werks/3569
new file mode 100644
index 0000000..2a2bb59
--- /dev/null
+++ b/.werks/3569
@@ -0,0 +1,10 @@
+Title: Dashboard: Fixed wrong links to views in statistics dashlets when using state
filters in dashlet
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1462779658
+
+
diff --git a/ChangeLog b/ChangeLog
index c925215..e1e2f48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -279,6 +279,7 @@
* 3462 FIX: Fixed ineffective localizations on werk page after language change
* 3468 FIX: Fix changing a user's language back to English if the default is
German...
* 3567 FIX: Werk list: Fixed link to not existing check man pages in some cases
+ * 3569 FIX: Dashboard: Fixed wrong links to views in statistics dashlets when using
state filters in dashlet
WATO:
* 3244 WATO BI Module: swap order of aggregation function and child node
selection...
diff --git a/web/plugins/dashboard/dashlets.py b/web/plugins/dashboard/dashlets.py
index f32bcba..1c7bc6f 100644
--- a/web/plugins/dashboard/dashlets.py
+++ b/web/plugins/dashboard/dashlets.py
@@ -248,14 +248,19 @@ def render_statistics(pie_id, what, table, filter, dashlet):
html.write('<table class="hoststats%s"
style="float:left">' % (
len(pies) > 1 and " narrow" or ""))
+
table_entries = pies
while len(table_entries) < 6:
table_entries = table_entries + [ (("", "#95BBCD",
"", ""), " ") ]
table_entries.append(((_("Total"), "", "all%s" % what,
""), total))
+
for (name, color, viewurl, query), count in table_entries:
url = "view.py?view_name=" + viewurl +
"&filled_in=filter&search=1&wato_folder="
for filter_name, url_params in dashlet['context'].items():
- url += '&' + html.urlencode_vars(url_params.items())
+ # The svcstate filter URL vars are controlled by dashlet
+ if filter_name != "svcstate":
+ url += '&' + html.urlencode_vars(url_params.items())
+
html.write('<tr><th><a
href="%s">%s</a></th>' % (url, name))
style = ''
if color: