// avoid errors related to Accessible Rich Internet Applications
// (access for people with disabilities)
-// TODO reenable after all components are upgraded
+// TODO reenable after all components are upgraded
Ext.enableAria = false;
Ext.enableAriaButtons = false;
Ext.enableAriaPanels = false;
// avoid errors when running without development tools
-if (!Ext.isDefined(Ext.global.console)) {
- var console = {
- dir: function() {},
- log: function() {}
+if (!Ext.isDefined(Ext.global.console)) {
+ var console = {
+ dir: function() {},
+ log: function() {}
};
}
-console.log("Starting PVE Manager");
+console.log("Starting PVE Manager");
Ext.Ajax.defaultHeaders = {
'Accept': 'application/json'
Ext.Ajax.on('beforerequest', function(conn, options) {
if (PVE.CSRFPreventionToken) {
- if (!options.headers) {
+ if (!options.headers) {
options.headers = {};
}
options.headers.CSRFPreventionToken = PVE.CSRFPreventionToken;
// this class only contains static functions
- toolkit: undefined, // (extjs|touch), set inside Toolkit.js
+ toolkit: undefined, // (extjs|touch), set inside Toolkit.js
log_severity_hash: {
0: "panic",
},
render_network_iface_type: function(value) {
- return PVE.Utils.network_iface_types[value] ||
+ return PVE.Utils.network_iface_types[value] ||
PVE.Utils.unknownText;
},
kvm_keymaps: {
//ar: 'Arabic',
da: 'Danish',
- de: 'German',
- 'de-ch': 'German (Swiss)',
- 'en-gb': 'English (UK)',
+ de: 'German',
+ 'de-ch': 'German (Swiss)',
+ 'en-gb': 'English (UK)',
'en-us': 'English (USA)',
es: 'Spanish',
//et: 'Estonia',
fi: 'Finnish',
- //fo: 'Faroe Islands',
- fr: 'French',
- 'fr-be': 'French (Belgium)',
+ //fo: 'Faroe Islands',
+ fr: 'French',
+ 'fr-be': 'French (Belgium)',
'fr-ca': 'French (Canada)',
'fr-ch': 'French (Swiss)',
//hr: 'Croatia',
hu: 'Hungarian',
is: 'Icelandic',
- it: 'Italian',
+ it: 'Italian',
ja: 'Japanese',
lt: 'Lithuanian',
//lv: 'Latvian',
- mk: 'Macedonian',
+ mk: 'Macedonian',
nl: 'Dutch',
//'nl-be': 'Dutch (Belgium)',
- no: 'Norwegian',
+ no: 'Norwegian',
pl: 'Polish',
pt: 'Portuguese',
'pt-br': 'Portuguese (Brazil)',
return PVE.Utils.defaultText;
}
var text = PVE.Utils.kvm_vga_drivers[value];
- if (text) {
+ if (text) {
return text + ' (' + value + ')';
}
return value;
// fixme: remove - not needed?
gridLineHeigh: function() {
return 21;
-
+
//if (Ext.isGecko)
//return 23;
//return 21;
if (verbose && Ext.isObject(result.errors)) {
msg += "<br>";
Ext.Object.each(result.errors, function(prop, desc) {
- msg += "<br><b>" + Ext.htmlEncode(prop) + "</b>: " +
+ msg += "<br><b>" + Ext.htmlEncode(prop) + "</b>: " +
Ext.htmlEncode(desc);
});
- }
+ }
}
return msg;
migrateall: [ '', gettext('Migrate all VMs and Containers') ]
},
- format_task_description: function(type, id) {
+ format_task_description: function(type, id) {
var farray = PVE.Utils.task_desc_table[type];
if (!farray) {
return type;
var prefix = farray[0];
var text = farray[1];
if (prefix) {
- return prefix + ' ' + id + ' - ' + text;
+ return prefix + ' ' + id + ' - ' + text;
}
return text;
},
return "<div class='pve-bar-wrap'>" + text + "<div class='pve-bar-border'>" +
"<div class='pve-bar-inner' style='width:" + per + "%;'></div>" +
"</div></div>";
-
+
},
format_cpu_bar: function(per1, per2, text) {
return "<div class='pve-bar-border'>" +
"<div class='pve-bar-inner' style='width:" + per1 + "%;'></div>" +
"<div class='pve-bar-inner2' style='width:" + per2 + "%;'></div>" +
- "<div class='pve-bar-text'>" + text + "</div>" +
+ "<div class='pve-bar-text'>" + text + "</div>" +
"</div>";
},
return "<div class='pve-largebar-border'>" +
"<div class='pve-largebar-inner' style='width:" + per + "%;'></div>" +
- "<div class='pve-largebar-text'>" + text + "</div>" +
+ "<div class='pve-largebar-text'>" + text + "</div>" +
"</div>";
},
if (days) {
var ds = days > 1 ? PVE.Utils.daysText : PVE.Utils.dayText;
- return days.toString() + ' ' + ds + ' ' +
+ return days.toString() + ' ' + ds + ' ' +
hours_str + ':' + mins_str + ':' + ut_str;
} else {
return hours_str + ':' + mins_str + ':' + ut_str;
},
format_duration_short: function(ut) {
-
+
if (ut < 60) {
return ut.toString() + 's';
}
}
var days = ut / 86400;
- return days.toFixed(0) + 'd';
+ return days.toFixed(0) + 'd';
},
yesText: gettext('Yes'),
if (Ext.isNumber(data.channel) &&
Ext.isNumber(data.id) &&
Ext.isNumber(data.lun)) {
- return "CH " +
- Ext.String.leftPad(data.channel,2, '0') +
+ return "CH " +
+ Ext.String.leftPad(data.channel,2, '0') +
" ID " + data.id + " LUN " + data.lun;
}
return data.volid.replace(/^.*:(.*\/)?/,'');
if (!Ext.isNumeric(maxcpu) && (maxcpu >= 1)) {
return '';
}
-
+
var per = value * 100;
return per.toFixed(1) + '% of ' + maxcpu.toString() + (maxcpu > 1 ? 'CPUs' : 'CPU');
var mem = value;
var maxmem = record.data.maxmem;
-
+
if (!record.data.uptime) {
return '';
}
if (uptime === undefined) {
return '';
}
-
+
if (uptime <= 0) {
return '-';
}
return PVE.Utils.support_level_hash[value] || '-';
},
- render_upid: function(value, metaData, record) {
+ render_upid: function(value, metaData, record) {
var type = record.data.type;
var id = record.data.id;
return window.location.hostname.replace(IP6_bracket_match,
function(m, addr, offset, original) { return addr; });
},
-
+
openDefaultConsoleWindow: function(allowSpice, vmtype, vmid, nodename, vmname) {
var dv = PVE.Utils.defaultViewer(allowSpice);
PVE.Utils.openConsoleWindow(dv, vmtype, vmid, nodename, vmname);
});
var url = 'data:application/x-virt-viewer;charset=UTF-8,' +
encodeURIComponent(raw);
-
+
downloadWithName(url, "pve-spice.vv");
}
});
},
- // comp.setLoading() is buggy in ExtJS 4.0.7, so we
+ // comp.setLoading() is buggy in ExtJS 4.0.7, so we
// use el.mask() instead
setErrorMask: function(comp, msg) {
var el = comp.el;