Module: check_mk
Branch: master
Commit: b37c296d0eecc8c061341782b2353e93940e3ec0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b37c296d0eecc8…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Feb 4 15:37:28 2013 +0100
Availability: make options hidable, like filters
---
web/htdocs/images/button_history_hi.png | Bin 0 -> 3519 bytes
web/htdocs/images/button_history_lo.png | Bin 0 -> 4711 bytes
web/htdocs/views.css | 4 ++++
web/htdocs/views.py | 10 ----------
web/plugins/views/availability.py | 16 +++++++++++++---
5 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/web/htdocs/images/button_history_hi.png
b/web/htdocs/images/button_history_hi.png
new file mode 100644
index 0000000..b6bbfc3
Binary files /dev/null and b/web/htdocs/images/button_history_hi.png differ
diff --git a/web/htdocs/images/button_history_lo.png
b/web/htdocs/images/button_history_lo.png
new file mode 100644
index 0000000..d3b8f47
Binary files /dev/null and b/web/htdocs/images/button_history_lo.png differ
diff --git a/web/htdocs/views.css b/web/htdocs/views.css
index 9185b4d..47be080 100644
--- a/web/htdocs/views.css
+++ b/web/htdocs/views.css
@@ -504,3 +504,7 @@ div.floatfilter.rangespec table.valuespec_tuple span.title {
position: relative;
top: 7px;
}
+
+div#avoptions_on {
+ margin-right: 132px;
+}
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 1d19c7c..9792000 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1610,16 +1610,6 @@ def view_optiondial(view, option, choices, help):
def view_optiondial_off(option):
html.write('<div class="optiondial off %s"></div>' %
option)
-
-def view_option_toggler(id, view, option, icon, help, hidden = False):
- vo = view_options(view["name"])
- value = vo.get(option, view.get(option, False))
- html.begin_context_buttons() # just to be sure
- hide = hidden and ' style="display:none"' or ''
- html.write('<div id="%s_on" title="%s"
class="togglebutton %s %s" '
- 'onclick="view_switch_option(this, \'%s\',
\'%s\');"%s></div>' % (
- id, help, icon, value and "down" or "up",
view["name"], option, hide))
-
def toggler(id, icon, help, onclick, value, hidden = False):
html.begin_context_buttons() # just to be sure
hide = hidden and ' style="display:none"' or ''
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index 109ab94..106d83a 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -37,6 +37,8 @@ def render_availability(view, datasource, filterheaders,
display_options,
html.top_heading(title)
if 'B' in display_options:
html.begin_context_buttons()
+ togglebutton("avoptions", False, "painteroptions",
_("Configure details of the report"))
+
html.context_button(_("Status View"), html.makeuri([("mode",
"status")]), "status")
html.end_context_buttons()
@@ -165,7 +167,10 @@ def render_availability_options():
},
})
+ is_open = False
html.begin_form("avoptions")
+ html.write('<div class="view_form" id="avoptions"
%s>'
+ % (not is_open and 'style="display: none"' or '')
)
html.write("<table border=0 cellspacing=0 cellpadding=0
class=filterform><tr><td>")
if html.form_submitted():
@@ -197,6 +202,7 @@ def render_availability_options():
html.write("<tr><td>")
html.button("apply", _("Apply"), "submit")
html.write("</td></tr></table>")
+ html.write("</div>")
html.hidden_fields()
html.end_form()
@@ -385,11 +391,15 @@ def do_render_availability(datasource, filterheaders, avoptions,
only_sites, lim
return "%02d:%02d:%02d" % (hours, minn, sec)
- table.begin(_("Availability Matrix") + " - " + range_title,
css="availability")
+ table.begin(_("Availability") + " " + range_title,
css="availability")
for site, host, service, states, considered_duration in availability:
table.row()
- table.cell(_("Host"), host)
- table.cell(_("Service"), service)
+ table.cell("", css="buttons")
+ html.icon_button("URL", _("Event History"),
"history")
+ host_url = "view.py?" + htmllib.urlencode_vars([("view_name",
"hoststatus"), ("site", site), ("host", host)])
+ table.cell(_("Host"), '<a
href="%s">%s</a>' % (host_url, host))
+ service_url = "view.py?" +
htmllib.urlencode_vars([("view_name", "service"), ("site",
site), ("host", host), ("service", service)])
+ table.cell(_("Service"), '<a
href="%s">%s</a>' % (service_url, service))
for sid, css, sname, help in availability_columns:
if sid == "outof_notification_period" and not
avoptions["consider"]["notification_period"]:
continue