2021-01-28 11:59:45 +00:00
|
|
|
Ext.define('PBS.form.DriveSelector', {
|
|
|
|
extend: 'Proxmox.form.ComboGrid',
|
|
|
|
alias: 'widget.pbsDriveSelector',
|
|
|
|
|
|
|
|
allowBlank: false,
|
|
|
|
displayField: 'name',
|
|
|
|
valueField: 'name',
|
|
|
|
value: null,
|
|
|
|
|
|
|
|
store: {
|
|
|
|
proxy: {
|
|
|
|
type: 'proxmox',
|
|
|
|
url: '/api2/json/tape/drive',
|
|
|
|
},
|
|
|
|
autoLoad: true,
|
|
|
|
sorters: 'name',
|
|
|
|
},
|
|
|
|
|
2021-06-07 13:06:44 +00:00
|
|
|
autoSelect: false,
|
|
|
|
|
2021-01-28 11:59:45 +00:00
|
|
|
listConfig: {
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
text: gettext('Name'),
|
|
|
|
dataIndex: 'name',
|
|
|
|
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.changer) {
|
|
|
|
me.store.proxy.extraParams = {
|
|
|
|
changer: me.changer,
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
me.store.proxy.extraParams = {};
|
|
|
|
}
|
|
|
|
|
|
|
|
me.callParent();
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|