ui: tape: add form fields
this includes selectors for * Allocation Policy * Retention Policy * Drives * Changers * Tape Device Paths * Pools Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
b03ec281bf
commit
c72fdb53ae
62
www/tape/form/TapeDevicePathSelector.js
Normal file
62
www/tape/form/TapeDevicePathSelector.js
Normal file
@ -0,0 +1,62 @@
|
||||
Ext.define('PBS.form.TapeDevicePathSelector', {
|
||||
extend: 'Proxmox.form.ComboGrid',
|
||||
alias: 'widget.pbsTapeDevicePathSelector',
|
||||
|
||||
allowBlank: false,
|
||||
displayField: 'path',
|
||||
valueField: 'path',
|
||||
|
||||
// type can be 'drives' or 'changers'
|
||||
type: 'drives',
|
||||
|
||||
listConfig: {
|
||||
columns: [
|
||||
{
|
||||
text: gettext('Path'),
|
||||
dataIndex: 'path',
|
||||
sortable: true,
|
||||
flex: 1,
|
||||
renderer: Ext.String.htmlEncode,
|
||||
},
|
||||
{
|
||||
text: gettext('Vendor'),
|
||||
dataIndex: 'vendor',
|
||||
sortable: true,
|
||||
flex: 1,
|
||||
renderer: Ext.String.htmlEncode,
|
||||
},
|
||||
{
|
||||
text: gettext('Model'),
|
||||
dataIndex: 'model',
|
||||
sortable: true,
|
||||
flex: 1,
|
||||
renderer: Ext.String.htmlEncode,
|
||||
},
|
||||
{
|
||||
text: gettext('Serial'),
|
||||
dataIndex: 'serial',
|
||||
sortable: true,
|
||||
flex: 1,
|
||||
renderer: Ext.String.htmlEncode,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
let me = this;
|
||||
if (me.type !== 'drives' && me.type !== 'changers') {
|
||||
throw `invalid type '${me.type}'`;
|
||||
}
|
||||
|
||||
let url = `/api2/json/tape/scan-${me.type}`;
|
||||
me.store = {
|
||||
proxy: {
|
||||
type: 'proxmox',
|
||||
url,
|
||||
},
|
||||
autoLoad: true,
|
||||
};
|
||||
|
||||
me.callParent();
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user