Ext.ns('PVE');
-// avoid errors related to Accessible Rich Internet Applications
-// (access for people with disabilities)
-// TODO reenable after all components are upgraded
-Ext.enableAria = false;
-Ext.enableAriaButtons = false;
-Ext.enableAriaPanels = false;
-
console.log("Starting Proxmox VE Manager");
Ext.Ajax.defaultHeaders = {
toolkit: undefined, // (extjs|touch), set inside Toolkit.js
- bus_match: /^(ide|sata|virtio|scsi)\d+$/,
+ bus_match: /^(ide|sata|virtio|scsi)(\d+)$/,
log_severity_hash: {
0: "panic",
syncipanel: 'pveAuthLDAPSyncPanel',
add: true,
tfa: true,
+ pwchange: true,
},
ldap: {
name: gettext('LDAP Server'),
syncipanel: 'pveAuthLDAPSyncPanel',
add: true,
tfa: true,
+ pwchange: true,
+ },
+ openid: {
+ name: gettext('OpenID Connect Server'),
+ ipanel: 'pveAuthOpenIDPanel',
+ add: true,
+ tfa: false,
+ pwchange: false,
+ iconCls: 'pmx-itype-icon-openid-logo',
},
pam: {
name: 'Linux PAM',
ipanel: 'pveAuthBasePanel',
add: false,
tfa: true,
+ pwchange: true,
},
pve: {
name: 'Proxmox VE authentication server',
ipanel: 'pveAuthBasePanel',
add: false,
+ tfa: true,
+ pwchange: true,
},
},
return true;
},
+
+ sortByPreviousUsage: function(vmconfig, controllerList) {
+ if (!controllerList) {
+ controllerList = ['ide', 'virtio', 'scsi', 'sata'];
+ }
+ let usedControllers = {};
+ for (const type of Object.keys(PVE.Utils.diskControllerMaxIDs)) {
+ usedControllers[type] = 0;
+ }
+
+ for (const property of Object.keys(vmconfig)) {
+ if (property.match(PVE.Utils.bus_match) && !vmconfig[property].match(/media=cdrom/)) {
+ const foundController = property.match(PVE.Utils.bus_match)[1];
+ usedControllers[foundController]++;
+ }
+ }
+
+ let sortPriority = PVE.qemu.OSDefaults.getDefaults(vmconfig.ostype).busPriority;
+
+ let sortedList = Ext.clone(controllerList);
+ sortedList.sort(function(a, b) {
+ if (usedControllers[b] === usedControllers[a]) {
+ return sortPriority[b] - sortPriority[a];
+ }
+ return usedControllers[b] - usedControllers[a];
+ });
+
+ return sortedList;
+ },
+
+ nextFreeDisk: function(controllers, config) {
+ for (const controller of controllers) {
+ for (let i = 0; i < PVE.Utils.diskControllerMaxIDs[controller]; i++) {
+ let confid = controller + i.toString();
+ if (!Ext.isDefined(config[confid])) {
+ return {
+ controller,
+ id: i,
+ confid,
+ };
+ }
+ }
+ }
+
+ return undefined;
+ },
},
singleton: true,
clusterjoin: ['', gettext('Join Cluster')],
dircreate: [gettext('Directory Storage'), gettext('Create')],
dirremove: [gettext('Directory'), gettext('Remove')],
- download: ['', gettext('Download')],
+ download: [gettext('File'), gettext('Download')],
hamigrate: ['HA', gettext('Migrate')],
hashutdown: ['HA', gettext('Shutdown')],
hastart: ['HA', gettext('Start')],