From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 68E151FF179 for ; Tue, 30 Jul 2024 08:38:03 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 56F30363E1; Tue, 30 Jul 2024 08:38:02 +0200 (CEST) To: pve-devel@lists.proxmox.com Date: Tue, 30 Jul 2024 08:37:41 +0200 MIME-Version: 1.0 Message-ID: List-Id: Proxmox VE development discussion List-Post: From: Theodor Fumics via pve-devel Precedence: list Cc: Theodor Fumics X-Mailman-Version: 2.1.29 X-BeenThere: pve-devel@lists.proxmox.com List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Proxmox VE development discussion List-Help: Subject: [pve-devel] [PATCH manager v3] ui: pool: separate "Add Virtual Machine" menu into distinct options Content-Type: multipart/mixed; boundary="===============4397418050493923760==" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" --===============4397418050493923760== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: pve-devel@lists.proxmox.com Delivered-To: pve-devel@lists.proxmox.com 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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 461BAC09CC for ; Tue, 30 Jul 2024 08:38:00 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2B18A363B8 for ; Tue, 30 Jul 2024 08:38:00 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 30 Jul 2024 08:37:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1722321472; x=1722926272; i=theodor.fumics@gmx.net; bh=XxZywIsQAEv+tnGq26FB7mIoEeEHsUmcIzYPBlexVb4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id: MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=tN32YmICO5QnBTKdWm6YOJ95pc16QoCYQtztgTwIfKnM2Iet0AyP1POI3f9SaQ+5 D1K9QtD3Iur0BBLWt5rXpyFXdRtal022P2APK4YVuFJNM+cE1GQPoXlrFk7DIaYso tgHZdxkJuHg9XqMxzlL5s6DdpvHKGoHKTRk1yyRF3C5DI3RgbmU6LYgfIRd5QGRhZ 7prIp5isr/C0zsTpV5WhnTPfeL8EsIkL1Ro6gzUh/OodeKTpq/a2xYdWYVIwGXw3W WQ5UBZIgGlPt5MfJbcqDImY0sVZop3/cKJ+KtFOPwup8zYyiF3i0EyqDGIRO4BdTN aGMU9pSRHcmvGqEyjQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from praktikum3.proxmox.com ([94.136.29.99]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MYeMt-1smpNk4AMN-00M0oh; Tue, 30 Jul 2024 08:37:52 +0200 From: Theodor Fumics To: pve-devel@lists.proxmox.com Subject: [PATCH manager v3] ui: pool: separate "Add Virtual Machine" menu into distinct options Date: Tue, 30 Jul 2024 08:37:41 +0200 Message-Id: <20240730063741.14946-1-theodor.fumics@gmx.net> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:N0rB+bBn/Wiait0jykEPrEbk46VOHe3asnGT4Xe9a258DM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EXDL0uQPVaA== X-SPAM-LEVEL: Spam detection results: 0 AWL 0.009 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust RCVD_IN_MSPIKE_H3 -0.01 Good reputation (+3) RCVD_IN_MSPIKE_WL -0.01 Mailspike good senders SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Split the "Add Virtual Machine" menu into separate options for Virtual Machines and Containers to reduce confusion This change follows feedback from a user in [1], who had difficulty finding the container option. Reasons for splitting the menu: - Separate VM and Container options enhance interface clarity and simplify bulk selection. - Reduces confusion by clearly distinguishing between VMs and Containers. [1] https://forum.proxmox.com/threads/how-to-add-containers-to-a-resource-= pool.151946/ Signed-off-by: Theodor Fumics =2D-- Notes: Changes from v1 -> v2 * changed logical expression to fit within 100 characters as per style guide Changes from v2 -> v3 * removed parenthesis as they are not needed * clarified reason for menu split in the commit message for better understanding of changes. * updated style for modern Windows to align with current standards. * Refactored callback into a higher-order closure to reduce redundancy. www/manager6/grid/PoolMembers.js | 46 +++++++++++++++++++------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/www/manager6/grid/PoolMembers.js b/www/manager6/grid/PoolMemb= ers.js index 75f20cab..bd2e6586 100644 =2D-- a/www/manager6/grid/PoolMembers.js +++ b/www/manager6/grid/PoolMembers.js @@ -1,4 +1,4 @@ -Ext.define('PVE.pool.AddVM', { +Ext.define('PVE.pool.AddGuest', { extend: 'Proxmox.window.Edit', width: 640, @@ -37,7 +37,7 @@ Ext.define('PVE.pool.AddVM', { ], filters: [ function(item) { - return (item.data.type =3D=3D=3D 'lxc' || item.data.type =3D=3D=3D = 'qemu') &&item.data.pool !=3D=3D me.pool; + return me.type =3D=3D=3D item.data.type && item.data.pool !=3D=3D m= e.pool; }, ], }); @@ -84,15 +84,11 @@ Ext.define('PVE.pool.AddVM', { dataIndex: 'name', flex: 1, }, - { - header: gettext('Type'), - dataIndex: 'type', - }, ], }); Ext.apply(me, { - subject: gettext('Virtual Machine'), + subject: gettext(me.type =3D=3D=3D 'qemu' ? 'Virtual Machine' : 'LXC= Container'), items: [ vmsField, vmGrid, @@ -218,6 +214,15 @@ Ext.define('PVE.grid.PoolMembers', { }, }); + let getAddGuestCallback =3D type =3D> () =3D> Ext.create('PVE.poo= l.AddGuest', { + autoShow: true, + pool: me.pool, + type, + listeners: { + destroy: () =3D> store.reload(), + }, + }); + Ext.apply(me, { store: store, selModel: sm, @@ -228,21 +233,24 @@ Ext.define('PVE.grid.PoolMembers', { items: [ { text: gettext('Virtual Machine'), - iconCls: 'pve-itype-icon-qemu', - handler: function() { - var win =3D Ext.create('PVE.pool.AddVM', { pool: me.pool }); - win.on('destroy', reload); - win.show(); - }, + iconCls: 'fa fa-fw fa-desktop', + handler: getAddGuestCallback('qemu'), + }, + { + text: gettext('Container'), + iconCls: 'fa fa-fw fa-cube', + handler: getAddGuestCallback('lxc'), }, { text: gettext('Storage'), - iconCls: 'pve-itype-icon-storage', - handler: function() { - var win =3D Ext.create('PVE.pool.AddStorage', { pool: me.pool }); - win.on('destroy', reload); - win.show(); - }, + iconCls: 'fa fa-fw fa-hdd-o', + handler: () =3D> Ext.create('PVE.pool.AddStorage', { + autoShow: true, + pool: me.pool, + listeners: { + destroy: () =3D> store.re= load(), + }, + }), }, ], }), =2D- 2.39.2 --===============4397418050493923760== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel --===============4397418050493923760==--