Module: check_mk
Branch: master
Commit: 4b5b8fcd663033950f08eb56dd960cb5c8cefad8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b5b8fcd663033…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Oct 17 15:17:53 2013 +0200
Commands can now be restricted to only be shown in specific views
---
web/htdocs/views.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index bd0c839..6420737 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -2181,6 +2181,10 @@ def show_command_form(is_open, datasource):
by_group = {}
for command in multisite_commands:
if what in command["tables"] and
config.may(command["permission"]):
+ # Some special commands can be shown on special views using this option.
+ # It is currently only used in custom views, not shipped with check_mk.
+ if command.get('only_view') and html.var('view_name') !=
command['only_view']:
+ continue
group = command.get("group", _("Various Commands"))
by_group.setdefault(group, []).append(command)