public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 4/5] ui: pci map edit: make top fields more clear
Date: Mon, 19 Jun 2023 11:13:33 +0200	[thread overview]
Message-ID: <20230619091334.1715659-4-d.csapak@proxmox.com> (raw)
In-Reply-To: <20230619091334.1715659-1-d.csapak@proxmox.com>

by
* moving the node to the left column and changing the label
* moving the mdev filter to the right column
* show only the create button for new node mappings (otherwise we'd have
  a reset button here that cannot do anything useful)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/window/PCIMapEdit.js | 38 +++++++++++++++++--------------
 1 file changed, 21 insertions(+), 17 deletions(-)

diff --git a/www/manager6/window/PCIMapEdit.js b/www/manager6/window/PCIMapEdit.js
index 0b6d7d60..516678e0 100644
--- a/www/manager6/window/PCIMapEdit.js
+++ b/www/manager6/window/PCIMapEdit.js
@@ -13,8 +13,8 @@ Ext.define('PVE.window.PCIMapEditWindow', {
 
     cbindData: function(initialConfig) {
 	let me = this;
-	me.isCreate = !me.name;
-	me.method = me.isCreate ? 'POST' : 'PUT';
+	me.isCreate = !me.name || !me.nodename;
+	me.method = me.name ? 'PUT' : 'POST';
 	return {
 	    name: me.name,
 	    nodename: me.nodename,
@@ -23,7 +23,7 @@ Ext.define('PVE.window.PCIMapEditWindow', {
 
     submitUrl: function(_url, data) {
 	let me = this;
-	let name = me.isCreate ? '' : me.name;
+	let name = me.method === 'PUT' ? me.name : '';
 	return `/cluster/mapping/pci/${name}`;
     },
 
@@ -155,22 +155,9 @@ Ext.define('PVE.window.PCIMapEditWindow', {
 		    name: 'id',
 		    allowBlank: false,
 		},
-		{
-		    xtype: 'proxmoxcheckbox',
-		    fieldLabel: gettext('Mediated Devices'),
-		    labelWidth: 120,
-		    reference: 'mdev',
-		    name: 'mdev',
-		    cbind: {
-			deleteEmpty: '{!isCreate}',
-		    },
-		},
-	    ],
-
-	    column2: [
 		{
 		    xtype: 'pmxDisplayEditField',
-		    fieldLabel: gettext('Node'),
+		    fieldLabel: gettext('Mapping on Node'),
 		    labelWidth: 120,
 		    name: 'node',
 		    editConfig: {
@@ -184,6 +171,23 @@ Ext.define('PVE.window.PCIMapEditWindow', {
 		},
 	    ],
 
+	    column2: [
+		{
+		    // as spacer
+		    xtype: 'displayfield',
+		},
+		{
+		    xtype: 'proxmoxcheckbox',
+		    fieldLabel: gettext('Mediated Devices'),
+		    labelWidth: 120,
+		    reference: 'mdev',
+		    name: 'mdev',
+		    cbind: {
+			deleteEmpty: '{!isCreate}',
+		    },
+		},
+	    ],
+
 	    columnB: [
 		{
 		    xtype: 'pveMultiPCISelector',
-- 
2.30.2





  parent reply	other threads:[~2023-06-19  9:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19  9:13 [pve-devel] [PATCH manager 1/5] ui: fix pci map selector status column Dominik Csapak
2023-06-19  9:13 ` [pve-devel] [PATCH manager 2/5] ui: multi pci selector: reset the selection properly on nodename change Dominik Csapak
2023-06-19  9:13 ` [pve-devel] [PATCH manager 3/5] ui: multi pci selector: indent functions multifunction devices Dominik Csapak
2023-06-19  9:13 ` Dominik Csapak [this message]
2023-06-19  9:13 ` [pve-devel] [PATCH manager 5/5] ui: resource mappings: remove border and add resize handle Dominik Csapak
2023-06-19 11:27 ` [pve-devel] applied-series: [PATCH manager 1/5] ui: fix pci map selector status column 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=20230619091334.1715659-4-d.csapak@proxmox.com \
    --to=d.csapak@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal