]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/Utils.js
3 // avoid errors related to Accessible Rich Internet Applications
4 // (access for people with disabilities)
5 // TODO reenable after all components are upgraded
6 Ext
.enableAria
= false;
7 Ext
.enableAriaButtons
= false;
8 Ext
.enableAriaPanels
= false;
10 console
.log("Starting Proxmox VE Manager");
12 Ext
.Ajax
.defaultHeaders
= {
13 'Accept': 'application/json',
16 Ext
.define('PVE.Utils', {
19 // this singleton contains miscellaneous utilities
21 toolkit
: undefined, // (extjs|touch), set inside Toolkit.js
23 bus_match
: /^(ide|sata|virtio|scsi)\d+$/,
37 'c': gettext('Community'),
38 'b': gettext('Basic'),
39 's': gettext('Standard'),
40 'p': gettext('Premium'),
43 noSubKeyHtml
: 'You do not have a valid subscription for this server. Please visit '
44 +'<a target="_blank" href="https://www.proxmox.com/products/proxmox-ve/subscription-service-plans">'
45 +'www.proxmox.com</a> to get a list of available options.',
49 { desc
: '5.x - 2.6 Kernel', val
: 'l26' },
50 { desc
: '2.4 Kernel', val
: 'l24' },
52 'Microsoft Windows': [
53 { desc
: '10/2016/2019', val
: 'win10' },
54 { desc
: '8.x/2012/2012r2', val
: 'win8' },
55 { desc
: '7/2008r2', val
: 'win7' },
56 { desc
: 'Vista/2008', val
: 'w2k8' },
57 { desc
: 'XP/2003', val
: 'wxp' },
58 { desc
: '2000', val
: 'w2k' },
61 { desc
: '-', val
: 'solaris' },
64 { desc
: '-', val
: 'other' },
68 is_windows: function(ostype
) {
69 for (let entry
of PVE
.Utils
.kvm_ostypes
['Microsoft Windows']) {
70 if (entry
.val
=== ostype
) {
77 get_health_icon: function(state
, circle
) {
78 if (circle
=== undefined) {
82 if (state
=== undefined) {
86 var icon
= 'faded fa-question';
89 icon
= 'good fa-check';
92 icon
= 'warning fa-upload';
95 icon
= 'warning fa-refresh';
98 icon
= 'warning fa-exclamation';
101 icon
= 'critical fa-times';
113 parse_ceph_version: function(service
) {
114 if (service
.ceph_version_short
) {
115 return service
.ceph_version_short
;
118 if (service
.ceph_version
) {
119 var match
= service
.ceph_version
.match(/version (\d+(\.\d+)*)/);
128 compare_ceph_versions: function(a
, b
) {
136 if (Ext
.isArray(a
)) {
137 avers
= a
.slice(); // copy array
139 avers
= a
.toString().split('.');
142 if (Ext
.isArray(b
)) {
143 bvers
= b
.slice(); // copy array
145 bvers
= b
.toString().split('.');
149 let av
= avers
.shift();
150 let bv
= bvers
.shift();
152 if (av
=== undefined && bv
=== undefined) {
154 } else if (av
=== undefined) {
156 } else if (bv
=== undefined) {
159 let diff
= parseInt(av
, 10) - parseInt(bv
, 10);
160 if (diff
!== 0) return diff
;
161 // else we need to look at the next parts
166 get_ceph_icon_html: function(health
, fw
) {
167 var state
= PVE
.Utils
.map_ceph_health
[health
];
168 var cls
= PVE
.Utils
.get_health_icon(state
);
172 return "<i class='fa " + cls
+ "'></i> ";
177 'HEALTH_UPGRADE': 'upgrade',
179 'HEALTH_WARN': 'warning',
180 'HEALTH_ERR': 'critical',
183 render_sdn_pending: function(rec
, value
, key
, index
) {
184 if (rec
.data
.state
=== undefined || rec
.data
.state
=== null) {
188 if (rec
.data
.state
=== 'deleted') {
189 if (value
=== undefined) {
192 return '<div style="text-decoration: line-through;">'+ value
+'</div>';
194 } else if (rec
.data
.pending
[key
] !== undefined && rec
.data
.pending
[key
] !== null) {
195 if (rec
.data
.pending
[key
] === 'deleted') {
198 return rec
.data
.pending
[key
];
204 render_sdn_pending_state: function(rec
, value
) {
205 if (value
=== undefined || value
=== null) {
209 let icon
= `<i class="fa fa-fw fa-refresh warning"></i>`;
211 if (value
=== 'deleted') {
212 return '<span>' + icon
+ value
+ '</span>';
215 let tip
= gettext('Pending Changes') + ': <br>';
217 for (const [key
, keyvalue
] of Object
.entries(rec
.data
.pending
)) {
218 if ((rec
.data
[key
] !== undefined && rec
.data
.pending
[key
] !== rec
.data
[key
]) ||
219 rec
.data
[key
] === undefined
221 tip
+= `${key}: ${keyvalue} <br>`;
224 return '<span data-qtip="' + tip
+ '">'+ icon
+ value
+ '</span>';
227 render_ceph_health: function(healthObj
) {
229 iconCls
: PVE
.Utils
.get_health_icon(),
233 if (!healthObj
|| !healthObj
.status
) {
237 var health
= PVE
.Utils
.map_ceph_health
[healthObj
.status
];
239 state
.iconCls
= PVE
.Utils
.get_health_icon(health
, true);
240 state
.text
= healthObj
.status
;
245 render_zfs_health: function(value
) {
246 if (typeof value
=== 'undefined') {
249 var iconCls
= 'question-circle';
253 iconCls
= 'check-circle good';
257 iconCls
= 'exclamation-circle warning';
262 iconCls
= 'times-circle critical';
267 return '<i class="fa fa-' + iconCls
+ '"></i> ' + value
;
270 render_pbs_fingerprint
: fp
=> fp
.substring(0, 23),
272 render_backup_encryption: function(v
, meta
, record
) {
274 return gettext('No');
278 if (v
.match(/^[a-fA-F0-9]{2}:/)) { // fingerprint
279 tip
= `Key fingerprint ${PVE.Utils.render_pbs_fingerprint(v)}`;
281 let icon
= `<i class="fa fa-fw fa-lock good"></i>`;
282 return `<span data-qtip="${tip}">${icon} ${gettext('Encrypted')}</span>`;
285 render_backup_verification: function(v
, meta
, record
) {
286 let i
= (cls
, txt
) => `<i class="fa fa-fw fa-${cls}"></i> ${txt}`;
287 if (v
=== undefined || v
=== null) {
288 return i('question-circle-o warning', gettext('None'));
291 let txt
= gettext('Failed');
292 let iconCls
= 'times critical';
293 if (v
.state
=== 'ok') {
295 iconCls
= 'check good';
296 let now
= Date
.now() / 1000;
297 let task
= Proxmox
.Utils
.parse_task_upid(v
.upid
);
298 let verify_time
= Proxmox
.Utils
.render_timestamp(task
.starttime
);
299 tip
= `Last verify task started on ${verify_time}`;
300 if (now
- v
.starttime
> 30 * 24 * 60 * 60) {
301 tip
= `Last verify task over 30 days ago: ${verify_time}`;
302 iconCls
= 'check warning';
305 return `<span data-qtip="${tip}"> ${i(iconCls, txt)} </span>`;
308 render_backup_status: function(value
, meta
, record
) {
309 if (typeof value
=== 'undefined') {
313 let iconCls
= 'check-circle good';
314 let text
= gettext('Yes');
316 if (!PVE
.Parser
.parseBoolean(value
.toString())) {
317 iconCls
= 'times-circle critical';
319 text
= gettext('No');
321 let reason
= record
.get('reason');
322 if (typeof reason
!== 'undefined') {
323 if (reason
in PVE
.Utils
.backup_reasons_table
) {
324 reason
= PVE
.Utils
.backup_reasons_table
[record
.get('reason')];
326 text
= `${text} - ${reason}`;
330 return `<i class="fa fa-${iconCls}"></i> ${text}`;
333 render_backup_days_of_week: function(val
) {
334 var dows
= ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
337 val
.split(',').forEach(function(day
) {
339 var dow
= (dows
.indexOf(day
)+6)%7;
341 if (selected
.length
=== 0 || selected
[selected
.length
-1] === 0) {
344 selected
[selected
.length
-1]++;
357 selected
.forEach(function(item
) {
360 days
.push(Ext
.Date
.dayNames
[cur
+1] + '-' + Ext
.Date
.dayNames
[(cur
+item
)%7]);
362 } else if (item
=== 2) {
363 days
.push(Ext
.Date
.dayNames
[cur
+1]);
364 days
.push(Ext
.Date
.dayNames
[(cur
+2)%7]);
366 } else if (item
=== 1) {
367 days
.push(Ext
.Date
.dayNames
[(cur
+1)%7]);
370 return days
.join(', ');
373 render_backup_selection: function(value
, metaData
, record
) {
374 let allExceptText
= gettext('All except {0}');
375 let allText
= '-- ' + gettext('All') + ' --';
376 if (record
.data
.all
) {
377 if (record
.data
.exclude
) {
378 return Ext
.String
.format(allExceptText
, record
.data
.exclude
);
382 if (record
.data
.vmid
) {
383 return record
.data
.vmid
;
386 if (record
.data
.pool
) {
387 return "Pool '"+ record
.data
.pool
+ "'";
393 backup_reasons_table
: {
394 'backup=yes': gettext('Enabled'),
395 'backup=no': gettext('Disabled'),
396 'enabled': gettext('Enabled'),
397 'disabled': gettext('Disabled'),
398 'not a volume': gettext('Not a volume'),
399 'efidisk but no OMVF BIOS': gettext('EFI Disk without OMVF BIOS'),
402 get_kvm_osinfo: function(value
) {
403 var info
= { base
: 'Other' }; // default
405 Ext
.each(Object
.keys(PVE
.Utils
.kvm_ostypes
), function(k
) {
406 Ext
.each(PVE
.Utils
.kvm_ostypes
[k
], function(e
) {
407 if (e
.val
=== value
) {
408 info
= { desc
: e
.desc
, base
: k
};
416 render_kvm_ostype: function(value
) {
417 var osinfo
= PVE
.Utils
.get_kvm_osinfo(value
);
418 if (osinfo
.desc
&& osinfo
.desc
!== '-') {
419 return osinfo
.base
+ ' ' + osinfo
.desc
;
425 render_hotplug_features: function(value
) {
428 if (!value
|| value
=== '0') {
429 return gettext('Disabled');
433 value
= 'disk,network,usb';
436 Ext
.each(value
.split(','), function(el
) {
438 fa
.push(gettext('Disk'));
439 } else if (el
=== 'network') {
440 fa
.push(gettext('Network'));
441 } else if (el
=== 'usb') {
443 } else if (el
=== 'memory') {
444 fa
.push(gettext('Memory'));
445 } else if (el
=== 'cpu') {
446 fa
.push(gettext('CPU'));
452 return fa
.join(', ');
455 render_localtime: function(value
) {
456 if (value
=== '__default__') {
457 return Proxmox
.Utils
.defaultText
+ ' (' + gettext('Enabled for Windows') + ')';
459 return Proxmox
.Utils
.format_boolean(value
);
462 render_qga_features: function(config
) {
464 return Proxmox
.Utils
.defaultText
+ ' (' + Proxmox
.Utils
.disabledText
+ ')';
466 let qga
= PVE
.Parser
.parsePropertyString(config
, 'enabled');
467 if (!PVE
.Parser
.parseBoolean(qga
.enabled
)) {
468 return Proxmox
.Utils
.disabledText
;
472 let agentstring
= Proxmox
.Utils
.enabledText
;
474 for (const [key
, value
] of Object
.entries(qga
)) {
475 let displayText
= Proxmox
.Utils
.disabledText
;
476 if (key
=== 'type') {
481 displayText
= map
[value
] || Proxmox
.Utils
.unknownText
;
482 } else if (PVE
.Parser
.parseBoolean(value
)) {
483 displayText
= Proxmox
.Utils
.enabledText
;
485 agentstring
+= `, ${key}: ${displayText}`;
491 render_qemu_machine: function(value
) {
492 return value
|| Proxmox
.Utils
.defaultText
+ ' (i440fx)';
495 render_qemu_bios: function(value
) {
497 return Proxmox
.Utils
.defaultText
+ ' (SeaBIOS)';
498 } else if (value
=== 'seabios') {
500 } else if (value
=== 'ovmf') {
501 return "OVMF (UEFI)";
507 render_dc_ha_opts: function(value
) {
509 return Proxmox
.Utils
.defaultText
;
511 return PVE
.Parser
.printPropertyString(value
);
514 render_as_property_string: function(value
) {
515 return !value
? Proxmox
.Utils
.defaultText
516 : PVE
.Parser
.printPropertyString(value
);
519 render_scsihw: function(value
) {
521 return Proxmox
.Utils
.defaultText
+ ' (LSI 53C895A)';
522 } else if (value
=== 'lsi') {
523 return 'LSI 53C895A';
524 } else if (value
=== 'lsi53c810') {
526 } else if (value
=== 'megasas') {
527 return 'MegaRAID SAS 8708EM2';
528 } else if (value
=== 'virtio-scsi-pci') {
529 return 'VirtIO SCSI';
530 } else if (value
=== 'virtio-scsi-single') {
531 return 'VirtIO SCSI single';
532 } else if (value
=== 'pvscsi') {
533 return 'VMware PVSCSI';
539 render_spice_enhancements: function(values
) {
540 let props
= PVE
.Parser
.parsePropertyString(values
);
541 if (Ext
.Object
.isEmpty(props
)) {
542 return Proxmox
.Utils
.noneText
;
546 if (PVE
.Parser
.parseBoolean(props
.foldersharing
)) {
547 output
.push('Folder Sharing: ' + gettext('Enabled'));
549 if (props
.videostreaming
=== 'all' || props
.videostreaming
=== 'filter') {
550 output
.push('Video Streaming: ' + props
.videostreaming
);
552 return output
.join(', ');
555 // fixme: auto-generate this
556 // for now, please keep in sync with PVE::Tools::kvmkeymaps
561 'de-ch': 'German (Swiss)',
562 'en-gb': 'English (UK)',
563 'en-us': 'English (USA)',
567 //fo: 'Faroe Islands',
569 'fr-be': 'French (Belgium)',
570 'fr-ca': 'French (Canada)',
571 'fr-ch': 'French (Swiss)',
581 //'nl-be': 'Dutch (Belgium)',
585 'pt-br': 'Portuguese (Brazil)',
594 std
: gettext('Standard VGA'),
595 vmware
: gettext('VMware compatible'),
597 qxl2
: 'SPICE dual monitor',
598 qxl3
: 'SPICE three monitors',
599 qxl4
: 'SPICE four monitors',
600 serial0
: gettext('Serial terminal') + ' 0',
601 serial1
: gettext('Serial terminal') + ' 1',
602 serial2
: gettext('Serial terminal') + ' 2',
603 serial3
: gettext('Serial terminal') + ' 3',
604 virtio
: 'VirtIO-GPU',
605 none
: Proxmox
.Utils
.noneText
,
608 render_kvm_language: function(value
) {
609 if (!value
|| value
=== '__default__') {
610 return Proxmox
.Utils
.defaultText
;
612 var text
= PVE
.Utils
.kvm_keymaps
[value
];
614 return text
+ ' (' + value
+ ')';
619 kvm_keymap_array: function() {
620 var data
= [['__default__', PVE
.Utils
.render_kvm_language('')]];
621 Ext
.Object
.each(PVE
.Utils
.kvm_keymaps
, function(key
, value
) {
622 data
.push([key
, PVE
.Utils
.render_kvm_language(value
)]);
629 '__default__': Proxmox
.Utils
.defaultText
+ ' (xterm.js)',
630 'vv': 'SPICE (remote-viewer)',
631 'html5': 'HTML5 (noVNC)',
632 'xtermjs': 'xterm.js',
635 render_console_viewer: function(value
) {
636 value
= value
|| '__default__';
637 if (PVE
.Utils
.console_map
[value
]) {
638 return PVE
.Utils
.console_map
[value
];
643 console_viewer_array: function() {
644 return Ext
.Array
.map(Object
.keys(PVE
.Utils
.console_map
), function(v
) {
645 return [v
, PVE
.Utils
.render_console_viewer(v
)];
649 render_kvm_vga_driver: function(value
) {
651 return Proxmox
.Utils
.defaultText
;
653 var vga
= PVE
.Parser
.parsePropertyString(value
, 'type');
654 var text
= PVE
.Utils
.kvm_vga_drivers
[vga
.type
];
656 text
= Proxmox
.Utils
.defaultText
;
659 return text
+ ' (' + value
+ ')';
664 kvm_vga_driver_array: function() {
665 var data
= [['__default__', PVE
.Utils
.render_kvm_vga_driver('')]];
666 Ext
.Object
.each(PVE
.Utils
.kvm_vga_drivers
, function(key
, value
) {
667 data
.push([key
, PVE
.Utils
.render_kvm_vga_driver(value
)]);
673 render_kvm_startup: function(value
) {
674 var startup
= PVE
.Parser
.parseStartup(value
);
677 if (startup
.order
=== undefined) {
680 res
+= startup
.order
;
682 if (startup
.up
!== undefined) {
683 res
+= ',up=' + startup
.up
;
685 if (startup
.down
!== undefined) {
686 res
+= ',down=' + startup
.down
;
692 extractFormActionError: function(action
) {
694 switch (action
.failureType
) {
695 case Ext
.form
.action
.Action
.CLIENT_INVALID
:
696 msg
= gettext('Form fields may not be submitted with invalid values');
698 case Ext
.form
.action
.Action
.CONNECT_FAILURE
:
699 msg
= gettext('Connection error');
700 var resp
= action
.response
;
701 if (resp
.status
&& resp
.statusText
) {
702 msg
+= " " + resp
.status
+ ": " + resp
.statusText
;
705 case Ext
.form
.action
.Action
.LOAD_FAILURE
:
706 case Ext
.form
.action
.Action
.SERVER_INVALID
:
707 msg
= Proxmox
.Utils
.extractRequestError(action
.result
, true);
714 'images': gettext('Disk image'),
715 'backup': gettext('VZDump backup file'),
716 'vztmpl': gettext('Container template'),
717 'iso': gettext('ISO image'),
718 'rootdir': gettext('Container'),
719 'snippets': gettext('Snippets'),
722 volume_is_qemu_backup: function(volid
, format
) {
723 return format
=== 'pbs-vm' || volid
.match(':backup/vzdump-qemu-');
726 volume_is_lxc_backup: function(volid
, format
) {
727 return format
=== 'pbs-ct' || volid
.match(':backup/vzdump-(lxc|openvz)-');
732 name
: gettext('Active Directory Server'),
733 ipanel
: 'pveAuthADPanel',
734 syncipanel
: 'pveAuthLDAPSyncPanel',
738 name
: gettext('LDAP Server'),
739 ipanel
: 'pveAuthLDAPPanel',
740 syncipanel
: 'pveAuthLDAPSyncPanel',
745 ipanel
: 'pveAuthBasePanel',
749 name
: 'Proxmox VE authentication server',
750 ipanel
: 'pveAuthBasePanel',
757 name
: Proxmox
.Utils
.directoryText
,
758 ipanel
: 'DirInputPanel',
764 ipanel
: 'LVMInputPanel',
770 ipanel
: 'LvmThinInputPanel',
776 ipanel
: 'NFSInputPanel',
782 ipanel
: 'CIFSInputPanel',
788 ipanel
: 'GlusterFsInputPanel',
794 ipanel
: 'IScsiInputPanel',
800 ipanel
: 'CephFSInputPanel',
805 name
: 'CephFS (PVE)',
806 ipanel
: 'CephFSInputPanel',
813 ipanel
: 'RBDInputPanel',
819 ipanel
: 'RBDInputPanel',
825 name
: 'ZFS over iSCSI',
826 ipanel
: 'ZFSInputPanel',
832 ipanel
: 'ZFSPoolInputPanel',
837 name
: 'Proxmox Backup Server',
838 ipanel
: 'PBSInputPanel',
863 ipanel
: 'SimpleInputPanel',
868 ipanel
: 'VlanInputPanel',
873 ipanel
: 'QinQInputPanel',
878 ipanel
: 'VxlanInputPanel',
883 ipanel
: 'EvpnInputPanel',
888 sdncontrollerSchema
: {
895 ipanel
: 'EvpnInputPanel',
896 faIcon
: 'crosshairs',
900 ipanel
: 'BgpInputPanel',
901 faIcon
: 'crosshairs',
912 ipanel
: 'PVEIpamInputPanel',
918 ipanel
: 'NetboxInputPanel',
923 ipanel
: 'PhpIpamInputPanel',
935 ipanel
: 'PowerdnsInputPanel',
940 format_sdnvnet_type: function(value
, md
, record
) {
941 var schema
= PVE
.Utils
.sdnvnetSchema
[value
];
945 return Proxmox
.Utils
.unknownText
;
948 format_sdnzone_type: function(value
, md
, record
) {
949 var schema
= PVE
.Utils
.sdnzoneSchema
[value
];
953 return Proxmox
.Utils
.unknownText
;
956 format_sdncontroller_type: function(value
, md
, record
) {
957 var schema
= PVE
.Utils
.sdncontrollerSchema
[value
];
961 return Proxmox
.Utils
.unknownText
;
964 format_sdnipam_type: function(value
, md
, record
) {
965 var schema
= PVE
.Utils
.sdnipamSchema
[value
];
969 return Proxmox
.Utils
.unknownText
;
972 format_sdndns_type: function(value
, md
, record
) {
973 var schema
= PVE
.Utils
.sdndnsSchema
[value
];
977 return Proxmox
.Utils
.unknownText
;
980 format_storage_type: function(value
, md
, record
) {
981 if (value
=== 'rbd') {
982 value
= !record
|| record
.get('monhost') ? 'rbd' : 'pveceph';
983 } else if (value
=== 'cephfs') {
984 value
= !record
|| record
.get('monhost') ? 'cephfs' : 'pvecephfs';
987 var schema
= PVE
.Utils
.storageSchema
[value
];
991 return Proxmox
.Utils
.unknownText
;
994 format_ha: function(value
) {
995 var text
= Proxmox
.Utils
.noneText
;
998 text
= value
.state
|| Proxmox
.Utils
.noneText
;
1000 text
+= ', ' + Proxmox
.Utils
.groupText
+ ': ';
1001 text
+= value
.group
|| Proxmox
.Utils
.noneText
;
1007 format_content_types: function(value
) {
1008 return value
.split(',').sort().map(function(ct
) {
1009 return PVE
.Utils
.contentTypes
[ct
] || ct
;
1013 render_storage_content: function(value
, metaData
, record
) {
1014 var data
= record
.data
;
1015 if (Ext
.isNumber(data
.channel
) &&
1016 Ext
.isNumber(data
.id
) &&
1017 Ext
.isNumber(data
.lun
)) {
1019 Ext
.String
.leftPad(data
.channel
, 2, '0') +
1020 " ID " + data
.id
+ " LUN " + data
.lun
;
1022 return data
.volid
.replace(/^.*?:(.*?\/)?/, '');
1025 render_serverity: function(value
) {
1026 return PVE
.Utils
.log_severity_hash
[value
] || value
;
1029 calculate_hostcpu: function(data
) {
1030 if (!(data
.uptime
&& Ext
.isNumeric(data
.cpu
))) {
1034 if (data
.type
!== 'qemu' && data
.type
!== 'lxc') {
1038 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + data
.node
);
1039 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1040 if (!Ext
.isDefined(node
) || node
=== null) {
1043 var maxcpu
= node
.data
.maxcpu
|| 1;
1045 if (!Ext
.isNumeric(maxcpu
) && (maxcpu
>= 1)) {
1049 return (data
.cpu
/maxcpu
) * data
.maxcpu
;
1052 render_hostcpu: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1053 if (!(record
.data
.uptime
&& Ext
.isNumeric(record
.data
.cpu
))) {
1057 if (record
.data
.type
!== 'qemu' && record
.data
.type
!== 'lxc') {
1061 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + record
.data
.node
);
1062 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1063 if (!Ext
.isDefined(node
) || node
=== null) {
1066 var maxcpu
= node
.data
.maxcpu
|| 1;
1068 if (!Ext
.isNumeric(maxcpu
) && (maxcpu
>= 1)) {
1072 var per
= (record
.data
.cpu
/maxcpu
) * record
.data
.maxcpu
* 100;
1074 return per
.toFixed(1) + '% of ' + maxcpu
.toString() + (maxcpu
> 1 ? 'CPUs' : 'CPU');
1077 render_bandwidth: function(value
) {
1078 if (!Ext
.isNumeric(value
)) {
1082 return Proxmox
.Utils
.format_size(value
) + '/s';
1085 render_timestamp_human_readable: function(value
) {
1086 return Ext
.Date
.format(new Date(value
* 1000), 'l d F Y H:i:s');
1089 calculate_mem_usage: function(data
) {
1090 if (!Ext
.isNumeric(data
.mem
) ||
1091 data
.maxmem
=== 0 ||
1096 return data
.mem
/ data
.maxmem
;
1099 calculate_hostmem_usage: function(data
) {
1100 if (data
.type
!== 'qemu' && data
.type
!== 'lxc') {
1104 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + data
.node
);
1105 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1107 if (!Ext
.isDefined(node
) || node
=== null) {
1110 var maxmem
= node
.data
.maxmem
|| 0;
1112 if (!Ext
.isNumeric(data
.mem
) ||
1118 return data
.mem
/ maxmem
;
1121 render_mem_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1122 if (!Ext
.isNumeric(value
) || value
=== -1) {
1126 // we got no percentage but bytes
1128 var maxmem
= record
.data
.maxmem
;
1129 if (!record
.data
.uptime
||
1131 !Ext
.isNumeric(mem
)) {
1135 return (mem
*100/maxmem
).toFixed(1) + " %";
1137 return (value
*100).toFixed(1) + " %";
1140 render_hostmem_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1141 if (!Ext
.isNumeric(record
.data
.mem
) || value
=== -1) {
1145 if (record
.data
.type
!== 'qemu' && record
.data
.type
!== 'lxc') {
1149 var index
= PVE
.data
.ResourceStore
.findExact('id', 'node/' + record
.data
.node
);
1150 var node
= PVE
.data
.ResourceStore
.getAt(index
);
1151 var maxmem
= node
.data
.maxmem
|| 0;
1153 if (record
.data
.mem
> 1) {
1154 // we got no percentage but bytes
1155 var mem
= record
.data
.mem
;
1156 if (!record
.data
.uptime
||
1158 !Ext
.isNumeric(mem
)) {
1162 return ((mem
*100)/maxmem
).toFixed(1) + " %";
1164 return (value
*100).toFixed(1) + " %";
1167 render_mem_usage: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1169 var maxmem
= record
.data
.maxmem
;
1171 if (!record
.data
.uptime
) {
1175 if (!(Ext
.isNumeric(mem
) && maxmem
)) {
1179 return Proxmox
.Utils
.render_size(value
);
1182 calculate_disk_usage: function(data
) {
1183 if (!Ext
.isNumeric(data
.disk
) ||
1184 ((data
.type
=== 'qemu' || data
.type
=== 'lxc') && data
.uptime
=== 0) ||
1190 return data
.disk
/ data
.maxdisk
;
1193 render_disk_usage_percent: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1194 if (!Ext
.isNumeric(value
) || value
=== -1) {
1198 return (value
* 100).toFixed(1) + " %";
1201 render_disk_usage: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1203 var maxdisk
= record
.data
.maxdisk
;
1204 var type
= record
.data
.type
;
1206 if (!Ext
.isNumeric(disk
) ||
1208 ((type
=== 'qemu' || type
=== 'lxc') && record
.data
.uptime
=== 0)
1213 return Proxmox
.Utils
.render_size(value
);
1216 get_object_icon_class: function(type
, record
) {
1220 if (type
=== 'type') {
1222 objType
= record
.groupbyid
;
1223 } else if (record
.template
) {
1225 objType
= 'template';
1229 status
= record
.status
+ ' ha-' + record
.hastate
;
1233 status
+= ' locked lock-' + record
.lock
;
1236 var defaults
= PVE
.tree
.ResourceTree
.typeDefaults
[objType
];
1237 if (defaults
&& defaults
.iconCls
) {
1238 var retVal
= defaults
.iconCls
+ ' ' + status
;
1245 render_resource_type: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1246 var cls
= PVE
.Utils
.get_object_icon_class(value
, record
.data
);
1248 var fa
= '<i class="fa-fw x-grid-icon-custom ' + cls
+ '"></i> ';
1252 render_support_level: function(value
, metaData
, record
) {
1253 return PVE
.Utils
.support_level_hash
[value
] || '-';
1256 render_upid: function(value
, metaData
, record
) {
1257 var type
= record
.data
.type
;
1258 var id
= record
.data
.id
;
1260 return Proxmox
.Utils
.format_task_description(type
, id
);
1263 render_optional_url: function(value
) {
1264 if (value
&& value
.match(/^https?:\/\//)) {
1265 return '<a target="_blank" href="' + value
+ '">' + value
+ '</a>';
1270 render_san: function(value
) {
1272 if (Ext
.isArray(value
)) {
1273 value
.forEach(function(val
) {
1274 if (!Ext
.isNumber(val
)) {
1278 return names
.join('<br>');
1283 render_full_name: function(firstname
, metaData
, record
) {
1284 var first
= firstname
|| '';
1285 var last
= record
.data
.lastname
|| '';
1286 return Ext
.htmlEncode(first
+ " " + last
);
1289 render_u2f_error: function(error
) {
1291 '1': gettext('Other Error'),
1292 '2': gettext('Bad Request'),
1293 '3': gettext('Configuration Unsupported'),
1294 '4': gettext('Device Ineligible'),
1295 '5': gettext('Timeout'),
1297 return "U2F Error: " + ErrorNames
[error
] || Proxmox
.Utils
.unknownText
;
1300 windowHostname: function() {
1301 return window
.location
.hostname
.replace(Proxmox
.Utils
.IP6_bracket_match
,
1302 function(m
, addr
, offset
, original
) { return addr
; });
1305 openDefaultConsoleWindow: function(consoles
, consoleType
, vmid
, nodename
, vmname
, cmd
) {
1306 var dv
= PVE
.Utils
.defaultViewer(consoles
, consoleType
);
1307 PVE
.Utils
.openConsoleWindow(dv
, consoleType
, vmid
, nodename
, vmname
, cmd
);
1310 openConsoleWindow: function(viewer
, consoleType
, vmid
, nodename
, vmname
, cmd
) {
1311 if (vmid
=== undefined && (consoleType
=== 'kvm' || consoleType
=== 'lxc')) {
1312 throw "missing vmid";
1315 throw "no nodename specified";
1318 if (viewer
=== 'html5') {
1319 PVE
.Utils
.openVNCViewer(consoleType
, vmid
, nodename
, vmname
, cmd
);
1320 } else if (viewer
=== 'xtermjs') {
1321 Proxmox
.Utils
.openXtermJsViewer(consoleType
, vmid
, nodename
, vmname
, cmd
);
1322 } else if (viewer
=== 'vv') {
1323 let url
= '/nodes/' + nodename
+ '/spiceshell';
1325 proxy
: PVE
.Utils
.windowHostname(),
1327 if (consoleType
=== 'kvm') {
1328 url
= '/nodes/' + nodename
+ '/qemu/' + vmid
.toString() + '/spiceproxy';
1329 } else if (consoleType
=== 'lxc') {
1330 url
= '/nodes/' + nodename
+ '/lxc/' + vmid
.toString() + '/spiceproxy';
1331 } else if (consoleType
=== 'upgrade') {
1332 params
.cmd
= 'upgrade';
1333 } else if (consoleType
=== 'cmd') {
1335 } else if (consoleType
!== 'shell') {
1336 throw `unknown spice viewer type '${consoleType}'`;
1338 PVE
.Utils
.openSpiceViewer(url
, params
);
1340 throw `unknown viewer type '${viewer}'`;
1344 defaultViewer: function(consoles
, type
) {
1345 var allowSpice
, allowXtermjs
;
1347 if (consoles
=== true) {
1349 allowXtermjs
= true;
1350 } else if (typeof consoles
=== 'object') {
1351 allowSpice
= consoles
.spice
;
1352 allowXtermjs
= !!consoles
.xtermjs
;
1354 let dv
= PVE
.VersionInfo
.console
|| (type
=== 'kvm' ? 'vv' : 'xtermjs');
1355 if (dv
=== 'vv' && !allowSpice
) {
1356 dv
= allowXtermjs
? 'xtermjs' : 'html5';
1357 } else if (dv
=== 'xtermjs' && !allowXtermjs
) {
1358 dv
= allowSpice
? 'vv' : 'html5';
1364 openVNCViewer: function(vmtype
, vmid
, nodename
, vmname
, cmd
) {
1365 let scaling
= 'off';
1366 if (Proxmox
.Utils
.toolkit
!== 'touch') {
1367 var sp
= Ext
.state
.Manager
.getProvider();
1368 scaling
= sp
.get('novnc-scaling', 'off');
1370 var url
= Ext
.Object
.toQueryString({
1371 console
: vmtype
, // kvm, lxc, upgrade or shell
1379 var nw
= window
.open("?" + url
, '_blank', "innerWidth=745,innerheight=427");
1385 openSpiceViewer: function(url
, params
) {
1386 var downloadWithName = function(uri
, name
) {
1387 var link
= Ext
.DomHelper
.append(document
.body
, {
1390 css
: 'display:none;visibility:hidden;height:0px;',
1393 // Note: we need to tell Android and Chrome the correct file name extension
1394 // but we do not set 'download' tag for other environments, because
1395 // It can have strange side effects (additional user prompt on firefox)
1396 if (navigator
.userAgent
.match(/Android|Chrome/i)) {
1397 link
.download
= name
;
1400 if (link
.fireEvent
) {
1401 link
.fireEvent('onclick');
1403 let evt
= document
.createEvent("MouseEvents");
1404 evt
.initMouseEvent('click', true, true, window
, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
1405 link
.dispatchEvent(evt
);
1409 Proxmox
.Utils
.API2Request({
1413 failure: function(response
, opts
) {
1414 Ext
.Msg
.alert('Error', response
.htmlStatus
);
1416 success: function(response
, opts
) {
1417 let cfg
= response
.result
.data
;
1418 let raw
= Object
.entries(cfg
).reduce((acc
, [k
, v
]) => acc
+ `${k}=${v}\n`, "[virt-viewer]\n");
1419 let spiceDownload
= 'data:application/x-virt-viewer;charset=UTF-8,' + encodeURIComponent(raw
);
1420 downloadWithName(spiceDownload
, "pve-spice.vv");
1425 openTreeConsole: function(tree
, record
, item
, index
, e
) {
1427 let nodename
= record
.data
.node
;
1428 let vmid
= record
.data
.vmid
;
1429 let vmname
= record
.data
.name
;
1430 if (record
.data
.type
=== 'qemu' && !record
.data
.template
) {
1431 Proxmox
.Utils
.API2Request({
1432 url
: `/nodes/${nodename}/qemu/${vmid}/status/current`,
1433 failure
: response
=> Ext
.Msg
.alert('Error', response
.htmlStatus
),
1434 success: function(response
, opts
) {
1435 let conf
= response
.result
.data
;
1437 spice
: !!conf
.spice
,
1438 xtermjs
: !!conf
.serial
,
1440 PVE
.Utils
.openDefaultConsoleWindow(consoles
, 'kvm', vmid
, nodename
, vmname
);
1443 } else if (record
.data
.type
=== 'lxc' && !record
.data
.template
) {
1444 PVE
.Utils
.openDefaultConsoleWindow(true, 'lxc', vmid
, nodename
, vmname
);
1448 // test automation helper
1449 call_menu_handler: function(menu
, text
) {
1450 let item
= menu
.query('menuitem').find(el
=> el
.text
=== text
);
1451 if (item
&& item
.handler
) {
1456 createCmdMenu: function(v
, record
, item
, index
, event
) {
1458 if (!(v
instanceof Ext
.tree
.View
)) {
1462 let type
= record
.data
.type
;
1464 if (record
.data
.template
) {
1465 if (type
=== 'qemu' || type
=== 'lxc') {
1466 menu
= Ext
.create('PVE.menu.TemplateMenu', {
1470 } else if (type
=== 'qemu' || type
=== 'lxc' || type
=== 'node') {
1471 menu
= Ext
.create('PVE.' + type
+ '.CmdMenu', {
1473 nodename
: record
.data
.node
,
1479 menu
.showAt(event
.getXY());
1483 // helper for deleting field which are set to there default values
1484 delete_if_default: function(values
, fieldname
, default_val
, create
) {
1485 if (values
[fieldname
] === '' || values
[fieldname
] === default_val
) {
1487 if (values
.delete) {
1488 if (Ext
.isArray(values
.delete)) {
1489 values
.delete.push(fieldname
);
1491 values
.delete += ',' + fieldname
;
1494 values
.delete = fieldname
;
1498 delete values
[fieldname
];
1502 loadSSHKeyFromFile: function(file
, callback
) {
1503 // ssh-keygen produces ~ 740 bytes for a 4096 bit RSA key, current max is 16 kbit, so assume:
1504 // 740 * 8 for max. 32kbit (5920 bytes), round upwards to 8192 bytes, leaves lots of comment space
1505 PVE
.Utils
.loadFile(file
, callback
, 8192);
1508 loadFile: function(file
, callback
, maxSize
) {
1509 maxSize
= maxSize
|| 32 * 1024;
1510 if (file
.size
> maxSize
) {
1511 Ext
.Msg
.alert(gettext('Error'), `${gettext("Invalid file size")}: ${file.size} > ${maxSize}`);
1514 let reader
= new FileReader();
1515 reader
.onload
= evt
=> callback(evt
.target
.result
);
1516 reader
.readAsText(file
);
1519 loadTextFromFile: function(file
, callback
, maxBytes
) {
1520 let maxSize
= maxBytes
|| 8192;
1521 if (file
.size
> maxSize
) {
1522 Ext
.Msg
.alert(gettext('Error'), gettext("Invalid file size: ") + file
.size
);
1525 let reader
= new FileReader();
1526 reader
.onload
= evt
=> callback(evt
.target
.result
);
1527 reader
.readAsText(file
);
1530 diskControllerMaxIDs
: {
1537 // types is either undefined (all busses), an array of busses, or a single bus
1538 forEachBus: function(types
, func
) {
1539 let busses
= Object
.keys(PVE
.Utils
.diskControllerMaxIDs
);
1541 if (Ext
.isArray(types
)) {
1543 } else if (Ext
.isDefined(types
)) {
1547 // check if we only have valid busses
1548 for (let i
= 0; i
< busses
.length
; i
++) {
1549 if (!PVE
.Utils
.diskControllerMaxIDs
[busses
[i
]]) {
1550 throw "invalid bus: '" + busses
[i
] + "'";
1554 for (let i
= 0; i
< busses
.length
; i
++) {
1555 let count
= PVE
.Utils
.diskControllerMaxIDs
[busses
[i
]];
1556 for (let j
= 0; j
< count
; j
++) {
1557 let cont
= func(busses
[i
], j
);
1558 if (!cont
&& cont
!== undefined) {
1570 forEachMP: function(func
, includeUnused
) {
1571 for (let i
= 0; i
< PVE
.Utils
.mp_counts
.mps
; i
++) {
1572 let cont
= func('mp', i
);
1573 if (!cont
&& cont
!== undefined) {
1578 if (!includeUnused
) {
1582 for (let i
= 0; i
< PVE
.Utils
.mp_counts
.unused
; i
++) {
1583 let cont
= func('unused', i
);
1584 if (!cont
&& cont
!== undefined) {
1590 hardware_counts
: { net
: 32, usb
: 5, hostpci
: 16, audio
: 1, efidisk
: 1, serial
: 4, rng
: 1 },
1592 cleanEmptyObjectKeys: function(obj
) {
1593 for (const propName
of Object
.keys(obj
)) {
1594 if (obj
[propName
] === null || obj
[propName
] === undefined) {
1595 delete obj
[propName
];
1600 acmedomain_count
: 5,
1602 add_domain_to_acme: function(acme
, domain
) {
1603 if (acme
.domains
=== undefined) {
1604 acme
.domains
= [domain
];
1606 acme
.domains
.push(domain
);
1607 acme
.domains
= acme
.domains
.filter((value
, index
, self
) => self
.indexOf(value
) === index
);
1612 remove_domain_from_acme: function(acme
, domain
) {
1613 if (acme
.domains
!== undefined) {
1616 .filter((value
, index
, self
) => self
.indexOf(value
) === index
&& value
!== domain
);
1621 handleStoreErrorOrMask: function(view
, store
, regex
, callback
) {
1622 view
.mon(store
, 'load', function(proxy
, response
, success
, operation
) {
1624 Proxmox
.Utils
.setErrorMask(view
, false);
1628 if (operation
.error
.statusText
) {
1629 if (operation
.error
.statusText
.match(regex
)) {
1630 callback(view
, operation
.error
);
1633 msg
= operation
.error
.statusText
+ ' (' + operation
.error
.status
+ ')';
1636 msg
= gettext('Connection error');
1638 Proxmox
.Utils
.setErrorMask(view
, msg
);
1642 showCephInstallOrMask: function(container
, msg
, nodename
, callback
) {
1643 if (msg
.match(/not (installed|initialized)/i)) {
1644 if (Proxmox
.UserName
=== 'root@pam') {
1645 container
.el
.mask();
1646 if (!container
.down('pveCephInstallWindow')) {
1647 var isInstalled
= !!msg
.match(/not initialized/i);
1648 var win
= Ext
.create('PVE.ceph.Install', {
1651 win
.getViewModel().set('isInstalled', isInstalled
);
1657 container
.mask(Ext
.String
.format(gettext('{0} not installed.') +
1658 ' ' + gettext('Log in as root to install.'), 'Ceph'), ['pve-static-mask']);
1666 monitor_ceph_installed: function(view
, rstore
, nodename
, maskOwnerCt
) {
1667 PVE
.Utils
.handleStoreErrorOrMask(
1670 /not (installed|initialized)/i,
1672 nodename
= nodename
|| 'localhost';
1673 let maskTarget
= maskOwnerCt
? view
.ownerCt
: view
;
1674 rstore
.stopUpdate();
1675 PVE
.Utils
.showCephInstallOrMask(maskTarget
, error
.statusText
, nodename
, win
=> {
1676 view
.mon(win
, 'cephInstallWindowClosed', () => rstore
.startUpdate());
1683 propertyStringSet: function(target
, source
, name
, value
) {
1685 if (value
=== undefined) {
1686 target
[name
] = source
;
1688 target
[name
] = value
;
1691 delete target
[name
];
1695 forEachCorosyncLink: function(nodeinfo
, cb
) {
1696 let re
= /(?:ring|link)(\d+)_addr/;
1697 Ext
.iterate(nodeinfo
, (prop
, val
) => {
1698 let match
= re
.exec(prop
);
1700 cb(Number(match
[1]), val
);
1707 'AuthenticAMD': 'AMD',
1708 'GenuineIntel': 'Intel',
1716 "_default_": 5, // includes custom models
1719 verify_ip64_address_list: function(value
, with_suffix
) {
1720 for (let addr
of value
.split(/[ ,;]+/)) {
1726 let parts
= addr
.split('%');
1729 if (parts
.length
> 2) {
1733 if (parts
.length
> 1 && !addr
.startsWith('fe80:')) {
1738 if (!Proxmox
.Utils
.IP64_match
.test(addr
)) {
1748 constructor: function() {
1750 Ext
.apply(me
, me
.utilities
);
1752 Proxmox
.Utils
.override_task_descriptions({
1753 acmedeactivate
: ['ACME Account', gettext('Deactivate')],
1754 acmenewcert
: ['SRV', gettext('Order Certificate')],
1755 acmerefresh
: ['ACME Account', gettext('Refresh')],
1756 acmeregister
: ['ACME Account', gettext('Register')],
1757 acmerenew
: ['SRV', gettext('Renew Certificate')],
1758 acmerevoke
: ['SRV', gettext('Revoke Certificate')],
1759 acmeupdate
: ['ACME Account', gettext('Update')],
1760 'auth-realm-sync': [gettext('Realm'), gettext('Sync')],
1761 'auth-realm-sync-test': [gettext('Realm'), gettext('Sync Preview')],
1762 cephcreatemds
: ['Ceph Metadata Server', gettext('Create')],
1763 cephcreatemgr
: ['Ceph Manager', gettext('Create')],
1764 cephcreatemon
: ['Ceph Monitor', gettext('Create')],
1765 cephcreateosd
: ['Ceph OSD', gettext('Create')],
1766 cephcreatepool
: ['Ceph Pool', gettext('Create')],
1767 cephdestroymds
: ['Ceph Metadata Server', gettext('Destroy')],
1768 cephdestroymgr
: ['Ceph Manager', gettext('Destroy')],
1769 cephdestroymon
: ['Ceph Monitor', gettext('Destroy')],
1770 cephdestroyosd
: ['Ceph OSD', gettext('Destroy')],
1771 cephdestroypool
: ['Ceph Pool', gettext('Destroy')],
1772 cephfscreate
: ['CephFS', gettext('Create')],
1773 cephsetpool
: ['Ceph Pool', gettext('Edit')],
1774 cephsetflags
: ['', gettext('Change global Ceph flags')],
1775 clustercreate
: ['', gettext('Create Cluster')],
1776 clusterjoin
: ['', gettext('Join Cluster')],
1777 dircreate
: [gettext('Directory Storage'), gettext('Create')],
1778 dirremove
: [gettext('Directory'), gettext('Remove')],
1779 download
: ['', gettext('Download')],
1780 hamigrate
: ['HA', gettext('Migrate')],
1781 hashutdown
: ['HA', gettext('Shutdown')],
1782 hastart
: ['HA', gettext('Start')],
1783 hastop
: ['HA', gettext('Stop')],
1784 imgcopy
: ['', gettext('Copy data')],
1785 imgdel
: ['', gettext('Erase data')],
1786 lvmcreate
: [gettext('LVM Storage'), gettext('Create')],
1787 lvmthincreate
: [gettext('LVM-Thin Storage'), gettext('Create')],
1788 migrateall
: ['', gettext('Migrate all VMs and Containers')],
1789 'move_volume': ['CT', gettext('Move Volume')],
1790 'pbs-download': ['VM/CT', gettext('File Restore Download')],
1791 pull_file
: ['CT', gettext('Pull file')],
1792 push_file
: ['CT', gettext('Push file')],
1793 qmclone
: ['VM', gettext('Clone')],
1794 qmconfig
: ['VM', gettext('Configure')],
1795 qmcreate
: ['VM', gettext('Create')],
1796 qmdelsnapshot
: ['VM', gettext('Delete Snapshot')],
1797 qmdestroy
: ['VM', gettext('Destroy')],
1798 qmigrate
: ['VM', gettext('Migrate')],
1799 qmmove
: ['VM', gettext('Move disk')],
1800 qmpause
: ['VM', gettext('Pause')],
1801 qmreboot
: ['VM', gettext('Reboot')],
1802 qmreset
: ['VM', gettext('Reset')],
1803 qmrestore
: ['VM', gettext('Restore')],
1804 qmresume
: ['VM', gettext('Resume')],
1805 qmrollback
: ['VM', gettext('Rollback')],
1806 qmshutdown
: ['VM', gettext('Shutdown')],
1807 qmsnapshot
: ['VM', gettext('Snapshot')],
1808 qmstart
: ['VM', gettext('Start')],
1809 qmstop
: ['VM', gettext('Stop')],
1810 qmsuspend
: ['VM', gettext('Hibernate')],
1811 qmtemplate
: ['VM', gettext('Convert to template')],
1812 spiceproxy
: ['VM/CT', gettext('Console') + ' (Spice)'],
1813 spiceshell
: ['', gettext('Shell') + ' (Spice)'],
1814 startall
: ['', gettext('Start all VMs and Containers')],
1815 stopall
: ['', gettext('Stop all VMs and Containers')],
1816 unknownimgdel
: ['', gettext('Destroy image from unknown guest')],
1817 wipedisk
: ['Device', gettext('Wipe Disk')],
1818 vncproxy
: ['VM/CT', gettext('Console')],
1819 vncshell
: ['', gettext('Shell')],
1820 vzclone
: ['CT', gettext('Clone')],
1821 vzcreate
: ['CT', gettext('Create')],
1822 vzdelsnapshot
: ['CT', gettext('Delete Snapshot')],
1823 vzdestroy
: ['CT', gettext('Destroy')],
1824 vzdump
: (type
, id
) => id
? `VM/CT ${id} - ${gettext('Backup')}` : gettext('Backup Job'),
1825 vzmigrate
: ['CT', gettext('Migrate')],
1826 vzmount
: ['CT', gettext('Mount')],
1827 vzreboot
: ['CT', gettext('Reboot')],
1828 vzrestore
: ['CT', gettext('Restore')],
1829 vzresume
: ['CT', gettext('Resume')],
1830 vzrollback
: ['CT', gettext('Rollback')],
1831 vzshutdown
: ['CT', gettext('Shutdown')],
1832 vzsnapshot
: ['CT', gettext('Snapshot')],
1833 vzstart
: ['CT', gettext('Start')],
1834 vzstop
: ['CT', gettext('Stop')],
1835 vzsuspend
: ['CT', gettext('Suspend')],
1836 vztemplate
: ['CT', gettext('Convert to template')],
1837 vzumount
: ['CT', gettext('Unmount')],
1838 zfscreate
: [gettext('ZFS Storage'), gettext('Create')],