[pve-devel] [PATCH manager] remove unnecessary sort function in HardwareView.js
Dominik Csapak
d.csapak at proxmox.com
Wed Nov 7 10:23:02 CET 2018
On 11/7/18 9:14 AM, Thomas Lamprecht wrote:
> On 11/6/18 12:14 PM, David Limbeck wrote:
>> we're adding everything in the right order already so there's no need to
>> sort them based on groups
>
> Hmm,
>
> Memory, Processor and Keyboard switches order with this.
>
> Also if I add a serial port and then a USB (e.g., spice) one the order is
> now switched until reload (as it does not gets ordered on change)
>
> Not a really big issue, but you should at least mention that...
>
> @Dominik do we really want this, or do we want a better sorter for the
> increase of unused disks?
>
> Because if I have holes in the unused disk id allocation the next detach
> also results in a wrong order with this, until reopening of component or
> page...
>
without looking at it, how does it work with containers?
does the wrong order until reload also exists there?
if yes, i would like to have it fixed in both so that the order is
always the same -> fix the sorter and add one for containers
if not, what is different there (since we do not define a sorter there
either) -> find out why it works there and do that also for vms
>>
>> Signed-off-by: David Limbeck <d.limbeck at proxmox.com>
>> ---
>> this is in preparation for increased unused disks as unused disk 10-19
>> would appear before disk 2
>>
>> www/manager6/qemu/HardwareView.js | 11 -----------
>> 1 file changed, 11 deletions(-)
>>
>> diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
>> index f2a3e244..2a86e461 100644
>> --- a/www/manager6/qemu/HardwareView.js
>> +++ b/www/manager6/qemu/HardwareView.js
>> @@ -233,16 +233,6 @@ Ext.define('PVE.qemu.HardwareView', {
>> };
>> }
>>
>> - var sorterFn = function(rec1, rec2) {
>> - var v1 = rec1.data.key;
>> - var v2 = rec2.data.key;
>> - var g1 = rows[v1].group || 0;
>> - var g2 = rows[v2].group || 0;
>> -
>> - return (g1 !== g2) ?
>> - (g1 > g2 ? 1 : -1) : (v1 > v2 ? 1 : (v1 < v2 ? -1 : 0));
>> - };
>> -
>> var reload = function() {
>> me.rstore.load();
>> };
>> @@ -627,7 +617,6 @@ Ext.define('PVE.qemu.HardwareView', {
>> revert_btn
>> ],
>> rows: rows,
>> - sorterFn: sorterFn,
>> listeners: {
>> itemdblclick: run_editor,
>> selectionchange: set_button_status
>>
>
More information about the pve-devel
mailing list