ui: datastore: rework sync layout, make job ID optional

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-10-28 21:25:30 +01:00
parent f26080fab1
commit 319fe45261
2 changed files with 49 additions and 33 deletions

View File

@ -204,7 +204,7 @@ Ext.define('PBS.config.SyncJobView', {
'-',
{
xtype: 'proxmoxButton',
text: gettext('Log'),
text: gettext('Show Log'),
handler: 'openTaskLog',
enableFn: (rec) => !!rec.data['last-run-upid'],
disabled: true,
@ -224,66 +224,68 @@ Ext.define('PBS.config.SyncJobView', {
columns: [
{
header: gettext('Sync Job'),
width: 100,
sortable: true,
renderer: Ext.String.htmlEncode,
dataIndex: 'id',
renderer: Ext.String.htmlEncode,
flex: 2,
sortable: true,
hidden: true,
},
{
header: gettext('Remote'),
width: 100,
sortable: true,
dataIndex: 'remote',
flex: 2,
sortable: true,
},
{
header: gettext('Remote Store'),
width: 100,
sortable: true,
dataIndex: 'remote-store',
flex: 2,
sortable: true,
},
{
header: gettext('Local Store'),
width: 100,
sortable: true,
dataIndex: 'store',
flex: 2,
sortable: true,
},
{
header: gettext('Schedule'),
sortable: true,
dataIndex: 'schedule',
flex: 2,
sortable: true,
},
{
header: gettext('Status'),
dataIndex: 'last-run-state',
flex: 1,
renderer: 'render_sync_status',
flex: 4,
},
{
header: gettext('Last Sync'),
sortable: true,
minWidth: 200,
renderer: 'render_optional_timestamp',
dataIndex: 'last-run-endtime',
renderer: 'render_optional_timestamp',
flex: 3,
sortable: true,
},
{
text: gettext('Duration'),
dataIndex: 'duration',
width: 60,
renderer: Proxmox.Utils.render_duration,
flex: 2,
},
{
header: gettext('Next Run'),
sortable: true,
minWidth: 200,
renderer: 'render_next_run',
dataIndex: 'next-run',
renderer: 'render_next_run',
flex: 3,
sortable: true,
},
{
header: gettext('Comment'),
hidden: true,
sortable: true,
renderer: Ext.String.htmlEncode,
dataIndex: 'comment',
renderer: Ext.String.htmlEncode,
flex: 4,
sortable: true,
},
],
});

View File

@ -28,16 +28,23 @@ Ext.define('PBS.window.SyncJobEdit', {
items: {
xtype: 'inputpanel',
onGetValues: function(values) {
let me = this;
if (!values.id && me.up('pbsSyncJobEdit').isCreate) {
values.id = 'auto-' + Ext.data.identifier.Uuid.Global.generate().slice(0, 23);
}
return values;
},
column1: [
{
fieldLabel: gettext('Sync Job ID'),
xtype: 'pmxDisplayEditField',
name: 'id',
renderer: Ext.htmlEncode,
xtype: 'displayfield',
name: 'store',
fieldLabel: gettext('Local Datastore'),
allowBlank: false,
minLength: 4,
submitValue: true,
cbind: {
editable: '{isCreate}',
value: '{datastore}',
},
},
{
@ -52,12 +59,18 @@ Ext.define('PBS.window.SyncJobEdit', {
allowBlank: false,
name: 'remote-store',
},
],
advancedColumn1: [
{
xtype: 'hiddenfield',
allowBlank: false,
name: 'store',
xtype: 'pmxDisplayEditField',
name: 'id',
fieldLabel: gettext('Sync Job ID'),
emptyText: gettext('Automatic'),
renderer: Ext.htmlEncode,
allowBlank: true,
minLength: 4,
cbind: {
value: '{datastore}',
editable: '{isCreate}',
},
},
],
@ -74,7 +87,8 @@ Ext.define('PBS.window.SyncJobEdit', {
fieldLabel: gettext('Schedule'),
xtype: 'pbsCalendarEvent',
name: 'schedule',
emptyText: gettext('none'),
value: 'hourly',
emptyText: gettext('none (disabled)'),
cbind: {
deleteEmpty: '{!isCreate}',
},