From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 7D5C57138A for ; Wed, 11 May 2022 14:27:47 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 772F91AF01 for ; Wed, 11 May 2022 14:27:47 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id B71BA1AEF4 for ; Wed, 11 May 2022 14:27:46 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 9350A4344D for ; Wed, 11 May 2022 14:27:46 +0200 (CEST) Message-ID: Date: Wed, 11 May 2022 14:27:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: Proxmox VE development discussion , Daniel Tschlatscher References: <20220506123910.146775-1-d.tschlatscher@proxmox.com> From: Markus Frank In-Reply-To: <20220506123910.146775-1-d.tschlatscher@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.338 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.851 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH manager v2] fix #3994: Options menu entry in the System menu X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2022 12:27:47 -0000 I tested it on a vm-cluster. GUI works as intended and only allows input which can be handled by the backend. Node-Config-Files get updated on change in GUI, and vice versa. I can also verify that startall-on-boot-delay works fine. Tested-by: Markus Frank On 5/6/22 14:39, Daniel Tschlatscher wrote: > Add the subentry "Options" in the "System" menu to expose some options > in the GUI which were not exposed before. > > Added a new file for displaying and editing the node config options > which were not exposed through the GUI yet. Namely those are the > settings for wakeonlan and startall-on-boot-delay. Edited the Makefile > to include the newly created file. > > Signed-off-by: Daniel Tschlatscher > --- > Changes from v2: > > - Moved the file from the widget-toolkit to the pve-manager repository > because it implements PVE specific functionality. > - I originally rewrote this class to use a ViewController, but then > found out that the ObjectGrid does most of what I wanted already, I > just had to address it correctly. > This means the code is now a bit shorter and a lot more concise. > > www/manager6/Makefile | 1 + > www/manager6/node/Config.js | 9 ++++ > www/manager6/node/NodeOptionsView.js | 67 ++++++++++++++++++++++++++++ > 3 files changed, 77 insertions(+) > create mode 100644 www/manager6/node/NodeOptionsView.js > > diff --git a/www/manager6/Makefile b/www/manager6/Makefile > index 2c7b1e70..d16770b1 100644 > --- a/www/manager6/Makefile > +++ b/www/manager6/Makefile > @@ -195,6 +195,7 @@ JSSRC= \ > node/Subscription.js \ > node/Summary.js \ > node/ZFS.js \ > + node/NodeOptionsView.js \ > pool/Config.js \ > pool/StatusView.js \ > pool/Summary.js \ > diff --git a/www/manager6/node/Config.js b/www/manager6/node/Config.js > index 52357df8..7e7d45f7 100644 > --- a/www/manager6/node/Config.js > +++ b/www/manager6/node/Config.js > @@ -195,6 +195,15 @@ Ext.define('PVE.node.Config', { > nodename: nodename, > onlineHelp: 'sysadmin_network_configuration', > }, > + { > + xtype: 'proxmoxNodeOptionsView', > + title: gettext('Options'), > + iconCls: 'fa fa-gear', > + groups: ['services'], > + itemId: 'options', > + nodename: nodename, > + onlineHelp: 'proxmox_node_management', > + }, > { > xtype: 'proxmoxNodeHostsView', > title: gettext('Hosts'), > diff --git a/www/manager6/node/NodeOptionsView.js b/www/manager6/node/NodeOptionsView.js > new file mode 100644 > index 00000000..b841b7b0 > --- /dev/null > +++ b/www/manager6/node/NodeOptionsView.js > @@ -0,0 +1,67 @@ > +Ext.define('Proxmox.node.NodeOptionsView', { > + extend: 'Proxmox.grid.ObjectGrid', > + alias: ['widget.proxmoxNodeOptionsView'], > + mixins: ['Proxmox.Mixin.CBind'], > + > + cbindData: function(_initialconfig) { > + let me = this; > + > + let baseUrl = `/nodes/${me.nodename}/config`; > + me.url = `/api2/json${baseUrl}`; > + me.editorConfig = { > + url: `/api2/extjs/${baseUrl}`, > + }; > + > + return {}; > + }, > + > + listeners: { > + itemdblclick: function() { this.run_editor(); }, > + activate: function() { this.rstore.startUpdate(); }, > + destroy: function() { this.rstore.stopUpdate(); }, > + deactivate: function() { this.rstore.stopUpdate(); }, > + }, > + > + tbar: [ > + { > + text: gettext('Edit'), > + xtype: 'proxmoxButton', > + disabled: true, > + handler: btn => btn.up('grid').run_editor(), > + }, > + ], > + > + gridRows: [ > + { > + xtype: 'integer', > + name: 'startall-onboot-delay', > + text: gettext('Start on boot delay'), > + minValue: 0, > + maxValue: 300, > + labelWidth: 130, > + deleteEmpty: true, > + renderer: function(value) { > + if (value === undefined) { > + return Proxmox.Utils.defaultText; > + } > + > + let secString = value === '1' ? gettext('Second') : gettext('Seconds'); > + return `${value} ${secString}`; > + }, > + }, > + { > + xtype: 'text', > + name: 'wakeonlan', > + text: gettext('Wake on LAN'), > + vtype: 'MacAddress', > + deleteEmpty: true, > + renderer: function(value) { > + if (value === undefined) { > + return Proxmox.Utils.NoneText; > + } > + > + return value; > + }, > + }, > + ], > +});