mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-06-25 20:53:14 +00:00
fix #5611: node service view: hide non-installed services
This patch adds a filter to identify services, which are reported as 'not-found' by the api. By default they will not be shown in the UI anymore, but visibility can still be toggled using a new checkbox. Signed-off-by: Daniel Herzig <d.herzig@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
0ad5712ac7
commit
a351d3d36d
@ -29,6 +29,8 @@ Ext.define('Proxmox.node.ServiceView', {
|
||||
},
|
||||
});
|
||||
|
||||
let filterInstalledOnly = record => record.get('unit-state') !== 'not-found';
|
||||
|
||||
let store = Ext.create('Proxmox.data.DiffStore', {
|
||||
rstore: rstore,
|
||||
sortAfterUpdate: true,
|
||||
@ -38,6 +40,24 @@ Ext.define('Proxmox.node.ServiceView', {
|
||||
direction: 'ASC',
|
||||
},
|
||||
],
|
||||
filters: [
|
||||
filterInstalledOnly,
|
||||
],
|
||||
});
|
||||
|
||||
let unHideCB = Ext.create('Ext.form.field.Checkbox', {
|
||||
boxLabel: gettext('Show only installed services'),
|
||||
value: true,
|
||||
boxLabelAlign: 'before',
|
||||
listeners: {
|
||||
change: function(_cb, value) {
|
||||
if (value) {
|
||||
store.addFilter([filterInstalledOnly]);
|
||||
} else {
|
||||
store.clearFilter();
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
let view_service_log = function() {
|
||||
@ -166,6 +186,8 @@ Ext.define('Proxmox.node.ServiceView', {
|
||||
restart_btn,
|
||||
'-',
|
||||
syslog_btn,
|
||||
'->',
|
||||
unHideCB,
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user