98ad58fbd2
split them into two files and put them into the respective directory refactor the DataStoreConfigPanel to controller/view and the DataStoreEdit window/inputpanel to simply an editwindow (there is no need to have a seperate inputpanel) which also prepares the window for edit (by using pmxDisplayEditFields) Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
60 lines
1.1 KiB
JavaScript
60 lines
1.1 KiB
JavaScript
Ext.define('PBS.DataStoreEdit', {
|
|
extend: 'Proxmox.window.Edit',
|
|
alias: 'widget.pbsDataStoreEdit',
|
|
mixins: ['Proxmox.Mixin.CBind'],
|
|
|
|
subject: gettext('Datastore'),
|
|
isAdd: true,
|
|
|
|
cbindData: function(initialConfig) {
|
|
var me = this;
|
|
|
|
let name = initialConfig.name;
|
|
let baseurl = '/api2/extjs/config/datastore';
|
|
|
|
me.isCreate = !name;
|
|
me.url = name ? baseurl + '/' + name : baseurl;
|
|
me.method = name ? 'PUT' : 'POST';
|
|
me.autoLoad = !!name;
|
|
return {};
|
|
},
|
|
|
|
items: [
|
|
{
|
|
xtype: 'inputpanel',
|
|
column1: [
|
|
{
|
|
xtype: 'pmxDisplayEditField',
|
|
cbind: {
|
|
editable: '{isCreate}',
|
|
},
|
|
name: 'name',
|
|
allowBlank: false,
|
|
fieldLabel: gettext('Name'),
|
|
},
|
|
],
|
|
|
|
column2: [
|
|
{
|
|
xtype: 'pmxDisplayEditField',
|
|
cbind: {
|
|
editable: '{isCreate}',
|
|
},
|
|
name: 'path',
|
|
allowBlank: false,
|
|
fieldLabel: gettext('Backing Path'),
|
|
emptyText: gettext('An absolute path'),
|
|
},
|
|
],
|
|
|
|
columnB: [
|
|
{
|
|
xtype: 'textfield',
|
|
name: 'comment',
|
|
fieldLabel: gettext('Comment'),
|
|
},
|
|
],
|
|
}
|
|
],
|
|
});
|