]>
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 // avoid errors when running without development tools
11 if (! Ext
. isDefined ( Ext
. global
. console
)) {
16 console
. log ( "Starting PVE Manager" );
18 Ext
. Ajax
. defaultHeaders
= {
19 'Accept' : 'application/json'
22 Ext
. define ( 'PVE.Utils' , { utilities
: {
24 // this singleton contains miscellaneous utilities
26 toolkit
: undefined , // (extjs|touch), set inside Toolkit.js
28 bus_match
: /^(ide|sata|virtio|scsi)\d+$/ ,
42 'c' : gettext ( 'Community' ),
43 'b' : gettext ( 'Basic' ),
44 's' : gettext ( 'Standard' ),
45 'p' : gettext ( 'Premium' )
48 noSubKeyHtml
: 'You do not have a valid subscription for this server. Please visit <a target="_blank" href="https://www.proxmox.com/products/proxmox-ve/subscription-service-plans">www.proxmox.com</a> to get a list of available options.' ,
52 { desc
: '5.x - 2.6 Kernel' , val
: 'l26' },
53 { desc
: '2.4 Kernel' , val
: 'l24' }
55 'Microsoft Windows' : [
56 { desc
: '10/2016/2019' , val
: 'win10' },
57 { desc
: '8.x/2012/2012r2' , val
: 'win8' },
58 { desc
: '7/2008r2' , val
: 'win7' },
59 { desc
: 'Vista/2008' , val
: 'w2k8' },
60 { desc
: 'XP/2003' , val
: 'wxp' },
61 { desc
: '2000' , val
: 'w2k' }
64 { desc
: '-' , val
: 'solaris' }
67 { desc
: '-' , val
: 'other' }
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
161 get_ceph_icon_html : function ( health
, fw
) {
162 var state
= PVE
. Utils
. map_ceph_health
[ health
];
163 var cls
= PVE
. Utils
. get_health_icon ( state
);
167 return "<i class='fa " + cls
+ "'></i> " ;
172 'HEALTH_UPGRADE' : 'upgrade' ,
174 'HEALTH_WARN' : 'warning' ,
175 'HEALTH_ERR' : 'critical'
178 render_ceph_health : function ( healthObj
) {
180 iconCls
: PVE
. Utils
. get_health_icon (),
184 if (! healthObj
|| ! healthObj
. status
) {
188 var health
= PVE
. Utils
. map_ceph_health
[ healthObj
. status
];
190 state
. iconCls
= PVE
. Utils
. get_health_icon ( health
, true );
191 state
. text
= healthObj
. status
;
196 render_zfs_health : function ( value
) {
197 if ( typeof value
== 'undefined' ){
200 var iconCls
= 'question-circle' ;
204 iconCls
= 'check-circle good' ;
208 iconCls
= 'exclamation-circle warning' ;
213 iconCls
= 'times-circle critical' ;
218 return '<i class="fa fa-' + iconCls
+ '"></i> ' + value
;
222 render_pbs_fingerprint
: fp
=> fp
. substring ( 0 , 23 ),
224 render_backup_encryption : function ( v
, meta
, record
) {
226 return gettext ( 'No' );
230 if ( v
. match ( /^[a-fA-F0-9]{2}:/ )) { // fingerprint
231 tip
= `Key fingerprint ${PVE.Utils.render_pbs_fingerprint(v)} ` ;
233 let icon
= `<i class="fa fa-fw fa-lock good"></i>` ;
234 return `<span data-qtip=" ${tip} "> ${icon} ${gettext('Encrypted')} </span>` ;
237 render_backup_status : function ( value
, meta
, record
) {
238 if ( typeof value
== 'undefined' ) {
242 let iconCls
= 'check-circle good' ;
243 let text
= gettext ( 'Yes' );
245 if (! PVE
. Parser
. parseBoolean ( value
. toString ())) {
246 iconCls
= 'times-circle critical' ;
248 text
= gettext ( 'No' );
250 let reason
= record
. get ( 'reason' );
251 if ( typeof reason
!== 'undefined' ) {
252 if ( reason
in PVE
. Utils
. backup_reasons_table
) {
253 reason
= PVE
. Utils
. backup_reasons_table
[ record
. get ( 'reason' )];
255 text
= ` ${text} - ${reason} ` ;
259 return `<i class="fa fa- ${iconCls} "></i> ${text} ` ;
262 render_backup_days_of_week : function ( val
) {
263 var dows
= [ 'sun' , 'mon' , 'tue' , 'wed' , 'thu' , 'fri' , 'sat' ];
266 val
. split ( ',' ). forEach ( function ( day
){
268 var dow
= ( dows
. indexOf ( day
)+ 6 )% 7 ;
270 if ( selected
. length
=== 0 || selected
[ selected
. length
- 1 ] === 0 ) {
273 selected
[ selected
. length
- 1 ]++;
286 selected
. forEach ( function ( item
) {
289 days
. push ( Ext
. Date
. dayNames
[( cur
+ 1 )] + '-' + Ext
. Date
. dayNames
[( cur
+ item
)% 7 ]);
291 } else if ( item
== 2 ) {
292 days
. push ( Ext
. Date
. dayNames
[ cur
+ 1 ]);
293 days
. push ( Ext
. Date
. dayNames
[( cur
+ 2 )% 7 ]);
295 } else if ( item
== 1 ) {
296 days
. push ( Ext
. Date
. dayNames
[( cur
+ 1 )% 7 ]);
299 return days
. join ( ', ' );
302 render_backup_selection : function ( value
, metaData
, record
) {
303 let allExceptText
= gettext ( 'All except {0}' );
304 let allText
= '-- ' + gettext ( 'All' ) + ' --' ;
305 if ( record
. data
. all
) {
306 if ( record
. data
. exclude
) {
307 return Ext
. String
. format ( allExceptText
, record
. data
. exclude
);
311 if ( record
. data
. vmid
) {
312 return record
. data
. vmid
;
315 if ( record
. data
. pool
) {
316 return "Pool '" + record
. data
. pool
+ "'" ;
322 backup_reasons_table
: {
323 'backup=yes' : gettext ( 'Enabled' ),
324 'backup=no' : gettext ( 'Disabled' ),
325 'enabled' : gettext ( 'Enabled' ),
326 'disabled' : gettext ( 'Disabled' ),
327 'not a volume' : gettext ( 'Not a volume' ),
328 'efidisk but no OMVF BIOS' : gettext ( 'EFI Disk without OMVF BIOS' ),
331 get_kvm_osinfo : function ( value
) {
332 var info
= { base
: 'Other' }; // default
334 Ext
. each ( Object
. keys ( PVE
. Utils
. kvm_ostypes
), function ( k
) {
335 Ext
. each ( PVE
. Utils
. kvm_ostypes
[ k
], function ( e
) {
336 if ( e
. val
=== value
) {
337 info
= { desc
: e
. desc
, base
: k
};
345 render_kvm_ostype : function ( value
) {
346 var osinfo
= PVE
. Utils
. get_kvm_osinfo ( value
);
347 if ( osinfo
. desc
&& osinfo
. desc
!== '-' ) {
348 return osinfo
. base
+ ' ' + osinfo
. desc
;
354 render_hotplug_features : function ( value
) {
357 if (! value
|| ( value
=== '0' )) {
358 return gettext ( 'Disabled' );
362 value
= 'disk,network,usb' ;
365 Ext
. each ( value
. split ( ',' ), function ( el
) {
367 fa
. push ( gettext ( 'Disk' ));
368 } else if ( el
=== 'network' ) {
369 fa
. push ( gettext ( 'Network' ));
370 } else if ( el
=== 'usb' ) {
372 } else if ( el
=== 'memory' ) {
373 fa
. push ( gettext ( 'Memory' ));
374 } else if ( el
=== 'cpu' ) {
375 fa
. push ( gettext ( 'CPU' ));
381 return fa
. join ( ', ' );
384 render_localtime : function ( value
) {
385 if ( value
=== '__default__' ) {
386 return Proxmox
. Utils
. defaultText
+ ' (' + gettext ( 'Enabled for Windows' ) + ')' ;
388 return Proxmox
. Utils
. format_boolean ( value
);
391 render_qga_features : function ( value
) {
393 return Proxmox
. Utils
. defaultText
+ ' (' + Proxmox
. Utils
. disabledText
+ ')' ;
395 var props
= PVE
. Parser
. parsePropertyString ( value
, 'enabled' );
396 if (! PVE
. Parser
. parseBoolean ( props
. enabled
)) {
397 return Proxmox
. Utils
. disabledText
;
400 delete props
. enabled
;
401 var agentstring
= Proxmox
. Utils
. enabledText
;
403 Ext
. Object
. each ( props
, function ( key
, value
) {
405 agentstring
+= ', ' + key
+ ': ' ;
407 if ( key
=== 'type' ) {
412 agentstring
+= map
[ value
] || Proxmox
. Utils
. unknownText
;
414 if ( PVE
. Parser
. parseBoolean ( value
)) {
415 agentstring
+= Proxmox
. Utils
. enabledText
;
417 agentstring
+= Proxmox
. Utils
. disabledText
;
425 render_qemu_machine : function ( value
) {
426 return value
|| ( Proxmox
. Utils
. defaultText
+ ' (i440fx)' );
429 render_qemu_bios : function ( value
) {
431 return Proxmox
. Utils
. defaultText
+ ' (SeaBIOS)' ;
432 } else if ( value
=== 'seabios' ) {
434 } else if ( value
=== 'ovmf' ) {
435 return "OVMF (UEFI)" ;
441 render_dc_ha_opts : function ( value
) {
443 return Proxmox
. Utils
. defaultText
;
445 return PVE
. Parser
. printPropertyString ( value
);
448 render_as_property_string : function ( value
) {
449 return (! value
) ? Proxmox
. Utils
. defaultText
450 : PVE
. Parser
. printPropertyString ( value
);
453 render_scsihw : function ( value
) {
455 return Proxmox
. Utils
. defaultText
+ ' (LSI 53C895A)' ;
456 } else if ( value
=== 'lsi' ) {
457 return 'LSI 53C895A' ;
458 } else if ( value
=== 'lsi53c810' ) {
460 } else if ( value
=== 'megasas' ) {
461 return 'MegaRAID SAS 8708EM2' ;
462 } else if ( value
=== 'virtio-scsi-pci' ) {
463 return 'VirtIO SCSI' ;
464 } else if ( value
=== 'virtio-scsi-single' ) {
465 return 'VirtIO SCSI single' ;
466 } else if ( value
=== 'pvscsi' ) {
467 return 'VMware PVSCSI' ;
473 render_spice_enhancements : function ( values
) {
474 let props
= PVE
. Parser
. parsePropertyString ( values
);
475 if ( Ext
. Object
. isEmpty ( props
)) {
476 return Proxmox
. Utils
. noneText
;
480 if ( PVE
. Parser
. parseBoolean ( props
. foldersharing
)) {
481 output
. push ( 'Folder Sharing: ' + gettext ( 'Enabled' ));
483 if ( props
. videostreaming
=== 'all' || props
. videostreaming
=== 'filter' ) {
484 output
. push ( 'Video Streaming: ' + props
. videostreaming
);
486 return output
. join ( ', ' );
489 // fixme: auto-generate this
490 // for now, please keep in sync with PVE::Tools::kvmkeymaps
495 'de-ch' : 'German (Swiss)' ,
496 'en-gb' : 'English (UK)' ,
497 'en-us' : 'English (USA)' ,
501 //fo: 'Faroe Islands',
503 'fr-be' : 'French (Belgium)' ,
504 'fr-ca' : 'French (Canada)' ,
505 'fr-ch' : 'French (Swiss)' ,
515 //'nl-be': 'Dutch (Belgium)',
519 'pt-br' : 'Portuguese (Brazil)' ,
528 std
: gettext ( 'Standard VGA' ),
529 vmware
: gettext ( 'VMware compatible' ),
531 qxl2
: 'SPICE dual monitor' ,
532 qxl3
: 'SPICE three monitors' ,
533 qxl4
: 'SPICE four monitors' ,
534 serial0
: gettext ( 'Serial terminal' ) + ' 0' ,
535 serial1
: gettext ( 'Serial terminal' ) + ' 1' ,
536 serial2
: gettext ( 'Serial terminal' ) + ' 2' ,
537 serial3
: gettext ( 'Serial terminal' ) + ' 3' ,
538 virtio
: 'VirtIO-GPU' ,
539 none
: Proxmox
. Utils
. noneText
542 render_kvm_language : function ( value
) {
543 if (! value
|| value
=== '__default__' ) {
544 return Proxmox
. Utils
. defaultText
;
546 var text
= PVE
. Utils
. kvm_keymaps
[ value
];
548 return text
+ ' (' + value
+ ')' ;
553 kvm_keymap_array : function () {
554 var data
= [[ '__default__' , PVE
. Utils
. render_kvm_language ( '' )]];
555 Ext
. Object
. each ( PVE
. Utils
. kvm_keymaps
, function ( key
, value
) {
556 data
. push ([ key
, PVE
. Utils
. render_kvm_language ( value
)]);
563 '__default__' : Proxmox
. Utils
. defaultText
+ ' (xterm.js)' ,
564 'vv' : 'SPICE (remote-viewer)' ,
565 'html5' : 'HTML5 (noVNC)' ,
566 'xtermjs' : 'xterm.js'
569 render_console_viewer : function ( value
) {
570 value
= value
|| '__default__' ;
571 if ( PVE
. Utils
. console_map
[ value
]) {
572 return PVE
. Utils
. console_map
[ value
];
577 console_viewer_array : function () {
578 return Ext
. Array
. map ( Object
. keys ( PVE
. Utils
. console_map
), function ( v
) {
579 return [ v
, PVE
. Utils
. render_console_viewer ( v
)];
583 render_kvm_vga_driver : function ( value
) {
585 return Proxmox
. Utils
. defaultText
;
587 var vga
= PVE
. Parser
. parsePropertyString ( value
, 'type' );
588 var text
= PVE
. Utils
. kvm_vga_drivers
[ vga
. type
];
590 text
= Proxmox
. Utils
. defaultText
;
593 return text
+ ' (' + value
+ ')' ;
598 kvm_vga_driver_array : function () {
599 var data
= [[ '__default__' , PVE
. Utils
. render_kvm_vga_driver ( '' )]];
600 Ext
. Object
. each ( PVE
. Utils
. kvm_vga_drivers
, function ( key
, value
) {
601 data
. push ([ key
, PVE
. Utils
. render_kvm_vga_driver ( value
)]);
607 render_kvm_startup : function ( value
) {
608 var startup
= PVE
. Parser
. parseStartup ( value
);
611 if ( startup
. order
=== undefined ) {
614 res
+= startup
. order
;
616 if ( startup
. up
!== undefined ) {
617 res
+= ',up=' + startup
. up
;
619 if ( startup
. down
!== undefined ) {
620 res
+= ',down=' + startup
. down
;
626 extractFormActionError : function ( action
) {
628 switch ( action
. failureType
) {
629 case Ext
. form
. action
. Action
. CLIENT_INVALID
:
630 msg
= gettext ( 'Form fields may not be submitted with invalid values' );
632 case Ext
. form
. action
. Action
. CONNECT_FAILURE
:
633 msg
= gettext ( 'Connection error' );
634 var resp
= action
. response
;
635 if ( resp
. status
&& resp
. statusText
) {
636 msg
+= " " + resp
. status
+ ": " + resp
. statusText
;
639 case Ext
. form
. action
. Action
. LOAD_FAILURE
:
640 case Ext
. form
. action
. Action
. SERVER_INVALID
:
641 msg
= Proxmox
. Utils
. extractRequestError ( action
. result
, true );
648 'images' : gettext ( 'Disk image' ),
649 'backup' : gettext ( 'VZDump backup file' ),
650 'vztmpl' : gettext ( 'Container template' ),
651 'iso' : gettext ( 'ISO image' ),
652 'rootdir' : gettext ( 'Container' ),
653 'snippets' : gettext ( 'Snippets' )
656 volume_is_qemu_backup : function ( volid
, format
) {
657 return format
=== 'pbs-vm' || volid
. match ( ':backup/vzdump-qemu-' );
660 volume_is_lxc_backup : function ( volid
, format
) {
661 return format
=== 'pbs-ct' || volid
. match ( ':backup/vzdump-(lxc|openvz)-' );
666 name
: gettext ( 'Active Directory Server' ),
667 ipanel
: 'pveAuthADPanel' ,
668 syncipanel
: 'pveAuthLDAPSyncPanel' ,
672 name
: gettext ( 'LDAP Server' ),
673 ipanel
: 'pveAuthLDAPPanel' ,
674 syncipanel
: 'pveAuthLDAPSyncPanel' ,
679 ipanel
: 'pveAuthBasePanel' ,
683 name
: 'Proxmox VE authentication server' ,
684 ipanel
: 'pveAuthBasePanel' ,
691 name
: Proxmox
. Utils
. directoryText
,
692 ipanel
: 'DirInputPanel' ,
697 ipanel
: 'LVMInputPanel' ,
702 ipanel
: 'LvmThinInputPanel' ,
707 ipanel
: 'NFSInputPanel' ,
712 ipanel
: 'CIFSInputPanel' ,
717 ipanel
: 'GlusterFsInputPanel' ,
722 ipanel
: 'IScsiInputPanel' ,
727 ipanel
: 'CephFSInputPanel' ,
731 name
: 'CephFS (PVE)' ,
732 ipanel
: 'CephFSInputPanel' ,
738 ipanel
: 'RBDInputPanel' ,
743 ipanel
: 'RBDInputPanel' ,
748 name
: 'ZFS over iSCSI' ,
749 ipanel
: 'ZFSInputPanel' ,
754 ipanel
: 'ZFSPoolInputPanel' ,
758 name
: 'Proxmox Backup Server' ,
759 ipanel
: 'PBSInputPanel' ,
782 ipanel
: 'SimpleInputPanel' ,
787 ipanel
: 'VlanInputPanel' ,
792 ipanel
: 'QinQInputPanel' ,
797 ipanel
: 'VxlanInputPanel' ,
802 ipanel
: 'EvpnInputPanel' ,
807 sdncontrollerSchema
: {
814 ipanel
: 'EvpnInputPanel' ,
819 format_sdnvnet_type : function ( value
, md
, record
) {
820 var schema
= PVE
. Utils
. sdnvnetSchema
[ value
];
824 return Proxmox
. Utils
. unknownText
;
827 format_sdnzone_type : function ( value
, md
, record
) {
828 var schema
= PVE
. Utils
. sdnzoneSchema
[ value
];
832 return Proxmox
. Utils
. unknownText
;
835 format_sdncontroller_type : function ( value
, md
, record
) {
836 var schema
= PVE
. Utils
. sdncontrollerSchema
[ value
];
840 return Proxmox
. Utils
. unknownText
;
843 format_storage_type : function ( value
, md
, record
) {
844 if ( value
=== 'rbd' ) {
845 value
= (! record
|| record
. get ( 'monhost' ) ? 'rbd' : 'pveceph' );
846 } else if ( value
=== 'cephfs' ) {
847 value
= (! record
|| record
. get ( 'monhost' ) ? 'cephfs' : 'pvecephfs' );
850 var schema
= PVE
. Utils
. storageSchema
[ value
];
854 return Proxmox
. Utils
. unknownText
;
857 format_ha : function ( value
) {
858 var text
= Proxmox
. Utils
. noneText
;
861 text
= value
. state
|| Proxmox
. Utils
. noneText
;
863 text
+= ', ' + Proxmox
. Utils
. groupText
+ ': ' ;
864 text
+= value
. group
|| Proxmox
. Utils
. noneText
;
870 format_content_types : function ( value
) {
871 return value
. split ( ',' ). sort (). map ( function ( ct
) {
872 return PVE
. Utils
. contentTypes
[ ct
] || ct
;
876 render_storage_content : function ( value
, metaData
, record
) {
877 var data
= record
. data
;
878 if ( Ext
. isNumber ( data
. channel
) &&
879 Ext
. isNumber ( data
. id
) &&
880 Ext
. isNumber ( data
. lun
)) {
882 Ext
. String
. leftPad ( data
. channel
, 2 , '0' ) +
883 " ID " + data
. id
+ " LUN " + data
. lun
;
885 return data
. volid
. replace ( /^.*?:(.*?\/)?/ , '' );
888 render_serverity : function ( value
) {
889 return PVE
. Utils
. log_severity_hash
[ value
] || value
;
892 render_cpu : function ( value
, metaData
, record
, rowIndex
, colIndex
, store
) {
894 if (!( record
. data
. uptime
&& Ext
. isNumeric ( value
))) {
898 var maxcpu
= record
. data
. maxcpu
|| 1 ;
900 if (! Ext
. isNumeric ( maxcpu
) && ( maxcpu
>= 1 )) {
904 var per
= value
* 100 ;
906 return per
. toFixed ( 1 ) + '% of ' + maxcpu
. toString () + ( maxcpu
> 1 ? 'CPUs' : 'CPU' );
909 render_size : function ( value
, metaData
, record
, rowIndex
, colIndex
, store
) {
911 if (! Ext
. isNumeric ( value
)) {
915 return Proxmox
. Utils
. format_size ( value
);
918 render_bandwidth : function ( value
) {
919 if (! Ext
. isNumeric ( value
)) {
923 return Proxmox
. Utils
. format_size ( value
) + '/s' ;
926 render_timestamp_human_readable : function ( value
) {
927 return Ext
. Date
. format ( new Date ( value
* 1000 ), 'l d F Y H:i:s' );
930 calculate_mem_usage : function ( data
) {
931 if (! Ext
. isNumeric ( data
. mem
) ||
937 return ( data
. mem
/ data
. maxmem
);
940 render_mem_usage_percent : function ( value
, metaData
, record
, rowIndex
, colIndex
, store
) {
941 if (! Ext
. isNumeric ( value
) || value
=== - 1 ) {
945 // we got no percentage but bytes
947 var maxmem
= record
. data
. maxmem
;
948 if (! record
. data
. uptime
||
950 ! Ext
. isNumeric ( mem
)) {
954 return (( mem
* 100 )/ maxmem
). toFixed ( 1 ) + " %" ;
956 return ( value
* 100 ). toFixed ( 1 ) + " %" ;
959 render_mem_usage : function ( value
, metaData
, record
, rowIndex
, colIndex
, store
) {
962 var maxmem
= record
. data
. maxmem
;
964 if (! record
. data
. uptime
) {
968 if (!( Ext
. isNumeric ( mem
) && maxmem
)) {
972 return PVE
. Utils
. render_size ( value
);
975 calculate_disk_usage : function ( data
) {
977 if (! Ext
. isNumeric ( data
. disk
) ||
978 data
. type
=== 'qemu' ||
979 ( data
. type
=== 'lxc' && data
. uptime
=== 0 ) ||
980 data
. maxdisk
=== 0 ) {
984 return ( data
. disk
/ data
. maxdisk
);
987 render_disk_usage_percent : function ( value
, metaData
, record
, rowIndex
, colIndex
, store
) {
988 if (! Ext
. isNumeric ( value
) || value
=== - 1 ) {
992 return ( value
* 100 ). toFixed ( 1 ) + " %" ;
995 render_disk_usage : function ( value
, metaData
, record
, rowIndex
, colIndex
, store
) {
998 var maxdisk
= record
. data
. maxdisk
;
999 var type
= record
. data
. type
;
1001 if (! Ext
. isNumeric ( disk
) ||
1004 ( type
=== 'lxc' && record
. data
. uptime
=== 0 )) {
1008 return PVE
. Utils
. render_size ( value
);
1011 get_object_icon_class : function ( type
, record
) {
1015 if ( type
=== 'type' ) {
1017 objType
= record
. groupbyid
;
1018 } else if ( record
. template
) {
1020 objType
= 'template' ;
1024 status
= record
. status
+ ' ha-' + record
. hastate
;
1028 status
+= ' locked lock-' + record
. lock
;
1031 var defaults
= PVE
. tree
. ResourceTree
. typeDefaults
[ objType
];
1032 if ( defaults
&& defaults
. iconCls
) {
1033 var retVal
= defaults
. iconCls
+ ' ' + status
;
1040 render_resource_type : function ( value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1042 var cls
= PVE
. Utils
. get_object_icon_class ( value
, record
. data
);
1044 var fa
= '<i class="fa-fw x-grid-icon-custom ' + cls
+ '"></i> ' ;
1048 render_support_level : function ( value
, metaData
, record
) {
1049 return PVE
. Utils
. support_level_hash
[ value
] || '-' ;
1052 render_upid : function ( value
, metaData
, record
) {
1053 var type
= record
. data
. type
;
1054 var id
= record
. data
. id
;
1056 return Proxmox
. Utils
. format_task_description ( type
, id
);
1059 /* render functions for new status panel */
1061 render_usage : function ( val
) {
1062 return ( val
* 100 ). toFixed ( 2 ) + '%' ;
1065 render_cpu_usage : function ( val
, max
) {
1066 return Ext
. String
. format ( gettext ( '{0}% of {1}' ) +
1067 ' ' + gettext ( 'CPU(s)' ), ( val
* 100 ). toFixed ( 2 ), max
);
1070 render_size_usage : function ( val
, max
) {
1072 return gettext ( 'N/A' );
1074 return ( val
* 100 / max
). toFixed ( 2 ) + '% ' + '(' +
1075 Ext
. String
. format ( gettext ( '{0} of {1}' ),
1076 PVE
. Utils
. render_size ( val
), PVE
. Utils
. render_size ( max
)) + ')' ;
1079 /* this is different for nodes */
1080 render_node_cpu_usage : function ( value
, record
) {
1081 return PVE
. Utils
. render_cpu_usage ( value
, record
. cpus
);
1084 /* this is different for nodes */
1085 render_node_size_usage : function ( record
) {
1086 return PVE
. Utils
. render_size_usage ( record
. used
, record
. total
);
1089 render_optional_url : function ( value
) {
1091 if ( value
&& ( match
= value
. match ( /^https?:\/\// )) !== null ) {
1092 return '<a target="_blank" href="' + value
+ '">' + value
+ '</a>' ;
1097 render_san : function ( value
) {
1099 if ( Ext
. isArray ( value
)) {
1100 value
. forEach ( function ( val
) {
1101 if (! Ext
. isNumber ( val
)) {
1105 return names
. join ( '<br>' );
1110 render_full_name : function ( firstname
, metaData
, record
) {
1111 var first
= firstname
|| '' ;
1112 var last
= record
. data
. lastname
|| '' ;
1113 return Ext
. htmlEncode ( first
+ " " + last
);
1116 render_u2f_error : function ( error
) {
1118 '1' : gettext ( 'Other Error' ),
1119 '2' : gettext ( 'Bad Request' ),
1120 '3' : gettext ( 'Configuration Unsupported' ),
1121 '4' : gettext ( 'Device Ineligible' ),
1122 '5' : gettext ( 'Timeout' )
1124 return "U2F Error: " + ErrorNames
[ error
] || Proxmox
. Utils
. unknownText
;
1127 windowHostname : function () {
1128 return window
. location
. hostname
. replace ( Proxmox
. Utils
. IP6_bracket_match
,
1129 function ( m
, addr
, offset
, original
) { return addr
; });
1132 openDefaultConsoleWindow : function ( consoles
, consoleType
, vmid
, nodename
, vmname
, cmd
) {
1133 var dv
= PVE
. Utils
. defaultViewer ( consoles
);
1134 PVE
. Utils
. openConsoleWindow ( dv
, consoleType
, vmid
, nodename
, vmname
, cmd
);
1137 openConsoleWindow : function ( viewer
, consoleType
, vmid
, nodename
, vmname
, cmd
) {
1138 if ( vmid
== undefined && ( consoleType
=== 'kvm' || consoleType
=== 'lxc' )) {
1139 throw "missing vmid" ;
1142 throw "no nodename specified" ;
1145 if ( viewer
=== 'html5' ) {
1146 PVE
. Utils
. openVNCViewer ( consoleType
, vmid
, nodename
, vmname
, cmd
);
1147 } else if ( viewer
=== 'xtermjs' ) {
1148 Proxmox
. Utils
. openXtermJsViewer ( consoleType
, vmid
, nodename
, vmname
, cmd
);
1149 } else if ( viewer
=== 'vv' ) {
1150 let url
= '/nodes/' + nodename
+ '/spiceshell' ;
1152 proxy
: PVE
. Utils
. windowHostname (),
1154 if ( consoleType
=== 'kvm' ) {
1155 url
= '/nodes/' + nodename
+ '/qemu/' + vmid
. toString () + '/spiceproxy' ;
1156 } else if ( consoleType
=== 'lxc' ) {
1157 url
= '/nodes/' + nodename
+ '/lxc/' + vmid
. toString () + '/spiceproxy' ;
1158 } else if ( consoleType
=== 'upgrade' ) {
1159 params
. cmd
= 'upgrade' ;
1160 } else if ( consoleType
=== 'cmd' ) {
1162 } else if ( consoleType
!== 'shell' ) {
1163 throw `unknown spice viewer type ' ${consoleType} '` ;
1165 PVE
. Utils
. openSpiceViewer ( url
, params
);
1167 throw `unknown viewer type ' ${viewer} '` ;
1171 defaultViewer : function ( consoles
) {
1173 var allowSpice
, allowXtermjs
;
1175 if ( consoles
=== true ) {
1177 allowXtermjs
= true ;
1178 } else if ( typeof consoles
=== 'object' ) {
1179 allowSpice
= consoles
. spice
;
1180 allowXtermjs
= !! consoles
. xtermjs
;
1182 var dv
= PVE
. VersionInfo
. console
|| 'xtermjs' ;
1183 if ( dv
=== 'vv' && ! allowSpice
) {
1184 dv
= ( allowXtermjs
) ? 'xtermjs' : 'html5' ;
1185 } else if ( dv
=== 'xtermjs' && ! allowXtermjs
) {
1186 dv
= ( allowSpice
) ? 'vv' : 'html5' ;
1192 openVNCViewer : function ( vmtype
, vmid
, nodename
, vmname
, cmd
) {
1193 let scaling
= 'off' ;
1194 if ( Proxmox
. Utils
. toolkit
!== 'touch' ) {
1195 var sp
= Ext
. state
. Manager
. getProvider ();
1196 scaling
= sp
. get ( 'novnc-scaling' , 'off' );
1198 var url
= Ext
. Object
. toQueryString ({
1199 console
: vmtype
, // kvm, lxc, upgrade or shell
1207 var nw
= window
. open ( "?" + url
, '_blank' , "innerWidth=745,innerheight=427" );
1213 openSpiceViewer : function ( url
, params
){
1215 var downloadWithName = function ( uri
, name
) {
1216 var link
= Ext
. DomHelper
. append ( document
. body
, {
1219 css
: 'display:none;visibility:hidden;height:0px;'
1222 // Note: we need to tell android the correct file name extension
1223 // but we do not set 'download' tag for other environments, because
1224 // It can have strange side effects (additional user prompt on firefox)
1225 var andriod
= navigator
. userAgent
. match ( /Android/i ) ? true : false ;
1227 link
. download
= name
;
1230 if ( link
. fireEvent
) {
1231 link
. fireEvent ( 'onclick' );
1233 let evt
= document
. createEvent ( "MouseEvents" );
1234 evt
. initMouseEvent ( 'click' , true , true , window
, 1 , 0 , 0 , 0 , 0 , false , false , false , false , 0 , null );
1235 link
. dispatchEvent ( evt
);
1239 Proxmox
. Utils
. API2Request ({
1243 failure : function ( response
, opts
){
1244 Ext
. Msg
. alert ( 'Error' , response
. htmlStatus
);
1246 success : function ( response
, opts
){
1247 var raw
= "[virt-viewer] \n " ;
1248 Ext
. Object
. each ( response
. result
. data
, function ( k
, v
) {
1249 raw
+= k
+ "=" + v
+ " \n " ;
1251 var url
= 'data:application/x-virt-viewer;charset=UTF-8,' +
1252 encodeURIComponent ( raw
);
1254 downloadWithName ( url
, "pve-spice.vv" );
1259 openTreeConsole : function ( tree
, record
, item
, index
, e
) {
1261 var nodename
= record
. data
. node
;
1262 var vmid
= record
. data
. vmid
;
1263 var vmname
= record
. data
. name
;
1264 if ( record
. data
. type
=== 'qemu' && ! record
. data
. template
) {
1265 Proxmox
. Utils
. API2Request ({
1266 url
: '/nodes/' + nodename
+ '/qemu/' + vmid
+ '/status/current' ,
1267 failure : function ( response
, opts
) {
1268 Ext
. Msg
. alert ( 'Error' , response
. htmlStatus
);
1270 success : function ( response
, opts
) {
1271 let conf
= response
. result
. data
;
1273 spice
: !! conf
. spice
,
1274 xtermjs
: !! conf
. serial
,
1276 PVE
. Utils
. openDefaultConsoleWindow ( consoles
, 'kvm' , vmid
, nodename
, vmname
);
1279 } else if ( record
. data
. type
=== 'lxc' && ! record
. data
. template
) {
1280 PVE
. Utils
. openDefaultConsoleWindow ( true , 'lxc' , vmid
, nodename
, vmname
);
1284 // test automation helper
1285 call_menu_handler : function ( menu
, text
) {
1287 var list
= menu
. query ( 'menuitem' );
1289 Ext
. Array
. each ( list
, function ( item
) {
1290 if ( item
. text
=== text
) {
1301 createCmdMenu : function ( v
, record
, item
, index
, event
) {
1303 if (!( v
instanceof Ext
. tree
. View
)) {
1307 var template
= !! record
. data
. template
;
1308 var type
= record
. data
. type
;
1311 if ( type
=== 'qemu' || type
== 'lxc' ) {
1312 menu
= Ext
. create ( 'PVE.menu.TemplateMenu' , {
1316 } else if ( type
=== 'qemu' ||
1319 menu
= Ext
. create ( 'PVE.' + type
+ '.CmdMenu' , {
1321 nodename
: record
. data
. node
1327 menu
. showAt ( event
. getXY ());
1331 // helper for deleting field which are set to there default values
1332 delete_if_default : function ( values
, fieldname
, default_val
, create
) {
1333 if ( values
[ fieldname
] === '' || values
[ fieldname
] === default_val
) {
1335 if ( values
[ 'delete' ]) {
1336 if ( Ext
. isArray ( values
[ 'delete' ])) {
1337 values
[ 'delete' ]. push ( fieldname
);
1339 values
[ 'delete' ] += ',' + fieldname
;
1342 values
[ 'delete' ] = fieldname
;
1346 delete values
[ fieldname
];
1350 loadSSHKeyFromFile : function ( file
, callback
) {
1351 // ssh-keygen produces 740 bytes for an average 4096 bit rsa key, with
1352 // a user@host comment, 1420 for 8192 bits; current max is 16kbit
1353 // assume: 740*8 for max. 32kbit (5920 byte file)
1354 // round upwards to nearest nice number => 8192 bytes, leaves lots of comment space
1355 if ( file
. size
> 8192 ) {
1356 Ext
. Msg
. alert ( gettext ( 'Error' ), gettext ( "Invalid file size: " ) + file
. size
);
1362 var reader
= new FileReader ();
1363 reader
. onload = function ( evt
) {
1364 callback ( evt
. target
. result
);
1366 reader
. readAsText ( file
);
1369 loadTextFromFile : function ( file
, callback
, maxBytes
) {
1370 let maxSize
= maxBytes
|| 8192 ;
1371 if ( file
. size
> maxSize
) {
1372 Ext
. Msg
. alert ( gettext ( 'Error' ), gettext ( "Invalid file size: " ) + file
. size
);
1378 let reader
= new FileReader ();
1379 reader
. onload
= evt
=> callback ( evt
. target
. result
);
1380 reader
. readAsText ( file
);
1383 diskControllerMaxIDs
: {
1390 // types is either undefined (all busses), an array of busses, or a single bus
1391 forEachBus : function ( types
, func
) {
1392 var busses
= Object
. keys ( PVE
. Utils
. diskControllerMaxIDs
);
1393 var i
, j
, count
, cont
;
1395 if ( Ext
. isArray ( types
)) {
1397 } else if ( Ext
. isDefined ( types
)) {
1401 // check if we only have valid busses
1402 for ( i
= 0 ; i
< busses
. length
; i
++) {
1403 if (! PVE
. Utils
. diskControllerMaxIDs
[ busses
[ i
]]) {
1404 throw "invalid bus: '" + busses
[ i
] + "'" ;
1408 for ( i
= 0 ; i
< busses
. length
; i
++) {
1409 count
= PVE
. Utils
. diskControllerMaxIDs
[ busses
[ i
]];
1410 for ( j
= 0 ; j
< count
; j
++) {
1411 cont
= func ( busses
[ i
], j
);
1412 if (! cont
&& cont
!== undefined ) {
1419 mp_counts
: { mps
: 256 , unused
: 256 },
1421 forEachMP : function ( func
, includeUnused
) {
1423 for ( i
= 0 ; i
< PVE
. Utils
. mp_counts
. mps
; i
++) {
1424 cont
= func ( 'mp' , i
);
1425 if (! cont
&& cont
!== undefined ) {
1430 if (! includeUnused
) {
1434 for ( i
= 0 ; i
< PVE
. Utils
. mp_counts
. unused
; i
++) {
1435 cont
= func ( 'unused' , i
);
1436 if (! cont
&& cont
!== undefined ) {
1442 hardware_counts
: { net
: 32 , usb
: 5 , hostpci
: 16 , audio
: 1 , efidisk
: 1 , serial
: 4 , rng
: 1 },
1444 cleanEmptyObjectKeys : function ( obj
) {
1446 for ( propName
in obj
) {
1447 if ( obj
. hasOwnProperty ( propName
)) {
1448 if ( obj
[ propName
] === null || obj
[ propName
] === undefined ) {
1449 delete obj
[ propName
];
1455 acmedomain_count
: 5 ,
1457 add_domain_to_acme : function ( acme
, domain
) {
1458 if ( acme
. domains
=== undefined ) {
1459 acme
. domains
= [ domain
];
1461 acme
. domains
. push ( domain
);
1462 acme
. domains
= acme
. domains
. filter (( value
, index
, self
) => {
1463 return self
. indexOf ( value
) === index
;
1469 remove_domain_from_acme : function ( acme
, domain
) {
1470 if ( acme
. domains
!== undefined ) {
1471 acme
. domains
= acme
. domains
. filter (( value
, index
, self
) => {
1472 return self
. indexOf ( value
) === index
&& value
!== domain
;
1478 handleStoreErrorOrMask : function ( me
, store
, regex
, callback
) {
1480 me
. mon ( store
, 'load' , function ( proxy
, response
, success
, operation
) {
1483 Proxmox
. Utils
. setErrorMask ( me
, false );
1488 if ( operation
. error
. statusText
) {
1489 if ( operation
. error
. statusText
. match ( regex
)) {
1490 callback ( me
, operation
. error
);
1493 msg
= operation
. error
. statusText
+ ' (' + operation
. error
. status
+ ')' ;
1496 msg
= gettext ( 'Connection error' );
1498 Proxmox
. Utils
. setErrorMask ( me
, msg
);
1502 showCephInstallOrMask : function ( container
, msg
, nodename
, callback
){
1503 var regex
= new RegExp ( "not (installed|initialized)" , "i" );
1504 if ( msg
. match ( regex
)) {
1505 if ( Proxmox
. UserName
=== 'root@pam' ) {
1506 container
. el
. mask ();
1507 if (! container
. down ( 'pveCephInstallWindow' )){
1508 var isInstalled
= msg
. match ( /not initialized/i ) ? true : false ;
1509 var win
= Ext
. create ( 'PVE.ceph.Install' , {
1512 win
. getViewModel (). set ( 'isInstalled' , isInstalled
);
1518 container
. mask ( Ext
. String
. format ( gettext ( '{0} not installed.' ) +
1519 ' ' + gettext ( 'Log in as root to install.' ), 'Ceph' ), [ 'pve-static-mask' ]);
1527 propertyStringSet : function ( target
, source
, name
, value
) {
1529 if ( value
=== undefined ) {
1530 target
[ name
] = source
;
1532 target
[ name
] = value
;
1535 delete target
[ name
];
1539 updateColumns : function ( container
) {
1540 let mode
= Ext
. state
. Manager
. get ( 'summarycolumns' ) || 'auto' ;
1542 if ( mode
!== 'auto' ) {
1543 factor
= parseInt ( mode
, 10 );
1544 if ( Number
. isNaN ( factor
)) {
1548 factor
= container
. getSize (). width
< 1400 ? 1 : 2 ;
1551 if ( container
. oldFactor
=== factor
) {
1555 let items
= container
. query ( '>' ); // direct childs
1556 factor
= Math
. min ( factor
, items
. length
);
1557 container
. oldFactor
= factor
;
1559 items
. forEach (( item
) => {
1560 item
. columnWidth
= 1 / factor
;
1563 // we have to update the layout twice, since the first layout change
1564 // can trigger the scrollbar which reduces the amount of space left
1565 container
. updateLayout ();
1566 container
. updateLayout ();
1569 forEachCorosyncLink : function ( nodeinfo
, cb
) {
1570 let re
= /(?:ring|link)(\d+)_addr/ ;
1571 Ext
. iterate ( nodeinfo
, ( prop
, val
) => {
1572 let match
= re
. exec ( prop
);
1574 cb ( Number ( match
[ 1 ]), val
);
1581 'AuthenticAMD' : 'AMD' ,
1582 'GenuineIntel' : 'Intel'
1590 "_default_" : 5 , // includes custom models
1595 constructor : function () {
1597 Ext
. apply ( me
, me
. utilities
);
1599 Proxmox
. Utils
. override_task_descriptions ({
1600 acmedeactivate
: [ 'ACME Account' , gettext ( 'Deactivate' )],
1601 acmenewcert
: [ 'SRV' , gettext ( 'Order Certificate' )],
1602 acmerefresh
: [ 'ACME Account' , gettext ( 'Refresh' )],
1603 acmeregister
: [ 'ACME Account' , gettext ( 'Register' )],
1604 acmerenew
: [ 'SRV' , gettext ( 'Renew Certificate' )],
1605 acmerevoke
: [ 'SRV' , gettext ( 'Revoke Certificate' )],
1606 acmeupdate
: [ 'ACME Account' , gettext ( 'Update' )],
1607 'auth-realm-sync' : [ gettext ( 'Realm' ), gettext ( 'Sync' )],
1608 'auth-realm-sync-test' : [ gettext ( 'Realm' ), gettext ( 'Sync Preview' )],
1609 cephcreatemds
: [ 'Ceph Metadata Server' , gettext ( 'Create' )],
1610 cephcreatemgr
: [ 'Ceph Manager' , gettext ( 'Create' )],
1611 cephcreatemon
: [ 'Ceph Monitor' , gettext ( 'Create' )],
1612 cephcreateosd
: [ 'Ceph OSD' , gettext ( 'Create' )],
1613 cephcreatepool
: [ 'Ceph Pool' , gettext ( 'Create' )],
1614 cephdestroymds
: [ 'Ceph Metadata Server' , gettext ( 'Destroy' )],
1615 cephdestroymgr
: [ 'Ceph Manager' , gettext ( 'Destroy' )],
1616 cephdestroymon
: [ 'Ceph Monitor' , gettext ( 'Destroy' )],
1617 cephdestroyosd
: [ 'Ceph OSD' , gettext ( 'Destroy' )],
1618 cephdestroypool
: [ 'Ceph Pool' , gettext ( 'Destroy' )],
1619 cephfscreate
: [ 'CephFS' , gettext ( 'Create' )],
1620 clustercreate
: [ '' , gettext ( 'Create Cluster' )],
1621 clusterjoin
: [ '' , gettext ( 'Join Cluster' )],
1622 dircreate
: [ gettext ( 'Directory Storage' ), gettext ( 'Create' )],
1623 dirremove
: [ gettext ( 'Directory' ), gettext ( 'Remove' )],
1624 download
: [ '' , gettext ( 'Download' )],
1625 hamigrate
: [ 'HA' , gettext ( 'Migrate' )],
1626 hashutdown
: [ 'HA' , gettext ( 'Shutdown' )],
1627 hastart
: [ 'HA' , gettext ( 'Start' )],
1628 hastop
: [ 'HA' , gettext ( 'Stop' )],
1629 imgcopy
: [ '' , gettext ( 'Copy data' )],
1630 imgdel
: [ '' , gettext ( 'Erase data' )],
1631 lvmcreate
: [ gettext ( 'LVM Storage' ), gettext ( 'Create' )],
1632 lvmthincreate
: [ gettext ( 'LVM-Thin Storage' ), gettext ( 'Create' )],
1633 migrateall
: [ '' , gettext ( 'Migrate all VMs and Containers' )],
1634 'move_volume' : [ 'CT' , gettext ( 'Move Volume' )],
1635 pull_file
: [ 'CT' , gettext ( 'Pull file' )],
1636 push_file
: [ 'CT' , gettext ( 'Push file' )],
1637 qmclone
: [ 'VM' , gettext ( 'Clone' )],
1638 qmconfig
: [ 'VM' , gettext ( 'Configure' )],
1639 qmcreate
: [ 'VM' , gettext ( 'Create' )],
1640 qmdelsnapshot
: [ 'VM' , gettext ( 'Delete Snapshot' )],
1641 qmdestroy
: [ 'VM' , gettext ( 'Destroy' )],
1642 qmigrate
: [ 'VM' , gettext ( 'Migrate' )],
1643 qmmove
: [ 'VM' , gettext ( 'Move disk' )],
1644 qmpause
: [ 'VM' , gettext ( 'Pause' )],
1645 qmreboot
: [ 'VM' , gettext ( 'Reboot' )],
1646 qmreset
: [ 'VM' , gettext ( 'Reset' )],
1647 qmrestore
: [ 'VM' , gettext ( 'Restore' )],
1648 qmresume
: [ 'VM' , gettext ( 'Resume' )],
1649 qmrollback
: [ 'VM' , gettext ( 'Rollback' )],
1650 qmshutdown
: [ 'VM' , gettext ( 'Shutdown' )],
1651 qmsnapshot
: [ 'VM' , gettext ( 'Snapshot' )],
1652 qmstart
: [ 'VM' , gettext ( 'Start' )],
1653 qmstop
: [ 'VM' , gettext ( 'Stop' )],
1654 qmsuspend
: [ 'VM' , gettext ( 'Hibernate' )],
1655 qmtemplate
: [ 'VM' , gettext ( 'Convert to template' )],
1656 spiceproxy
: [ 'VM/CT' , gettext ( 'Console' ) + ' (Spice)' ],
1657 spiceshell
: [ '' , gettext ( 'Shell' ) + ' (Spice)' ],
1658 startall
: [ '' , gettext ( 'Start all VMs and Containers' )],
1659 stopall
: [ '' , gettext ( 'Stop all VMs and Containers' )],
1660 unknownimgdel
: [ '' , gettext ( 'Destroy image from unknown guest' )],
1661 vncproxy
: [ 'VM/CT' , gettext ( 'Console' )],
1662 vncshell
: [ '' , gettext ( 'Shell' )],
1663 vzclone
: [ 'CT' , gettext ( 'Clone' )],
1664 vzcreate
: [ 'CT' , gettext ( 'Create' )],
1665 vzdelsnapshot
: [ 'CT' , gettext ( 'Delete Snapshot' )],
1666 vzdestroy
: [ 'CT' , gettext ( 'Destroy' )],
1667 vzdump
: ( type
, id
) => id
? `VM/CT ${id} - ${gettext('Backup')} ` : gettext ( 'Backup Job' ),
1668 vzmigrate
: [ 'CT' , gettext ( 'Migrate' )],
1669 vzmount
: [ 'CT' , gettext ( 'Mount' )],
1670 vzreboot
: [ 'CT' , gettext ( 'Reboot' )],
1671 vzrestore
: [ 'CT' , gettext ( 'Restore' )],
1672 vzresume
: [ 'CT' , gettext ( 'Resume' )],
1673 vzrollback
: [ 'CT' , gettext ( 'Rollback' )],
1674 vzshutdown
: [ 'CT' , gettext ( 'Shutdown' )],
1675 vzsnapshot
: [ 'CT' , gettext ( 'Snapshot' )],
1676 vzstart
: [ 'CT' , gettext ( 'Start' )],
1677 vzstop
: [ 'CT' , gettext ( 'Stop' )],
1678 vzsuspend
: [ 'CT' , gettext ( 'Suspend' )],
1679 vztemplate
: [ 'CT' , gettext ( 'Convert to template' )],
1680 vzumount
: [ 'CT' , gettext ( 'Unmount' )],
1681 zfscreate
: [ gettext ( 'ZFS Storage' ), gettext ( 'Create' )],