Module: check_mk
Branch: master
Commit: 4dc44d02f6889447227c193d7dbc5fdc5509452b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4dc44d02f68894…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Oct 23 03:06:07 2013 -0400
WATO: bulk operations now also available when checkboxes are off
---
.bugs/982 | 9 ++++++++-
ChangeLog | 1 +
web/htdocs/wato.py | 39 +++++++++++++++++++++------------------
3 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/.bugs/982 b/.bugs/982
index f7b3731..3c6fd58 100644
--- a/.bugs/982
+++ b/.bugs/982
@@ -1,9 +1,16 @@
Title: WATO: Hostlist in folder: enable checkboxes -> all should be checked
Component: wato
-State: open
+State: done
Date: 2013-10-09 20:39:38
Targetversion: 1.4.0
Class: nastiness
When you enable the checkboxes in a WATO folder host list,
then all boxes should initially be checked.
+
+Better solution: readd the bulk buttons also when there
+are no checkboxes at all.
+
+
+2013-10-23 03:05:33: changed state open -> done
+Bulk operations now also work without checkboxes
diff --git a/ChangeLog b/ChangeLog
index c22bec4..0cf8cf3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -87,6 +87,7 @@
distributed WATO (available in the "Distributed Monitoring")
* bulk inventory: display percentage in progress bar
* New option for full SNMP scan in bulk inventory
+ * bulk operations now also available when checkboxes are off
* FIX: correct display of number of hosts in bulk inventory
* FIX: nailed down ".siteid" exception when added new site
* FIX: fixed setting for locking mode from 'ait' to 'wait'
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index bb9fc1d..3f5241f 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1292,23 +1292,23 @@ def show_hosts(folder):
'checkbox', _('Hide Checkboxes and bulk
actions'), 'checkbox',
html.makeuri([('show_checkboxes', '0')])))
- html.write(' ' + _("Selected hosts:\n"))
+ html.write(' ' + _("Selected hosts:\n"))
- if not g_folder.get(".lock_hosts"):
- if config.may("wato.manage_hosts"):
- html.button("_bulk_delete", _("Delete"))
- if config.may("wato.edit_hosts"):
- html.button("_bulk_edit", _("Edit"))
- html.button("_bulk_cleanup", _("Cleanup"))
- if config.may("wato.services"):
- html.button("_bulk_inventory", _("Inventory"))
- if not g_folder.get(".lock_hosts"):
- if config.may("wato.parentscan"):
- html.button("_parentscan", _("Parentscan"))
- if config.may("wato.edit_hosts") and
config.may("wato.move_hosts"):
- move_to_folder_combo("host", None, top)
- if at_least_one_imported:
- html.button("_bulk_movetotarget", _("Move to
Target Folders"))
+ if not g_folder.get(".lock_hosts"):
+ if config.may("wato.manage_hosts"):
+ html.button("_bulk_delete", _("Delete"))
+ if config.may("wato.edit_hosts"):
+ html.button("_bulk_edit", _("Edit"))
+ html.button("_bulk_cleanup", _("Cleanup"))
+ if config.may("wato.services"):
+ html.button("_bulk_inventory", _("Inventory"))
+ if not g_folder.get(".lock_hosts"):
+ if config.may("wato.parentscan"):
+ html.button("_parentscan", _("Parentscan"))
+ if config.may("wato.edit_hosts") and
config.may("wato.move_hosts"):
+ move_to_folder_combo("host", None, top)
+ if at_least_one_imported:
+ html.button("_bulk_movetotarget", _("Move to Target
Folders"))
html.write("</td></tr>\n")
# Show table of hosts in this folder
@@ -1680,16 +1680,19 @@ def delete_folder_after_confirm(del_folder):
# Create list of all hosts that are select with checkboxes in the current file.
# This is needed for bulk operations.
def get_hostnames_from_checkboxes(filterfunc = None):
+ show_checkboxes = html.var("show_checkboxes") == "1"
+
entries = g_folder[".hosts"].items()
entries.sort()
- selected =
weblib.get_rowselection('wato-folder-/'+g_folder['.path'])
+ if show_checkboxes:
+ selected =
weblib.get_rowselection('wato-folder-/'+g_folder['.path'])
selected_hosts = []
search_text = html.var("search")
for hostname, host in entries:
if (not search_text or (search_text.lower() in hostname.lower())) \
- and ('_c_' + hostname) in selected:
+ and (not show_checkboxes or ('_c_' + hostname) in selected):
if filterfunc == None or \
filterfunc(host):
selected_hosts.append(hostname)