Module: check_mk
Branch: master
Commit: 7146c8800f1015796d8a21cbe0bce2abf8885833
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7146c8800f1015…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue May 31 13:22:21 2016 +0200
Better styling of permission matrix in WATO roles module
---
web/htdocs/images/icon_perm_no.png | Bin 0 -> 5630 bytes
web/htdocs/images/icon_perm_no_default.png | Bin 0 -> 5056 bytes
web/htdocs/images/icon_perm_yes.png | Bin 0 -> 2855 bytes
web/htdocs/images/icon_perm_yes_default.png | Bin 0 -> 2310 bytes
web/htdocs/wato.py | 16 ++++++++++++----
5 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/images/icon_perm_no.png b/web/htdocs/images/icon_perm_no.png
new file mode 100644
index 0000000..7f2bac1
Binary files /dev/null and b/web/htdocs/images/icon_perm_no.png differ
diff --git a/web/htdocs/images/icon_perm_no_default.png
b/web/htdocs/images/icon_perm_no_default.png
new file mode 100644
index 0000000..08c22d7
Binary files /dev/null and b/web/htdocs/images/icon_perm_no_default.png differ
diff --git a/web/htdocs/images/icon_perm_yes.png b/web/htdocs/images/icon_perm_yes.png
new file mode 100644
index 0000000..3b7a690
Binary files /dev/null and b/web/htdocs/images/icon_perm_yes.png differ
diff --git a/web/htdocs/images/icon_perm_yes_default.png
b/web/htdocs/images/icon_perm_yes_default.png
new file mode 100644
index 0000000..fbcd433
Binary files /dev/null and b/web/htdocs/images/icon_perm_yes_default.png differ
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 2fadb23..1d9c0a6 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -10993,8 +10993,8 @@ def mode_role_matrix(phase):
html.write("<table class=data>")
html.write("<tr class=dualheader><th></th>")
num_roles = 1
- for id, role in role_list:
- html.write('<th>%s</th>' % role['alias'])
+ for role_id, role in role_list:
+ html.write('<th>%s</th>' % role_id)
num_roles += 1
html.write("</tr>\n")
@@ -11027,9 +11027,17 @@ def mode_role_matrix(phase):
base_on_id = role.get('basedon', id)
pvalue = role["permissions"].get(pname)
if pvalue is None:
- pvalue = base_on_id in perm["defaults"]
+ if base_on_id in perm["defaults"]:
+ icon_name = "perm_yes_default"
+ else:
+ icon_name = None
+ else:
+ icon_name = "perm_%s" % (pvalue and "yes" or
"no")
- html.write('<td>%s</td>' % (pvalue and 'X' or
''))
+ html.write('<td align=center>')
+ if icon_name:
+ html.icon(None, icon_name)
+ html.write('</td>')
html.write('</tr>')