2021-11-29 14:39:40 +00:00
|
|
|
Ext.define('pbs-groups', {
|
|
|
|
extend: 'Ext.data.Model',
|
|
|
|
fields: [
|
|
|
|
'backup-type',
|
|
|
|
'backup-id',
|
|
|
|
{
|
|
|
|
name: 'group',
|
|
|
|
type: 'string',
|
|
|
|
convert: function(value, record) {
|
|
|
|
if (record.data['backup-type'] && record.data['backup-id']) {
|
|
|
|
return `${record.data['backup-type']}/${record.data['backup-id']}`;
|
|
|
|
}
|
|
|
|
return value;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
proxy: {
|
|
|
|
type: 'proxmox',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
Ext.define('PBS.form.GroupSelector', {
|
|
|
|
extend: 'Proxmox.form.ComboGrid',
|
|
|
|
alias: 'widget.pbsGroupSelector',
|
2022-05-13 11:14:53 +00:00
|
|
|
mixins: ['Proxmox.Mixin.CBind'],
|
2021-11-29 14:39:40 +00:00
|
|
|
|
|
|
|
allowBlank: false,
|
|
|
|
autoSelect: false,
|
|
|
|
notFoundIsValid: true,
|
|
|
|
editable: true,
|
|
|
|
valueField: 'group',
|
|
|
|
displayField: 'group',
|
|
|
|
|
|
|
|
store: {
|
|
|
|
sorters: 'group',
|
|
|
|
model: 'pbs-groups',
|
|
|
|
},
|
|
|
|
|
|
|
|
listConfig: {
|
|
|
|
minHeight: 80,
|
|
|
|
emptyText: gettext('No Groups'),
|
|
|
|
viewConfig: {
|
|
|
|
deferEmptyText: false,
|
|
|
|
},
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
header: gettext('Group'),
|
|
|
|
sortable: true,
|
|
|
|
dataIndex: 'group',
|
|
|
|
renderer: Ext.String.htmlEncode,
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|