ui: datastore: rework verify 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:07 +01:00
parent 0cbdeed96b
commit f26080fab1
2 changed files with 84 additions and 52 deletions

View File

@ -204,7 +204,7 @@ Ext.define('PBS.config.VerifyJobView', {
'-',
{
xtype: 'proxmoxButton',
text: gettext('Log'),
text: gettext('Show Log'),
handler: 'openTaskLog',
enableFn: (rec) => !!rec.data['last-run-upid'],
disabled: true,
@ -223,62 +223,65 @@ Ext.define('PBS.config.VerifyJobView', {
columns: [
{
header: gettext('Verify Job'),
width: 100,
sortable: true,
renderer: Ext.String.htmlEncode,
header: gettext('Job ID'),
dataIndex: 'id',
renderer: Ext.String.htmlEncode,
flex: 2,
sortable: true,
hidden: true,
},
{
header: gettext('Days valid'),
width: 125,
sortable: true,
dataIndex: 'outdated-after',
},
{
header: gettext('Ignore verified'),
width: 125,
sortable: true,
renderer: Proxmox.Utils.format_boolean,
header: gettext('Skip Verified'),
dataIndex: 'ignore-verified',
renderer: Proxmox.Utils.format_boolean,
flex: 2,
sortable: true,
},
{
header: gettext('Re-Verfiy Age'),
dataIndex: 'outdated-after',
renderer: v => v ? v +' '+ gettext('Days') : gettext('Never'),
flex: 2,
sortable: true,
},
{
header: gettext('Schedule'),
sortable: true,
dataIndex: 'schedule',
sortable: true,
flex: 2,
},
{
header: gettext('Status'),
dataIndex: 'last-run-state',
flex: 1,
renderer: 'render_verify_status',
flex: 4,
},
{
header: gettext('Last Verification'),
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

@ -12,6 +12,7 @@ Ext.define('PBS.window.VerifyJobEdit', {
subject: gettext('VerifyJob'),
fieldDefaults: { labelWidth: 120 },
defaultFocus: 'field[name="ignore-verified"]',
cbindData: function(initialConfig) {
let me = this;
@ -26,55 +27,83 @@ Ext.define('PBS.window.VerifyJobEdit', {
return { };
},
viewModel: {
data: {
'ignore-verified': true,
},
},
items: {
xtype: 'inputpanel',
onGetValues: function(values) {
let me = this;
if (!values.id && me.up('pbsVerifyJobEdit').isCreate) {
values.id = 'auto-' + Ext.data.identifier.Uuid.Global.generate().slice(0, 23);
}
return values;
},
column1: [
{
fieldLabel: gettext('Verify Job ID'),
xtype: 'pmxDisplayEditField',
name: 'id',
renderer: Ext.htmlEncode,
allowBlank: false,
minLength: 4,
cbind: {
editable: '{isCreate}',
},
},
{
xtype: 'hiddenfield',
allowBlank: false,
xtype: 'displayfield',
name: 'store',
fieldLabel: gettext('Datastore'),
allowBlank: false,
submitValue: true,
cbind: {
value: '{datastore}',
},
},
{
xtype: 'proxmoxintegerfield',
fieldLabel: gettext('Days valid'),
minValue: 1,
value: '',
allowBlank: true,
name: 'outdated-after',
emptyText: gettext('no expiration'),
xtype: 'pbsCalendarEvent',
name: 'schedule',
fieldLabel: gettext('Schedule'),
emptyText: gettext('none (disabled)'),
value: 'daily',
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
advancedColumn1: [
{
xtype: 'pmxDisplayEditField',
name: 'id',
fieldLabel: gettext('Verify Job ID'),
emptyText: gettext('Automatic'),
renderer: Ext.htmlEncode,
allowBlank: true,
minLength: 4,
cbind: {
editable: '{isCreate}',
},
},
],
column2: [
{
fieldLabel: gettext('Ignore verified'),
xtype: 'proxmoxcheckbox',
name: 'ignore-verified',
fieldLabel: gettext('Skip verified snapshots'),
labelWidth: 150,
uncheckedValue: false,
value: true,
bind: {
value: '{ignore-verified}',
},
},
{
fieldLabel: gettext('Schedule'),
xtype: 'pbsCalendarEvent',
name: 'schedule',
emptyText: gettext('none'),
xtype: 'proxmoxintegerfield',
name: 'outdated-after',
fieldLabel: gettext('Re-Verify After (days)'),
labelWidth: 150,
minValue: 1,
value: 30,
allowBlank: true,
emptyText: gettext('Never'),
bind: {
disabled: '{!ignore-verified}',
},
cbind: {
deleteEmpty: '{!isCreate}',
},