Module: check_mk
Branch: master
Commit: 442c58e703ceabbba9868d513a11a580f60663a7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=442c58e703ceab…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Dec 16 14:03:18 2010 +0100
new view property: hidebutton
---
ChangeLog | 4 ++++
web/htdocs/views.py | 9 ++++++++-
web/plugins/views/builtin.py | 5 +++++
3 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 64e2171..d298885 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,10 @@
OMD users put the icons into ~/local/share/check_mk/web/htdocs/images/icons.
* New automatic PNP-link icons: These icons automatically appear, if
the new livestatus is configured correctly (see below).
+ * new view property "hidebutton": allow to hide context button to a view.
+ * Defaults views 'Services: OK', 'Services: WARN, etc. do now not create
+ context buttons (cleans up button bar).
+
Checks & Agents:
* Fixed problem with OnlyFrom: in Linux agent (df didn't work properly)
* cups_queues: fixed plugin error due to invalid import of datetime,
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 9b696ab..32c8b2b 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -531,7 +531,9 @@ function toggle_section(nr, oImg) {
html.write(" hide this view from the sidebar")
html.write("<br />\n")
html.checkbox("mustsearch")
- html.write(" show data only on search")
+ html.write(" show data only on search<br>")
+ html.checkbox("hidebutton")
+ html.write(" do not show a context button to this view")
section_footer()
# [3] Filters
@@ -658,6 +660,7 @@ def load_view_into_html_vars(view):
html.set_var("public", view["public"] and
"on" or "")
html.set_var("hidden", view["hidden"] and
"on" or "")
html.set_var("mustsearch", view["mustsearch"] and
"on" or "")
+ html.set_var("hidebutton", view.get("hidebutton", False)
and "on" or "")
html.set_var("show_header", view.get("show_header", True)
and "on" or "")
html.set_var("show_controls", view.get("show_controls", True)
and "on" or "")
@@ -744,6 +747,7 @@ def create_view():
public = html.var("public", "") != "" and
config.may("publish_views")
hidden = html.var("hidden", "") != ""
mustsearch = html.var("mustsearch", "") != ""
+ hidebutton = html.var("hidebutton", "") != ""
column_headers = html.var("column_headers")
show_header = html.var("show_header", "") != ""
show_controls = html.var("show_controls", "") != ""
@@ -805,6 +809,7 @@ def create_view():
"public" : public,
"hidden" : hidden,
"mustsearch" : mustsearch,
+ "hidebutton" : hidebutton,
"layout" : layoutname,
"num_columns" : num_columns,
"browser_reload" : browser_reload,
@@ -1137,6 +1142,8 @@ def show_context_links(thisview, active_filters):
name = view["name"]
if view == thisview:
continue
+ if view.get("hidebutton", False):
+ continue # this view does not want a button to be displayed
hidden_filternames = view["hide_filters"]
used_contextvars = []
skip = False
diff --git a/web/plugins/views/builtin.py b/web/plugins/views/builtin.py
index 232dfa2..99d0254 100644
--- a/web/plugins/views/builtin.py
+++ b/web/plugins/views/builtin.py
@@ -380,6 +380,7 @@ multisite_builtin_views = {
('stp', '')],
'hidden': True,
'hide_filters': ['site', 'host'],
+ 'hidebutton' : True,
'layout': 'boxed',
'mustsearch': False,
'name': 'host_lk',
@@ -411,6 +412,7 @@ multisite_builtin_views = {
('stp', '')],
'hidden': True,
'hide_filters': ['site', 'host'],
+ 'hidebutton' : True,
'layout': 'boxed',
'mustsearch': False,
'name': 'host_warn',
@@ -442,6 +444,7 @@ multisite_builtin_views = {
('stp', '')],
'hidden': True,
'hide_filters': ['site', 'host'],
+ 'hidebutton' : True,
'layout': 'boxed',
'mustsearch': False,
'name': 'host_crit',
@@ -473,6 +476,7 @@ multisite_builtin_views = {
('stp', '')],
'hidden': True,
'hide_filters': ['site', 'host'],
+ 'hidebutton' : True,
'layout': 'boxed',
'mustsearch': False,
'name': 'host_unknown',
@@ -504,6 +508,7 @@ multisite_builtin_views = {
('stp', 'on')],
'hidden': True,
'hide_filters': ['site', 'host'],
+ 'hidebutton' : True,
'layout': 'boxed',
'mustsearch': False,
'name': 'host_pending',