]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/Utils.js
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: function(value
) {
509 return !value
? Proxmox
.Utils
.defaultText
510 : PVE
.Parser
.printPropertyString(value
);
513 render_scsihw: function(value
) {
515 return Proxmox
.Utils
.defaultText
+ ' (LSI 53C895A)';
516 } else if (value
=== 'lsi') {
517 return 'LSI 53C895A';
518 } else if (value
=== 'lsi53c810') {
520 } else if (value
=== 'megasas') {
521 return 'MegaRAID SAS 8708EM2';
522 } else if (value
=== 'virtio-scsi-pci') {
523 return 'VirtIO SCSI';
524 } else if (value
=== 'virtio-scsi-single') {
525 return 'VirtIO SCSI single';
526 } else if (value
=== 'pvscsi') {
527 return 'VMware PVSCSI';
533 render_spice_enhancements: function(values
) {
534 let props
= PVE
.Parser
.parsePropertyString(values
);
535 if (Ext
.Object
.isEmpty(props
)) {
536 return Proxmox
.Utils
.noneText
;
540 if (PVE
.Parser
.parseBoolean(props
.foldersharing
)) {
541 output
.push('Folder Sharing: ' + gettext('Enabled'));
543 if (props
.videostreaming
=== 'all' || props
.videostreaming
=== 'filter') {
544 output
.push('Video Streaming: ' + props
.videostreaming
);
546 return output
.join(', ');
549 // fixme: auto-generate this
550 // for now, please keep in sync with PVE::Tools::kvmkeymaps
555 'de-ch': 'German (Swiss)',
556 'en-gb': 'English (UK)',
557 'en-us': 'English (USA)',
561 //fo: 'Faroe Islands',
563 'fr-be': 'French (Belgium)',
564 'fr-ca': 'French (Canada)',
565 'fr-ch': 'French (Swiss)',
575 //'nl-be': 'Dutch (Belgium)',
579 'pt-br': 'Portuguese (Brazil)',
588 std
: gettext('Standard VGA'),
589 vmware
: gettext('VMware compatible'),
591 qxl2
: 'SPICE dual monitor',
592 qxl3
: 'SPICE three monitors',
593 qxl4
: 'SPICE four monitors',
594 serial0
: gettext('Serial terminal') + ' 0',
595 serial1
: gettext('Serial terminal') + ' 1',
596 serial2
: gettext('Serial terminal') + ' 2',
597 serial3
: gettext('Serial terminal') + ' 3',
598 virtio
: 'VirtIO-GPU',
599 none
: Proxmox
.Utils
.noneText
,
602 render_kvm_language: function(value
) {
603 if (!value
|| value
=== '__default__') {
604 return Proxmox
.Utils
.defaultText
;
606 var text
= PVE
.Utils
.kvm_keymaps
[value
];
608 return text
+ ' (' + value
+ ')';
613 kvm_keymap_array: function() {
614 var data
= [['__default__', PVE
.Utils
.render_kvm_language('')]];
615 Ext
.Object
.each(PVE
.Utils
.kvm_keymaps
, function(key
, value
) {
616 data
.push([key
, PVE
.Utils
.render_kvm_language(value
)]);
623 '__default__': Proxmox
.Utils
.defaultText
+ ' (xterm.js)',
624 'vv': 'SPICE (remote-viewer)',
625 'html5': 'HTML5 (noVNC)',
626 'xtermjs': 'xterm.js',
629 render_console_viewer: function(value
) {
630 value
= value
|| '__default__';
631 if (PVE
.Utils
.console_map
[value
]) {
632 return PVE
.Utils
.console_map
[value
];
637 console_viewer_array: function() {
638 return Ext
.Array
.map(Object
.keys(PVE
.Utils
.console_map
), function(v
) {
639 return [v
, PVE
.Utils
.render_console_viewer(v
)];
643 render_kvm_vga_driver: function(value
) {
645 return Proxmox
.Utils
.defaultText
;
647 var vga
= PVE
.Parser
.parsePropertyString(value
, 'type');
648 var text
= PVE
.Utils
.kvm_vga_drivers
[vga
.type
];
650 text
= Proxmox
.Utils
.defaultText
;
653 return text
+ ' (' + value
+ ')';
658 kvm_vga_driver_array: function() {
659 var data
= [['__default__', PVE
.Utils
.render_kvm_vga_driver('')]];
660 Ext
.Object
.each(PVE
.Utils
.kvm_vga_drivers
, function(key
, value
) {
661 data
.push([key
, PVE
.Utils
.render_kvm_vga_driver(value
)]);
667 render_kvm_startup: function(value
) {
668 var startup
= PVE
.Parser
.parseStartup(value
);
671 if (startup
.order
=== undefined) {
674 res
+= startup
.order
;
676 if (startup
.up
!== undefined) {
677 res
+= ',up=' + startup
.up
;
679 if (startup
.down
!== undefined) {
680 res
+= ',down=' + startup
.down
;
686 extractFormActionError: function(action
) {
688 switch (action
.failureType
) {
689 case Ext
.form
.action
.Action
.CLIENT_INVALID
:
690 msg
= gettext('Form fields may not be submitted with invalid values');
692 case Ext
.form
.action
.Action
.CONNECT_FAILURE
:
693 msg
= gettext('Connection error');
694 var resp
= action
.response
;
695 if (resp
.status
&& resp
.statusText
) {
696 msg
+= " " + resp
.status
+ ": " + resp
.statusText
;
699 case Ext
.form
.action
.Action
.LOAD_FAILURE
:
700 case Ext
.form
.action
.Action
.SERVER_INVALID
:
701 msg
= Proxmox
.Utils
.extractRequestError(action
.result
, true);
708 'images': gettext('Disk image'),
709 'backup': gettext('VZDump backup file'),
710 'vztmpl': gettext('Container template'),
711 'iso': gettext('ISO image'),
712 'rootdir': gettext('Container'),
713 'snippets': gettext('Snippets'),
716 volume_is_qemu_backup: function(volid
, format
) {
717 return format
=== 'pbs-vm' || volid
.match(':backup/vzdump-qemu-');
720 volume_is_lxc_backup: function(volid
, format
) {
721 return format
=== 'pbs-ct' || volid
.match(':backup/vzdump-(lxc|openvz)-');
726 name
: gettext('Active Directory Server'),
727 ipanel
: 'pveAuthADPanel',
728 syncipanel
: 'pveAuthLDAPSyncPanel',
734 name
: gettext('LDAP Server'),
735 ipanel
: 'pveAuthLDAPPanel',
736 syncipanel
: 'pveAuthLDAPSyncPanel',
742 name
: gettext('OpenID Connect Server'),
743 ipanel
: 'pveAuthOpenIDPanel',
747 iconCls
: 'pmx-itype-icon-openid-logo',
751 ipanel
: 'pveAuthBasePanel',
757 name
: 'Proxmox VE authentication server',
758 ipanel
: 'pveAuthBasePanel',
767 name
: Proxmox
.Utils
.directoryText
,
768 ipanel
: 'DirInputPanel',
774 ipanel
: 'LVMInputPanel',
780 ipanel
: 'LvmThinInputPanel',
786 ipanel
: 'BTRFSInputPanel',
792 ipanel
: 'NFSInputPanel',
798 ipanel
: 'CIFSInputPanel',
804 ipanel
: 'GlusterFsInputPanel',
810 ipanel
: 'IScsiInputPanel',
816 ipanel
: 'CephFSInputPanel',
821 name
: 'CephFS (PVE)',
822 ipanel
: 'CephFSInputPanel',
829 ipanel
: 'RBDInputPanel',
835 ipanel
: 'RBDInputPanel',
841 name
: 'ZFS over iSCSI',
842 ipanel
: 'ZFSInputPanel',
848 ipanel
: 'ZFSPoolInputPanel',
853 name
: 'Proxmox Backup Server',
854 ipanel
: 'PBSInputPanel',
879 ipanel
: 'SimpleInputPanel',
884 ipanel
: 'VlanInputPanel',
889 ipanel
: 'QinQInputPanel',
894 ipanel
: 'VxlanInputPanel',
899 ipanel
: 'EvpnInputPanel',
904 sdncontrollerSchema
: {
911 ipanel
: 'EvpnInputPanel',
912 faIcon
: 'crosshairs',
916 ipanel
: 'BgpInputPanel',
917 faIcon
: 'crosshairs',
928 ipanel
: 'PVEIpamInputPanel',
934 ipanel
: 'NetboxInputPanel',
939 ipanel
: 'PhpIpamInputPanel',
951 ipanel
: 'PowerdnsInputPanel',
956 format_sdnvnet_type: function(value
, md
, record
) {
957 var schema
= PVE
.Utils
.sdnvnetSchema
[value
];
961 return Proxmox
.Utils
.unknownText
;
964 format_sdnzone_type: function(value
, md
, record
) {
965 var schema
= PVE
.Utils
.sdnzoneSchema
[value
];
969 return Proxmox
.Utils
.unknownText
;
972 format_sdncontroller_type: function(value
, md
, record
) {
973 var schema
= PVE
.Utils
.sdncontrollerSchema
[value
];
977 return Proxmox
.Utils
.unknownText
;
980 format_sdnipam_type: function(value
, md
, record
) {
981 var schema
= PVE
.Utils
.sdnipamSchema
[value
];
985 return Proxmox
.Utils
.unknownText
;
988 format_sdndns_type: function(value
, md
, record
) {
989 var schema
= PVE
.Utils
.sdndnsSchema
[value
];
993 return Proxmox
.Utils
.unknownText
;
996 format_storage_type: function(value
, md
, record
) {
997 if (value
=== 'rbd') {
998 value
= !record
|| record
.get('monhost') ? 'rbd' : 'pveceph';
999 } else if (value
=== 'cephfs') {
1000 value
= !record
|| record
.get('monhost') ? 'cephfs' : 'pvecephfs';
1003 var schema
= PVE
.Utils
.storageSchema
[value
];
1007 return Proxmox
.Utils
.unknownText
;
1010 format_ha: function(value
) {
1011 var text
= Proxmox
.Utils
.noneText
;
1013 if (value
.managed
) {
1014 text
= value
.state
|| Proxmox
.Utils
.noneText
;
1016 text
+= ', ' + Proxmox
.Utils
.groupText
+ ': ';
1017 text
+= value
.group
|| Proxmox
.Utils
.noneText
;
1023 format_content_types: function(value
) {
1024 return value
.split(',').sort().map(function(ct
) {
1025 return PVE
.Utils
.contentTypes
[ct
] || ct
;
1029 render_storage_content: function(value
, metaData
, record
) {
1030 var data
= record
.data
;
1031 if (Ext
.isNumber(data
.channel
) &&
1032 Ext
.isNumber(data
.id
) &&
1033 Ext
.isNumber(data
.lun
)) {
1035 Ext
.String
.leftPad(data
.channel
, 2, '0') +
1036 " ID " + data
.id
+ " LUN " + data
.lun
;
1038 return data
.volid
.replace(/^.*?:(.*?\/)?/, '');
1041 render_serverity: function(value
) {
1042 return PVE
.Utils
.log_severity_hash
[value
] || value
;
1045 calculate_hostcpu: function(data
) {
1046 if (!(data
.uptime
&& Ext
.isNumeric(data
.cpu
))) {
1050 if (data
.type
!== 'qemu' && data
.type
!== 'lxc') {
1054 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + data
.node
);
1055 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1056 if (!Ext
.isDefined(node
) || node
=== null) {
1059 var maxcpu
= node
.data
.maxcpu
|| 1;
1061 if (!Ext
.isNumeric(maxcpu
) && (maxcpu
>= 1)) {
1065 return (data
.cpu
/maxcpu
) * data
.maxcpu
;
1068 render_hostcpu: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1069 if (!(record
.data
.uptime
&& Ext
.isNumeric(record
.data
.cpu
))) {
1073 if (record
.data
.type
!== 'qemu' && record
.data
.type
!== 'lxc') {
1077 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + record
.data
.node
);
1078 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1079 if (!Ext
.isDefined(node
) || node
=== null) {
1082 var maxcpu
= node
.data
.maxcpu
|| 1;
1084 if (!Ext
.isNumeric(maxcpu
) && (maxcpu
>= 1)) {
1088 var per
= (record
.data
.cpu
/maxcpu
) * record
.data
.maxcpu
* 100;
1090 return per
.toFixed(1) + '% of ' + maxcpu
.toString() + (maxcpu
> 1 ? 'CPUs' : 'CPU');
1093 render_bandwidth: function(value
) {
1094 if (!Ext
.isNumeric(value
)) {
1098 return Proxmox
.Utils
.format_size(value
) + '/s';
1101 render_timestamp_human_readable: function(value
) {
1102 return Ext
.Date
.format(new Date(value
* 1000), 'l d F Y H:i:s');
1105 calculate_mem_usage: function(data
) {
1106 if (!Ext
.isNumeric(data
.mem
) ||
1107 data
.maxmem
=== 0 ||
1112 return data
.mem
/ data
.maxmem
;
1115 calculate_hostmem_usage: function(data
) {
1116 if (data
.type
!== 'qemu' && data
.type
!== 'lxc') {
1120 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + data
.node
);
1121 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1123 if (!Ext
.isDefined(node
) || node
=== null) {
1126 var maxmem
= node
.data
.maxmem
|| 0;
1128 if (!Ext
.isNumeric(data
.mem
) ||
1134 return data
.mem
/ maxmem
;
1137 render_mem_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1138 if (!Ext
.isNumeric(value
) || value
=== -1) {
1142 // we got no percentage but bytes
1144 var maxmem
= record
.data
.maxmem
;
1145 if (!record
.data
.uptime
||
1147 !Ext
.isNumeric(mem
)) {
1151 return (mem
*100/maxmem
).toFixed(1) + " %";
1153 return (value
*100).toFixed(1) + " %";
1156 render_hostmem_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1157 if (!Ext
.isNumeric(record
.data
.mem
) || value
=== -1) {
1161 if (record
.data
.type
!== 'qemu' && record
.data
.type
!== 'lxc') {
1165 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + record
.data
.node
);
1166 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1167 var maxmem
= node
.data
.maxmem
|| 0;
1169 if (record
.data
.mem
> 1) {
1170 // we got no percentage but bytes
1171 var mem
= record
.data
.mem
;
1172 if (!record
.data
.uptime
||
1174 !Ext
.isNumeric(mem
)) {
1178 return ((mem
*100)/maxmem
).toFixed(1) + " %";
1180 return (value
*100).toFixed(1) + " %";
1183 render_mem_usage: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1185 var maxmem
= record
.data
.maxmem
;
1187 if (!record
.data
.uptime
) {
1191 if (!(Ext
.isNumeric(mem
) && maxmem
)) {
1195 return Proxmox
.Utils
.render_size(value
);
1198 calculate_disk_usage: function(data
) {
1199 if (!Ext
.isNumeric(data
.disk
) ||
1200 ((data
.type
=== 'qemu' || data
.type
=== 'lxc') && data
.uptime
=== 0) ||
1206 return data
.disk
/ data
.maxdisk
;
1209 render_disk_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1210 if (!Ext
.isNumeric(value
) || value
=== -1) {
1214 return (value
* 100).toFixed(1) + " %";
1217 render_disk_usage: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1219 var maxdisk
= record
.data
.maxdisk
;
1220 var type
= record
.data
.type
;
1222 if (!Ext
.isNumeric(disk
) ||
1224 ((type
=== 'qemu' || type
=== 'lxc') && record
.data
.uptime
=== 0)
1229 return Proxmox
.Utils
.render_size(value
);
1232 get_object_icon_class: function(type
, record
) {
1236 if (type
=== 'type') {
1238 objType
= record
.groupbyid
;
1239 } else if (record
.template
) {
1241 objType
= 'template';
1245 status
= record
.status
+ ' ha-' + record
.hastate
;
1249 status
+= ' locked lock-' + record
.lock
;
1252 var defaults
= PVE
.tree
.ResourceTree
.typeDefaults
[objType
];
1253 if (defaults
&& defaults
.iconCls
) {
1254 var retVal
= defaults
.iconCls
+ ' ' + status
;
1261 render_resource_type: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1262 var cls
= PVE
.Utils
.get_object_icon_class(value
, record
.data
);
1264 var fa
= '<i class="fa-fw x-grid-icon-custom ' + cls
+ '"></i> ';
1268 render_support_level: function(value
, metaData
, record
) {
1269 return PVE
.Utils
.support_level_hash
[value
] || '-';
1272 render_upid: function(value
, metaData
, record
) {
1273 var type
= record
.data
.type
;
1274 var id
= record
.data
.id
;
1276 return Proxmox
.Utils
.format_task_description(type
, id
);
1279 render_optional_url: function(value
) {
1280 if (value
&& value
.match(/^https?:\/\//)) {
1281 return '<a target="_blank" href="' + value
+ '">' + value
+ '</a>';
1286 render_san: function(value
) {
1288 if (Ext
.isArray(value
)) {
1289 value
.forEach(function(val
) {
1290 if (!Ext
.isNumber(val
)) {
1294 return names
.join('<br>');
1299 render_full_name: function(firstname
, metaData
, record
) {
1300 var first
= firstname
|| '';
1301 var last
= record
.data
.lastname
|| '';
1302 return Ext
.htmlEncode(first
+ " " + last
);
1305 windowHostname: function() {
1306 return window
.location
.hostname
.replace(Proxmox
.Utils
.IP6_bracket_match
,
1307 function(m
, addr
, offset
, original
) { return addr
; });
1310 openDefaultConsoleWindow: function(consoles
, consoleType
, vmid
, nodename
, vmname
, cmd
) {
1311 var dv
= PVE
.Utils
.defaultViewer(consoles
, consoleType
);
1312 PVE
.Utils
.openConsoleWindow(dv
, consoleType
, vmid
, nodename
, vmname
, cmd
);
1315 openConsoleWindow: function(viewer
, consoleType
, vmid
, nodename
, vmname
, cmd
) {
1316 if (vmid
=== undefined && (consoleType
=== 'kvm' || consoleType
=== 'lxc')) {
1317 throw "missing vmid";
1320 throw "no nodename specified";
1323 if (viewer
=== 'html5') {
1324 PVE
.Utils
.openVNCViewer(consoleType
, vmid
, nodename
, vmname
, cmd
);
1325 } else if (viewer
=== 'xtermjs') {
1326 Proxmox
.Utils
.openXtermJsViewer(consoleType
, vmid
, nodename
, vmname
, cmd
);
1327 } else if (viewer
=== 'vv') {
1328 let url
= '/nodes/' + nodename
+ '/spiceshell';
1330 proxy
: PVE
.Utils
.windowHostname(),
1332 if (consoleType
=== 'kvm') {
1333 url
= '/nodes/' + nodename
+ '/qemu/' + vmid
.toString() + '/spiceproxy';
1334 } else if (consoleType
=== 'lxc') {
1335 url
= '/nodes/' + nodename
+ '/lxc/' + vmid
.toString() + '/spiceproxy';
1336 } else if (consoleType
=== 'upgrade') {
1337 params
.cmd
= 'upgrade';
1338 } else if (consoleType
=== 'cmd') {
1340 } else if (consoleType
!== 'shell') {
1341 throw `unknown spice viewer type '${consoleType}'`;
1343 PVE
.Utils
.openSpiceViewer(url
, params
);
1345 throw `unknown viewer type '${viewer}'`;
1349 defaultViewer: function(consoles
, type
) {
1350 var allowSpice
, allowXtermjs
;
1352 if (consoles
=== true) {
1354 allowXtermjs
= true;
1355 } else if (typeof consoles
=== 'object') {
1356 allowSpice
= consoles
.spice
;
1357 allowXtermjs
= !!consoles
.xtermjs
;
1359 let dv
= PVE
.VersionInfo
.console
|| (type
=== 'kvm' ? 'vv' : 'xtermjs');
1360 if (dv
=== 'vv' && !allowSpice
) {
1361 dv
= allowXtermjs
? 'xtermjs' : 'html5';
1362 } else if (dv
=== 'xtermjs' && !allowXtermjs
) {
1363 dv
= allowSpice
? 'vv' : 'html5';
1369 openVNCViewer: function(vmtype
, vmid
, nodename
, vmname
, cmd
) {
1370 let scaling
= 'off';
1371 if (Proxmox
.Utils
.toolkit
!== 'touch') {
1372 var sp
= Ext
.state
.Manager
.getProvider();
1373 scaling
= sp
.get('novnc-scaling', 'off');
1375 var url
= Ext
.Object
.toQueryString({
1376 console
: vmtype
, // kvm, lxc, upgrade or shell
1384 var nw
= window
.open("?" + url
, '_blank', "innerWidth=745,innerheight=427");
1390 openSpiceViewer: function(url
, params
) {
1391 var downloadWithName = function(uri
, name
) {
1392 var link
= Ext
.DomHelper
.append(document
.body
, {
1395 css
: 'display:none;visibility:hidden;height:0px;',
1398 // Note: we need to tell Android and Chrome the correct file name extension
1399 // but we do not set 'download' tag for other environments, because
1400 // It can have strange side effects (additional user prompt on firefox)
1401 if (navigator
.userAgent
.match(/Android|Chrome/i)) {
1402 link
.download
= name
;
1405 if (link
.fireEvent
) {
1406 link
.fireEvent('onclick');
1408 let evt
= document
.createEvent("MouseEvents");
1409 evt
.initMouseEvent('click', true, true, window
, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
1410 link
.dispatchEvent(evt
);
1414 Proxmox
.Utils
.API2Request({
1418 failure: function(response
, opts
) {
1419 Ext
.Msg
.alert('Error', response
.htmlStatus
);
1421 success: function(response
, opts
) {
1422 let cfg
= response
.result
.data
;
1423 let raw
= Object
.entries(cfg
).reduce((acc
, [k
, v
]) => acc
+ `${k}=${v}\n`, "[virt-viewer]\n");
1424 let spiceDownload
= 'data:application/x-virt-viewer;charset=UTF-8,' + encodeURIComponent(raw
);
1425 downloadWithName(spiceDownload
, "pve-spice.vv");
1430 openTreeConsole: function(tree
, record
, item
, index
, e
) {
1432 let nodename
= record
.data
.node
;
1433 let vmid
= record
.data
.vmid
;
1434 let vmname
= record
.data
.name
;
1435 if (record
.data
.type
=== 'qemu' && !record
.data
.template
) {
1436 Proxmox
.Utils
.API2Request({
1437 url
: `/nodes/${nodename}/qemu/${vmid}/status/current`,
1438 failure
: response
=> Ext
.Msg
.alert('Error', response
.htmlStatus
),
1439 success: function(response
, opts
) {
1440 let conf
= response
.result
.data
;
1442 spice
: !!conf
.spice
,
1443 xtermjs
: !!conf
.serial
,
1445 PVE
.Utils
.openDefaultConsoleWindow(consoles
, 'kvm', vmid
, nodename
, vmname
);
1448 } else if (record
.data
.type
=== 'lxc' && !record
.data
.template
) {
1449 PVE
.Utils
.openDefaultConsoleWindow(true, 'lxc', vmid
, nodename
, vmname
);
1453 // test automation helper
1454 call_menu_handler: function(menu
, text
) {
1455 let item
= menu
.query('menuitem').find(el
=> el
.text
=== text
);
1456 if (item
&& item
.handler
) {
1461 createCmdMenu: function(v
, record
, item
, index
, event
) {
1463 if (!(v
instanceof Ext
.tree
.View
)) {
1467 let type
= record
.data
.type
;
1469 if (record
.data
.template
) {
1470 if (type
=== 'qemu' || type
=== 'lxc') {
1471 menu
= Ext
.create('PVE.menu.TemplateMenu', {
1475 } else if (type
=== 'qemu' || type
=== 'lxc' || type
=== 'node') {
1476 menu
= Ext
.create('PVE.' + type
+ '.CmdMenu', {
1478 nodename
: record
.data
.node
,
1484 menu
.showAt(event
.getXY());
1488 // helper for deleting field which are set to there default values
1489 delete_if_default: function(values
, fieldname
, default_val
, create
) {
1490 if (values
[fieldname
] === '' || values
[fieldname
] === default_val
) {
1492 if (values
.delete) {
1493 if (Ext
.isArray(values
.delete)) {
1494 values
.delete.push(fieldname
);
1496 values
.delete += ',' + fieldname
;
1499 values
.delete = fieldname
;
1503 delete values
[fieldname
];
1507 loadSSHKeyFromFile: function(file
, callback
) {
1508 // ssh-keygen produces ~ 740 bytes for a 4096 bit RSA key, current max is 16 kbit, so assume:
1509 // 740 * 8 for max. 32kbit (5920 bytes), round upwards to 8192 bytes, leaves lots of comment space
1510 PVE
.Utils
.loadFile(file
, callback
, 8192);
1513 loadFile: function(file
, callback
, maxSize
) {
1514 maxSize
= maxSize
|| 32 * 1024;
1515 if (file
.size
> maxSize
) {
1516 Ext
.Msg
.alert(gettext('Error'), `${gettext("Invalid file size")}: ${file.size} > ${maxSize}`);
1519 let reader
= new FileReader();
1520 reader
.onload
= evt
=> callback(evt
.target
.result
);
1521 reader
.readAsText(file
);
1524 loadTextFromFile: function(file
, callback
, maxBytes
) {
1525 let maxSize
= maxBytes
|| 8192;
1526 if (file
.size
> maxSize
) {
1527 Ext
.Msg
.alert(gettext('Error'), gettext("Invalid file size: ") + file
.size
);
1530 let reader
= new FileReader();
1531 reader
.onload
= evt
=> callback(evt
.target
.result
);
1532 reader
.readAsText(file
);
1535 diskControllerMaxIDs
: {
1542 // types is either undefined (all busses), an array of busses, or a single bus
1543 forEachBus: function(types
, func
) {
1544 let busses
= Object
.keys(PVE
.Utils
.diskControllerMaxIDs
);
1546 if (Ext
.isArray(types
)) {
1548 } else if (Ext
.isDefined(types
)) {
1552 // check if we only have valid busses
1553 for (let i
= 0; i
< busses
.length
; i
++) {
1554 if (!PVE
.Utils
.diskControllerMaxIDs
[busses
[i
]]) {
1555 throw "invalid bus: '" + busses
[i
] + "'";
1559 for (let i
= 0; i
< busses
.length
; i
++) {
1560 let count
= PVE
.Utils
.diskControllerMaxIDs
[busses
[i
]];
1561 for (let j
= 0; j
< count
; j
++) {
1562 let cont
= func(busses
[i
], j
);
1563 if (!cont
&& cont
!== undefined) {
1575 forEachMP: function(func
, includeUnused
) {
1576 for (let i
= 0; i
< PVE
.Utils
.mp_counts
.mps
; i
++) {
1577 let cont
= func('mp', i
);
1578 if (!cont
&& cont
!== undefined) {
1583 if (!includeUnused
) {
1587 for (let i
= 0; i
< PVE
.Utils
.mp_counts
.unused
; i
++) {
1588 let cont
= func('unused', i
);
1589 if (!cont
&& cont
!== undefined) {
1595 hardware_counts
: { net
: 32, usb
: 5, hostpci
: 16, audio
: 1, efidisk
: 1, serial
: 4, rng
: 1, tpmstate
: 1 },
1597 cleanEmptyObjectKeys: function(obj
) {
1598 for (const propName
of Object
.keys(obj
)) {
1599 if (obj
[propName
] === null || obj
[propName
] === undefined) {
1600 delete obj
[propName
];
1605 acmedomain_count
: 5,
1607 add_domain_to_acme: function(acme
, domain
) {
1608 if (acme
.domains
=== undefined) {
1609 acme
.domains
= [domain
];
1611 acme
.domains
.push(domain
);
1612 acme
.domains
= acme
.domains
.filter((value
, index
, self
) => self
.indexOf(value
) === index
);
1617 remove_domain_from_acme: function(acme
, domain
) {
1618 if (acme
.domains
!== undefined) {
1621 .filter((value
, index
, self
) => self
.indexOf(value
) === index
&& value
!== domain
);
1626 handleStoreErrorOrMask: function(view
, store
, regex
, callback
) {
1627 view
.mon(store
, 'load', function(proxy
, response
, success
, operation
) {
1629 Proxmox
.Utils
.setErrorMask(view
, false);
1633 if (operation
.error
.statusText
) {
1634 if (operation
.error
.statusText
.match(regex
)) {
1635 callback(view
, operation
.error
);
1638 msg
= operation
.error
.statusText
+ ' (' + operation
.error
.status
+ ')';
1641 msg
= gettext('Connection error');
1643 Proxmox
.Utils
.setErrorMask(view
, msg
);
1647 showCephInstallOrMask: function(container
, msg
, nodename
, callback
) {
1648 if (msg
.match(/not (installed|initialized)/i)) {
1649 if (Proxmox
.UserName
=== 'root@pam') {
1650 container
.el
.mask();
1651 if (!container
.down('pveCephInstallWindow')) {
1652 var isInstalled
= !!msg
.match(/not initialized/i);
1653 var win
= Ext
.create('PVE.ceph.Install', {
1656 win
.getViewModel().set('isInstalled', isInstalled
);
1662 container
.mask(Ext
.String
.format(gettext('{0} not installed.') +
1663 ' ' + gettext('Log in as root to install.'), 'Ceph'), ['pve-static-mask']);
1671 monitor_ceph_installed: function(view
, rstore
, nodename
, maskOwnerCt
) {
1672 PVE
.Utils
.handleStoreErrorOrMask(
1675 /not (installed|initialized)/i,
1677 nodename
= nodename
|| 'localhost';
1678 let maskTarget
= maskOwnerCt
? view
.ownerCt
: view
;
1679 rstore
.stopUpdate();
1680 PVE
.Utils
.showCephInstallOrMask(maskTarget
, error
.statusText
, nodename
, win
=> {
1681 view
.mon(win
, 'cephInstallWindowClosed', () => rstore
.startUpdate());
1688 propertyStringSet: function(target
, source
, name
, value
) {
1690 if (value
=== undefined) {
1691 target
[name
] = source
;
1693 target
[name
] = value
;
1696 delete target
[name
];
1700 forEachCorosyncLink: function(nodeinfo
, cb
) {
1701 let re
= /(?:ring|link)(\d+)_addr/;
1702 Ext
.iterate(nodeinfo
, (prop
, val
) => {
1703 let match
= re
.exec(prop
);
1705 cb(Number(match
[1]), val
);
1712 'AuthenticAMD': 'AMD',
1713 'GenuineIntel': 'Intel',
1721 "_default_": 5, // includes custom models
1724 verify_ip64_address_list: function(value
, with_suffix
) {
1725 for (let addr
of value
.split(/[ ,;]+/)) {
1731 let parts
= addr
.split('%');
1734 if (parts
.length
> 2) {
1738 if (parts
.length
> 1 && !addr
.startsWith('fe80:')) {
1743 if (!Proxmox
.Utils
.IP64_match
.test(addr
)) {
1751 sortByPreviousUsage: function(vmconfig
, controllerList
) {
1752 if (!controllerList
) {
1753 controllerList
= ['ide', 'virtio', 'scsi', 'sata'];
1755 let usedControllers
= {};
1756 for (const type
of Object
.keys(PVE
.Utils
.diskControllerMaxIDs
)) {
1757 usedControllers
[type
] = 0;
1760 for (const property
of Object
.keys(vmconfig
)) {
1761 if (property
.match(PVE
.Utils
.bus_match
) && !vmconfig
[property
].match(/media=cdrom/)) {
1762 const foundController
= property
.match(PVE
.Utils
.bus_match
)[1];
1763 usedControllers
[foundController
]++;
1767 let sortPriority
= PVE
.qemu
.OSDefaults
.getDefaults(vmconfig
.ostype
).busPriority
;
1769 let sortedList
= Ext
.clone(controllerList
);
1770 sortedList
.sort(function(a
, b
) {
1771 if (usedControllers
[b
] === usedControllers
[a
]) {
1772 return sortPriority
[b
] - sortPriority
[a
];
1774 return usedControllers
[b
] - usedControllers
[a
];
1780 nextFreeDisk: function(controllers
, config
) {
1781 for (const controller
of controllers
) {
1782 for (let i
= 0; i
< PVE
.Utils
.diskControllerMaxIDs
[controller
]; i
++) {
1783 let confid
= controller
+ i
.toString();
1784 if (!Ext
.isDefined(config
[confid
])) {
1799 constructor: function() {
1801 Ext
.apply(me
, me
.utilities
);
1803 Proxmox
.Utils
.override_task_descriptions({
1804 acmedeactivate
: ['ACME Account', gettext('Deactivate')],
1805 acmenewcert
: ['SRV', gettext('Order Certificate')],
1806 acmerefresh
: ['ACME Account', gettext('Refresh')],
1807 acmeregister
: ['ACME Account', gettext('Register')],
1808 acmerenew
: ['SRV', gettext('Renew Certificate')],
1809 acmerevoke
: ['SRV', gettext('Revoke Certificate')],
1810 acmeupdate
: ['ACME Account', gettext('Update')],
1811 'auth-realm-sync': [gettext('Realm'), gettext('Sync')],
1812 'auth-realm-sync-test': [gettext('Realm'), gettext('Sync Preview')],
1813 cephcreatemds
: ['Ceph Metadata Server', gettext('Create')],
1814 cephcreatemgr
: ['Ceph Manager', gettext('Create')],
1815 cephcreatemon
: ['Ceph Monitor', gettext('Create')],
1816 cephcreateosd
: ['Ceph OSD', gettext('Create')],
1817 cephcreatepool
: ['Ceph Pool', gettext('Create')],
1818 cephdestroymds
: ['Ceph Metadata Server', gettext('Destroy')],
1819 cephdestroymgr
: ['Ceph Manager', gettext('Destroy')],
1820 cephdestroymon
: ['Ceph Monitor', gettext('Destroy')],
1821 cephdestroyosd
: ['Ceph OSD', gettext('Destroy')],
1822 cephdestroypool
: ['Ceph Pool', gettext('Destroy')],
1823 cephdestroyfs
: ['CephFS', gettext('Destroy')],
1824 cephfscreate
: ['CephFS', gettext('Create')],
1825 cephsetpool
: ['Ceph Pool', gettext('Edit')],
1826 cephsetflags
: ['', gettext('Change global Ceph flags')],
1827 clustercreate
: ['', gettext('Create Cluster')],
1828 clusterjoin
: ['', gettext('Join Cluster')],
1829 dircreate
: [gettext('Directory Storage'), gettext('Create')],
1830 dirremove
: [gettext('Directory'), gettext('Remove')],
1831 download
: [gettext('File'), gettext('Download')],
1832 hamigrate
: ['HA', gettext('Migrate')],
1833 hashutdown
: ['HA', gettext('Shutdown')],
1834 hastart
: ['HA', gettext('Start')],
1835 hastop
: ['HA', gettext('Stop')],
1836 imgcopy
: ['', gettext('Copy data')],
1837 imgdel
: ['', gettext('Erase data')],
1838 lvmcreate
: [gettext('LVM Storage'), gettext('Create')],
1839 lvmremove
: ['Volume Group', gettext('Remove')],
1840 lvmthincreate
: [gettext('LVM-Thin Storage'), gettext('Create')],
1841 lvmthinremove
: ['Thinpool', gettext('Remove')],
1842 migrateall
: ['', gettext('Migrate all VMs and Containers')],
1843 'move_volume': ['CT', gettext('Move Volume')],
1844 'pbs-download': ['VM/CT', gettext('File Restore Download')],
1845 pull_file
: ['CT', gettext('Pull file')],
1846 push_file
: ['CT', gettext('Push file')],
1847 qmclone
: ['VM', gettext('Clone')],
1848 qmconfig
: ['VM', gettext('Configure')],
1849 qmcreate
: ['VM', gettext('Create')],
1850 qmdelsnapshot
: ['VM', gettext('Delete Snapshot')],
1851 qmdestroy
: ['VM', gettext('Destroy')],
1852 qmigrate
: ['VM', gettext('Migrate')],
1853 qmmove
: ['VM', gettext('Move disk')],
1854 qmpause
: ['VM', gettext('Pause')],
1855 qmreboot
: ['VM', gettext('Reboot')],
1856 qmreset
: ['VM', gettext('Reset')],
1857 qmrestore
: ['VM', gettext('Restore')],
1858 qmresume
: ['VM', gettext('Resume')],
1859 qmrollback
: ['VM', gettext('Rollback')],
1860 qmshutdown
: ['VM', gettext('Shutdown')],
1861 qmsnapshot
: ['VM', gettext('Snapshot')],
1862 qmstart
: ['VM', gettext('Start')],
1863 qmstop
: ['VM', gettext('Stop')],
1864 qmsuspend
: ['VM', gettext('Hibernate')],
1865 qmtemplate
: ['VM', gettext('Convert to template')],
1866 spiceproxy
: ['VM/CT', gettext('Console') + ' (Spice)'],
1867 spiceshell
: ['', gettext('Shell') + ' (Spice)'],
1868 startall
: ['', gettext('Start all VMs and Containers')],
1869 stopall
: ['', gettext('Stop all VMs and Containers')],
1870 unknownimgdel
: ['', gettext('Destroy image from unknown guest')],
1871 wipedisk
: ['Device', gettext('Wipe Disk')],
1872 vncproxy
: ['VM/CT', gettext('Console')],
1873 vncshell
: ['', gettext('Shell')],
1874 vzclone
: ['CT', gettext('Clone')],
1875 vzcreate
: ['CT', gettext('Create')],
1876 vzdelsnapshot
: ['CT', gettext('Delete Snapshot')],
1877 vzdestroy
: ['CT', gettext('Destroy')],
1878 vzdump
: (type
, id
) => id
? `VM/CT ${id} - ${gettext('Backup')}` : gettext('Backup Job'),
1879 vzmigrate
: ['CT', gettext('Migrate')],
1880 vzmount
: ['CT', gettext('Mount')],
1881 vzreboot
: ['CT', gettext('Reboot')],
1882 vzrestore
: ['CT', gettext('Restore')],
1883 vzresume
: ['CT', gettext('Resume')],
1884 vzrollback
: ['CT', gettext('Rollback')],
1885 vzshutdown
: ['CT', gettext('Shutdown')],
1886 vzsnapshot
: ['CT', gettext('Snapshot')],
1887 vzstart
: ['CT', gettext('Start')],
1888 vzstop
: ['CT', gettext('Stop')],
1889 vzsuspend
: ['CT', gettext('Suspend')],
1890 vztemplate
: ['CT', gettext('Convert to template')],
1891 vzumount
: ['CT', gettext('Unmount')],
1892 zfscreate
: [gettext('ZFS Storage'), gettext('Create')],
1893 zfsremove
: ['ZFS Pool', gettext('Remove')],