Module: check_mk
Branch: master
Commit: 9b021956d97465d56b9d1b75234610a4a086a0e7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9b021956d97465…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon May 11 11:42:10 2015 +0200
Small internal code change in new matrix layout
---
web/plugins/views/layouts.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/web/plugins/views/layouts.py b/web/plugins/views/layouts.py
index b05d571..25a69c3 100644
--- a/web/plugins/views/layouts.py
+++ b/web/plugins/views/layouts.py
@@ -100,6 +100,7 @@ def render_single_dataset(rows, view, group_painters, painters,
num_columns, _ig
html.write("</table>\n")
html.write("</div>\n")
+
multisite_layouts["dataset"] = {
"title" : _("Single dataset"),
"render" : render_single_dataset,
@@ -519,12 +520,6 @@ multisite_layouts["table"] = {
def render_matrix(rows, view, group_painters, painters, num_columns,
_ignore_show_checkboxes):
- if len(painters) < 2:
- raise MKGeneralException(_("Cannot display this view in matrix layout. You
need at least two columns!"))
-
- if not group_painters:
- raise MKGeneralException(_("Cannot display this view in matrix layout. You
need at least one group column!"))
-
for groups, unique_row_ids, matrix_cells in \
create_matrices(rows, group_painters, painters, num_columns):
@@ -571,6 +566,12 @@ def render_matrix(rows, view, group_painters, painters, num_columns,
_ignore_sho
# Create list of matrices to render
def create_matrices(rows, group_painters, painters, num_columns):
+ if len(painters) < 2:
+ raise MKGeneralException(_("Cannot display this view in matrix layout. You
need at least two columns!"))
+
+ if not group_painters:
+ raise MKGeneralException(_("Cannot display this view in matrix layout. You
need at least one group column!"))
+
# First find the groups - all rows that have the same values for
# all group columns. Usually these should correspond with the hosts
# in the matrix