]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/SerialEdit.js
794c7fa28d4c1796d5260a537a8b352787e953a3
1 /*jslint confusion: true */
2 Ext
.define('PVE.qemu.SerialnputPanel', {
3 extend
: 'Proxmox.panel.InputPanel',
7 setVMConfig: function(vmconfig
) {
9 me
.vmconfig
= vmconfig
;
11 for (i
= 0; i
< 4; i
++) {
12 var port
= 'serial' + i
.toString();
13 if (!me
.vmconfig
[port
]) {
14 me
.down('field[name=serialid]').setValue(i
);
21 onGetValues: function(values
) {
24 var id
= 'serial' + values
.serialid
;
25 delete values
.serialid
;
26 values
[id
] = 'socket';
32 xtype
: 'proxmoxintegerfield',
34 fieldLabel
: gettext('Serial Port'),
38 validator: function(id
) {
42 var me
= this.up('panel');
43 if (me
.vmconfig
!== undefined && Ext
.isDefined(me
.vmconfig
['serial' + id
])) {
44 return "This device is already in use.";
52 Ext
.define('PVE.qemu.SerialEdit', {
53 extend
: 'Proxmox.window.Edit',
59 subject
: gettext('Serial Port'),
61 initComponent : function() {
64 // for now create of (socket) serial port only
67 var ipanel
= Ext
.create('PVE.qemu.SerialnputPanel', {});
76 success: function(response
, options
) {
77 ipanel
.setVMConfig(response
.result
.data
);