From: Daniel Herzig <d.herzig@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit] node/ServiceView: fix #5611: hiding the non-installed services
Date: Wed, 6 Nov 2024 12:37:25 +0100 [thread overview]
Message-ID: <20241106113725.48415-1-d.herzig@proxmox.com> (raw)
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>
---
src/node/ServiceView.js | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/node/ServiceView.js b/src/node/ServiceView.js
index 19cfc18..f1c2e5f 100644
--- a/src/node/ServiceView.js
+++ b/src/node/ServiceView.js
@@ -29,6 +29,10 @@ Ext.define('Proxmox.node.ServiceView', {
},
});
+ let hide_not_installed = function(record) {
+ return record.get('unit-state') !== 'not-found';
+ };
+
let store = Ext.create('Proxmox.data.DiffStore', {
rstore: rstore,
sortAfterUpdate: true,
@@ -38,6 +42,24 @@ Ext.define('Proxmox.node.ServiceView', {
direction: 'ASC',
},
],
+ filters: [
+ hide_not_installed,
+ ],
+ });
+
+ let unHideCB = Ext.create('Ext.form.field.Checkbox', {
+ boxLabel: gettext('Show non-installed services'),
+ value: false,
+ boxLabelAlign: 'before',
+ listeners: {
+ change: function(_cb, value) {
+ if (value) {
+ store.clearFilter();
+ } else {
+ store.addFilter([hide_not_installed]);
+ }
+ },
+ },
});
let view_service_log = function() {
@@ -166,6 +188,8 @@ Ext.define('Proxmox.node.ServiceView', {
restart_btn,
'-',
syslog_btn,
+ '->',
+ unHideCB,
],
columns: [
{
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next reply other threads:[~2024-11-06 11:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 11:37 Daniel Herzig [this message]
2024-11-08 14:02 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241106113725.48415-1-d.herzig@proxmox.com \
--to=d.herzig@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal