mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-03 23:46:58 +00:00
60 lines
1.3 KiB
JavaScript
60 lines
1.3 KiB
JavaScript
Ext.define('PVE.dc.PoolEdit', {
|
|
extend: 'Proxmox.window.Edit',
|
|
alias: ['widget.pveDcPoolEdit'],
|
|
|
|
initComponent : function() {
|
|
var me = this;
|
|
|
|
me.isCreate = !me.poolid;
|
|
|
|
var url;
|
|
var method;
|
|
|
|
if (me.isCreate) {
|
|
url = '/api2/extjs/pools';
|
|
method = 'POST';
|
|
} else {
|
|
url = '/api2/extjs/pools/' + me.poolid;
|
|
method = 'PUT';
|
|
}
|
|
|
|
Ext.applyIf(me, {
|
|
subject: gettext('Pool'),
|
|
url: url,
|
|
method: method,
|
|
items: [
|
|
{
|
|
xtype: me.isCreate ? 'proxmoxtextfield' : 'displayfield',
|
|
fieldLabel: gettext('Name'),
|
|
name: 'poolid',
|
|
value: me.poolid,
|
|
allowBlank: false
|
|
},
|
|
{
|
|
xtype: 'textfield',
|
|
fieldLabel: gettext('Comment'),
|
|
name: 'comment',
|
|
allowBlank: true
|
|
}
|
|
]
|
|
});
|
|
|
|
me.callParent();
|
|
|
|
if (!me.isCreate) {
|
|
me.load();
|
|
} else {
|
|
me.type = 'vnet'
|
|
/*
|
|
for (i = 0; i < 100; i++) {
|
|
confid = 'net' + i.toString();
|
|
if (!Ext.isDefined(me.vmconfig[confid])) {
|
|
me.confid = confid;
|
|
break;
|
|
}
|
|
}
|
|
*/
|
|
}
|
|
}
|
|
});
|