]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: utils: refactor mps to mp
authorAaron Lauterer <a.lauterer@proxmox.com>
Tue, 5 Apr 2022 12:30:12 +0000 (14:30 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 7 Apr 2022 13:32:44 +0000 (15:32 +0200)
Using the actual config key instead of the pluralization, makes it
easier in the situations where we need to match against it.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
www/manager6/Utils.js
www/manager6/lxc/MPEdit.js
www/manager6/lxc/MultiMPEdit.js

index 735806aa1b5c90429136e242ba77dfa67e00f094..3351e53b21f3040ae22e4d69495cf52524ae3011 100644 (file)
@@ -1575,12 +1575,12 @@ Ext.define('PVE.Utils', {
     },
 
     mp_counts: {
-       mps: 256,
+       mp: 256,
        unused: 256,
     },
 
     forEachMP: function(func, includeUnused) {
-       for (let i = 0; i < PVE.Utils.mp_counts.mps; i++) {
+       for (let i = 0; i < PVE.Utils.mp_counts.mp; i++) {
            let cont = func('mp', i);
            if (!cont && cont !== undefined) {
                return;
index b8c6b6cbf469395be337769af741ef491bc8a6a8..609447efb84348379411312c035fcbec16bb57ae 100644 (file)
@@ -194,7 +194,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
            name: 'mpid',
            fieldLabel: gettext('Mount Point ID'),
            minValue: 0,
-           maxValue: PVE.Utils.mp_counts.mps - 1,
+           maxValue: PVE.Utils.mp_counts.mp - 1,
            hidden: true,
            allowBlank: false,
            disabled: true,
index 709dacb1776af5200f04d590693c02d1ad9549ae..36cee4ff63d6e7d6b2ed5d9ca3f34568ec73922f 100644 (file)
@@ -8,7 +8,7 @@ Ext.define('PVE.lxc.MultiMPPanel', {
        xclass: 'Ext.app.ViewController',
 
        // count of mps + rootfs
-       maxCount: PVE.Utils.mp_counts.mps + 1,
+       maxCount: PVE.Utils.mp_counts.mp + 1,
 
        getNextFreeDisk: function(vmconfig) {
            let nextFreeDisk;
@@ -17,7 +17,7 @@ Ext.define('PVE.lxc.MultiMPPanel', {
                    confid: 'rootfs',
                };
            } else {
-               for (let i = 0; i < PVE.Utils.mp_counts.mps; i++) {
+               for (let i = 0; i < PVE.Utils.mp_counts.mp; i++) {
                    let confid = `mp${i}`;
                    if (!vmconfig[confid]) {
                        nextFreeDisk = {