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
549 '__default__': Proxmox
.Utils
.defaultText
,
553 'de-ch': 'German (Swiss)',
554 'en-gb': 'English (UK)',
555 'en-us': 'English (USA)',
559 //fo: 'Faroe Islands',
561 'fr-be': 'French (Belgium)',
562 'fr-ca': 'French (Canada)',
563 'fr-ch': 'French (Swiss)',
573 //'nl-be': 'Dutch (Belgium)',
577 'pt-br': 'Portuguese (Brazil)',
586 '__default__': Proxmox
.Utils
.defaultText
,
587 std
: gettext('Standard VGA'),
588 vmware
: gettext('VMware compatible'),
590 qxl2
: 'SPICE dual monitor',
591 qxl3
: 'SPICE three monitors',
592 qxl4
: 'SPICE four monitors',
593 serial0
: gettext('Serial terminal') + ' 0',
594 serial1
: gettext('Serial terminal') + ' 1',
595 serial2
: gettext('Serial terminal') + ' 2',
596 serial3
: gettext('Serial terminal') + ' 3',
597 virtio
: 'VirtIO-GPU',
598 none
: Proxmox
.Utils
.noneText
,
601 render_kvm_language: function(value
) {
603 return Proxmox
.Utils
.defaultText
;
605 let text
= PVE
.Utils
.kvm_keymaps
[value
];
606 return text
? `${text} (${value})` : value
;
610 '__default__': Proxmox
.Utils
.defaultText
+ ' (xterm.js)',
611 'vv': 'SPICE (remote-viewer)',
612 'html5': 'HTML5 (noVNC)',
613 'xtermjs': 'xterm.js',
616 render_console_viewer: function(value
) {
617 value
= value
|| '__default__';
618 return PVE
.Utils
.console_map
[value
] || value
;
621 render_kvm_vga_driver: function(value
) {
623 return Proxmox
.Utils
.defaultText
;
625 let vga
= PVE
.Parser
.parsePropertyString(value
, 'type');
626 let text
= PVE
.Utils
.kvm_vga_drivers
[vga
.type
];
628 text
= Proxmox
.Utils
.defaultText
;
630 return text
? `${text} (${value})` : value
;
633 render_kvm_startup: function(value
) {
634 var startup
= PVE
.Parser
.parseStartup(value
);
637 if (startup
.order
=== undefined) {
640 res
+= startup
.order
;
642 if (startup
.up
!== undefined) {
643 res
+= ',up=' + startup
.up
;
645 if (startup
.down
!== undefined) {
646 res
+= ',down=' + startup
.down
;
652 extractFormActionError: function(action
) {
654 switch (action
.failureType
) {
655 case Ext
.form
.action
.Action
.CLIENT_INVALID
:
656 msg
= gettext('Form fields may not be submitted with invalid values');
658 case Ext
.form
.action
.Action
.CONNECT_FAILURE
:
659 msg
= gettext('Connection error');
660 var resp
= action
.response
;
661 if (resp
.status
&& resp
.statusText
) {
662 msg
+= " " + resp
.status
+ ": " + resp
.statusText
;
665 case Ext
.form
.action
.Action
.LOAD_FAILURE
:
666 case Ext
.form
.action
.Action
.SERVER_INVALID
:
667 msg
= Proxmox
.Utils
.extractRequestError(action
.result
, true);
674 'images': gettext('Disk image'),
675 'backup': gettext('VZDump backup file'),
676 'vztmpl': gettext('Container template'),
677 'iso': gettext('ISO image'),
678 'rootdir': gettext('Container'),
679 'snippets': gettext('Snippets'),
682 volume_is_qemu_backup: function(volid
, format
) {
683 return format
=== 'pbs-vm' || volid
.match(':backup/vzdump-qemu-');
686 volume_is_lxc_backup: function(volid
, format
) {
687 return format
=== 'pbs-ct' || volid
.match(':backup/vzdump-(lxc|openvz)-');
692 name
: gettext('Active Directory Server'),
693 ipanel
: 'pveAuthADPanel',
694 syncipanel
: 'pveAuthLDAPSyncPanel',
700 name
: gettext('LDAP Server'),
701 ipanel
: 'pveAuthLDAPPanel',
702 syncipanel
: 'pveAuthLDAPSyncPanel',
708 name
: gettext('OpenID Connect Server'),
709 ipanel
: 'pveAuthOpenIDPanel',
713 iconCls
: 'pmx-itype-icon-openid-logo',
717 ipanel
: 'pveAuthBasePanel',
723 name
: 'Proxmox VE authentication server',
724 ipanel
: 'pveAuthBasePanel',
733 name
: Proxmox
.Utils
.directoryText
,
734 ipanel
: 'DirInputPanel',
740 ipanel
: 'LVMInputPanel',
746 ipanel
: 'LvmThinInputPanel',
752 ipanel
: 'BTRFSInputPanel',
758 ipanel
: 'NFSInputPanel',
764 ipanel
: 'CIFSInputPanel',
770 ipanel
: 'GlusterFsInputPanel',
776 ipanel
: 'IScsiInputPanel',
782 ipanel
: 'CephFSInputPanel',
787 name
: 'CephFS (PVE)',
788 ipanel
: 'CephFSInputPanel',
795 ipanel
: 'RBDInputPanel',
801 ipanel
: 'RBDInputPanel',
807 name
: 'ZFS over iSCSI',
808 ipanel
: 'ZFSInputPanel',
814 ipanel
: 'ZFSPoolInputPanel',
819 name
: 'Proxmox Backup Server',
820 ipanel
: 'PBSInputPanel',
845 ipanel
: 'SimpleInputPanel',
850 ipanel
: 'VlanInputPanel',
855 ipanel
: 'QinQInputPanel',
860 ipanel
: 'VxlanInputPanel',
865 ipanel
: 'EvpnInputPanel',
870 sdncontrollerSchema
: {
877 ipanel
: 'EvpnInputPanel',
878 faIcon
: 'crosshairs',
882 ipanel
: 'BgpInputPanel',
883 faIcon
: 'crosshairs',
894 ipanel
: 'PVEIpamInputPanel',
900 ipanel
: 'NetboxInputPanel',
905 ipanel
: 'PhpIpamInputPanel',
917 ipanel
: 'PowerdnsInputPanel',
922 format_sdnvnet_type: function(value
, md
, record
) {
923 var schema
= PVE
.Utils
.sdnvnetSchema
[value
];
927 return Proxmox
.Utils
.unknownText
;
930 format_sdnzone_type: function(value
, md
, record
) {
931 var schema
= PVE
.Utils
.sdnzoneSchema
[value
];
935 return Proxmox
.Utils
.unknownText
;
938 format_sdncontroller_type: function(value
, md
, record
) {
939 var schema
= PVE
.Utils
.sdncontrollerSchema
[value
];
943 return Proxmox
.Utils
.unknownText
;
946 format_sdnipam_type: function(value
, md
, record
) {
947 var schema
= PVE
.Utils
.sdnipamSchema
[value
];
951 return Proxmox
.Utils
.unknownText
;
954 format_sdndns_type: function(value
, md
, record
) {
955 var schema
= PVE
.Utils
.sdndnsSchema
[value
];
959 return Proxmox
.Utils
.unknownText
;
962 format_storage_type: function(value
, md
, record
) {
963 if (value
=== 'rbd') {
964 value
= !record
|| record
.get('monhost') ? 'rbd' : 'pveceph';
965 } else if (value
=== 'cephfs') {
966 value
= !record
|| record
.get('monhost') ? 'cephfs' : 'pvecephfs';
969 let schema
= PVE
.Utils
.storageSchema
[value
];
970 return schema
?.name
?? value
;
973 format_ha: function(value
) {
974 var text
= Proxmox
.Utils
.noneText
;
977 text
= value
.state
|| Proxmox
.Utils
.noneText
;
979 text
+= ', ' + Proxmox
.Utils
.groupText
+ ': ';
980 text
+= value
.group
|| Proxmox
.Utils
.noneText
;
986 format_content_types: function(value
) {
987 return value
.split(',').sort().map(function(ct
) {
988 return PVE
.Utils
.contentTypes
[ct
] || ct
;
992 render_storage_content: function(value
, metaData
, record
) {
993 var data
= record
.data
;
994 if (Ext
.isNumber(data
.channel
) &&
995 Ext
.isNumber(data
.id
) &&
996 Ext
.isNumber(data
.lun
)) {
998 Ext
.String
.leftPad(data
.channel
, 2, '0') +
999 " ID " + data
.id
+ " LUN " + data
.lun
;
1001 return data
.volid
.replace(/^.*?:(.*?\/)?/, '');
1004 render_serverity: function(value
) {
1005 return PVE
.Utils
.log_severity_hash
[value
] || value
;
1008 calculate_hostcpu: function(data
) {
1009 if (!(data
.uptime
&& Ext
.isNumeric(data
.cpu
))) {
1013 if (data
.type
!== 'qemu' && data
.type
!== 'lxc') {
1017 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + data
.node
);
1018 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1019 if (!Ext
.isDefined(node
) || node
=== null) {
1022 var maxcpu
= node
.data
.maxcpu
|| 1;
1024 if (!Ext
.isNumeric(maxcpu
) && (maxcpu
>= 1)) {
1028 return (data
.cpu
/maxcpu
) * data
.maxcpu
;
1031 render_hostcpu: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1032 if (!(record
.data
.uptime
&& Ext
.isNumeric(record
.data
.cpu
))) {
1036 if (record
.data
.type
!== 'qemu' && record
.data
.type
!== 'lxc') {
1040 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + record
.data
.node
);
1041 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1042 if (!Ext
.isDefined(node
) || node
=== null) {
1045 var maxcpu
= node
.data
.maxcpu
|| 1;
1047 if (!Ext
.isNumeric(maxcpu
) && (maxcpu
>= 1)) {
1051 var per
= (record
.data
.cpu
/maxcpu
) * record
.data
.maxcpu
* 100;
1053 return per
.toFixed(1) + '% of ' + maxcpu
.toString() + (maxcpu
> 1 ? 'CPUs' : 'CPU');
1056 render_bandwidth: function(value
) {
1057 if (!Ext
.isNumeric(value
)) {
1061 return Proxmox
.Utils
.format_size(value
) + '/s';
1064 render_timestamp_human_readable: function(value
) {
1065 return Ext
.Date
.format(new Date(value
* 1000), 'l d F Y H:i:s');
1068 // render a timestamp or pending
1069 render_next_event: function(value
) {
1073 let now
= new Date(), next
= new Date(value
* 1000);
1075 return gettext('pending');
1077 return Proxmox
.Utils
.render_timestamp(value
);
1080 calculate_mem_usage: function(data
) {
1081 if (!Ext
.isNumeric(data
.mem
) ||
1082 data
.maxmem
=== 0 ||
1087 return data
.mem
/ data
.maxmem
;
1090 calculate_hostmem_usage: function(data
) {
1091 if (data
.type
!== 'qemu' && data
.type
!== 'lxc') {
1095 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + data
.node
);
1096 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1098 if (!Ext
.isDefined(node
) || node
=== null) {
1101 var maxmem
= node
.data
.maxmem
|| 0;
1103 if (!Ext
.isNumeric(data
.mem
) ||
1109 return data
.mem
/ maxmem
;
1112 render_mem_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1113 if (!Ext
.isNumeric(value
) || value
=== -1) {
1117 // we got no percentage but bytes
1119 var maxmem
= record
.data
.maxmem
;
1120 if (!record
.data
.uptime
||
1122 !Ext
.isNumeric(mem
)) {
1126 return (mem
*100/maxmem
).toFixed(1) + " %";
1128 return (value
*100).toFixed(1) + " %";
1131 render_hostmem_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1132 if (!Ext
.isNumeric(record
.data
.mem
) || value
=== -1) {
1136 if (record
.data
.type
!== 'qemu' && record
.data
.type
!== 'lxc') {
1140 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + record
.data
.node
);
1141 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1142 var maxmem
= node
.data
.maxmem
|| 0;
1144 if (record
.data
.mem
> 1) {
1145 // we got no percentage but bytes
1146 var mem
= record
.data
.mem
;
1147 if (!record
.data
.uptime
||
1149 !Ext
.isNumeric(mem
)) {
1153 return ((mem
*100)/maxmem
).toFixed(1) + " %";
1155 return (value
*100).toFixed(1) + " %";
1158 render_mem_usage: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1160 var maxmem
= record
.data
.maxmem
;
1162 if (!record
.data
.uptime
) {
1166 if (!(Ext
.isNumeric(mem
) && maxmem
)) {
1170 return Proxmox
.Utils
.render_size(value
);
1173 calculate_disk_usage: function(data
) {
1174 if (!Ext
.isNumeric(data
.disk
) ||
1175 ((data
.type
=== 'qemu' || data
.type
=== 'lxc') && data
.uptime
=== 0) ||
1181 return data
.disk
/ data
.maxdisk
;
1184 render_disk_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1185 if (!Ext
.isNumeric(value
) || value
=== -1) {
1189 return (value
* 100).toFixed(1) + " %";
1192 render_disk_usage: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1194 var maxdisk
= record
.data
.maxdisk
;
1195 var type
= record
.data
.type
;
1197 if (!Ext
.isNumeric(disk
) ||
1199 ((type
=== 'qemu' || type
=== 'lxc') && record
.data
.uptime
=== 0)
1204 return Proxmox
.Utils
.render_size(value
);
1207 get_object_icon_class: function(type
, record
) {
1211 if (type
=== 'type') {
1213 objType
= record
.groupbyid
;
1214 } else if (record
.template
) {
1216 objType
= 'template';
1220 status
= record
.status
+ ' ha-' + record
.hastate
;
1224 status
+= ' locked lock-' + record
.lock
;
1227 var defaults
= PVE
.tree
.ResourceTree
.typeDefaults
[objType
];
1228 if (defaults
&& defaults
.iconCls
) {
1229 var retVal
= defaults
.iconCls
+ ' ' + status
;
1236 render_resource_type: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1237 var cls
= PVE
.Utils
.get_object_icon_class(value
, record
.data
);
1239 var fa
= '<i class="fa-fw x-grid-icon-custom ' + cls
+ '"></i> ';
1243 render_support_level: function(value
, metaData
, record
) {
1244 return PVE
.Utils
.support_level_hash
[value
] || '-';
1247 render_upid: function(value
, metaData
, record
) {
1248 var type
= record
.data
.type
;
1249 var id
= record
.data
.id
;
1251 return Proxmox
.Utils
.format_task_description(type
, id
);
1254 render_optional_url: function(value
) {
1255 if (value
&& value
.match(/^https?:\/\//)) {
1256 return '<a target="_blank" href="' + value
+ '">' + value
+ '</a>';
1261 render_san: function(value
) {
1263 if (Ext
.isArray(value
)) {
1264 value
.forEach(function(val
) {
1265 if (!Ext
.isNumber(val
)) {
1269 return names
.join('<br>');
1274 render_full_name: function(firstname
, metaData
, record
) {
1275 var first
= firstname
|| '';
1276 var last
= record
.data
.lastname
|| '';
1277 return Ext
.htmlEncode(first
+ " " + last
);
1280 windowHostname: function() {
1281 return window
.location
.hostname
.replace(Proxmox
.Utils
.IP6_bracket_match
,
1282 function(m
, addr
, offset
, original
) { return addr
; });
1285 openDefaultConsoleWindow: function(consoles
, consoleType
, vmid
, nodename
, vmname
, cmd
) {
1286 var dv
= PVE
.Utils
.defaultViewer(consoles
, consoleType
);
1287 PVE
.Utils
.openConsoleWindow(dv
, consoleType
, vmid
, nodename
, vmname
, cmd
);
1290 openConsoleWindow: function(viewer
, consoleType
, vmid
, nodename
, vmname
, cmd
) {
1291 if (vmid
=== undefined && (consoleType
=== 'kvm' || consoleType
=== 'lxc')) {
1292 throw "missing vmid";
1295 throw "no nodename specified";
1298 if (viewer
=== 'html5') {
1299 PVE
.Utils
.openVNCViewer(consoleType
, vmid
, nodename
, vmname
, cmd
);
1300 } else if (viewer
=== 'xtermjs') {
1301 Proxmox
.Utils
.openXtermJsViewer(consoleType
, vmid
, nodename
, vmname
, cmd
);
1302 } else if (viewer
=== 'vv') {
1303 let url
= '/nodes/' + nodename
+ '/spiceshell';
1305 proxy
: PVE
.Utils
.windowHostname(),
1307 if (consoleType
=== 'kvm') {
1308 url
= '/nodes/' + nodename
+ '/qemu/' + vmid
.toString() + '/spiceproxy';
1309 } else if (consoleType
=== 'lxc') {
1310 url
= '/nodes/' + nodename
+ '/lxc/' + vmid
.toString() + '/spiceproxy';
1311 } else if (consoleType
=== 'upgrade') {
1312 params
.cmd
= 'upgrade';
1313 } else if (consoleType
=== 'cmd') {
1315 } else if (consoleType
!== 'shell') {
1316 throw `unknown spice viewer type '${consoleType}'`;
1318 PVE
.Utils
.openSpiceViewer(url
, params
);
1320 throw `unknown viewer type '${viewer}'`;
1324 defaultViewer: function(consoles
, type
) {
1325 var allowSpice
, allowXtermjs
;
1327 if (consoles
=== true) {
1329 allowXtermjs
= true;
1330 } else if (typeof consoles
=== 'object') {
1331 allowSpice
= consoles
.spice
;
1332 allowXtermjs
= !!consoles
.xtermjs
;
1334 let dv
= PVE
.VersionInfo
.console
|| (type
=== 'kvm' ? 'vv' : 'xtermjs');
1335 if (dv
=== 'vv' && !allowSpice
) {
1336 dv
= allowXtermjs
? 'xtermjs' : 'html5';
1337 } else if (dv
=== 'xtermjs' && !allowXtermjs
) {
1338 dv
= allowSpice
? 'vv' : 'html5';
1344 openVNCViewer: function(vmtype
, vmid
, nodename
, vmname
, cmd
) {
1345 let scaling
= 'off';
1346 if (Proxmox
.Utils
.toolkit
!== 'touch') {
1347 var sp
= Ext
.state
.Manager
.getProvider();
1348 scaling
= sp
.get('novnc-scaling', 'off');
1350 var url
= Ext
.Object
.toQueryString({
1351 console
: vmtype
, // kvm, lxc, upgrade or shell
1359 var nw
= window
.open("?" + url
, '_blank', "innerWidth=745,innerheight=427");
1365 openSpiceViewer: function(url
, params
) {
1366 var downloadWithName = function(uri
, name
) {
1367 var link
= Ext
.DomHelper
.append(document
.body
, {
1370 css
: 'display:none;visibility:hidden;height:0px;',
1373 // Note: we need to tell Android and Chrome the correct file name extension
1374 // but we do not set 'download' tag for other environments, because
1375 // It can have strange side effects (additional user prompt on firefox)
1376 if (navigator
.userAgent
.match(/Android|Chrome/i)) {
1377 link
.download
= name
;
1380 if (link
.fireEvent
) {
1381 link
.fireEvent('onclick');
1383 let evt
= document
.createEvent("MouseEvents");
1384 evt
.initMouseEvent('click', true, true, window
, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
1385 link
.dispatchEvent(evt
);
1389 Proxmox
.Utils
.API2Request({
1393 failure: function(response
, opts
) {
1394 Ext
.Msg
.alert('Error', response
.htmlStatus
);
1396 success: function(response
, opts
) {
1397 let cfg
= response
.result
.data
;
1398 let raw
= Object
.entries(cfg
).reduce((acc
, [k
, v
]) => acc
+ `${k}=${v}\n`, "[virt-viewer]\n");
1399 let spiceDownload
= 'data:application/x-virt-viewer;charset=UTF-8,' + encodeURIComponent(raw
);
1400 downloadWithName(spiceDownload
, "pve-spice.vv");
1405 openTreeConsole: function(tree
, record
, item
, index
, e
) {
1407 let nodename
= record
.data
.node
;
1408 let vmid
= record
.data
.vmid
;
1409 let vmname
= record
.data
.name
;
1410 if (record
.data
.type
=== 'qemu' && !record
.data
.template
) {
1411 Proxmox
.Utils
.API2Request({
1412 url
: `/nodes/${nodename}/qemu/${vmid}/status/current`,
1413 failure
: response
=> Ext
.Msg
.alert('Error', response
.htmlStatus
),
1414 success: function(response
, opts
) {
1415 let conf
= response
.result
.data
;
1417 spice
: !!conf
.spice
,
1418 xtermjs
: !!conf
.serial
,
1420 PVE
.Utils
.openDefaultConsoleWindow(consoles
, 'kvm', vmid
, nodename
, vmname
);
1423 } else if (record
.data
.type
=== 'lxc' && !record
.data
.template
) {
1424 PVE
.Utils
.openDefaultConsoleWindow(true, 'lxc', vmid
, nodename
, vmname
);
1428 // test automation helper
1429 call_menu_handler: function(menu
, text
) {
1430 let item
= menu
.query('menuitem').find(el
=> el
.text
=== text
);
1431 if (item
&& item
.handler
) {
1436 createCmdMenu: function(v
, record
, item
, index
, event
) {
1438 if (!(v
instanceof Ext
.tree
.View
)) {
1442 let type
= record
.data
.type
;
1444 if (record
.data
.template
) {
1445 if (type
=== 'qemu' || type
=== 'lxc') {
1446 menu
= Ext
.create('PVE.menu.TemplateMenu', {
1450 } else if (type
=== 'qemu' || type
=== 'lxc' || type
=== 'node') {
1451 menu
= Ext
.create('PVE.' + type
+ '.CmdMenu', {
1453 nodename
: record
.data
.node
,
1459 menu
.showAt(event
.getXY());
1463 // helper for deleting field which are set to there default values
1464 delete_if_default: function(values
, fieldname
, default_val
, create
) {
1465 if (values
[fieldname
] === '' || values
[fieldname
] === default_val
) {
1467 if (values
.delete) {
1468 if (Ext
.isArray(values
.delete)) {
1469 values
.delete.push(fieldname
);
1471 values
.delete += ',' + fieldname
;
1474 values
.delete = fieldname
;
1478 delete values
[fieldname
];
1482 loadSSHKeyFromFile: function(file
, callback
) {
1483 // ssh-keygen produces ~ 740 bytes for a 4096 bit RSA key, current max is 16 kbit, so assume:
1484 // 740 * 8 for max. 32kbit (5920 bytes), round upwards to 8192 bytes, leaves lots of comment space
1485 PVE
.Utils
.loadFile(file
, callback
, 8192);
1488 loadFile: function(file
, callback
, maxSize
) {
1489 maxSize
= maxSize
|| 32 * 1024;
1490 if (file
.size
> maxSize
) {
1491 Ext
.Msg
.alert(gettext('Error'), `${gettext("Invalid file size")}: ${file.size} > ${maxSize}`);
1494 let reader
= new FileReader();
1495 reader
.onload
= evt
=> callback(evt
.target
.result
);
1496 reader
.readAsText(file
);
1499 loadTextFromFile: function(file
, callback
, maxBytes
) {
1500 let maxSize
= maxBytes
|| 8192;
1501 if (file
.size
> maxSize
) {
1502 Ext
.Msg
.alert(gettext('Error'), gettext("Invalid file size: ") + file
.size
);
1505 let reader
= new FileReader();
1506 reader
.onload
= evt
=> callback(evt
.target
.result
);
1507 reader
.readAsText(file
);
1510 diskControllerMaxIDs
: {
1518 // types is either undefined (all busses), an array of busses, or a single bus
1519 forEachBus: function(types
, func
) {
1520 let busses
= Object
.keys(PVE
.Utils
.diskControllerMaxIDs
);
1522 if (Ext
.isArray(types
)) {
1524 } else if (Ext
.isDefined(types
)) {
1528 // check if we only have valid busses
1529 for (let i
= 0; i
< busses
.length
; i
++) {
1530 if (!PVE
.Utils
.diskControllerMaxIDs
[busses
[i
]]) {
1531 throw "invalid bus: '" + busses
[i
] + "'";
1535 for (let i
= 0; i
< busses
.length
; i
++) {
1536 let count
= PVE
.Utils
.diskControllerMaxIDs
[busses
[i
]];
1537 for (let j
= 0; j
< count
; j
++) {
1538 let cont
= func(busses
[i
], j
);
1539 if (!cont
&& cont
!== undefined) {
1551 forEachMP: function(func
, includeUnused
) {
1552 for (let i
= 0; i
< PVE
.Utils
.mp_counts
.mp
; i
++) {
1553 let cont
= func('mp', i
);
1554 if (!cont
&& cont
!== undefined) {
1559 if (!includeUnused
) {
1563 for (let i
= 0; i
< PVE
.Utils
.mp_counts
.unused
; i
++) {
1564 let cont
= func('unused', i
);
1565 if (!cont
&& cont
!== undefined) {
1571 hardware_counts
: { net
: 32, usb
: 5, hostpci
: 16, audio
: 1, efidisk
: 1, serial
: 4, rng
: 1, tpmstate
: 1 },
1573 cleanEmptyObjectKeys: function(obj
) {
1574 for (const propName
of Object
.keys(obj
)) {
1575 if (obj
[propName
] === null || obj
[propName
] === undefined) {
1576 delete obj
[propName
];
1581 acmedomain_count
: 5,
1583 add_domain_to_acme: function(acme
, domain
) {
1584 if (acme
.domains
=== undefined) {
1585 acme
.domains
= [domain
];
1587 acme
.domains
.push(domain
);
1588 acme
.domains
= acme
.domains
.filter((value
, index
, self
) => self
.indexOf(value
) === index
);
1593 remove_domain_from_acme: function(acme
, domain
) {
1594 if (acme
.domains
!== undefined) {
1597 .filter((value
, index
, self
) => self
.indexOf(value
) === index
&& value
!== domain
);
1602 handleStoreErrorOrMask: function(view
, store
, regex
, callback
) {
1603 view
.mon(store
, 'load', function(proxy
, response
, success
, operation
) {
1605 Proxmox
.Utils
.setErrorMask(view
, false);
1609 if (operation
.error
.statusText
) {
1610 if (operation
.error
.statusText
.match(regex
)) {
1611 callback(view
, operation
.error
);
1614 msg
= operation
.error
.statusText
+ ' (' + operation
.error
.status
+ ')';
1617 msg
= gettext('Connection error');
1619 Proxmox
.Utils
.setErrorMask(view
, msg
);
1623 showCephInstallOrMask: function(container
, msg
, nodename
, callback
) {
1624 if (msg
.match(/not (installed|initialized)/i)) {
1625 if (Proxmox
.UserName
=== 'root@pam') {
1626 container
.el
.mask();
1627 if (!container
.down('pveCephInstallWindow')) {
1628 var isInstalled
= !!msg
.match(/not initialized/i);
1629 var win
= Ext
.create('PVE.ceph.Install', {
1632 win
.getViewModel().set('isInstalled', isInstalled
);
1638 container
.mask(Ext
.String
.format(gettext('{0} not installed.') +
1639 ' ' + gettext('Log in as root to install.'), 'Ceph'), ['pve-static-mask']);
1647 monitor_ceph_installed: function(view
, rstore
, nodename
, maskOwnerCt
) {
1648 PVE
.Utils
.handleStoreErrorOrMask(
1651 /not (installed|initialized)/i,
1653 nodename
= nodename
|| 'localhost';
1654 let maskTarget
= maskOwnerCt
? view
.ownerCt
: view
;
1655 rstore
.stopUpdate();
1656 PVE
.Utils
.showCephInstallOrMask(maskTarget
, error
.statusText
, nodename
, win
=> {
1657 view
.mon(win
, 'cephInstallWindowClosed', () => rstore
.startUpdate());
1664 propertyStringSet: function(target
, source
, name
, value
) {
1666 if (value
=== undefined) {
1667 target
[name
] = source
;
1669 target
[name
] = value
;
1672 delete target
[name
];
1676 forEachCorosyncLink: function(nodeinfo
, cb
) {
1677 let re
= /(?:ring|link)(\d+)_addr/;
1678 Ext
.iterate(nodeinfo
, (prop
, val
) => {
1679 let match
= re
.exec(prop
);
1681 cb(Number(match
[1]), val
);
1688 'AuthenticAMD': 'AMD',
1689 'GenuineIntel': 'Intel',
1697 "_default_": 5, // includes custom models
1700 verify_ip64_address_list: function(value
, with_suffix
) {
1701 for (let addr
of value
.split(/[ ,;]+/)) {
1707 let parts
= addr
.split('%');
1710 if (parts
.length
> 2) {
1714 if (parts
.length
> 1 && !addr
.startsWith('fe80:')) {
1719 if (!Proxmox
.Utils
.IP64_match
.test(addr
)) {
1727 sortByPreviousUsage: function(vmconfig
, controllerList
) {
1728 if (!controllerList
) {
1729 controllerList
= ['ide', 'virtio', 'scsi', 'sata'];
1731 let usedControllers
= {};
1732 for (const type
of Object
.keys(PVE
.Utils
.diskControllerMaxIDs
)) {
1733 usedControllers
[type
] = 0;
1736 for (const property
of Object
.keys(vmconfig
)) {
1737 if (property
.match(PVE
.Utils
.bus_match
) && !vmconfig
[property
].match(/media=cdrom/)) {
1738 const foundController
= property
.match(PVE
.Utils
.bus_match
)[1];
1739 usedControllers
[foundController
]++;
1743 let sortPriority
= PVE
.qemu
.OSDefaults
.getDefaults(vmconfig
.ostype
).busPriority
;
1745 let sortedList
= Ext
.clone(controllerList
);
1746 sortedList
.sort(function(a
, b
) {
1747 if (usedControllers
[b
] === usedControllers
[a
]) {
1748 return sortPriority
[b
] - sortPriority
[a
];
1750 return usedControllers
[b
] - usedControllers
[a
];
1756 nextFreeDisk: function(controllers
, config
) {
1757 for (const controller
of controllers
) {
1758 for (let i
= 0; i
< PVE
.Utils
.diskControllerMaxIDs
[controller
]; i
++) {
1759 let confid
= controller
+ i
.toString();
1760 if (!Ext
.isDefined(config
[confid
])) {
1773 nextFreeMP: function(type
, config
) {
1774 for (let i
= 0; i
< PVE
.Utils
.mp_counts
[type
]; i
++) {
1775 let confid
= `${type}${i}`;
1776 if (!Ext
.isDefined(config
[confid
])) {
1790 constructor: function() {
1792 Ext
.apply(me
, me
.utilities
);
1794 Proxmox
.Utils
.override_task_descriptions({
1795 acmedeactivate
: ['ACME Account', gettext('Deactivate')],
1796 acmenewcert
: ['SRV', gettext('Order Certificate')],
1797 acmerefresh
: ['ACME Account', gettext('Refresh')],
1798 acmeregister
: ['ACME Account', gettext('Register')],
1799 acmerenew
: ['SRV', gettext('Renew Certificate')],
1800 acmerevoke
: ['SRV', gettext('Revoke Certificate')],
1801 acmeupdate
: ['ACME Account', gettext('Update')],
1802 'auth-realm-sync': [gettext('Realm'), gettext('Sync')],
1803 'auth-realm-sync-test': [gettext('Realm'), gettext('Sync Preview')],
1804 cephcreatemds
: ['Ceph Metadata Server', gettext('Create')],
1805 cephcreatemgr
: ['Ceph Manager', gettext('Create')],
1806 cephcreatemon
: ['Ceph Monitor', gettext('Create')],
1807 cephcreateosd
: ['Ceph OSD', gettext('Create')],
1808 cephcreatepool
: ['Ceph Pool', gettext('Create')],
1809 cephdestroymds
: ['Ceph Metadata Server', gettext('Destroy')],
1810 cephdestroymgr
: ['Ceph Manager', gettext('Destroy')],
1811 cephdestroymon
: ['Ceph Monitor', gettext('Destroy')],
1812 cephdestroyosd
: ['Ceph OSD', gettext('Destroy')],
1813 cephdestroypool
: ['Ceph Pool', gettext('Destroy')],
1814 cephdestroyfs
: ['CephFS', gettext('Destroy')],
1815 cephfscreate
: ['CephFS', gettext('Create')],
1816 cephsetpool
: ['Ceph Pool', gettext('Edit')],
1817 cephsetflags
: ['', gettext('Change global Ceph flags')],
1818 clustercreate
: ['', gettext('Create Cluster')],
1819 clusterjoin
: ['', gettext('Join Cluster')],
1820 dircreate
: [gettext('Directory Storage'), gettext('Create')],
1821 dirremove
: [gettext('Directory'), gettext('Remove')],
1822 download
: [gettext('File'), gettext('Download')],
1823 hamigrate
: ['HA', gettext('Migrate')],
1824 hashutdown
: ['HA', gettext('Shutdown')],
1825 hastart
: ['HA', gettext('Start')],
1826 hastop
: ['HA', gettext('Stop')],
1827 imgcopy
: ['', gettext('Copy data')],
1828 imgdel
: ['', gettext('Erase data')],
1829 lvmcreate
: [gettext('LVM Storage'), gettext('Create')],
1830 lvmremove
: ['Volume Group', gettext('Remove')],
1831 lvmthincreate
: [gettext('LVM-Thin Storage'), gettext('Create')],
1832 lvmthinremove
: ['Thinpool', gettext('Remove')],
1833 migrateall
: ['', gettext('Migrate all VMs and Containers')],
1834 'move_volume': ['CT', gettext('Move Volume')],
1835 'pbs-download': ['VM/CT', gettext('File Restore Download')],
1836 pull_file
: ['CT', gettext('Pull file')],
1837 push_file
: ['CT', gettext('Push file')],
1838 qmclone
: ['VM', gettext('Clone')],
1839 qmconfig
: ['VM', gettext('Configure')],
1840 qmcreate
: ['VM', gettext('Create')],
1841 qmdelsnapshot
: ['VM', gettext('Delete Snapshot')],
1842 qmdestroy
: ['VM', gettext('Destroy')],
1843 qmigrate
: ['VM', gettext('Migrate')],
1844 qmmove
: ['VM', gettext('Move disk')],
1845 qmpause
: ['VM', gettext('Pause')],
1846 qmreboot
: ['VM', gettext('Reboot')],
1847 qmreset
: ['VM', gettext('Reset')],
1848 qmrestore
: ['VM', gettext('Restore')],
1849 qmresume
: ['VM', gettext('Resume')],
1850 qmrollback
: ['VM', gettext('Rollback')],
1851 qmshutdown
: ['VM', gettext('Shutdown')],
1852 qmsnapshot
: ['VM', gettext('Snapshot')],
1853 qmstart
: ['VM', gettext('Start')],
1854 qmstop
: ['VM', gettext('Stop')],
1855 qmsuspend
: ['VM', gettext('Hibernate')],
1856 qmtemplate
: ['VM', gettext('Convert to template')],
1857 spiceproxy
: ['VM/CT', gettext('Console') + ' (Spice)'],
1858 spiceshell
: ['', gettext('Shell') + ' (Spice)'],
1859 startall
: ['', gettext('Start all VMs and Containers')],
1860 stopall
: ['', gettext('Stop all VMs and Containers')],
1861 unknownimgdel
: ['', gettext('Destroy image from unknown guest')],
1862 wipedisk
: ['Device', gettext('Wipe Disk')],
1863 vncproxy
: ['VM/CT', gettext('Console')],
1864 vncshell
: ['', gettext('Shell')],
1865 vzclone
: ['CT', gettext('Clone')],
1866 vzcreate
: ['CT', gettext('Create')],
1867 vzdelsnapshot
: ['CT', gettext('Delete Snapshot')],
1868 vzdestroy
: ['CT', gettext('Destroy')],
1869 vzdump
: (type
, id
) => id
? `VM/CT ${id} - ${gettext('Backup')}` : gettext('Backup Job'),
1870 vzmigrate
: ['CT', gettext('Migrate')],
1871 vzmount
: ['CT', gettext('Mount')],
1872 vzreboot
: ['CT', gettext('Reboot')],
1873 vzrestore
: ['CT', gettext('Restore')],
1874 vzresume
: ['CT', gettext('Resume')],
1875 vzrollback
: ['CT', gettext('Rollback')],
1876 vzshutdown
: ['CT', gettext('Shutdown')],
1877 vzsnapshot
: ['CT', gettext('Snapshot')],
1878 vzstart
: ['CT', gettext('Start')],
1879 vzstop
: ['CT', gettext('Stop')],
1880 vzsuspend
: ['CT', gettext('Suspend')],
1881 vztemplate
: ['CT', gettext('Convert to template')],
1882 vzumount
: ['CT', gettext('Unmount')],
1883 zfscreate
: [gettext('ZFS Storage'), gettext('Create')],
1884 zfsremove
: ['ZFS Pool', gettext('Remove')],