Module: check_mk
Branch: master
Commit: 68c3b7b1082ce9e9a9db03d2eb904c6acf68ca23
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=68c3b7b1082ce9…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Nov 24 16:52:31 2011 +0100
Add Snapin page: show previews of all snapins
---
ChangeLog | 1 +
web/htdocs/check_mk.css | 45 ++++++++++++++++++++++++----------------
web/htdocs/sidebar.py | 25 ++++++++-------------
web/plugins/sidebar/shipped.py | 2 +-
4 files changed, 39 insertions(+), 34 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b9e3d55..3b1df7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -44,6 +44,7 @@
* Logwatch: Switched strings in logwatch to i18n strings
* Logwatch: Fixed styling of context button when acknowleding log messages
* Logwatch: Implemented overview page to show all problematic logfiles
+ * Add Snapin page: show previews of all snapins
WATO:
* Evolved to full featured monitoring configuration tool!
diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css
index f693710..21a49a9 100644
--- a/web/htdocs/check_mk.css
+++ b/web/htdocs/check_mk.css
@@ -393,7 +393,7 @@ div.snapin h3 {
font-size: 100%;
}
-body.side li {
+div.snapin li {
padding-left: 1px;
color: #274750;
color: #478;
@@ -418,7 +418,7 @@ div.snapin ul {
/* width: 220px; Bei mehrstufigen Einrueckungen stimmt der rechte Rand nicht */
}
-li.sidebar {
+div.snapin li.sidebar {
margin-left: 0px;
margin-left: 0px;
}
@@ -1936,29 +1936,38 @@ The page to add snapins to the sidebar - linked from the
footer of the sidebar
*/
-table.add_snapin {
- margin: 0;
- padding: 0;
- border-spacing: 5px;
- empty-cells: hide;
- width: 100%;
-}
-
-table.add_snapin td {
- padding: 8px;
+div.add_snapin div.snapinadder {
+ padding: 8px 2px;
background-color: #9bc;
- width: 33%;
-moz-border-radius: 8px;
border-bottom: 1px solid #9ab;
border-right: 1px solid #89a;
- height: 90px;
+ height: 220px;
+ width: 280px;
+ margin-right: 10px;
+ margin-bottom: 10px;
+ float: left;
+}
+div.add_snapin div.snapinadder div.description {
color: #369;
+ padding: 10px;
}
-table.add_snapin b {
- color: #000;
+div.add_snapin div.snapin_preview div.clickshield {
+ z-index: 100;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 270px;
+ height: 120px;
}
-table.add_snapin i {
- color: #fff;
+
+div.add_snapin div.snapin_preview {
+ width: 270px;
+ height: 120px;
+ overflow: hidden;
+ position: relative;
+ top: 0px;
+ left: 0px;
}
/*
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index c3958d7..b84779a 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -319,36 +319,31 @@ def page_add_snapin():
names = sidebar_snapins.keys()
names.sort()
- html.write('<table class="add_snapin">\n<tr>\n')
- n = 0
+ html.write('<div class="add_snapin">\n')
for name in names:
if name in used_snapins:
continue
if not config.may("sidesnap." + name):
continue # not allowed for this user
- if n == 3:
- html.write("</tr><tr>\n")
- n = 0
- n += 1
snapin = sidebar_snapins[name]
title = snapin["title"]
description = snapin.get("description", "")
- author = snapin.get("author")
transid = html.current_transid()
url = 'sidebar_add_snapin.py?name=%s&_transid=%d&pos=top' %
(name, transid)
- html.write('<td onmouseover="this.style.background=\'#cde\';
this.style.cursor=\'pointer\';" '
+ html.write('<div class=snapinadder
onmouseover="this.style.background=\'#cde\';
this.style.cursor=\'pointer\';" '
'onmouseout="this.style.background=\'#9bc\' "'
'onclick="window.location.href=\'%s\';">' %
url)
- html.write("<b>%s</b><br>\n"
- "%s" % (title, description))
- if author:
- html.write("<br><i>Author: %s</i>" % author)
+ html.write("<div class=snapin_preview>")
+ html.write("<div class=clickshield></div>")
+ render_snapin(name, "open")
+ html.write("</div>")
+ html.write("<div class=description>%s</div>" %
(description))
+
+ html.write("</div>")
- html.write("<td></td>" * (3-n))
-
- html.write("</tr></table>\n")
+ html.write("</div>\n")
html.footer()
load_plugins()
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index d597851..3a479e3 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -172,7 +172,7 @@ sidebar_snapins["servicegroups"] = {
# --------------------------------------------------------------
def render_hosts(mode):
html.live.set_prepend_site(True)
- query = "GET hosts\nColumns: name state worst_service_state\n"
+ query = "GET hosts\nColumns: name state worst_service_state\nLimit: 100"
view = "host"
if mode == "summary":