pve-manager/www/manager6/dc/PoolEdit.js
Thomas Lamprecht 17e852abce ui: refactor pool edit window
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-22 17:16:04 +02:00

38 lines
730 B
JavaScript

Ext.define('PVE.dc.PoolEdit', {
extend: 'Proxmox.window.Edit',
alias: ['widget.pveDcPoolEdit'],
mixins: ['Proxmox.Mixin.CBind'],
subject: gettext('Pool'),
cbindData: {
poolid: '',
isCreate: (cfg) => !cfg.poolid,
},
cbind: {
autoLoad: get => !get('isCreate'),
url: get => `/api2/extjs/pools/${get('poolid')}`,
method: get => get('isCreate') ? 'POST' : 'PUT',
},
items: [
{
xtype: 'pmxDisplayEditField',
fieldLabel: gettext('Name'),
cbind: {
editable: '{isCreate}',
value: '{poolid}',
},
name: 'poolid',
allowBlank: false,
},
{
xtype: 'textfield',
fieldLabel: gettext('Comment'),
name: 'comment',
allowBlank: true,
},
],
});