Module: check_mk
Branch: master
Commit: efc5c0a292eadb156aadf0878f575f3b15ac854d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=efc5c0a292eadb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 27 13:02:14 2018 +0200
Minor code cleanups
Change-Id: I4260630ec1673cc687b775a49a4a0a7e763c8326
---
cmk/gui/plugins/views/layouts.py | 58 +++++++++++++++++++++++-----------------
1 file changed, 33 insertions(+), 25 deletions(-)
diff --git a/cmk/gui/plugins/views/layouts.py b/cmk/gui/plugins/views/layouts.py
index 4923b42..4bd9bed 100644
--- a/cmk/gui/plugins/views/layouts.py
+++ b/cmk/gui/plugins/views/layouts.py
@@ -218,7 +218,7 @@ def render_grouped_boxes(rows, view, group_cells, cells, num_columns, show_check
if column_headers != "off":
show_header_line()
- groups, rows_with_ids = calculate_grouping_of_services(rows_with_ids)
+ groups, rows_with_ids = calculate_view_grouping_of_services(rows_with_ids)
visible_row_number = 0
group_hidden, num_grouped_rows = None, 0
@@ -305,7 +305,14 @@ def grouped_row_title(index, group_spec, num_rows, trclass, num_cells):
# Produces a dictionary where the row index of the first row is used as key
# and a tuple of the group_spec and the number of rows in this group is the value
-def calculate_grouping_of_services(rows):
+#
+# TODO: Be aware: We have a naming issue here. There are two things named "grouping"
+#
+# a) There is the view grouping (service grouping based on regex matching with folding of rows)
+# b) Row grouping (Displaying header painters for each row)
+#
+# This is confusing and needs to be cleaned up!
+def calculate_view_grouping_of_services(rows):
if not config.service_view_grouping:
return {}, rows
@@ -316,29 +323,30 @@ def calculate_grouping_of_services(rows):
group_id = None
for index, (row_id, row) in enumerate(rows[:]):
group_spec = try_to_match_group(row)
- if group_spec:
- if current_group == None:
- group_id = row_id
-
- elif current_group != group_spec:
- group_id = row_id
-
- # When the service is not OK and should not be grouped, move it's row
- # in front of the group.
- if row.get("service_state", -1) != 0 or is_stale(row):
- if current_group == None or current_group != group_spec:
- continue # skip grouping first row
-
- elif current_group == group_spec:
- row = rows.pop(index)
- rows.insert(index - len(groups[group_id][1]), row)
- continue
-
- current_group = group_spec
- groups.setdefault(group_id, (group_spec, []))
- groups[group_id][1].append(row_id)
- else:
+ if not group_spec:
current_group = None
+ continue
+
+ if current_group == None:
+ group_id = row_id
+
+ elif current_group != group_spec:
+ group_id = row_id
+
+ # When the service is not OK and should not be grouped, move it's row
+ # in front of the group.
+ if row.get("service_state", -1) != 0 or is_stale(row):
+ if current_group == None or current_group != group_spec:
+ continue # skip grouping first row
+
+ elif current_group == group_spec:
+ row = rows.pop(index)
+ rows.insert(index - len(groups[group_id][1]), row)
+ continue
+
+ current_group = group_spec
+ groups.setdefault(group_id, (group_spec, []))
+ groups[group_id][1].append(row_id)
# Now create the final structure as described above
groupings = {}
@@ -573,7 +581,7 @@ def render_grouped_list(rows, view, group_cells, cells, num_columns, show_checkb
show_header_line()
rows_with_ids = [ (row_id(view, row), row) for row in rows ]
- groups, rows_with_ids = calculate_grouping_of_services(rows_with_ids)
+ groups, rows_with_ids = calculate_view_grouping_of_services(rows_with_ids)
visible_row_number = 0
group_hidden, num_grouped_rows = None, 0
Module: check_mk
Branch: master
Commit: 73a569af7ac42d4dcace599ada97095a3f06cdfd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=73a569af7ac42d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 27 13:05:49 2018 +0200
6725 FIX Fixed grouping of service descriptions when view rows are already grouped
When a view is grouped by the host name and it shows only services starting with "Log" of
each host and there is a view grouping for all services starting with "Log" configured,
this resulted in rendering issues. The foldable groups should only fold/unfold services of a
single host (row group) but there were groups spanning over multiple hosts.
Change-Id: I543d93fa193925a50452685fc6c3cefa007cfab7
---
.werks/6725 | 14 ++++++++++++++
cmk/gui/plugins/views/layouts.py | 15 ++++++++++++---
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/.werks/6725 b/.werks/6725
new file mode 100644
index 0000000..327983b
--- /dev/null
+++ b/.werks/6725
@@ -0,0 +1,14 @@
+Title: Fixed grouping of service descriptions when view rows are already grouped
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1538046148
+
+When a view is grouped by the host name and it shows only services starting with "Log" of
+each host and there is a view grouping for all services starting with "Log" configured,
+this resulted in rendering issues. The foldable groups should only fold/unfold services of a
+single host (row group) but there were groups spanning over multiple hosts.
diff --git a/cmk/gui/plugins/views/layouts.py b/cmk/gui/plugins/views/layouts.py
index 4bd9bed..abf94b6 100644
--- a/cmk/gui/plugins/views/layouts.py
+++ b/cmk/gui/plugins/views/layouts.py
@@ -218,7 +218,7 @@ def render_grouped_boxes(rows, view, group_cells, cells, num_columns, show_check
if column_headers != "off":
show_header_line()
- groups, rows_with_ids = calculate_view_grouping_of_services(rows_with_ids)
+ groups, rows_with_ids = calculate_view_grouping_of_services(rows_with_ids, row_group_cells=None)
visible_row_number = 0
group_hidden, num_grouped_rows = None, 0
@@ -312,7 +312,7 @@ def grouped_row_title(index, group_spec, num_rows, trclass, num_cells):
# b) Row grouping (Displaying header painters for each row)
#
# This is confusing and needs to be cleaned up!
-def calculate_view_grouping_of_services(rows):
+def calculate_view_grouping_of_services(rows, row_group_cells):
if not config.service_view_grouping:
return {}, rows
@@ -321,12 +321,21 @@ def calculate_view_grouping_of_services(rows):
groups = {}
current_group = None
group_id = None
+ last_row_group = None
for index, (row_id, row) in enumerate(rows[:]):
group_spec = try_to_match_group(row)
if not group_spec:
current_group = None
continue
+ # New row groups need to separate the view groups. There is no folding allowed
+ # between row groups (e.g. services of different hosts when the host is a group cell)
+ if row_group_cells:
+ this_row_group = group_value(row, row_group_cells)
+ if this_row_group != last_row_group:
+ group_id = row_id
+ last_row_group = this_row_group
+
if current_group == None:
group_id = row_id
@@ -581,7 +590,7 @@ def render_grouped_list(rows, view, group_cells, cells, num_columns, show_checkb
show_header_line()
rows_with_ids = [ (row_id(view, row), row) for row in rows ]
- groups, rows_with_ids = calculate_view_grouping_of_services(rows_with_ids)
+ groups, rows_with_ids = calculate_view_grouping_of_services(rows_with_ids, row_group_cells=group_cells)
visible_row_number = 0
group_hidden, num_grouped_rows = None, 0
Module: check_mk
Branch: master
Commit: 9e065ae7fe73b4b9964f4dfe052d9e5627705be6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9e065ae7fe73b4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 27 11:42:17 2018 +0200
6723 FIX Fixed custom logo in facelift theme
The globally uploaded custom logo is now also used for the facelift theme.
Change-Id: I6255e6e8cfecf48bb827aa9d0a55fe5756d6f1c5
---
.werks/6723 | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/.werks/6723 b/.werks/6723
new file mode 100644
index 0000000..13d57f4
--- /dev/null
+++ b/.werks/6723
@@ -0,0 +1,11 @@
+Title: Fixed custom logo in facelift theme
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cme
+State: unknown
+Version: 1.6.0i1
+Date: 1537974015
+
+The globally uploaded custom logo is now also used for the facelift theme.
Module: check_mk
Branch: master
Commit: 42dea483a4c23a0f0d0ca432b97704867e837bf3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=42dea483a4c23a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Sep 26 15:26:49 2018 +0200
6722 FIX Do not offer the custom GUI design for the provider
The provider design can be set through the global settings.
Change-Id: I8eb52f16eb0582113b2242d26acba3ee6f5da823
---
.werks/6722 | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/.werks/6722 b/.werks/6722
new file mode 100644
index 0000000..911d033
--- /dev/null
+++ b/.werks/6722
@@ -0,0 +1,11 @@
+Title: Do not offer the custom GUI design for the provider
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cme
+State: unknown
+Version: 1.6.0i1
+Date: 1537968350
+
+The provider design can be set through the global settings.