Module: check_mk
Branch: master
Commit: 6746bf40a9f5204060aad3260b19e8d9288a6401
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6746bf40a9f520…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon May 30 12:15:07 2011 +0200
WATO: Checkbox in search dialog for global search
---
web/htdocs/wato.py | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 1821cec..03a78ca 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -809,9 +809,14 @@ def mode_search(phase):
## # Show search form
html.begin_form("search")
- html.hidden_fields()
html.write("<table class=form>")
+ # Wether to search only in this folder
+ html.write("<tr><td class=legend></td><td
class=content>")
+ html.checkbox("onlyhere", True)
+ html.write(" Search only in the folder <b>%s</b> and below"
% g_folder["title"])
+ html.write("</td></tr>")
+
# host name
html.write("<tr><td class=legend>Hostname</td><td
class=content>")
html.text_input("host")
@@ -837,6 +842,7 @@ def mode_search(phase):
html.write("</td></tr>\n")
html.write("</table>\n")
+ html.hidden_fields()
html.end_form()
# Show search results
@@ -858,7 +864,11 @@ def mode_search(phase):
"tags" : tags,
}
html.write("<h3>Search results:</h3>")
- if not search_hosts_in_folder(g_folder, crit):
+ if html.var("onlyhere"):
+ folder = g_folder
+ else:
+ folder = g_root_folder
+ if not search_hosts_in_folder(folder, crit):
html.message(_("No matching hosts found."))
html.write("</td></tr></table>")