service view: avoid showing not installed services as error

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-07-13 18:29:21 +02:00
parent 7a17156d65
commit ae6a1cc908

View File

@ -146,7 +146,7 @@ Ext.define('Proxmox.node.ServiceView', {
if (!unitState) { if (!unitState) {
return ''; return '';
} }
if (unitState === 'masked') { if (unitState === 'masked' || unitState === 'not-found') {
return "proxmox-disabled-row"; return "proxmox-disabled-row";
} else if (unitState === 'unknown') { } else if (unitState === 'unknown') {
if (record.get('name') === 'syslog') { if (record.get('name') === 'syslog') {
@ -178,9 +178,16 @@ Ext.define('Proxmox.node.ServiceView', {
width: 100, width: 100,
sortable: true, sortable: true,
dataIndex: 'state', dataIndex: 'state',
renderer: (v, meta, rec) => rec.get('unit-state') === 'masked' renderer: (value, meta, rec) => {
? gettext('disabled') const unitState = rec.get('unit-state');
: v, if (unitState === 'masked') {
return gettext('disabled');
} else if (unitState === 'not-found') {
return gettext('not installed');
} else {
return value;
}
},
}, },
{ {
header: gettext('Active'), header: gettext('Active'),