improving oclass formatter

this adds from/to to the oclass text object
adds a new oclass_icon object
and a new format_oclass function, which
combines the icon with the text

this will be used in the new ruleinfo sidebar

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-04-04 13:48:43 +02:00 committed by Dietmar Maurer
parent f1ab2a1476
commit 076d6a72ad

View File

@ -15,7 +15,24 @@ Ext.define('PMG.Utils', {
who: gettext('Who Objects'),
what: gettext('What Objects'),
when: gettext('When Objects'),
action: gettext('Action Objects')
action: gettext('Action Objects'),
from: gettext('From'),
to: gettext('To')
},
oclass_icon: {
who: '<span class="fa fa-fw fa-user-circle"></span> ',
what: '<span class="fa fa-fw fa-cube"></span> ',
when: '<span class="fa fa-fw fa-clock-o"></span> ',
action: '<span class="fa fa-fw fa-flag"></span> ',
from: '<span class="fa fa-fw fa-user-circle"></span> ',
to: '<span class="fa fa-fw fa-user-circle"></span> ',
},
format_oclass: function(oclass) {
var icon = PMG.Utils.oclass_icon[oclass] || '';
var text = PMG.Utils.oclass_text[oclass] || oclass;
return icon + text;
},
rule_direction_text: {