Module: check_mk
Branch: master
Commit: 54657fdeedb2053b3e573d8a838d6d946b08bda7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=54657fdeedb205…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Mar 26 16:00:02 2012 +0200
Fixed spacing of host stats
---
web/htdocs/dashboard.css | 23 ++++++++++++++++-------
web/htdocs/dashboard.py | 12 +++++++++---
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/web/htdocs/dashboard.css b/web/htdocs/dashboard.css
index 5adbcd4..8108e87 100644
--- a/web/htdocs/dashboard.css
+++ b/web/htdocs/dashboard.css
@@ -137,14 +137,14 @@ table.dashlet_overview h2 {
/* Styles for various builtin dashlets */
canvas.pie {
- margin-top: 10px;
+ margin-top: 5px;
margin-left: 10px;
z-index: 20;
}
img.globe {
position: absolute;
- top: 10px;
+ top: 5px;
left: 10px;
}
img.globe {
@@ -155,12 +155,12 @@ div.dashlet table.hoststats {
margin-top: 10px;
margin-left: 5px;
width: 143px;
- height: 136px;
+ height: 142px;
border-collapse: collapse;
border-spacing: 0px;
}
div.dashlet table.hoststats.narrow {
- margin-top: 4px;
+ margin-top: 6px;
}
div.dashlet table.hoststats a {
@@ -186,12 +186,13 @@ div.dashlet table.hoststats th {
padding-left: 4px;
}
div.dashlet table.hoststats td.color {
- padding: 2px;
+ padding: 0px;
+ width: 3px;
}
div.dashlet table.hoststats th, table.hoststats td {
padding-top: 3px;
padding-bottom: 3px;
- border-color: #fff;
+ border-color: #498aa6;
border-style: solid none;
border-width: 1px;
vertical-align: middle;
@@ -200,6 +201,15 @@ div.dashlet table.hoststats.narrow th, table.hoststats.narrow td {
font-size: 8pt;
}
+div.dashlet_inner div.stats {
+ background-color: #6da1b8;
+ position: absolute;
+ height: 100%;
+ width: 100%;
+ padding: 0px;
+ margin: 0px;
+}
+
div.dashlet div.nograph {
background-color: #fff;
width: 100%;
@@ -210,4 +220,3 @@ div.dashlet div.nograph div.msg {
padding: 10px;
}
-
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index b826768..d540ea8 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -498,6 +498,7 @@ def dashlet_servicestats():
def render_statistics(pie_id, what, table, filter):
+ html.write("<div class=stats>")
pie_diameter = 130
pie_left_aspect = 0.5
pie_right_aspect = 0.8
@@ -522,8 +523,12 @@ def render_statistics(pie_id, what, table, filter):
html.write('<img src="images/globe.png"
class="globe">')
html.write('<table class="hoststats%s"
style="float:left">' % (
- len(pies) > 5 and " narrow" or ""))
- for (name, color, viewurl, query), count in pies + [ ((_("Total"),
"", "all%s" % what, ""), total) ]:
+ len(pies) > 1 and " narrow" or ""))
+ table_entries = pies
+ while len(table_entries) < 6:
+ table_entries = table_entries + [ (("", "fff", "",
""), " ") ]
+ 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=" \
+ htmllib.urlencode(html.var("wato_folder", ""))
html.write('<tr><th><a
href="%s">%s</a></th>' % (url, name))
@@ -531,7 +536,7 @@ def render_statistics(pie_id, what, table, filter):
if color:
style = ' style="background-color: %s"' % color
html.write('<td class=color%s>'
- '</td><td><a
href="%s">%d</a></td></tr>' % (style, url, count))
+ '</td><td><a
href="%s">%s</a></td></tr>' % (style, url, count))
html.write("</table>")
@@ -563,6 +568,7 @@ def render_statistics(pie_id, what, table, filter):
sum_separator -= separator
+ html.write("</div>")
html.javascript("""
function chart_pie(pie_id, x_scale, radius, color) {
var context = document.getElementById(pie_id +
"_stats").getContext('2d');