var keystring = '' ;
agentstring += ', ' + key + ': ';
- if (PVE.Parser.parseBoolean(value)) {
- agentstring += Proxmox.Utils.enabledText;
+ if (key === 'type') {
+ let map = {
+ isa: "ISA",
+ virtio: "VirtIO",
+ };
+ agentstring += map[value] || Proxmox.Utils.unknownText;
} else {
- agentstring += Proxmox.Utils.disabledText;
+ if (PVE.Parser.parseBoolean(value)) {
+ agentstring += Proxmox.Utils.enabledText;
+ } else {
+ agentstring += Proxmox.Utils.disabledText;
+ }
}
});
'snippets': gettext('Snippets')
},
+ volume_is_qemu_backup: function(volid, format) {
+ return format === 'pbs-vm' || volid.match(':backup/vzdump-qemu-');
+ },
+
+ volume_is_lxc_backup: function(volid, format) {
+ return format === 'pbs-ct' || volid.match(':backup/vzdump-(lxc|openvz)-');
+ },
+
storageSchema: {
dir: {
name: Proxmox.Utils.directoryText,
Ext.String.leftPad(data.channel,2, '0') +
" ID " + data.id + " LUN " + data.lun;
}
- return data.volid.replace(/^.*:(.*\/)?/,'');
+ return data.volid.replace(/^.*?:(.*?\/)?/,'');
},
render_serverity: function (value) {
reader.readAsText(file);
},
- bus_counts: { ide: 4, sata: 6, scsi: 16, virtio: 16 },
+ diskControllerMaxIDs: {
+ ide: 4,
+ sata: 6,
+ scsi: 31,
+ virtio: 16,
+ },
// types is either undefined (all busses), an array of busses, or a single bus
forEachBus: function(types, func) {
- var busses = Object.keys(PVE.Utils.bus_counts);
+ var busses = Object.keys(PVE.Utils.diskControllerMaxIDs);
var i, j, count, cont;
if (Ext.isArray(types)) {
// check if we only have valid busses
for (i = 0; i < busses.length; i++) {
- if (!PVE.Utils.bus_counts[busses[i]]) {
+ if (!PVE.Utils.diskControllerMaxIDs[busses[i]]) {
throw "invalid bus: '" + busses[i] + "'";
}
}
for (i = 0; i < busses.length; i++) {
- count = PVE.Utils.bus_counts[busses[i]];
+ count = PVE.Utils.diskControllerMaxIDs[busses[i]];
for (j = 0; j < count; j++) {
cont = func(busses[i], j);
if (!cont && cont !== undefined) {
}
},
+ hardware_counts: { net: 32, usb: 5, hostpci: 16, audio: 1, efidisk: 1, serial: 4, rng: 1 },
+
cleanEmptyObjectKeys: function (obj) {
var propName;
for (propName in obj) {
} else {
delete target[name];
}
- }
+ },
+
+ updateColumns: function(container) {
+ let mode = Ext.state.Manager.get('summarycolumns') || 'auto';
+ let factor;
+ if (mode !== 'auto') {
+ factor = parseInt(mode, 10);
+ if (Number.isNaN(factor)) {
+ factor = 1;
+ }
+ } else {
+ factor = container.getSize().width < 1400 ? 1 : 2;
+ }
+
+ if (container.oldFactor === factor) {
+ return;
+ }
+
+ let items = container.query('>'); // direct childs
+ factor = Math.min(factor, items.length);
+ container.oldFactor = factor;
+
+ items.forEach((item) => {
+ item.columnWidth = 1 / factor;
+ });
+
+ // we have to update the layout twice, since the first layout change
+ // can trigger the scrollbar which reduces the amount of space left
+ container.updateLayout();
+ container.updateLayout();
+ },
+
+ forEachCorosyncLink: function(nodeinfo, cb) {
+ let re = /(?:ring|link)(\d+)_addr/;
+ Ext.iterate(nodeinfo, (prop, val) => {
+ let match = re.exec(prop);
+ if (match) {
+ cb(Number(match[1]), val);
+ }
+ });
+ },
},
singleton: true,
}
});
-