Module: check_mk
Branch: master
Commit: 2ecd50649b891774b2d13ea68950c3269d5d49db
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2ecd50649b8917…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Oct 6 11:56:12 2011 +0200
Dashboard: new dashlet attribute title_url
---
ChangeLog | 1 +
web/htdocs/check_mk.css | 8 ++++++++
web/htdocs/dashboard.py | 7 ++++++-
web/plugins/dashboard/builtin.py | 3 +++
4 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c3faacd..6c81f22 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@
* Added "Administration" snapin to default sidebar
* Tactical Overview: make link clickable even if count is zero
* Minor cleanup in default dashboard
+ * Dashboard: new dashlet attribute title_url lets you make a title into a link
Livestatus:
* Write messages after initialization into an own livestatus.log
diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css
index 8867279..3daf5ce 100644
--- a/web/htdocs/check_mk.css
+++ b/web/htdocs/check_mk.css
@@ -1680,6 +1680,14 @@ div.dashlet div.title {
font-size: 10pt;
font-weight: bold;
}
+div.dashlet div.title a {
+ text-decoration: none;
+ border-bottom: 1px dotted white;
+ color: white;
+}
+div.dashlet div.title a:hover {
+ color: #00f;
+}
div.dashlet img.shadow {
position: absolute;
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 15458e0..ddf77ef 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -173,7 +173,12 @@ def render_dashlet(nr, dashlet, filename):
(p, nr, p, p))
if dashlet.get("title"):
- html.write('<div class="title"
id="dashlet_title_%d">%s</div>' % (nr,
dashlet["title"]))
+ url = dashlet.get("title_url", None)
+ if url:
+ title = '<a href="%s">%s</a>' % (url,
dashlet["title"])
+ else:
+ title = dashlet["title"]
+ html.write('<div class="title"
id="dashlet_title_%d">%s</div>' % (nr, title))
if dashlet.get("background", True):
bg = " background"
else:
diff --git a/web/plugins/dashboard/builtin.py b/web/plugins/dashboard/builtin.py
index 7fc6cdc..9064434 100644
--- a/web/plugins/dashboard/builtin.py
+++ b/web/plugins/dashboard/builtin.py
@@ -55,18 +55,21 @@ builtin_dashboards = {
},
{
"title" : _("Host Problems"),
+ "title_url" : "view.py?view_name=hostproblems",
"view" : "hostproblems_dash", #
"view.py?view_name=hostproblems_dash&display_options=SIXHR&_body_class=dashlet",
"position" : (-1, 1),
"size" : (GROW, 6),
},
{
"title" : _("Service Problems"),
+ "title_url" : "view.py?view_name=svcproblems",
"view" : "svcproblems_dash", #
"view.py?view_name=svcproblems_dash&display_options=SIXHR&_body_class=dashlet",
"position" : (1, 7),
"size" : (GROW, MAX),
},
{
"title" : _("Events of recent 4 hours"),
+ "title_url" : "view.py?view_name=events_dash",
"view" : "events_dash", #
"view.py?view_name=events_dash&display_options=SIXHR&_body_class=dashlet",
"position" : (-1, -1),
"size" : (GROW, GROW),