3 console
.log("Starting Proxmox VE Manager");
5 Ext
.Ajax
.defaultHeaders
= {
6 'Accept': 'application/json',
9 Ext
.define('PVE.Utils', {
12 // this singleton contains miscellaneous utilities
14 toolkit
: undefined, // (extjs|touch), set inside Toolkit.js
16 bus_match
: /^(ide|sata|virtio|scsi)(\d+)$/,
30 'c': gettext('Community'),
31 'b': gettext('Basic'),
32 's': gettext('Standard'),
33 'p': gettext('Premium'),
36 noSubKeyHtml
: 'You do not have a valid subscription for this server. Please visit '
37 +'<a target="_blank" href="https://www.proxmox.com/products/proxmox-ve/subscription-service-plans">'
38 +'www.proxmox.com</a> to get a list of available options.',
42 { desc
: '5.x - 2.6 Kernel', val
: 'l26' },
43 { desc
: '2.4 Kernel', val
: 'l24' },
45 'Microsoft Windows': [
46 { desc
: '11/2022', val
: 'win11' },
47 { desc
: '10/2016/2019', val
: 'win10' },
48 { desc
: '8.x/2012/2012r2', val
: 'win8' },
49 { desc
: '7/2008r2', val
: 'win7' },
50 { desc
: 'Vista/2008', val
: 'w2k8' },
51 { desc
: 'XP/2003', val
: 'wxp' },
52 { desc
: '2000', val
: 'w2k' },
55 { desc
: '-', val
: 'solaris' },
58 { desc
: '-', val
: 'other' },
62 is_windows: function(ostype
) {
63 for (let entry
of PVE
.Utils
.kvm_ostypes
['Microsoft Windows']) {
64 if (entry
.val
=== ostype
) {
71 get_health_icon: function(state
, circle
) {
72 if (circle
=== undefined) {
76 if (state
=== undefined) {
80 var icon
= 'faded fa-question';
83 icon
= 'good fa-check';
86 icon
= 'warning fa-upload';
89 icon
= 'warning fa-refresh';
92 icon
= 'warning fa-exclamation';
95 icon
= 'critical fa-times';
107 parse_ceph_version: function(service
) {
108 if (service
.ceph_version_short
) {
109 return service
.ceph_version_short
;
112 if (service
.ceph_version
) {
113 var match
= service
.ceph_version
.match(/version (\d+(\.\d+)*)/);
122 compare_ceph_versions: function(a
, b
) {
130 if (Ext
.isArray(a
)) {
131 avers
= a
.slice(); // copy array
133 avers
= a
.toString().split('.');
136 if (Ext
.isArray(b
)) {
137 bvers
= b
.slice(); // copy array
139 bvers
= b
.toString().split('.');
143 let av
= avers
.shift();
144 let bv
= bvers
.shift();
146 if (av
=== undefined && bv
=== undefined) {
148 } else if (av
=== undefined) {
150 } else if (bv
=== undefined) {
153 let diff
= parseInt(av
, 10) - parseInt(bv
, 10);
154 if (diff
!== 0) return diff
;
155 // else we need to look at the next parts
160 get_ceph_icon_html: function(health
, fw
) {
161 var state
= PVE
.Utils
.map_ceph_health
[health
];
162 var cls
= PVE
.Utils
.get_health_icon(state
);
166 return "<i class='fa " + cls
+ "'></i> ";
171 'HEALTH_UPGRADE': 'upgrade',
173 'HEALTH_WARN': 'warning',
174 'HEALTH_ERR': 'critical',
177 render_sdn_pending: function(rec
, value
, key
, index
) {
178 if (rec
.data
.state
=== undefined || rec
.data
.state
=== null) {
182 if (rec
.data
.state
=== 'deleted') {
183 if (value
=== undefined) {
186 return '<div style="text-decoration: line-through;">'+ value
+'</div>';
188 } else if (rec
.data
.pending
[key
] !== undefined && rec
.data
.pending
[key
] !== null) {
189 if (rec
.data
.pending
[key
] === 'deleted') {
192 return rec
.data
.pending
[key
];
198 render_sdn_pending_state: function(rec
, value
) {
199 if (value
=== undefined || value
=== null) {
203 let icon
= `<i class="fa fa-fw fa-refresh warning"></i>`;
205 if (value
=== 'deleted') {
206 return '<span>' + icon
+ value
+ '</span>';
209 let tip
= gettext('Pending Changes') + ': <br>';
211 for (const [key
, keyvalue
] of Object
.entries(rec
.data
.pending
)) {
212 if ((rec
.data
[key
] !== undefined && rec
.data
.pending
[key
] !== rec
.data
[key
]) ||
213 rec
.data
[key
] === undefined
215 tip
+= `${key}: ${keyvalue} <br>`;
218 return '<span data-qtip="' + tip
+ '">'+ icon
+ value
+ '</span>';
221 render_ceph_health: function(healthObj
) {
223 iconCls
: PVE
.Utils
.get_health_icon(),
227 if (!healthObj
|| !healthObj
.status
) {
231 var health
= PVE
.Utils
.map_ceph_health
[healthObj
.status
];
233 state
.iconCls
= PVE
.Utils
.get_health_icon(health
, true);
234 state
.text
= healthObj
.status
;
239 render_zfs_health: function(value
) {
240 if (typeof value
=== 'undefined') {
243 var iconCls
= 'question-circle';
247 iconCls
= 'check-circle good';
251 iconCls
= 'exclamation-circle warning';
256 iconCls
= 'times-circle critical';
261 return '<i class="fa fa-' + iconCls
+ '"></i> ' + value
;
264 render_pbs_fingerprint
: fp
=> fp
.substring(0, 23),
266 render_backup_encryption: function(v
, meta
, record
) {
268 return gettext('No');
272 if (v
.match(/^[a-fA-F0-9]{2}:/)) { // fingerprint
273 tip
= `Key fingerprint ${PVE.Utils.render_pbs_fingerprint(v)}`;
275 let icon
= `<i class="fa fa-fw fa-lock good"></i>`;
276 return `<span data-qtip="${tip}">${icon} ${gettext('Encrypted')}</span>`;
279 render_backup_verification: function(v
, meta
, record
) {
280 let i
= (cls
, txt
) => `<i class="fa fa-fw fa-${cls}"></i> ${txt}`;
281 if (v
=== undefined || v
=== null) {
282 return i('question-circle-o warning', gettext('None'));
285 let txt
= gettext('Failed');
286 let iconCls
= 'times critical';
287 if (v
.state
=== 'ok') {
289 iconCls
= 'check good';
290 let now
= Date
.now() / 1000;
291 let task
= Proxmox
.Utils
.parse_task_upid(v
.upid
);
292 let verify_time
= Proxmox
.Utils
.render_timestamp(task
.starttime
);
293 tip
= `Last verify task started on ${verify_time}`;
294 if (now
- v
.starttime
> 30 * 24 * 60 * 60) {
295 tip
= `Last verify task over 30 days ago: ${verify_time}`;
296 iconCls
= 'check warning';
299 return `<span data-qtip="${tip}"> ${i(iconCls, txt)} </span>`;
302 render_backup_status: function(value
, meta
, record
) {
303 if (typeof value
=== 'undefined') {
307 let iconCls
= 'check-circle good';
308 let text
= gettext('Yes');
310 if (!PVE
.Parser
.parseBoolean(value
.toString())) {
311 iconCls
= 'times-circle critical';
313 text
= gettext('No');
315 let reason
= record
.get('reason');
316 if (typeof reason
!== 'undefined') {
317 if (reason
in PVE
.Utils
.backup_reasons_table
) {
318 reason
= PVE
.Utils
.backup_reasons_table
[record
.get('reason')];
320 text
= `${text} - ${reason}`;
324 return `<i class="fa fa-${iconCls}"></i> ${text}`;
327 render_backup_days_of_week: function(val
) {
328 var dows
= ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
331 val
.split(',').forEach(function(day
) {
333 var dow
= (dows
.indexOf(day
)+6)%7;
335 if (selected
.length
=== 0 || selected
[selected
.length
-1] === 0) {
338 selected
[selected
.length
-1]++;
351 selected
.forEach(function(item
) {
354 days
.push(Ext
.Date
.dayNames
[cur
+1] + '-' + Ext
.Date
.dayNames
[(cur
+item
)%7]);
356 } else if (item
=== 2) {
357 days
.push(Ext
.Date
.dayNames
[cur
+1]);
358 days
.push(Ext
.Date
.dayNames
[(cur
+2)%7]);
360 } else if (item
=== 1) {
361 days
.push(Ext
.Date
.dayNames
[(cur
+1)%7]);
364 return days
.join(', ');
367 render_backup_selection: function(value
, metaData
, record
) {
368 let allExceptText
= gettext('All except {0}');
369 let allText
= '-- ' + gettext('All') + ' --';
370 if (record
.data
.all
) {
371 if (record
.data
.exclude
) {
372 return Ext
.String
.format(allExceptText
, record
.data
.exclude
);
376 if (record
.data
.vmid
) {
377 return record
.data
.vmid
;
380 if (record
.data
.pool
) {
381 return "Pool '"+ record
.data
.pool
+ "'";
387 backup_reasons_table
: {
388 'backup=yes': gettext('Enabled'),
389 'backup=no': gettext('Disabled'),
390 'enabled': gettext('Enabled'),
391 'disabled': gettext('Disabled'),
392 'not a volume': gettext('Not a volume'),
393 'efidisk but no OMVF BIOS': gettext('EFI Disk without OMVF BIOS'),
396 get_kvm_osinfo: function(value
) {
397 var info
= { base
: 'Other' }; // default
399 Ext
.each(Object
.keys(PVE
.Utils
.kvm_ostypes
), function(k
) {
400 Ext
.each(PVE
.Utils
.kvm_ostypes
[k
], function(e
) {
401 if (e
.val
=== value
) {
402 info
= { desc
: e
.desc
, base
: k
};
410 render_kvm_ostype: function(value
) {
411 var osinfo
= PVE
.Utils
.get_kvm_osinfo(value
);
412 if (osinfo
.desc
&& osinfo
.desc
!== '-') {
413 return osinfo
.base
+ ' ' + osinfo
.desc
;
419 render_hotplug_features: function(value
) {
422 if (!value
|| value
=== '0') {
423 return gettext('Disabled');
427 value
= 'disk,network,usb';
430 Ext
.each(value
.split(','), function(el
) {
432 fa
.push(gettext('Disk'));
433 } else if (el
=== 'network') {
434 fa
.push(gettext('Network'));
435 } else if (el
=== 'usb') {
437 } else if (el
=== 'memory') {
438 fa
.push(gettext('Memory'));
439 } else if (el
=== 'cpu') {
440 fa
.push(gettext('CPU'));
446 return fa
.join(', ');
449 render_localtime: function(value
) {
450 if (value
=== '__default__') {
451 return Proxmox
.Utils
.defaultText
+ ' (' + gettext('Enabled for Windows') + ')';
453 return Proxmox
.Utils
.format_boolean(value
);
456 render_qga_features: function(config
) {
458 return Proxmox
.Utils
.defaultText
+ ' (' + Proxmox
.Utils
.disabledText
+ ')';
460 let qga
= PVE
.Parser
.parsePropertyString(config
, 'enabled');
461 if (!PVE
.Parser
.parseBoolean(qga
.enabled
)) {
462 return Proxmox
.Utils
.disabledText
;
466 let agentstring
= Proxmox
.Utils
.enabledText
;
468 for (const [key
, value
] of Object
.entries(qga
)) {
469 let displayText
= Proxmox
.Utils
.disabledText
;
470 if (key
=== 'type') {
475 displayText
= map
[value
] || Proxmox
.Utils
.unknownText
;
476 } else if (PVE
.Parser
.parseBoolean(value
)) {
477 displayText
= Proxmox
.Utils
.enabledText
;
479 agentstring
+= `, ${key}: ${displayText}`;
485 render_qemu_machine: function(value
) {
486 return value
|| Proxmox
.Utils
.defaultText
+ ' (i440fx)';
489 render_qemu_bios: function(value
) {
491 return Proxmox
.Utils
.defaultText
+ ' (SeaBIOS)';
492 } else if (value
=== 'seabios') {
494 } else if (value
=== 'ovmf') {
495 return "OVMF (UEFI)";
501 render_dc_ha_opts: function(value
) {
503 return Proxmox
.Utils
.defaultText
;
505 return PVE
.Parser
.printPropertyString(value
);
508 render_as_property_string
: v
=> !v
? Proxmox
.Utils
.defaultText
: PVE
.Parser
.printPropertyString(v
),
510 render_scsihw: function(value
) {
512 return Proxmox
.Utils
.defaultText
+ ' (LSI 53C895A)';
513 } else if (value
=== 'lsi') {
514 return 'LSI 53C895A';
515 } else if (value
=== 'lsi53c810') {
517 } else if (value
=== 'megasas') {
518 return 'MegaRAID SAS 8708EM2';
519 } else if (value
=== 'virtio-scsi-pci') {
520 return 'VirtIO SCSI';
521 } else if (value
=== 'virtio-scsi-single') {
522 return 'VirtIO SCSI single';
523 } else if (value
=== 'pvscsi') {
524 return 'VMware PVSCSI';
530 render_spice_enhancements: function(values
) {
531 let props
= PVE
.Parser
.parsePropertyString(values
);
532 if (Ext
.Object
.isEmpty(props
)) {
533 return Proxmox
.Utils
.noneText
;
537 if (PVE
.Parser
.parseBoolean(props
.foldersharing
)) {
538 output
.push('Folder Sharing: ' + gettext('Enabled'));
540 if (props
.videostreaming
=== 'all' || props
.videostreaming
=== 'filter') {
541 output
.push('Video Streaming: ' + props
.videostreaming
);
543 return output
.join(', ');
546 // fixme: auto-generate this
547 // for now, please keep in sync with PVE::Tools::kvmkeymaps
552 'de-ch': 'German (Swiss)',
553 'en-gb': 'English (UK)',
554 'en-us': 'English (USA)',
558 //fo: 'Faroe Islands',
560 'fr-be': 'French (Belgium)',
561 'fr-ca': 'French (Canada)',
562 'fr-ch': 'French (Swiss)',
572 //'nl-be': 'Dutch (Belgium)',
576 'pt-br': 'Portuguese (Brazil)',
585 std
: gettext('Standard VGA'),
586 vmware
: gettext('VMware compatible'),
588 qxl2
: 'SPICE dual monitor',
589 qxl3
: 'SPICE three monitors',
590 qxl4
: 'SPICE four monitors',
591 serial0
: gettext('Serial terminal') + ' 0',
592 serial1
: gettext('Serial terminal') + ' 1',
593 serial2
: gettext('Serial terminal') + ' 2',
594 serial3
: gettext('Serial terminal') + ' 3',
595 virtio
: 'VirtIO-GPU',
596 none
: Proxmox
.Utils
.noneText
,
599 render_kvm_language: function(value
) {
600 if (!value
|| value
=== '__default__') {
601 return Proxmox
.Utils
.defaultText
;
603 var text
= PVE
.Utils
.kvm_keymaps
[value
];
605 return text
+ ' (' + value
+ ')';
610 kvm_keymap_array: function() {
611 var data
= [['__default__', PVE
.Utils
.render_kvm_language('')]];
612 Ext
.Object
.each(PVE
.Utils
.kvm_keymaps
, function(key
, value
) {
613 data
.push([key
, PVE
.Utils
.render_kvm_language(value
)]);
620 '__default__': Proxmox
.Utils
.defaultText
+ ' (xterm.js)',
621 'vv': 'SPICE (remote-viewer)',
622 'html5': 'HTML5 (noVNC)',
623 'xtermjs': 'xterm.js',
626 render_console_viewer: function(value
) {
627 value
= value
|| '__default__';
628 if (PVE
.Utils
.console_map
[value
]) {
629 return PVE
.Utils
.console_map
[value
];
634 console_viewer_array: function() {
635 return Ext
.Array
.map(Object
.keys(PVE
.Utils
.console_map
), function(v
) {
636 return [v
, PVE
.Utils
.render_console_viewer(v
)];
640 render_kvm_vga_driver: function(value
) {
642 return Proxmox
.Utils
.defaultText
;
644 var vga
= PVE
.Parser
.parsePropertyString(value
, 'type');
645 var text
= PVE
.Utils
.kvm_vga_drivers
[vga
.type
];
647 text
= Proxmox
.Utils
.defaultText
;
650 return text
+ ' (' + value
+ ')';
655 kvm_vga_driver_array: function() {
656 var data
= [['__default__', PVE
.Utils
.render_kvm_vga_driver('')]];
657 Ext
.Object
.each(PVE
.Utils
.kvm_vga_drivers
, function(key
, value
) {
658 data
.push([key
, PVE
.Utils
.render_kvm_vga_driver(value
)]);
664 render_kvm_startup: function(value
) {
665 var startup
= PVE
.Parser
.parseStartup(value
);
668 if (startup
.order
=== undefined) {
671 res
+= startup
.order
;
673 if (startup
.up
!== undefined) {
674 res
+= ',up=' + startup
.up
;
676 if (startup
.down
!== undefined) {
677 res
+= ',down=' + startup
.down
;
683 extractFormActionError: function(action
) {
685 switch (action
.failureType
) {
686 case Ext
.form
.action
.Action
.CLIENT_INVALID
:
687 msg
= gettext('Form fields may not be submitted with invalid values');
689 case Ext
.form
.action
.Action
.CONNECT_FAILURE
:
690 msg
= gettext('Connection error');
691 var resp
= action
.response
;
692 if (resp
.status
&& resp
.statusText
) {
693 msg
+= " " + resp
.status
+ ": " + resp
.statusText
;
696 case Ext
.form
.action
.Action
.LOAD_FAILURE
:
697 case Ext
.form
.action
.Action
.SERVER_INVALID
:
698 msg
= Proxmox
.Utils
.extractRequestError(action
.result
, true);
705 'images': gettext('Disk image'),
706 'backup': gettext('VZDump backup file'),
707 'vztmpl': gettext('Container template'),
708 'iso': gettext('ISO image'),
709 'rootdir': gettext('Container'),
710 'snippets': gettext('Snippets'),
713 volume_is_qemu_backup: function(volid
, format
) {
714 return format
=== 'pbs-vm' || volid
.match(':backup/vzdump-qemu-');
717 volume_is_lxc_backup: function(volid
, format
) {
718 return format
=== 'pbs-ct' || volid
.match(':backup/vzdump-(lxc|openvz)-');
723 name
: gettext('Active Directory Server'),
724 ipanel
: 'pveAuthADPanel',
725 syncipanel
: 'pveAuthLDAPSyncPanel',
731 name
: gettext('LDAP Server'),
732 ipanel
: 'pveAuthLDAPPanel',
733 syncipanel
: 'pveAuthLDAPSyncPanel',
739 name
: gettext('OpenID Connect Server'),
740 ipanel
: 'pveAuthOpenIDPanel',
744 iconCls
: 'pmx-itype-icon-openid-logo',
748 ipanel
: 'pveAuthBasePanel',
754 name
: 'Proxmox VE authentication server',
755 ipanel
: 'pveAuthBasePanel',
764 name
: Proxmox
.Utils
.directoryText
,
765 ipanel
: 'DirInputPanel',
771 ipanel
: 'LVMInputPanel',
777 ipanel
: 'LvmThinInputPanel',
783 ipanel
: 'BTRFSInputPanel',
789 ipanel
: 'NFSInputPanel',
795 ipanel
: 'CIFSInputPanel',
801 ipanel
: 'GlusterFsInputPanel',
807 ipanel
: 'IScsiInputPanel',
813 ipanel
: 'CephFSInputPanel',
818 name
: 'CephFS (PVE)',
819 ipanel
: 'CephFSInputPanel',
826 ipanel
: 'RBDInputPanel',
832 ipanel
: 'RBDInputPanel',
838 name
: 'ZFS over iSCSI',
839 ipanel
: 'ZFSInputPanel',
845 ipanel
: 'ZFSPoolInputPanel',
850 name
: 'Proxmox Backup Server',
851 ipanel
: 'PBSInputPanel',
876 ipanel
: 'SimpleInputPanel',
881 ipanel
: 'VlanInputPanel',
886 ipanel
: 'QinQInputPanel',
891 ipanel
: 'VxlanInputPanel',
896 ipanel
: 'EvpnInputPanel',
901 sdncontrollerSchema
: {
908 ipanel
: 'EvpnInputPanel',
909 faIcon
: 'crosshairs',
913 ipanel
: 'BgpInputPanel',
914 faIcon
: 'crosshairs',
925 ipanel
: 'PVEIpamInputPanel',
931 ipanel
: 'NetboxInputPanel',
936 ipanel
: 'PhpIpamInputPanel',
948 ipanel
: 'PowerdnsInputPanel',
953 format_sdnvnet_type: function(value
, md
, record
) {
954 var schema
= PVE
.Utils
.sdnvnetSchema
[value
];
958 return Proxmox
.Utils
.unknownText
;
961 format_sdnzone_type: function(value
, md
, record
) {
962 var schema
= PVE
.Utils
.sdnzoneSchema
[value
];
966 return Proxmox
.Utils
.unknownText
;
969 format_sdncontroller_type: function(value
, md
, record
) {
970 var schema
= PVE
.Utils
.sdncontrollerSchema
[value
];
974 return Proxmox
.Utils
.unknownText
;
977 format_sdnipam_type: function(value
, md
, record
) {
978 var schema
= PVE
.Utils
.sdnipamSchema
[value
];
982 return Proxmox
.Utils
.unknownText
;
985 format_sdndns_type: function(value
, md
, record
) {
986 var schema
= PVE
.Utils
.sdndnsSchema
[value
];
990 return Proxmox
.Utils
.unknownText
;
993 format_storage_type: function(value
, md
, record
) {
994 if (value
=== 'rbd') {
995 value
= !record
|| record
.get('monhost') ? 'rbd' : 'pveceph';
996 } else if (value
=== 'cephfs') {
997 value
= !record
|| record
.get('monhost') ? 'cephfs' : 'pvecephfs';
1000 var schema
= PVE
.Utils
.storageSchema
[value
];
1004 return Proxmox
.Utils
.unknownText
;
1007 format_ha: function(value
) {
1008 var text
= Proxmox
.Utils
.noneText
;
1010 if (value
.managed
) {
1011 text
= value
.state
|| Proxmox
.Utils
.noneText
;
1013 text
+= ', ' + Proxmox
.Utils
.groupText
+ ': ';
1014 text
+= value
.group
|| Proxmox
.Utils
.noneText
;
1020 format_content_types: function(value
) {
1021 return value
.split(',').sort().map(function(ct
) {
1022 return PVE
.Utils
.contentTypes
[ct
] || ct
;
1026 render_storage_content: function(value
, metaData
, record
) {
1027 var data
= record
.data
;
1028 if (Ext
.isNumber(data
.channel
) &&
1029 Ext
.isNumber(data
.id
) &&
1030 Ext
.isNumber(data
.lun
)) {
1032 Ext
.String
.leftPad(data
.channel
, 2, '0') +
1033 " ID " + data
.id
+ " LUN " + data
.lun
;
1035 return data
.volid
.replace(/^.*?:(.*?\/)?/, '');
1038 render_serverity: function(value
) {
1039 return PVE
.Utils
.log_severity_hash
[value
] || value
;
1042 calculate_hostcpu: function(data
) {
1043 if (!(data
.uptime
&& Ext
.isNumeric(data
.cpu
))) {
1047 if (data
.type
!== 'qemu' && data
.type
!== 'lxc') {
1051 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + data
.node
);
1052 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1053 if (!Ext
.isDefined(node
) || node
=== null) {
1056 var maxcpu
= node
.data
.maxcpu
|| 1;
1058 if (!Ext
.isNumeric(maxcpu
) && (maxcpu
>= 1)) {
1062 return (data
.cpu
/maxcpu
) * data
.maxcpu
;
1065 render_hostcpu: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1066 if (!(record
.data
.uptime
&& Ext
.isNumeric(record
.data
.cpu
))) {
1070 if (record
.data
.type
!== 'qemu' && record
.data
.type
!== 'lxc') {
1074 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + record
.data
.node
);
1075 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1076 if (!Ext
.isDefined(node
) || node
=== null) {
1079 var maxcpu
= node
.data
.maxcpu
|| 1;
1081 if (!Ext
.isNumeric(maxcpu
) && (maxcpu
>= 1)) {
1085 var per
= (record
.data
.cpu
/maxcpu
) * record
.data
.maxcpu
* 100;
1087 return per
.toFixed(1) + '% of ' + maxcpu
.toString() + (maxcpu
> 1 ? 'CPUs' : 'CPU');
1090 render_bandwidth: function(value
) {
1091 if (!Ext
.isNumeric(value
)) {
1095 return Proxmox
.Utils
.format_size(value
) + '/s';
1098 render_timestamp_human_readable: function(value
) {
1099 return Ext
.Date
.format(new Date(value
* 1000), 'l d F Y H:i:s');
1102 calculate_mem_usage: function(data
) {
1103 if (!Ext
.isNumeric(data
.mem
) ||
1104 data
.maxmem
=== 0 ||
1109 return data
.mem
/ data
.maxmem
;
1112 calculate_hostmem_usage: function(data
) {
1113 if (data
.type
!== 'qemu' && data
.type
!== 'lxc') {
1117 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + data
.node
);
1118 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1120 if (!Ext
.isDefined(node
) || node
=== null) {
1123 var maxmem
= node
.data
.maxmem
|| 0;
1125 if (!Ext
.isNumeric(data
.mem
) ||
1131 return data
.mem
/ maxmem
;
1134 render_mem_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1135 if (!Ext
.isNumeric(value
) || value
=== -1) {
1139 // we got no percentage but bytes
1141 var maxmem
= record
.data
.maxmem
;
1142 if (!record
.data
.uptime
||
1144 !Ext
.isNumeric(mem
)) {
1148 return (mem
*100/maxmem
).toFixed(1) + " %";
1150 return (value
*100).toFixed(1) + " %";
1153 render_hostmem_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1154 if (!Ext
.isNumeric(record
.data
.mem
) || value
=== -1) {
1158 if (record
.data
.type
!== 'qemu' && record
.data
.type
!== 'lxc') {
1162 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + record
.data
.node
);
1163 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1164 var maxmem
= node
.data
.maxmem
|| 0;
1166 if (record
.data
.mem
> 1) {
1167 // we got no percentage but bytes
1168 var mem
= record
.data
.mem
;
1169 if (!record
.data
.uptime
||
1171 !Ext
.isNumeric(mem
)) {
1175 return ((mem
*100)/maxmem
).toFixed(1) + " %";
1177 return (value
*100).toFixed(1) + " %";
1180 render_mem_usage: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1182 var maxmem
= record
.data
.maxmem
;
1184 if (!record
.data
.uptime
) {
1188 if (!(Ext
.isNumeric(mem
) && maxmem
)) {
1192 return Proxmox
.Utils
.render_size(value
);
1195 calculate_disk_usage: function(data
) {
1196 if (!Ext
.isNumeric(data
.disk
) ||
1197 ((data
.type
=== 'qemu' || data
.type
=== 'lxc') && data
.uptime
=== 0) ||
1203 return data
.disk
/ data
.maxdisk
;
1206 render_disk_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1207 if (!Ext
.isNumeric(value
) || value
=== -1) {
1211 return (value
* 100).toFixed(1) + " %";
1214 render_disk_usage: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1216 var maxdisk
= record
.data
.maxdisk
;
1217 var type
= record
.data
.type
;
1219 if (!Ext
.isNumeric(disk
) ||
1221 ((type
=== 'qemu' || type
=== 'lxc') && record
.data
.uptime
=== 0)
1226 return Proxmox
.Utils
.render_size(value
);
1229 get_object_icon_class: function(type
, record
) {
1233 if (type
=== 'type') {
1235 objType
= record
.groupbyid
;
1236 } else if (record
.template
) {
1238 objType
= 'template';
1242 status
= record
.status
+ ' ha-' + record
.hastate
;
1246 status
+= ' locked lock-' + record
.lock
;
1249 var defaults
= PVE
.tree
.ResourceTree
.typeDefaults
[objType
];
1250 if (defaults
&& defaults
.iconCls
) {
1251 var retVal
= defaults
.iconCls
+ ' ' + status
;
1258 render_resource_type: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1259 var cls
= PVE
.Utils
.get_object_icon_class(value
, record
.data
);
1261 var fa
= '<i class="fa-fw x-grid-icon-custom ' + cls
+ '"></i> ';
1265 render_support_level: function(value
, metaData
, record
) {
1266 return PVE
.Utils
.support_level_hash
[value
] || '-';
1269 render_upid: function(value
, metaData
, record
) {
1270 var type
= record
.data
.type
;
1271 var id
= record
.data
.id
;
1273 return Proxmox
.Utils
.format_task_description(type
, id
);
1276 render_optional_url: function(value
) {
1277 if (value
&& value
.match(/^https?:\/\//)) {
1278 return '<a target="_blank" href="' + value
+ '">' + value
+ '</a>';
1283 render_san: function(value
) {
1285 if (Ext
.isArray(value
)) {
1286 value
.forEach(function(val
) {
1287 if (!Ext
.isNumber(val
)) {
1291 return names
.join('<br>');
1296 render_full_name: function(firstname
, metaData
, record
) {
1297 var first
= firstname
|| '';
1298 var last
= record
.data
.lastname
|| '';
1299 return Ext
.htmlEncode(first
+ " " + last
);
1302 windowHostname: function() {
1303 return window
.location
.hostname
.replace(Proxmox
.Utils
.IP6_bracket_match
,
1304 function(m
, addr
, offset
, original
) { return addr
; });
1307 openDefaultConsoleWindow: function(consoles
, consoleType
, vmid
, nodename
, vmname
, cmd
) {
1308 var dv
= PVE
.Utils
.defaultViewer(consoles
, consoleType
);
1309 PVE
.Utils
.openConsoleWindow(dv
, consoleType
, vmid
, nodename
, vmname
, cmd
);
1312 openConsoleWindow: function(viewer
, consoleType
, vmid
, nodename
, vmname
, cmd
) {
1313 if (vmid
=== undefined && (consoleType
=== 'kvm' || consoleType
=== 'lxc')) {
1314 throw "missing vmid";
1317 throw "no nodename specified";
1320 if (viewer
=== 'html5') {
1321 PVE
.Utils
.openVNCViewer(consoleType
, vmid
, nodename
, vmname
, cmd
);
1322 } else if (viewer
=== 'xtermjs') {
1323 Proxmox
.Utils
.openXtermJsViewer(consoleType
, vmid
, nodename
, vmname
, cmd
);
1324 } else if (viewer
=== 'vv') {
1325 let url
= '/nodes/' + nodename
+ '/spiceshell';
1327 proxy
: PVE
.Utils
.windowHostname(),
1329 if (consoleType
=== 'kvm') {
1330 url
= '/nodes/' + nodename
+ '/qemu/' + vmid
.toString() + '/spiceproxy';
1331 } else if (consoleType
=== 'lxc') {
1332 url
= '/nodes/' + nodename
+ '/lxc/' + vmid
.toString() + '/spiceproxy';
1333 } else if (consoleType
=== 'upgrade') {
1334 params
.cmd
= 'upgrade';
1335 } else if (consoleType
=== 'cmd') {
1337 } else if (consoleType
!== 'shell') {
1338 throw `unknown spice viewer type '${consoleType}'`;
1340 PVE
.Utils
.openSpiceViewer(url
, params
);
1342 throw `unknown viewer type '${viewer}'`;
1346 defaultViewer: function(consoles
, type
) {
1347 var allowSpice
, allowXtermjs
;
1349 if (consoles
=== true) {
1351 allowXtermjs
= true;
1352 } else if (typeof consoles
=== 'object') {
1353 allowSpice
= consoles
.spice
;
1354 allowXtermjs
= !!consoles
.xtermjs
;
1356 let dv
= PVE
.VersionInfo
.console
|| (type
=== 'kvm' ? 'vv' : 'xtermjs');
1357 if (dv
=== 'vv' && !allowSpice
) {
1358 dv
= allowXtermjs
? 'xtermjs' : 'html5';
1359 } else if (dv
=== 'xtermjs' && !allowXtermjs
) {
1360 dv
= allowSpice
? 'vv' : 'html5';
1366 openVNCViewer: function(vmtype
, vmid
, nodename
, vmname
, cmd
) {
1367 let scaling
= 'off';
1368 if (Proxmox
.Utils
.toolkit
!== 'touch') {
1369 var sp
= Ext
.state
.Manager
.getProvider();
1370 scaling
= sp
.get('novnc-scaling', 'off');
1372 var url
= Ext
.Object
.toQueryString({
1373 console
: vmtype
, // kvm, lxc, upgrade or shell
1381 var nw
= window
.open("?" + url
, '_blank', "innerWidth=745,innerheight=427");
1387 openSpiceViewer: function(url
, params
) {
1388 var downloadWithName = function(uri
, name
) {
1389 var link
= Ext
.DomHelper
.append(document
.body
, {
1392 css
: 'display:none;visibility:hidden;height:0px;',
1395 // Note: we need to tell Android and Chrome the correct file name extension
1396 // but we do not set 'download' tag for other environments, because
1397 // It can have strange side effects (additional user prompt on firefox)
1398 if (navigator
.userAgent
.match(/Android|Chrome/i)) {
1399 link
.download
= name
;
1402 if (link
.fireEvent
) {
1403 link
.fireEvent('onclick');
1405 let evt
= document
.createEvent("MouseEvents");
1406 evt
.initMouseEvent('click', true, true, window
, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
1407 link
.dispatchEvent(evt
);
1411 Proxmox
.Utils
.API2Request({
1415 failure: function(response
, opts
) {
1416 Ext
.Msg
.alert('Error', response
.htmlStatus
);
1418 success: function(response
, opts
) {
1419 let cfg
= response
.result
.data
;
1420 let raw
= Object
.entries(cfg
).reduce((acc
, [k
, v
]) => acc
+ `${k}=${v}\n`, "[virt-viewer]\n");
1421 let spiceDownload
= 'data:application/x-virt-viewer;charset=UTF-8,' + encodeURIComponent(raw
);
1422 downloadWithName(spiceDownload
, "pve-spice.vv");
1427 openTreeConsole: function(tree
, record
, item
, index
, e
) {
1429 let nodename
= record
.data
.node
;
1430 let vmid
= record
.data
.vmid
;
1431 let vmname
= record
.data
.name
;
1432 if (record
.data
.type
=== 'qemu' && !record
.data
.template
) {
1433 Proxmox
.Utils
.API2Request({
1434 url
: `/nodes/${nodename}/qemu/${vmid}/status/current`,
1435 failure
: response
=> Ext
.Msg
.alert('Error', response
.htmlStatus
),
1436 success: function(response
, opts
) {
1437 let conf
= response
.result
.data
;
1439 spice
: !!conf
.spice
,
1440 xtermjs
: !!conf
.serial
,
1442 PVE
.Utils
.openDefaultConsoleWindow(consoles
, 'kvm', vmid
, nodename
, vmname
);
1445 } else if (record
.data
.type
=== 'lxc' && !record
.data
.template
) {
1446 PVE
.Utils
.openDefaultConsoleWindow(true, 'lxc', vmid
, nodename
, vmname
);
1450 // test automation helper
1451 call_menu_handler: function(menu
, text
) {
1452 let item
= menu
.query('menuitem').find(el
=> el
.text
=== text
);
1453 if (item
&& item
.handler
) {
1458 createCmdMenu: function(v
, record
, item
, index
, event
) {
1460 if (!(v
instanceof Ext
.tree
.View
)) {
1464 let type
= record
.data
.type
;
1466 if (record
.data
.template
) {
1467 if (type
=== 'qemu' || type
=== 'lxc') {
1468 menu
= Ext
.create('PVE.menu.TemplateMenu', {
1472 } else if (type
=== 'qemu' || type
=== 'lxc' || type
=== 'node') {
1473 menu
= Ext
.create('PVE.' + type
+ '.CmdMenu', {
1475 nodename
: record
.data
.node
,
1481 menu
.showAt(event
.getXY());
1485 // helper for deleting field which are set to there default values
1486 delete_if_default: function(values
, fieldname
, default_val
, create
) {
1487 if (values
[fieldname
] === '' || values
[fieldname
] === default_val
) {
1489 if (values
.delete) {
1490 if (Ext
.isArray(values
.delete)) {
1491 values
.delete.push(fieldname
);
1493 values
.delete += ',' + fieldname
;
1496 values
.delete = fieldname
;
1500 delete values
[fieldname
];
1504 loadSSHKeyFromFile: function(file
, callback
) {
1505 // ssh-keygen produces ~ 740 bytes for a 4096 bit RSA key, current max is 16 kbit, so assume:
1506 // 740 * 8 for max. 32kbit (5920 bytes), round upwards to 8192 bytes, leaves lots of comment space
1507 PVE
.Utils
.loadFile(file
, callback
, 8192);
1510 loadFile: function(file
, callback
, maxSize
) {
1511 maxSize
= maxSize
|| 32 * 1024;
1512 if (file
.size
> maxSize
) {
1513 Ext
.Msg
.alert(gettext('Error'), `${gettext("Invalid file size")}: ${file.size} > ${maxSize}`);
1516 let reader
= new FileReader();
1517 reader
.onload
= evt
=> callback(evt
.target
.result
);
1518 reader
.readAsText(file
);
1521 loadTextFromFile: function(file
, callback
, maxBytes
) {
1522 let maxSize
= maxBytes
|| 8192;
1523 if (file
.size
> maxSize
) {
1524 Ext
.Msg
.alert(gettext('Error'), gettext("Invalid file size: ") + file
.size
);
1527 let reader
= new FileReader();
1528 reader
.onload
= evt
=> callback(evt
.target
.result
);
1529 reader
.readAsText(file
);
1532 diskControllerMaxIDs
: {
1540 // types is either undefined (all busses), an array of busses, or a single bus
1541 forEachBus: function(types
, func
) {
1542 let busses
= Object
.keys(PVE
.Utils
.diskControllerMaxIDs
);
1544 if (Ext
.isArray(types
)) {
1546 } else if (Ext
.isDefined(types
)) {
1550 // check if we only have valid busses
1551 for (let i
= 0; i
< busses
.length
; i
++) {
1552 if (!PVE
.Utils
.diskControllerMaxIDs
[busses
[i
]]) {
1553 throw "invalid bus: '" + busses
[i
] + "'";
1557 for (let i
= 0; i
< busses
.length
; i
++) {
1558 let count
= PVE
.Utils
.diskControllerMaxIDs
[busses
[i
]];
1559 for (let j
= 0; j
< count
; j
++) {
1560 let cont
= func(busses
[i
], j
);
1561 if (!cont
&& cont
!== undefined) {
1573 forEachMP: function(func
, includeUnused
) {
1574 for (let i
= 0; i
< PVE
.Utils
.mp_counts
.mps
; i
++) {
1575 let cont
= func('mp', i
);
1576 if (!cont
&& cont
!== undefined) {
1581 if (!includeUnused
) {
1585 for (let i
= 0; i
< PVE
.Utils
.mp_counts
.unused
; i
++) {
1586 let cont
= func('unused', i
);
1587 if (!cont
&& cont
!== undefined) {
1593 hardware_counts
: { net
: 32, usb
: 5, hostpci
: 16, audio
: 1, efidisk
: 1, serial
: 4, rng
: 1, tpmstate
: 1 },
1595 cleanEmptyObjectKeys: function(obj
) {
1596 for (const propName
of Object
.keys(obj
)) {
1597 if (obj
[propName
] === null || obj
[propName
] === undefined) {
1598 delete obj
[propName
];
1603 acmedomain_count
: 5,
1605 add_domain_to_acme: function(acme
, domain
) {
1606 if (acme
.domains
=== undefined) {
1607 acme
.domains
= [domain
];
1609 acme
.domains
.push(domain
);
1610 acme
.domains
= acme
.domains
.filter((value
, index
, self
) => self
.indexOf(value
) === index
);
1615 remove_domain_from_acme: function(acme
, domain
) {
1616 if (acme
.domains
!== undefined) {
1619 .filter((value
, index
, self
) => self
.indexOf(value
) === index
&& value
!== domain
);
1624 handleStoreErrorOrMask: function(view
, store
, regex
, callback
) {
1625 view
.mon(store
, 'load', function(proxy
, response
, success
, operation
) {
1627 Proxmox
.Utils
.setErrorMask(view
, false);
1631 if (operation
.error
.statusText
) {
1632 if (operation
.error
.statusText
.match(regex
)) {
1633 callback(view
, operation
.error
);
1636 msg
= operation
.error
.statusText
+ ' (' + operation
.error
.status
+ ')';
1639 msg
= gettext('Connection error');
1641 Proxmox
.Utils
.setErrorMask(view
, msg
);
1645 showCephInstallOrMask: function(container
, msg
, nodename
, callback
) {
1646 if (msg
.match(/not (installed|initialized)/i)) {
1647 if (Proxmox
.UserName
=== 'root@pam') {
1648 container
.el
.mask();
1649 if (!container
.down('pveCephInstallWindow')) {
1650 var isInstalled
= !!msg
.match(/not initialized/i);
1651 var win
= Ext
.create('PVE.ceph.Install', {
1654 win
.getViewModel().set('isInstalled', isInstalled
);
1660 container
.mask(Ext
.String
.format(gettext('{0} not installed.') +
1661 ' ' + gettext('Log in as root to install.'), 'Ceph'), ['pve-static-mask']);
1669 monitor_ceph_installed: function(view
, rstore
, nodename
, maskOwnerCt
) {
1670 PVE
.Utils
.handleStoreErrorOrMask(
1673 /not (installed|initialized)/i,
1675 nodename
= nodename
|| 'localhost';
1676 let maskTarget
= maskOwnerCt
? view
.ownerCt
: view
;
1677 rstore
.stopUpdate();
1678 PVE
.Utils
.showCephInstallOrMask(maskTarget
, error
.statusText
, nodename
, win
=> {
1679 view
.mon(win
, 'cephInstallWindowClosed', () => rstore
.startUpdate());
1686 propertyStringSet: function(target
, source
, name
, value
) {
1688 if (value
=== undefined) {
1689 target
[name
] = source
;
1691 target
[name
] = value
;
1694 delete target
[name
];
1698 forEachCorosyncLink: function(nodeinfo
, cb
) {
1699 let re
= /(?:ring|link)(\d+)_addr/;
1700 Ext
.iterate(nodeinfo
, (prop
, val
) => {
1701 let match
= re
.exec(prop
);
1703 cb(Number(match
[1]), val
);
1710 'AuthenticAMD': 'AMD',
1711 'GenuineIntel': 'Intel',
1719 "_default_": 5, // includes custom models
1722 verify_ip64_address_list: function(value
, with_suffix
) {
1723 for (let addr
of value
.split(/[ ,;]+/)) {
1729 let parts
= addr
.split('%');
1732 if (parts
.length
> 2) {
1736 if (parts
.length
> 1 && !addr
.startsWith('fe80:')) {
1741 if (!Proxmox
.Utils
.IP64_match
.test(addr
)) {
1749 sortByPreviousUsage: function(vmconfig
, controllerList
) {
1750 if (!controllerList
) {
1751 controllerList
= ['ide', 'virtio', 'scsi', 'sata'];
1753 let usedControllers
= {};
1754 for (const type
of Object
.keys(PVE
.Utils
.diskControllerMaxIDs
)) {
1755 usedControllers
[type
] = 0;
1758 for (const property
of Object
.keys(vmconfig
)) {
1759 if (property
.match(PVE
.Utils
.bus_match
) && !vmconfig
[property
].match(/media=cdrom/)) {
1760 const foundController
= property
.match(PVE
.Utils
.bus_match
)[1];
1761 usedControllers
[foundController
]++;
1765 let sortPriority
= PVE
.qemu
.OSDefaults
.getDefaults(vmconfig
.ostype
).busPriority
;
1767 let sortedList
= Ext
.clone(controllerList
);
1768 sortedList
.sort(function(a
, b
) {
1769 if (usedControllers
[b
] === usedControllers
[a
]) {
1770 return sortPriority
[b
] - sortPriority
[a
];
1772 return usedControllers
[b
] - usedControllers
[a
];
1778 nextFreeDisk: function(controllers
, config
) {
1779 for (const controller
of controllers
) {
1780 for (let i
= 0; i
< PVE
.Utils
.diskControllerMaxIDs
[controller
]; i
++) {
1781 let confid
= controller
+ i
.toString();
1782 if (!Ext
.isDefined(config
[confid
])) {
1797 constructor: function() {
1799 Ext
.apply(me
, me
.utilities
);
1801 Proxmox
.Utils
.override_task_descriptions({
1802 acmedeactivate
: ['ACME Account', gettext('Deactivate')],
1803 acmenewcert
: ['SRV', gettext('Order Certificate')],
1804 acmerefresh
: ['ACME Account', gettext('Refresh')],
1805 acmeregister
: ['ACME Account', gettext('Register')],
1806 acmerenew
: ['SRV', gettext('Renew Certificate')],
1807 acmerevoke
: ['SRV', gettext('Revoke Certificate')],
1808 acmeupdate
: ['ACME Account', gettext('Update')],
1809 'auth-realm-sync': [gettext('Realm'), gettext('Sync')],
1810 'auth-realm-sync-test': [gettext('Realm'), gettext('Sync Preview')],
1811 cephcreatemds
: ['Ceph Metadata Server', gettext('Create')],
1812 cephcreatemgr
: ['Ceph Manager', gettext('Create')],
1813 cephcreatemon
: ['Ceph Monitor', gettext('Create')],
1814 cephcreateosd
: ['Ceph OSD', gettext('Create')],
1815 cephcreatepool
: ['Ceph Pool', gettext('Create')],
1816 cephdestroymds
: ['Ceph Metadata Server', gettext('Destroy')],
1817 cephdestroymgr
: ['Ceph Manager', gettext('Destroy')],
1818 cephdestroymon
: ['Ceph Monitor', gettext('Destroy')],
1819 cephdestroyosd
: ['Ceph OSD', gettext('Destroy')],
1820 cephdestroypool
: ['Ceph Pool', gettext('Destroy')],
1821 cephdestroyfs
: ['CephFS', gettext('Destroy')],
1822 cephfscreate
: ['CephFS', gettext('Create')],
1823 cephsetpool
: ['Ceph Pool', gettext('Edit')],
1824 cephsetflags
: ['', gettext('Change global Ceph flags')],
1825 clustercreate
: ['', gettext('Create Cluster')],
1826 clusterjoin
: ['', gettext('Join Cluster')],
1827 dircreate
: [gettext('Directory Storage'), gettext('Create')],
1828 dirremove
: [gettext('Directory'), gettext('Remove')],
1829 download
: [gettext('File'), gettext('Download')],
1830 hamigrate
: ['HA', gettext('Migrate')],
1831 hashutdown
: ['HA', gettext('Shutdown')],
1832 hastart
: ['HA', gettext('Start')],
1833 hastop
: ['HA', gettext('Stop')],
1834 imgcopy
: ['', gettext('Copy data')],
1835 imgdel
: ['', gettext('Erase data')],
1836 lvmcreate
: [gettext('LVM Storage'), gettext('Create')],
1837 lvmremove
: ['Volume Group', gettext('Remove')],
1838 lvmthincreate
: [gettext('LVM-Thin Storage'), gettext('Create')],
1839 lvmthinremove
: ['Thinpool', gettext('Remove')],
1840 migrateall
: ['', gettext('Migrate all VMs and Containers')],
1841 'move_volume': ['CT', gettext('Move Volume')],
1842 'pbs-download': ['VM/CT', gettext('File Restore Download')],
1843 pull_file
: ['CT', gettext('Pull file')],
1844 push_file
: ['CT', gettext('Push file')],
1845 qmclone
: ['VM', gettext('Clone')],
1846 qmconfig
: ['VM', gettext('Configure')],
1847 qmcreate
: ['VM', gettext('Create')],
1848 qmdelsnapshot
: ['VM', gettext('Delete Snapshot')],
1849 qmdestroy
: ['VM', gettext('Destroy')],
1850 qmigrate
: ['VM', gettext('Migrate')],
1851 qmmove
: ['VM', gettext('Move disk')],
1852 qmpause
: ['VM', gettext('Pause')],
1853 qmreboot
: ['VM', gettext('Reboot')],
1854 qmreset
: ['VM', gettext('Reset')],
1855 qmrestore
: ['VM', gettext('Restore')],
1856 qmresume
: ['VM', gettext('Resume')],
1857 qmrollback
: ['VM', gettext('Rollback')],
1858 qmshutdown
: ['VM', gettext('Shutdown')],
1859 qmsnapshot
: ['VM', gettext('Snapshot')],
1860 qmstart
: ['VM', gettext('Start')],
1861 qmstop
: ['VM', gettext('Stop')],
1862 qmsuspend
: ['VM', gettext('Hibernate')],
1863 qmtemplate
: ['VM', gettext('Convert to template')],
1864 spiceproxy
: ['VM/CT', gettext('Console') + ' (Spice)'],
1865 spiceshell
: ['', gettext('Shell') + ' (Spice)'],
1866 startall
: ['', gettext('Start all VMs and Containers')],
1867 stopall
: ['', gettext('Stop all VMs and Containers')],
1868 unknownimgdel
: ['', gettext('Destroy image from unknown guest')],
1869 wipedisk
: ['Device', gettext('Wipe Disk')],
1870 vncproxy
: ['VM/CT', gettext('Console')],
1871 vncshell
: ['', gettext('Shell')],
1872 vzclone
: ['CT', gettext('Clone')],
1873 vzcreate
: ['CT', gettext('Create')],
1874 vzdelsnapshot
: ['CT', gettext('Delete Snapshot')],
1875 vzdestroy
: ['CT', gettext('Destroy')],
1876 vzdump
: (type
, id
) => id
? `VM/CT ${id} - ${gettext('Backup')}` : gettext('Backup Job'),
1877 vzmigrate
: ['CT', gettext('Migrate')],
1878 vzmount
: ['CT', gettext('Mount')],
1879 vzreboot
: ['CT', gettext('Reboot')],
1880 vzrestore
: ['CT', gettext('Restore')],
1881 vzresume
: ['CT', gettext('Resume')],
1882 vzrollback
: ['CT', gettext('Rollback')],
1883 vzshutdown
: ['CT', gettext('Shutdown')],
1884 vzsnapshot
: ['CT', gettext('Snapshot')],
1885 vzstart
: ['CT', gettext('Start')],
1886 vzstop
: ['CT', gettext('Stop')],
1887 vzsuspend
: ['CT', gettext('Suspend')],
1888 vztemplate
: ['CT', gettext('Convert to template')],
1889 vzumount
: ['CT', gettext('Unmount')],
1890 zfscreate
: [gettext('ZFS Storage'), gettext('Create')],
1891 zfsremove
: ['ZFS Pool', gettext('Remove')],