]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/lxc/MultiMPEdit.js
1 Ext
.define('PVE.lxc.MultiMPPanel', {
2 extend
: 'PVE.panel.MultiDiskPanel',
3 alias
: 'widget.pveMultiMPPanel',
5 onlineHelp
: 'pct_container_storage',
8 xclass
: 'Ext.app.ViewController',
10 // count of mps + rootfs
11 maxCount
: PVE
.Utils
.mp_counts
.mps
+ 1,
13 getNextFreeDisk: function(vmconfig
) {
15 if (!vmconfig
.rootfs
) {
20 for (let i
= 0; i
< PVE
.Utils
.mp_counts
.mps
; i
++) {
21 let confid
= `mp${i}`;
22 if (!vmconfig
[confid
]) {
33 addPanel: function(itemId
, vmconfig
, nextFreeDisk
) {
35 return me
.getView().add({
38 showAdvanced
: Ext
.state
.Manager
.getProvider().get('proxmox-advanced-cb'),
39 xtype
: 'pveLxcMountPointInputPanel',
40 confid
: nextFreeDisk
.confid
=== 'rootfs' ? 'rootfs' : null,
42 nodename
: '{nodename}',
43 unprivileged
: '{unprivileged}',
53 getBaseVMConfig: function() {
57 unprivileged
: me
.getViewModel().get('unprivileged'),
62 sorterFn: function(rec1
, rec2
) {
63 if (rec1
.data
.name
=== 'rootfs') {
65 } else if (rec2
.data
.name
=== 'rootfs') {
69 let mp_match
= /^mp(\d+)$/;
70 let [, id1
] = mp_match
.exec(rec1
.data
.name
);
71 let [, id2
] = mp_match
.exec(rec2
.data
.name
);
73 return parseInt(id1
, 10) - parseInt(id2
, 10);
77 deleteDisabled
: (view
, rI
, cI
, item
, rec
) => rec
.data
.name
=== 'rootfs',