From e8352a8f169841fc8ac687c5c7b74f338e4e7a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 5 Sep 2018 11:37:11 +0200 Subject: [PATCH] switch MP selector to integer input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit instead of combobox - 256 elements are too much. Signed-off-by: Fabian Grünbichler --- www/manager6/lxc/MPEdit.js | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/www/manager6/lxc/MPEdit.js b/www/manager6/lxc/MPEdit.js index 63315cfdd..c7c3870a3 100644 --- a/www/manager6/lxc/MPEdit.js +++ b/www/manager6/lxc/MPEdit.js @@ -27,17 +27,17 @@ Ext.define('PVE.lxc.MountPointInputPanel', { onGetValues: function(values) { var me = this; - var confid = me.confid || values.mpsel; + var confid = me.confid || "mp"+values.mpid; values.file = me.down('field[name=file]').getValue(); if (me.unused) { - confid = values.mpsel; + confid = "mp"+values.mpid; } else if (me.isCreate) { values.file = values.hdstorage + ':' + values.disksize; } // delete unnecessary fields - delete values.mpsel; + delete values.mpid; delete values.hdstorage; delete values.disksize; delete values.diskformat; @@ -65,7 +65,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', { PVE.Utils.forEachMP(function(bus, i) { var name = "mp" + i.toString(); if (!Ext.isDefined(vmconfig[name])) { - me.down('field[name=mpsel]').setValue(name); + me.down('field[name=mpid]').setValue(i); return false; } }); @@ -83,7 +83,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', { xclass: 'Ext.app.ViewController', control: { - 'field[name=mpsel]': { + 'field[name=mpid]': { change: function(field, value) { field.validate(); } @@ -154,10 +154,11 @@ Ext.define('PVE.lxc.MountPointInputPanel', { column1: [ { - xtype: 'proxmoxKVComboBox', - name: 'mpsel', - fieldLabel: gettext('Mount Point'), - matchFieldWidth: false, + xtype: 'proxmoxintegerfield', + name: 'mpid', + fieldLabel: gettext('Mount Point ID'), + minValue: 0, + maxValue: PVE.Utils.mp_counts.mps - 1, hidden: true, allowBlank: false, disabled: true, @@ -165,20 +166,12 @@ Ext.define('PVE.lxc.MountPointInputPanel', { hidden: '{hasMP}', disabled: '{hasMP}' }, - comboItems: (function(){ - var mps = []; - PVE.Utils.forEachMP(function(bus,i) { - var name = 'mp' + i.toString(); - mps.push([name,name]); - }); - return mps; - }()), validator: function(value) { var me = this.up('inputpanel'); if (!me.rendered) { return; } - if (Ext.isDefined(me.vmconfig[value])) { + if (Ext.isDefined(me.vmconfig["mp"+value])) { return "Mount point is already in use."; } /*jslint confusion: true*/