Module: check_mk
Branch: master
Commit: 91863d731949897eb4a57e10d0f89ec6278a9783
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=91863d73194989…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 19 13:20:39 2017 +0100
4282 FIX Fixed rendering of perfometers when no RRDs exist yet
Change-Id: I537066504552b04792a7d615900e38b8a3bc0e18
---
.werks/4282 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/status.css | 4 ++++
web/plugins/views/perfometer.py | 16 ++++++++++------
4 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/.werks/4282 b/.werks/4282
new file mode 100644
index 0000000..2699006
--- /dev/null
+++ b/.werks/4282
@@ -0,0 +1,9 @@
+Title: Fixed rendering of perfometers when no RRDs exist yet
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.4.0i4
+Date: 1484828434
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 7dc1287..3bea072 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -73,6 +73,7 @@
* 4228 FIX: Context links to HW/SW inventory views are only shown when useful
* 4280 FIX: Interactive login is now denied for automation users...
* 4307 FIX: Fixed wrong filters in Eventviews linked by Tactical Overview
+ * 4282 FIX: Fixed rendering of perfometers when no RRDs exist yet
WATO:
* 4142 New extended search dialog for rulesets and rules...
diff --git a/web/htdocs/status.css b/web/htdocs/status.css
index cc27855..f293de4 100644
--- a/web/htdocs/status.css
+++ b/web/htdocs/status.css
@@ -194,6 +194,10 @@ td.perfometer > a {
position: relative;
}
+td.perfometer > a.disabled {
+ cursor: auto;
+}
+
td.perfometer div.content {
width: 120px;
z-index: 20;
diff --git a/web/plugins/views/perfometer.py b/web/plugins/views/perfometer.py
index 5b5c26b..1c340f8 100644
--- a/web/plugins/views/perfometer.py
+++ b/web/plugins/views/perfometer.py
@@ -162,9 +162,9 @@ def paint_perfometer(row):
raise
return "perfometer", ("invalid data: %s" % e)
- content = '<div class=content>%s</div>' % h
- content += '<div class=title>%s</div>' % title
- content += '<img class=glass
src="images/perfometer-bg.png">'
+ content = html.render_div(HTML(h), class_=["content"]) \
+ + html.render_div(title, class_=["title"]) \
+ + html.render_img(src="images/perfometer-bg.png",
class_=["glass"])
# pnpgraph_present: -1 means unknown (path not configured), 0: no, 1: yes
if display_options.enabled(display_options.X) \
@@ -173,10 +173,14 @@ def paint_perfometer(row):
url = new_graphing_url(row, "service")
else:
url = pnp_url(row, "service")
- return "perfometer" + stale_css, ('<a href="%s"
title="%s">%s</a>' % \
- (url, title, content))
+ disabled = False
else:
- return "perfometer" + stale_css, content
+ url = "javascript:void(0)"
+ disabled = True
+
+ return "perfometer" + stale_css, \
+ html.render_a(content=content, href=url, title=title,
+ class_=["disabled" if disabled else None])
#.