fix #2864: add owner option to sync

instead of hard-coding 'backup@pam'. this allows a bit more flexibility
(e.g., syncing to a datastore that can directly be used as restore
source) without overly complicating things.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2020-10-30 12:36:41 +01:00
committed by Dietmar Maurer
parent fa7aceeb15
commit f1694b062d
5 changed files with 61 additions and 6 deletions

View File

@ -1,7 +1,7 @@
Ext.define('pbs-sync-jobs-status', {
extend: 'Ext.data.Model',
fields: [
'id', 'remote', 'remote-store', 'store', 'schedule',
'id', 'owner', 'remote', 'remote-store', 'store', 'schedule',
'next-run', 'last-run-upid', 'last-run-state', 'last-run-endtime',
{
name: 'duration',
@ -151,6 +151,11 @@ Ext.define('PBS.config.SyncJobView', {
return Proxmox.Utils.render_timestamp(value);
},
render_optional_owner: function(value, metadata, record) {
if (!value) return '-';
return Ext.String.htmlEncode(value, metadata, record);
},
startStore: function() { this.getView().getStore().rstore.startUpdate(); },
stopStore: function() { this.getView().getStore().rstore.stopUpdate(); },
@ -250,6 +255,13 @@ Ext.define('PBS.config.SyncJobView', {
width: 120,
sortable: true,
},
{
header: gettext('Owner'),
dataIndex: 'owner',
renderer: 'render_optional_owner',
flex: 2,
sortable: true,
},
{
header: gettext('Schedule'),
dataIndex: 'schedule',

View File

@ -62,6 +62,26 @@ Ext.define('PBS.window.SyncJobEdit', {
],
column2: [
{
fieldLabel: gettext('Owner'),
xtype: 'pbsUserSelector',
name: 'owner',
allowBlank: true,
emptyText: 'backup@pam',
getSubmitData: function() {
let me = this;
let name = me.getName();
let val = me.getSubmitValue();
let data = {};
if (val === null || val === "") {
data.delete = name;
} else {
data[name] = val;
}
return data;
},
},
{
fieldLabel: gettext('Remove vanished'),
xtype: 'proxmoxcheckbox',