]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/Utils.js
ui: lxc: pass full property name to for-each dev & mountpoint helpers
[pve-manager.git] / www / manager6 / Utils.js
index 8c2beb8c008cc6a04584a5282b08b431e3d5b389..54aa8bacae5e2f91b210f627c987b6cac31e80b6 100644 (file)
@@ -1022,6 +1022,8 @@ Ext.define('PVE.Utils', {
            result = "CH " +
                Ext.String.leftPad(data.channel, 2, '0') +
                " ID " + data.id + " LUN " + data.lun;
+       } else if (data.content === 'import') {
+           result = data.volid.replace(/^.*?:/, '');
        } else {
            result = data.volid.replace(/^.*?:(.*?\/)?/, '');
        }
@@ -1588,14 +1590,14 @@ 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++) {
-           let cont = func('mp', i);
+    forEachLxcMP: function(func, includeUnused) {
+       for (let i = 0; i < PVE.Utils.lxc_mp_counts.mp; i++) {
+           let cont = func('mp', i, `mp${i}`);
            if (!cont && cont !== undefined) {
                return;
            }
@@ -1605,8 +1607,19 @@ Ext.define('PVE.Utils', {
            return;
        }
 
-       for (let i = 0; i < PVE.Utils.mp_counts.unused; i++) {
-           let cont = func('unused', i);
+       for (let i = 0; i < PVE.Utils.lxc_mp_counts.unused; i++) {
+           let cont = func('unused', i, `unused${i}`);
+           if (!cont && cont !== undefined) {
+               return;
+           }
+       }
+    },
+
+    lxc_dev_count: 256,
+
+    forEachLxcDev: function(func) {
+       for (let i = 0; i < PVE.Utils.lxc_dev_count; i++) {
+           let cont = func(i, `dev${i}`);
            if (!cont && cont !== undefined) {
                return;
            }
@@ -1869,8 +1882,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 {