Module: check_mk
Branch: master
Commit: 4505df14e638fb567421ef711d3a76f001df6674
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4505df14e638fb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jun 9 13:51:44 2016 +0200
3592 Views: Added sorter for host names (without site)
---
.werks/3592 | 10 ++++++++++
ChangeLog | 1 +
web/plugins/views/sorters.py | 11 ++++++++++-
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/3592 b/.werks/3592
new file mode 100644
index 0000000..5aefcd0
--- /dev/null
+++ b/.werks/3592
@@ -0,0 +1,10 @@
+Title: Views: Added sorter for host names (without site)
+Level: 1
+Component: multisite
+Class: feature
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1465473081
+
+
diff --git a/ChangeLog b/ChangeLog
index 6e81dc8..447eae5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -281,6 +281,7 @@
* 3129 new view and datasource containing the results of the last periodic discovery
check...
* 3572 Added user login session idle timeout...
* 3575 User logins can now be limited to single session at a time...
+ * 3592 Views: Added sorter for host names (without site)
* 3059 FIX: Fixed highlighting of availability timeline time slices
* 3175 FIX: Fix timeranges of graphs that are embedded in a dashboard...
* 3076 FIX: fixed broken views in check_mk raw edition
diff --git a/web/plugins/views/sorters.py b/web/plugins/views/sorters.py
index e6daa25..6565e54 100644
--- a/web/plugins/views/sorters.py
+++ b/web/plugins/views/sorters.py
@@ -100,11 +100,20 @@ def cmp_site_host(r1, r2):
cmp_num_split("host_name", r1, r2)
multisite_sorters["site_host"] = {
- "title" : _("Host"),
+ "title" : _("Host site and name"),
"columns" : ["site", "host_name" ],
"cmp" : cmp_site_host
}
+def cmp_host_name(r1, r2):
+ return cmp_num_split("host_name", r1, r2)
+
+multisite_sorters["host_name"] = {
+ "title" : _("Host name"),
+ "columns" : ["host_name" ],
+ "cmp" : cmp_host_name,
+}
+
def cmp_site_alias(r1, r2):
return cmp(config.site(r1["site"])["alias"],
config.site(r2["site"])["alias"])