]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/SerialEdit.js
1 Ext
.define('PVE.qemu.SerialnputPanel', {
2 extend
: 'Proxmox.panel.InputPanel',
6 setVMConfig: function(vmconfig
) {
8 me
.vmconfig
= vmconfig
;
10 for (i
= 0; i
< 4; i
++) {
11 var port
= 'serial' + i
.toString();
12 if (!me
.vmconfig
[port
]) {
13 me
.down('field[name=serialid]').setValue(i
);
20 onGetValues: function(values
) {
23 var id
= 'serial' + values
.serialid
;
24 delete values
.serialid
;
25 values
[id
] = 'socket';
31 xtype
: 'proxmoxintegerfield',
33 fieldLabel
: gettext('Serial Port'),
37 validator: function(id
) {
41 var me
= this.up('panel');
42 if (me
.vmconfig
!== undefined && Ext
.isDefined(me
.vmconfig
['serial' + id
])) {
43 return "This device is already in use.";
51 Ext
.define('PVE.qemu.SerialEdit', {
52 extend
: 'Proxmox.window.Edit',
58 subject
: gettext('Serial Port'),
60 initComponent : function() {
63 // for now create of (socket) serial port only
66 var ipanel
= Ext
.create('PVE.qemu.SerialnputPanel', {});
75 success: function(response
, options
) {
76 ipanel
.setVMConfig(response
.result
.data
);