Module: check_mk
Branch: master
Commit: bcff444034dba4411293b3c97c7c0370d10f3217
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bcff444034dba4…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Oct 6 13:24:29 2011 +0200
New dummy dashlet as replacement if not data
---
web/htdocs/check_mk.css | 8 ++++++++
web/htdocs/dashboard.py | 5 +++++
web/plugins/pages/shipped.py | 1 +
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css
index 379b197..974e4ea 100644
--- a/web/htdocs/check_mk.css
+++ b/web/htdocs/check_mk.css
@@ -1790,7 +1790,15 @@ div.dashlet table.hoststats th, table.hoststats td {
vertical-align: middle;
}
+div.dashlet div.nograph {
+ background-color: white;
+ width: 100%;
+ height: 100%;
+}
+div.dashlet div.nograph div.msg {
+ padding: 10px;
+}
/*
_ _ _ ____ _
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 358b981..ab31ee4 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -548,6 +548,11 @@ if(has_canvas_support()) {
def dashlet_pnpgraph():
render_pnpgraph(html.var("site"), html.var("host"),
html.var("service"), int(html.var("source", 0)))
+def dashlet_nodata():
+ html.write("<div class=nograph><div class=msg>")
+ html.write(html.var("message", _("No data available.")))
+ html.write("</div></div>")
+
def render_pnpgraph(site, host, service=None, source=0):
if not host:
html.message("Invalid URL to this dashlet. Missing
<tt>host</tt>")
diff --git a/web/plugins/pages/shipped.py b/web/plugins/pages/shipped.py
index b29dcf1..dc90bb7 100644
--- a/web/plugins/pages/shipped.py
+++ b/web/plugins/pages/shipped.py
@@ -68,5 +68,6 @@ pagehandlers.update({
"dashlet_hoststats" : dashboard.dashlet_hoststats,
"dashlet_servicestats" : dashboard.dashlet_servicestats,
"dashlet_pnpgraph" : dashboard.dashlet_pnpgraph,
+ "dashlet_nodata" : dashboard.dashlet_nodata,
})