]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: pci map edit: make top fields more clear
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 19 Jun 2023 09:13:33 +0000 (11:13 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 19 Jun 2023 11:05:17 +0000 (13:05 +0200)
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

index 0b6d7d60998f4e84abfb9e93784b5d5b83e52b07..516678e095285b6af86f2b7563c97abbd093311f 100644 (file)
@@ -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',