mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-12-25 17:30:45 +00:00
fix #5836: ui: translate systemd states in ServiceView
Signed-off-by: Timothy Nicholson <t.nicholson@proxmox.com>
This commit is contained in:
parent
a351d3d36d
commit
4ca542b811
12
src/Utils.js
12
src/Utils.js
@ -305,6 +305,18 @@ utilities: {
|
||||
return Ext.htmlEncode(username);
|
||||
},
|
||||
|
||||
systemdStates: {
|
||||
'enabled': gettext('enabled'),
|
||||
'disabled': gettext('disabled'),
|
||||
'running': gettext('running'),
|
||||
'dead': gettext('dead'),
|
||||
'not-found': gettext('not installed'),
|
||||
'static': gettext('static'),
|
||||
'reload': gettext('reload'),
|
||||
'start': gettext('starting'),
|
||||
'stop': gettext('stopping'),
|
||||
},
|
||||
|
||||
getStoredAuth: function() {
|
||||
let storedAuth = JSON.parse(window.localStorage.getItem('ProxmoxUser'));
|
||||
return storedAuth || {};
|
||||
|
||||
@ -202,14 +202,8 @@ Ext.define('Proxmox.node.ServiceView', {
|
||||
sortable: true,
|
||||
dataIndex: 'state',
|
||||
renderer: (value, meta, rec) => {
|
||||
const unitState = rec.get('unit-state');
|
||||
if (unitState === 'masked') {
|
||||
return gettext('disabled');
|
||||
} else if (unitState === 'not-found') {
|
||||
return gettext('not installed');
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
const state = rec.get('state');
|
||||
return Proxmox.Utils.systemdStates[state] ?? state;
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -225,6 +219,10 @@ Ext.define('Proxmox.node.ServiceView', {
|
||||
sortable: true,
|
||||
hidden: !Ext.Array.contains(['PVEAuthCookie', 'PBSAuthCookie'], Proxmox?.Setup?.auth_cookie_name),
|
||||
dataIndex: 'unit-state',
|
||||
renderer: (value, meta, rec) => {
|
||||
const unitState = rec.get('unit-state');
|
||||
return Proxmox.Utils.systemdStates[unitState] ?? unitState;
|
||||
},
|
||||
},
|
||||
{
|
||||
header: gettext('Description'),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user