Module: check_mk
Branch: master
Commit: 8083b297bb48eb5d540cd79f4fb5b44e378ce784
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8083b297bb48eb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Mar 9 17:06:04 2012 +0100
Make master control foldable
---
web/plugins/sidebar/shipped.py | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index 24e0435..46ea3c1 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -952,21 +952,21 @@ def render_master_control():
html.live.set_prepend_site(True)
data = html.live.query("GET status\nColumns: %s" % " ".join([
i[0] for i in items ]))
html.live.set_prepend_site(False)
- html.write("<table class=master_control>\n")
for siteline in data:
siteid = siteline[0]
if siteid:
sitealias = html.site_status[siteid]["site"]["alias"]
- html.write("<tr><td class=left colspan=2>")
- heading(sitealias)
- html.write("</tr>\n")
+ html.begin_foldable_container("master_control", siteid, True,
sitealias)
+ html.write("<table class=master_control>\n")
for i, (colname, title) in enumerate(items):
colvalue = siteline[i + 1]
url = defaults.url_prefix +
("check_mk/switch_master_state.py?site=%s&switch=%s&state=%d" % (siteid,
colname, 1 - colvalue))
onclick = "get_url('%s', updateContents,
'snapin_master_control')" % url
enabled = colvalue and "enabled" or "disabled"
html.write("<tr><td class=left>%s</td><td
class=%s><a onclick=\"%s\"
href=\"#\">%s</a></td></tr>\n" % (title, enabled,
onclick, enabled))
- html.write("</table>")
+ html.write("</table>")
+ if siteid:
+ html.end_foldable_container()
sidebar_snapins["master_control"] = {
"title" : _("Master control"),
@@ -977,7 +977,7 @@ sidebar_snapins["master_control"] = {
"styles" : """
div.snapin table.master_control {
width: %dpx;
- margin: 0px;
+ margin: 0px 0px 8px 0px;
border-spacing: 0px;
}
@@ -1017,7 +1017,7 @@ div.snapin table.master_control td.disabled a {
border-color: #c00;
color: #fff;
}
-""" % snapin_width
+""" % (snapin_width - 20)
}
def ajax_switch_masterstate():