Module: check_mk
Branch: master
Commit: d98166bc51cbf159c4e18bc8aa2b09d741728fb6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d98166bc51cbf1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 5 14:40:00 2011 +0200
FIX: Not showing the action form in "try" mode of the view editor
---
ChangeLog | 1 +
web/htdocs/views.py | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fd71f13..c7e0b1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
* FIX: fix error when using non-Ascii characters in view title
* FIX: fix error on comment page caused by missing sorter
* FIX: endless javascript when fetching pnp graphs on host/service detail pages
+ * FIX: Not showing the action form in "try" mode of the view editor
* Added missing i18n strings in command form and list of views
* Views are not reloaded completely anymore. The data tables are reloaded
on their own.
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 9fdfb07..7d2fb0c 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1793,6 +1793,8 @@ def collist_of_collection(collection, join_target = []):
def show_action_form(is_open, datasource):
if not config.may("act"):
return
+ if html.has_var("try"):
+ return
# We take the first info to be the native data type of this table
# and show actions useful for that
Module: check_mk
Branch: master
Commit: bef81a57d7bf4e94108eb3e4d4134c2a788fd0c3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bef81a57d7bf4e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 5 13:04:03 2011 +0200
Top buttons recognizing search filter now
---
web/htdocs/wato.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 2fef9db..09342b9 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -655,7 +655,8 @@ def mode_file(phase):
# a folder information but not yet moved to that folder). If at least
# one host has a target folder, then we show an additional bulk action.
at_least_one_imported = False
- for hostname in hostnames:
+ more_than_ten_items = False
+ for num, hostname in enumerate(hostnames):
if search_text and (search_text.lower() not in hostname.lower()):
continue
@@ -665,9 +666,12 @@ def mode_file(phase):
if effective.get("imported_folder"):
at_least_one_imported = True
+ if num == 11:
+ more_than_ten_items = True
+
# Add the bulk action buttons also to the top of the table when this
# list shows more than 10 rows
- if len(hostnames) > 10:
+ if more_than_ten_items:
bulk_actions(at_least_one_imported)
for hostname in hostnames:
Module: check_mk
Branch: master
Commit: 566a862ed99219d3ef36033c4133e306aea99077
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=566a862ed99219…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 5 12:55:55 2011 +0200
Bulk action buttons are shown at the top of hostlists too when the lists have more than 10 list items
---
ChangeLog | 4 +++
web/htdocs/wato.py | 56 ++++++++++++++++++++++++++++++++-------------------
2 files changed, 39 insertions(+), 21 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b3ab8c9..c121dcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,7 +16,11 @@
* Added missing sorters for "service nth service perfdata" painters
* Implemented row selection in views to select only a subset of shown data
for actions
+
+ WATO:
* Changed row selection in WATO to new row selection mechanism
+ * Bulk action buttons are shown at the top of hostlists too when the lists
+ have more than 10 list items
1.1.11i3:
Core, Setup, etc.:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 6f10be4..2fef9db 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -634,7 +634,26 @@ def mode_file(phase):
html.write("</tr>\n")
odd = "odd"
+ def bulk_actions(at_least_one_imported):
+ # bulk actions
+ html.write('<tr class="data %s0">' % odd)
+ html.write("<td colspan=%d>" % colspan)
+ html.jsbutton('_markall', 'X', 'javascript:toggle_all_rows();')
+ html.write(' ' + _("On all selected hosts:\n"))
+ html.button("_bulk_delete", _("Delete"))
+ html.button("_bulk_edit", _("Edit"))
+ html.button("_bulk_cleanup", _("Cleanup"))
+ html.button("_bulk_inventory", _("Inventory"))
+ host_move_combo(None)
+ if at_least_one_imported:
+ html.button("_bulk_movetotarget", _("Move to Target Folders"))
+ html.write("</td></tr>\n")
+
search_text = html.var("search")
+
+ # Remember if that host has a target folder (i.e. was imported with
+ # a folder information but not yet moved to that folder). If at least
+ # one host has a target folder, then we show an additional bulk action.
at_least_one_imported = False
for hostname in hostnames:
if search_text and (search_text.lower() not in hostname.lower()):
@@ -643,6 +662,21 @@ def mode_file(phase):
host = g_hosts[hostname]
effective = effective_attributes(host, g_file)
+ if effective.get("imported_folder"):
+ at_least_one_imported = True
+
+ # Add the bulk action buttons also to the top of the table when this
+ # list shows more than 10 rows
+ if len(hostnames) > 10:
+ bulk_actions(at_least_one_imported)
+
+ for hostname in hostnames:
+ if search_text and (search_text.lower() not in hostname.lower()):
+ continue
+
+ host = g_hosts[hostname]
+ effective = effective_attributes(host, g_file)
+
# Rows with alternating odd/even styles
html.write('<tr class="dr_%s dr data %s0">' % (hostname, odd))
odd = odd == "odd" and "even" or "odd"
@@ -682,27 +716,7 @@ def mode_file(phase):
html.write("</td>")
html.write("</tr>\n")
- # Remember if that host has a target folder (i.e. was imported with
- # a folder information but not yet moved to that folder). If at least
- # one host has a target folder, then we show an additional bulk action.
- if effective.get("imported_folder"):
- at_least_one_imported = True
-
-
- # bulk actions
- html.write('<tr class="data %s0">' % odd)
- html.write("<td colspan=%d>" % colspan)
- html.jsbutton('_markall', 'X', 'javascript:toggle_all_rows();')
- html.write(_("On all selected hosts:\n"))
- html.button("_bulk_delete", _("Delete"))
- html.button("_bulk_edit", _("Edit"))
- html.button("_bulk_cleanup", _("Cleanup"))
- html.button("_bulk_inventory", _("Inventory"))
- host_move_combo(None)
- if at_least_one_imported:
- html.button("_bulk_movetotarget", _("Move to Target Folders"))
- html.write("</td></tr>\n")
-
+ bulk_actions(at_least_one_imported)
html.write("</table>\n")
# Important: remove selected hosts from the hidden fields. Otherwise
Module: check_mk
Branch: master
Commit: f4a91624fd6bcba64dc214b9058cfabba3464541
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f4a91624fd6bcb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 5 10:17:46 2011 +0200
Dont make rows selectable when no commands can be fired
---
web/plugins/views/layouts.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/web/plugins/views/layouts.py b/web/plugins/views/layouts.py
index 5c8a98b..09c710a 100644
--- a/web/plugins/views/layouts.py
+++ b/web/plugins/views/layouts.py
@@ -25,6 +25,10 @@
# Boston, MA 02110-1301 USA.
def init_rowselect():
+ # Don't make rows selectable when no commands can be fired
+ if not 'C' in html.display_options or not config.may("act"):
+ return
+
row_nums = []
if html.has_var('selected_rows'):
selected_rows = html.var('selected_rows', '')