]> git.proxmox.com Git - pve-manager.git/commitdiff
utils: clarify naming of LXC mount point utils
authorFilip Schauer <f.schauer@proxmox.com>
Wed, 17 Apr 2024 08:44:18 +0000 (10:44 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 17 Apr 2024 08:51:21 +0000 (10:51 +0200)
Clarify the naming of mount point utils to clearly indicate their
relation to LXC containers.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
www/manager6/Utils.js
www/manager6/lxc/MPEdit.js
www/manager6/lxc/MultiMPEdit.js
www/manager6/lxc/Resources.js
www/manager6/window/GuestDiskReassign.js

index 287d651a46fea7e03853e74fd4315fe9a25c3750..8205598af1d60af66819c52098f5ffc1c9b6ffd6 100644 (file)
@@ -1590,13 +1590,13 @@ Ext.define('PVE.Utils', {
        }
     },
 
-    mp_counts: {
+    lxc_mp_counts: {
        mp: 256,
        unused: 256,
     },
 
-    forEachMP: function(func, includeUnused) {
-       for (let i = 0; i < PVE.Utils.mp_counts.mp; i++) {
+    forEachLxcMP: function(func, includeUnused) {
+       for (let i = 0; i < PVE.Utils.lxc_mp_counts.mp; i++) {
            let cont = func('mp', i);
            if (!cont && cont !== undefined) {
                return;
@@ -1607,7 +1607,7 @@ Ext.define('PVE.Utils', {
            return;
        }
 
-       for (let i = 0; i < PVE.Utils.mp_counts.unused; i++) {
+       for (let i = 0; i < PVE.Utils.lxc_mp_counts.unused; i++) {
            let cont = func('unused', i);
            if (!cont && cont !== undefined) {
                return;
@@ -1871,8 +1871,8 @@ Ext.define('PVE.Utils', {
        return undefined;
     },
 
-    nextFreeMP: function(type, config) {
-       for (let i = 0; i < PVE.Utils.mp_counts[type]; i++) {
+    nextFreeLxcMP: function(type, config) {
+       for (let i = 0; i < PVE.Utils.lxc_mp_counts[type]; i++) {
            let confid = `${type}${i}`;
            if (!Ext.isDefined(config[confid])) {
                return {
index 609447efb84348379411312c035fcbec16bb57ae..1ea0f10ecf3549d377d120c32d4307c4e46c6ea4 100644 (file)
@@ -87,7 +87,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
        let me = this;
 
        me.updateVMConfig(vmconfig);
-       PVE.Utils.forEachMP((bus, i) => {
+       PVE.Utils.forEachLxcMP((bus, i) => {
            let name = "mp" + i.toString();
            if (!Ext.isDefined(vmconfig[name])) {
                me.down('field[name=mpid]').setValue(i);
@@ -194,7 +194,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
            name: 'mpid',
            fieldLabel: gettext('Mount Point ID'),
            minValue: 0,
-           maxValue: PVE.Utils.mp_counts.mp - 1,
+           maxValue: PVE.Utils.lxc_mp_counts.mp - 1,
            hidden: true,
            allowBlank: false,
            disabled: true,
index 36cee4ff63d6e7d6b2ed5d9ca3f34568ec73922f..d13dc81f4e8d6bcffd1032b34f6d77027ba7722f 100644 (file)
@@ -8,7 +8,7 @@ Ext.define('PVE.lxc.MultiMPPanel', {
        xclass: 'Ext.app.ViewController',
 
        // count of mps + rootfs
-       maxCount: PVE.Utils.mp_counts.mp + 1,
+       maxCount: PVE.Utils.lxc_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.mp; i++) {
+               for (let i = 0; i < PVE.Utils.lxc_mp_counts.mp; i++) {
                    let confid = `mp${i}`;
                    if (!vmconfig[confid]) {
                        nextFreeDisk = {
index 85112345523dde64977702344cb02b3b0a2aabd4..61182ef3e56121464e6ddfa91d73f0cb901979a4 100644 (file)
@@ -116,7 +116,7 @@ Ext.define('PVE.lxc.RessourceView', {
            },
        };
 
-       PVE.Utils.forEachMP(function(bus, i) {
+       PVE.Utils.forEachLxcMP(function(bus, i) {
            confid = bus + i;
            var group = 5;
            var header;
index f6d08b32b39791ceff6f1a07f443babc20751f3e..405e7c9ef5ba28aa7635f8ba28399b525d84ea75 100644 (file)
@@ -17,8 +17,8 @@ Ext.define('PVE.window.GuestDiskReassign', {
        },
        formulas: {
            mpMaxCount: get => get('mpType') === 'mp'
-               ? PVE.Utils.mp_counts.mps - 1
-               : PVE.Utils.mp_counts.unused - 1,
+               ? PVE.Utils.lxc_mp_counts.mps - 1
+               : PVE.Utils.lxc_mp_counts.unused - 1,
        },
     },
 
@@ -103,7 +103,7 @@ Ext.define('PVE.window.GuestDiskReassign', {
                        view.VMConfig = result.data;
 
                        mpIdSelector.setValue(
-                           PVE.Utils.nextFreeMP(
+                           PVE.Utils.nextFreeLxcMP(
                                view.getViewModel().get('mpType'),
                                view.VMConfig,
                            ).id,