},
noSubKeyHtml: 'You do not have a valid subscription for this server. Please visit '
- +'<a target="_blank" href="https://www.proxmox.com/products/proxmox-ve/subscription-service-plans">'
+ +'<a target="_blank" href="https://www.proxmox.com/en/proxmox-virtual-environment/pricing">'
+'www.proxmox.com</a> to get a list of available options.',
kvm_ostypes: {
'Linux': [
- { desc: '5.x - 2.6 Kernel', val: 'l26' },
+ { desc: '6.x - 2.6 Kernel', val: 'l26' },
{ desc: '2.4 Kernel', val: 'l24' },
],
'Microsoft Windows': [
'efidisk but no OMVF BIOS': gettext('EFI Disk without OMVF BIOS'),
},
+ renderNotFound: what => Ext.String.format(gettext("No {0} found"), what),
+
get_kvm_osinfo: function(value) {
var info = { base: 'Other' }; // default
if (value) {
return Ext.htmlEncode(first + " " + last);
},
+ // expecting the following format:
+ // [v2:10.10.10.1:6802/2008,v1:10.10.10.1:6803/2008]
+ render_ceph_osd_addr: function(value) {
+ value = value.trim();
+ if (value.startsWith('[') && value.endsWith(']')) {
+ value = value.slice(1, -1); // remove []
+ }
+ value = value.replaceAll(',', '\n'); // split IPs in lines
+ let retVal = '';
+ for (const i of value.matchAll(/^(v[0-9]):(.*):([0-9]*)\/([0-9]*)$/gm)) {
+ retVal += `${i[1]}: ${i[2]}:${i[3]}<br>`;
+ }
+ return retVal.length < 1 ? value : retVal;
+ },
+
windowHostname: function() {
return window.location.hostname.replace(Proxmox.Utils.IP6_bracket_match,
function(m, addr, offset, original) { return addr; });
allowSpice = consoles.spice;
allowXtermjs = !!consoles.xtermjs;
}
- let dv = PVE.UIOptions.console || (type === 'kvm' ? 'vv' : 'xtermjs');
+ let dv = PVE.UIOptions.options.console || (type === 'kvm' ? 'vv' : 'xtermjs');
if (dv === 'vv' && !allowSpice) {
dv = allowXtermjs ? 'xtermjs' : 'html5';
} else if (dv === 'xtermjs' && !allowXtermjs) {
});
win.getViewModel().set('isInstalled', isInstalled);
container.add(win);
+ win.on('close', () => {
+ container.el.unmask();
+ });
win.show();
callback(win);
}
rstore,
/not (installed|initialized)/i,
(_, error) => {
- nodename = nodename || 'localhost';
+ nodename = nodename || Proxmox.NodeName;
let maskTarget = maskOwnerCt ? view.ownerCt : view;
rstore.stopUpdate();
PVE.Utils.showCephInstallOrMask(maskTarget, error.statusText, nodename, win => {
notesTemplateVars: ['cluster', 'guestname', 'node', 'vmid'],
- updateUIOptions: function() {
- Proxmox.Utils.API2Request({
- url: '/cluster/options',
- method: 'GET',
- success: function(response) {
- PVE.UIOptions = {
- 'allowed-tags': [],
- };
- for (const option of ['allowed-tags', 'console', 'tag-style']) {
- PVE.UIOptions[option] = response?.result?.data?.[option];
- }
-
- PVE.Utils.updateTagList(PVE.UIOptions['allowed-tags']);
- PVE.Utils.updateTagSettings(PVE.UIOptions?.['tag-style']);
- },
- });
- },
-
- tagList: [],
-
- updateTagList: function(tags) {
- PVE.Utils.tagList = [...new Set([...tags])].sort();
- },
-
- parseTagOverrides: function(overrides) {
- let colors = {};
- (overrides || "").split(';').forEach(color => {
- if (!color) {
- return;
- }
- let [tag, color_hex, font_hex] = color.split(':');
- let r = parseInt(color_hex.slice(0, 2), 16);
- let g = parseInt(color_hex.slice(2, 4), 16);
- let b = parseInt(color_hex.slice(4, 6), 16);
- colors[tag] = [r, g, b];
- if (font_hex) {
- colors[tag].push(parseInt(font_hex.slice(0, 2), 16));
- colors[tag].push(parseInt(font_hex.slice(2, 4), 16));
- colors[tag].push(parseInt(font_hex.slice(4, 6), 16));
- }
- });
- return colors;
- },
-
- tagOverrides: {},
-
- updateTagOverrides: function(colors) {
- let sp = Ext.state.Manager.getProvider();
- let color_state = sp.get('colors', '');
- let browser_colors = PVE.Utils.parseTagOverrides(color_state);
- PVE.Utils.tagOverrides = Ext.apply({}, browser_colors, colors);
- },
-
- updateTagSettings: function(style) {
- let overrides = style?.['color-map'];
- PVE.Utils.updateTagOverrides(PVE.Utils.parseTagOverrides(overrides ?? ""));
-
- let shape = style?.shape ?? 'circle';
- if (shape === '__default__') {
- style = 'circle';
- }
-
- Ext.ComponentQuery.query('pveResourceTree')[0].setUserCls(`proxmox-tags-${shape}`);
- PVE.data.ResourceStore.fireEvent('load');
- Ext.GlobalEvents.fireEvent('loadedUiOptions');
- },
-
- tagTreeStyles: {
- '__default__': `${Proxmox.Utils.defaultText} (${gettext('Cirlce')})`,
- 'full': gettext('Full'),
- 'circle': gettext('Circle'),
- 'dense': gettext('Dense'),
- 'none': Proxmox.Utils.NoneText,
- },
-
- tagOrderOptions: {
- '__default__': `${Proxmox.Utils.defaultText} (${gettext('Alphabetical')})`,
- 'config': gettext('Configuration'),
- 'alphabetical': gettext('Alphabetical'),
- },
-
renderTags: function(tagstext, overrides) {
let text = '';
if (tagstext) {
let tags = (tagstext.split(/[,; ]/) || []).filter(t => !!t);
- if (PVE.Utils.shouldSortTags()) {
- tags = tags.sort((a,b) => {
+ if (PVE.UIOptions.shouldSortTags()) {
+ tags = tags.sort((a, b) => {
let alc = a.toLowerCase();
let blc = b.toLowerCase();
return alc < blc ? -1 : blc < alc ? 1 : a.localeCompare(b);
return text;
},
- shouldSortTags: function() {
- return !(PVE.UIOptions?.['tag-style']?.ordering === 'config');
- },
-
tagCharRegex: /^[a-z0-9+_.-]+$/i,
+
+ verificationStateOrder: {
+ 'failed': 0,
+ 'none': 1,
+ 'ok': 2,
+ '__default__': 3,
+ },
},
singleton: true,