2021-01-28 14:59:46 +03:00
Ext . define ( 'PBS.TapeManagement.LabelMediaWindow' , {
extend : 'Proxmox.window.Edit' ,
alias : 'widget.pbsLabelMediaWindow' ,
mixins : [ 'Proxmox.Mixin.CBind' ] ,
isCreate : true ,
isAdd : true ,
title : gettext ( 'Label Media' ) ,
submitText : gettext ( 'OK' ) ,
2021-02-15 17:22:22 +03:00
url : '/api2/extjs/tape/drive/' ,
cbindData : function ( config ) {
let me = this ;
return {
driveid : config . driveid ,
2021-03-02 11:54:33 +03:00
label : config . label ,
2021-02-15 17:22:22 +03:00
} ;
} ,
2021-02-08 13:10:09 +03:00
method : 'POST' ,
2021-01-28 14:59:46 +03:00
showProgress : true ,
2021-02-15 17:22:22 +03:00
submitUrl : function ( url , values ) {
let driveid = encodeURIComponent ( values . drive ) ;
delete values . drive ;
return ` ${ url } / ${ driveid } /label-media ` ;
} ,
2021-01-28 14:59:46 +03:00
items : [
{
xtype : 'displayfield' ,
2021-02-15 17:22:22 +03:00
cls : 'pmx-hint' ,
2023-11-24 15:05:00 +03:00
value : gettext ( 'Make sure that the correct tape is inserted in the selected drive and type in the label written on the tape.' ) ,
2021-02-15 17:22:22 +03:00
} ,
{
xtype : 'pmxDisplayEditField' ,
2021-01-28 14:59:46 +03:00
fieldLabel : gettext ( 'Drive' ) ,
2021-02-25 14:25:32 +03:00
submitValue : true ,
2021-02-15 17:22:22 +03:00
name : 'drive' ,
editConfig : {
xtype : 'pbsDriveSelector' ,
} ,
2021-01-28 14:59:46 +03:00
cbind : {
value : '{driveid}' ,
2021-02-15 17:22:22 +03:00
editable : '{!driveid}' ,
2021-01-28 14:59:46 +03:00
} ,
} ,
{
fieldLabel : gettext ( 'Label' ) ,
name : 'label-text' ,
2023-04-17 14:59:05 +03:00
xtype : 'pmxDisplayEditField' ,
submitValue : true ,
2021-01-28 14:59:46 +03:00
allowBlank : false ,
2021-03-02 11:54:33 +03:00
cbind : {
value : '{label}' ,
2023-04-17 14:59:05 +03:00
editable : '{!label}' ,
2021-03-02 11:54:33 +03:00
} ,
2021-01-28 14:59:46 +03:00
} ,
{
xtype : 'pbsMediaPoolSelector' ,
fieldLabel : gettext ( 'Media Pool' ) ,
name : 'pool' ,
allowBlank : true ,
skipEmptyText : true ,
} ,
] ,
} ) ;