2016-09-12 13:02:36 +03:00
Ext . define ( 'PVE.qemu.EFIDiskInputPanel' , {
2017-12-11 18:10:13 +03:00
extend : 'Proxmox.panel.InputPanel' ,
2016-09-12 13:02:36 +03:00
alias : 'widget.pveEFIDiskInputPanel' ,
insideWizard : false ,
unused : false , // ADD usused disk imaged
vmconfig : { } , // used to select usused disks
onGetValues : function ( values ) {
var me = this ;
2021-10-05 21:03:19 +03:00
if ( me . disabled ) {
return { } ;
}
2016-09-12 13:02:36 +03:00
var confid = 'efidisk0' ;
if ( values . hdimage ) {
me . drive . file = values . hdimage ;
} else {
// we use 1 here, because for efi the size gets overridden from the backend
me . drive . file = values . hdstorage + ":1" ;
}
2021-10-05 21:05:20 +03:00
// always default to newer 4m type with secure boot support, if we're
// adding a new EFI disk there can't be any old state anyway
me . drive . efitype = '4m' ;
me . drive [ 'pre-enrolled-keys' ] = values . preEnrolledKeys ;
delete values . preEnrolledKeys ;
2016-09-12 13:02:36 +03:00
me . drive . format = values . diskformat ;
2021-10-05 21:05:20 +03:00
let params = { } ;
2016-09-12 13:02:36 +03:00
params [ confid ] = PVE . Parser . printQemuDrive ( me . drive ) ;
return params ;
} ,
setNodename : function ( nodename ) {
var me = this ;
2017-11-10 16:49:23 +03:00
me . down ( '#hdstorage' ) . setNodename ( nodename ) ;
me . down ( '#hdimage' ) . setStorage ( undefined , nodename ) ;
2016-09-12 13:02:36 +03:00
} ,
2021-10-05 21:03:19 +03:00
setDisabled : function ( disabled ) {
let me = this ;
me . down ( 'pveDiskStorageSelector' ) . setDisabled ( disabled ) ;
2021-10-05 21:05:20 +03:00
me . down ( 'proxmoxcheckbox[name=preEnrolledKeys]' ) . setDisabled ( disabled ) ;
2021-10-05 21:03:19 +03:00
me . callParent ( arguments ) ;
} ,
2021-01-19 19:39:15 +03:00
initComponent : function ( ) {
2016-09-12 13:02:36 +03:00
var me = this ;
me . drive = { } ;
2021-10-05 21:03:19 +03:00
me . items = [
2019-10-01 10:30:03 +03:00
{
xtype : 'pveDiskStorageSelector' ,
name : 'efidisk0' ,
2021-10-21 14:41:06 +03:00
storageLabel : gettext ( 'EFI Storage' ) ,
2019-10-01 10:30:03 +03:00
storageContent : 'images' ,
nodename : me . nodename ,
2021-10-05 21:03:19 +03:00
disabled : me . disabled ,
2021-01-19 19:31:03 +03:00
hideSize : true ,
2019-10-01 10:30:03 +03:00
} ,
2021-10-05 21:05:20 +03:00
{
xtype : 'proxmoxcheckbox' ,
name : 'preEnrolledKeys' ,
checked : true ,
fieldLabel : gettext ( "Pre-Enroll keys" ) ,
disabled : me . disabled ,
//boxLabel: '(e.g., Microsoft secure-boot keys')',
autoEl : {
tag : 'div' ,
2021-10-21 14:41:06 +03:00
'data-qtip' : gettext ( 'Use EFIvars image with standard distribution and Microsoft secure boot keys enrolled.' ) ,
2021-10-05 21:05:20 +03:00
} ,
} ,
2019-10-01 10:30:03 +03:00
{
xtype : 'label' ,
text : gettext ( "Warning: The VM currently does not uses 'OVMF (UEFI)' as BIOS." ) ,
2019-10-07 22:37:34 +03:00
userCls : 'pmx-hint' ,
2019-10-01 10:30:03 +03:00
hidden : me . usesEFI ,
} ,
] ;
2016-09-12 13:02:36 +03:00
me . callParent ( ) ;
2021-01-19 19:31:03 +03:00
} ,
2016-09-12 13:02:36 +03:00
} ) ;
Ext . define ( 'PVE.qemu.EFIDiskEdit' , {
2017-12-06 20:12:41 +03:00
extend : 'Proxmox.window.Edit' ,
2016-09-12 13:02:36 +03:00
isAdd : true ,
subject : gettext ( 'EFI Disk' ) ,
2019-10-01 10:30:03 +03:00
width : 450 ,
2021-01-19 19:39:15 +03:00
initComponent : function ( ) {
2016-09-12 13:02:36 +03:00
var me = this ;
var nodename = me . pveSelNode . data . node ;
if ( ! nodename ) {
throw "no node name specified" ;
}
me . items = [ {
xtype : 'pveEFIDiskInputPanel' ,
2016-10-13 12:26:06 +03:00
onlineHelp : 'qm_bios_and_uefi' ,
2016-09-12 13:02:36 +03:00
confid : me . confid ,
nodename : nodename ,
2019-10-01 10:30:03 +03:00
usesEFI : me . usesEFI ,
isCreate : true ,
2016-09-12 13:02:36 +03:00
} ] ;
me . callParent ( ) ;
2021-01-19 19:31:03 +03:00
} ,
2016-09-12 13:02:36 +03:00
} ) ;