* [pve-devel] [PATCH manager 2/5] ui: multi pci selector: reset the selection properly on nodename change
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 ` Dominik Csapak
2023-06-19 9:13 ` [pve-devel] [PATCH manager 3/5] ui: multi pci selector: indent functions multifunction devices Dominik Csapak
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Dominik Csapak @ 2023-06-19 9:13 UTC (permalink / raw)
To: pve-devel
and mdev change.
giving an empty array did not have the desired effect of resetting the
selection, but giving no parameter at all does.
this now also clears the selection when the mdev filter/config changed
(was just forgotten)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/manager6/form/MultiPCISelector.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/www/manager6/form/MultiPCISelector.js b/www/manager6/form/MultiPCISelector.js
index 99f9d50b..97241bb0 100644
--- a/www/manager6/form/MultiPCISelector.js
+++ b/www/manager6/form/MultiPCISelector.js
@@ -77,7 +77,7 @@ Ext.define('PVE.form.MultiPCISelector', {
}
me.suspendEvent('change');
- me.setSelection([]);
+ me.setSelection();
me.setSelection(recs);
me.resumeEvent('change');
},
@@ -96,7 +96,7 @@ Ext.define('PVE.form.MultiPCISelector', {
url: '/api2/json/nodes/' + me.nodename + '/hardware/pci?pci-class-blacklist=',
});
- me.setSelection([]);
+ me.setSelection();
me.getStore().load({
callback: (recs, op, success) => me.addSlotRecords(recs, op, success),
@@ -115,6 +115,7 @@ Ext.define('PVE.form.MultiPCISelector', {
} else {
me.getStore().removeFilter('mdev-filter');
}
+ me.setSelection();
},
// adds the virtual 'slot' records (e.g. '0000:01:00') to the store
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pve-devel] [PATCH manager 3/5] ui: multi pci selector: indent functions multifunction devices
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 ` Dominik Csapak
2023-06-19 9:13 ` [pve-devel] [PATCH manager 4/5] ui: pci map edit: make top fields more clear Dominik Csapak
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Dominik Csapak @ 2023-06-19 9:13 UTC (permalink / raw)
To: pve-devel
when there is more than one function for a device, indent the individual
functions. This sets them visually apart from the 'pass all through as
one' entry
We have to use a html entity here, as extjs trims the normal whitespace.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/manager6/form/MultiPCISelector.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/www/manager6/form/MultiPCISelector.js b/www/manager6/form/MultiPCISelector.js
index 97241bb0..e1ef691a 100644
--- a/www/manager6/form/MultiPCISelector.js
+++ b/www/manager6/form/MultiPCISelector.js
@@ -128,16 +128,17 @@ Ext.define('PVE.form.MultiPCISelector', {
let slots = {};
records.forEach((rec) => {
let slotname = rec.data.id.slice(0, -2); // remove function
- rec.set('slot', slotname);
if (slots[slotname] !== undefined) {
slots[slotname].count++;
+ rec.set('slot', slots[slotname]);
return;
}
-
slots[slotname] = {
count: 1,
};
+ rec.set('slot', slots[slotname]);
+
if (rec.data.id.endsWith('.0')) {
slots[slotname].device = rec.data;
}
@@ -213,6 +214,12 @@ Ext.define('PVE.form.MultiPCISelector', {
{
header: 'ID',
dataIndex: 'id',
+ renderer: function(value, _md, rec) {
+ if (value.match(/\.[0-9a-f]/i) && rec.data.slot?.count > 1) {
+ return ` ${value}`;
+ }
+ return value;
+ },
width: 150,
},
{
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pve-devel] [PATCH manager 4/5] ui: pci map edit: make top fields more clear
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
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
4 siblings, 0 replies; 6+ messages in thread
From: Dominik Csapak @ 2023-06-19 9:13 UTC (permalink / raw)
To: pve-devel
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pve-devel] [PATCH manager 5/5] ui: resource mappings: remove border and add resize handle
2023-06-19 9:13 [pve-devel] [PATCH manager 1/5] ui: fix pci map selector status column Dominik Csapak
` (2 preceding siblings ...)
2023-06-19 9:13 ` [pve-devel] [PATCH manager 4/5] ui: pci map edit: make top fields more clear Dominik Csapak
@ 2023-06-19 9:13 ` Dominik Csapak
2023-06-19 11:27 ` [pve-devel] applied-series: [PATCH manager 1/5] ui: fix pci map selector status column Thomas Lamprecht
4 siblings, 0 replies; 6+ messages in thread
From: Dominik Csapak @ 2023-06-19 9:13 UTC (permalink / raw)
To: pve-devel
aka a 'splitter'. that way the user can determine how much of each panel
he wants to see himself
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/manager6/dc/Config.js | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/www/manager6/dc/Config.js b/www/manager6/dc/Config.js
index 10a4d83a..04ed04f0 100644
--- a/www/manager6/dc/Config.js
+++ b/www/manager6/dc/Config.js
@@ -294,19 +294,20 @@ Ext.define('PVE.dc.Config', {
},
scrollable: true,
defaults: {
- collapsible: true,
- animCollapse: false,
- margin: '7 10 3 10',
+ border: false,
},
items: [
{
- collapsible: true,
xtype: 'pveDcPCIMapView',
title: gettext('PCI Devices'),
flex: 1,
},
{
- collapsible: true,
+ xtype: 'splitter',
+ collapsible: false,
+ performCollapse: false,
+ },
+ {
xtype: 'pveDcUSBMapView',
title: gettext('USB Devices'),
flex: 1,
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pve-devel] applied-series: [PATCH manager 1/5] ui: fix pci map selector status column
2023-06-19 9:13 [pve-devel] [PATCH manager 1/5] ui: fix pci map selector status column Dominik Csapak
` (3 preceding siblings ...)
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 ` Thomas Lamprecht
4 siblings, 0 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2023-06-19 11:27 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
Am 19/06/2023 um 11:13 schrieb Dominik Csapak:
> the 'errors' property changed to 'checks' so we have to adapt here too
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> www/manager6/form/PCIMapSelector.js | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
>
applied series, thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread