Module: check_mk
Branch: master
Commit: f6af5c08a28765a78cc81bf899d189ac77985339
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f6af5c08a28765…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 18 11:31:18 2013 -0500
FIX: remove duplicate entries from Quicksearch
---
.bugs/831 | 6 ++++--
.bugs/998 | 9 +++++++--
ChangeLog | 1 +
web/htdocs/sidebar.py | 16 +++++++++++-----
web/plugins/sidebar/search.py | 1 +
5 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/.bugs/831 b/.bugs/831
index 998061d..d2a797c 100644
--- a/.bugs/831
+++ b/.bugs/831
@@ -1,8 +1,10 @@
Title: Quicksearch: Duplicate results
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2013-10-16 13:41:13
Targetversion: 1.4.0
-Class: bug
In Version 1.2.3i4, the quicksearch repeats some of the results what means that some of
the hosts are shown twice.
+
+2013-10-18 11:31:07: changed state open -> done
diff --git a/.bugs/998 b/.bugs/998
index c1298ff..ba2287c 100644
--- a/.bugs/998
+++ b/.bugs/998
@@ -1,12 +1,17 @@
Title: ntp check does not disable dns lookups and uses ipv6 as default with newer ntp
versions
Component: checks
-State: open
+Class: bug
+State: wontfix
Date: 2013-08-09 12:39:37
Targetversion: future
-Class: bug
check_mk_agents ntp check calls 'ntpq -p' as check command. This uses dns to
resolve
addresses of ntp servers and uses ipv6 as default if available. Both may lead to
timeouts of the check. Calling 'ntpq -4np' might be a better choice.
Solution not clear. -n introduces other problems.
+
+2013-10-18 11:19:19: changed state open -> wontfix
+Adding -n causes trouble when using
pool.ntp.org and stuff,
+because the IP addresses are always changing. That make
+the ntp.peers check unhappy.
diff --git a/ChangeLog b/ChangeLog
index d4cec65..78d7587 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,7 @@
* FIX: Fixed encoding problem in webservice column output
* FIX: Fix output format python for several numeric columns
* FIX: Fixed searching hosts by aliases/adresses
+ * FIX: Remove duplicate entries from Quicksearch
BI:
* FIX: Fix exception when showing BI tree in reporting time warp
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 8e9c1aa..5f6b478 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -594,6 +594,7 @@ def page_edit_bookmark():
html.footer()
+#.
# .--Quicksearch---------------------------------------------------------.
# | ___ _ _ _ |
# | / _ \ _ _(_) ___| | _____ ___ __ _ _ __ ___| |__ |
@@ -712,17 +713,22 @@ def render_search_results(ty, objects):
display_site = True
break
+ # Remove duplicate entries, i.e. with the same name and
+ # the same URL.
+ unique = set([])
for obj in objects:
if len(obj) == 3:
plugin, site, name = obj
url = url_tmpl % {'name': name, 'site': site}
else:
plugin, site, name, url = obj
- html.write('<a id="result_%s" class="%s"
href="%s" onClick="mkSearchClose()" target="main">%s'
%
- (name, ty, url, name))
- if display_site:
- html.write(' (%s)' % site)
- html.write('</a>\n')
+ if not (name, url) in unique:
+ html.write('<a id="result_%s" class="%s"
href="%s" onClick="mkSearchClose()" target="main">%s'
%
+ (name, ty, url, name))
+ if display_site:
+ html.write(' (%s)' % site)
+ html.write('</a>\n')
+ unique.add((name, url))
def process_search(q):
ty, q = parse_search_query(q)
diff --git a/web/plugins/sidebar/search.py b/web/plugins/sidebar/search.py
index a574b9d..e2e5a9c 100644
--- a/web/plugins/sidebar/search.py
+++ b/web/plugins/sidebar/search.py
@@ -96,6 +96,7 @@ sidebar_snapins["search"] = {
"""
}
+#.
# .--Search Plugins------------------------------------------------------.
# | ____ _ ____ _ _ |
# | / ___| ___ __ _ _ __ ___| |__ | _ \| |_ _ __ _(_)_ __ ___ |