2020-10-20 09:10:09 +00:00
|
|
|
Ext.define('PBS.window.VerifyJobEdit', {
|
|
|
|
extend: 'Proxmox.window.Edit',
|
|
|
|
alias: 'widget.pbsVerifyJobEdit',
|
|
|
|
mixins: ['Proxmox.Mixin.CBind'],
|
|
|
|
|
|
|
|
userid: undefined,
|
|
|
|
|
|
|
|
onlineHelp: 'verifyjobs',
|
|
|
|
|
|
|
|
isAdd: true,
|
|
|
|
|
|
|
|
subject: gettext('VerifyJob'),
|
|
|
|
|
|
|
|
fieldDefaults: { labelWidth: 120 },
|
2020-10-28 20:25:07 +00:00
|
|
|
defaultFocus: 'field[name="ignore-verified"]',
|
2020-10-20 09:10:09 +00:00
|
|
|
|
|
|
|
cbindData: function(initialConfig) {
|
|
|
|
let me = this;
|
|
|
|
|
|
|
|
let baseurl = '/api2/extjs/config/verify';
|
|
|
|
let id = initialConfig.id;
|
|
|
|
|
|
|
|
me.isCreate = !id;
|
|
|
|
me.url = id ? `${baseurl}/${id}` : baseurl;
|
|
|
|
me.method = id ? 'PUT' : 'POST';
|
|
|
|
me.autoLoad = !!id;
|
|
|
|
return { };
|
|
|
|
},
|
|
|
|
|
2020-10-28 20:25:07 +00:00
|
|
|
viewModel: {
|
|
|
|
data: {
|
|
|
|
'ignore-verified': true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2020-10-20 09:10:09 +00:00
|
|
|
items: {
|
|
|
|
xtype: 'inputpanel',
|
2020-10-28 20:25:07 +00:00
|
|
|
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;
|
|
|
|
},
|
2020-10-20 09:10:09 +00:00
|
|
|
column1: [
|
|
|
|
{
|
2020-10-28 20:25:07 +00:00
|
|
|
xtype: 'displayfield',
|
|
|
|
name: 'store',
|
|
|
|
fieldLabel: gettext('Datastore'),
|
2020-10-20 09:10:09 +00:00
|
|
|
allowBlank: false,
|
2020-10-28 20:25:07 +00:00
|
|
|
submitValue: true,
|
2020-10-20 09:10:09 +00:00
|
|
|
cbind: {
|
2020-10-28 20:25:07 +00:00
|
|
|
value: '{datastore}',
|
2020-10-20 09:10:09 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2020-10-28 20:25:07 +00:00
|
|
|
xtype: 'pbsCalendarEvent',
|
|
|
|
name: 'schedule',
|
|
|
|
fieldLabel: gettext('Schedule'),
|
|
|
|
emptyText: gettext('none (disabled)'),
|
|
|
|
value: 'daily',
|
2020-10-27 15:20:08 +00:00
|
|
|
cbind: {
|
2020-10-28 20:25:07 +00:00
|
|
|
deleteEmpty: '{!isCreate}',
|
2020-10-27 15:20:08 +00:00
|
|
|
},
|
2020-10-20 09:10:09 +00:00
|
|
|
},
|
2020-10-28 20:25:07 +00:00
|
|
|
],
|
|
|
|
advancedColumn1: [
|
2020-10-20 09:10:09 +00:00
|
|
|
{
|
2020-10-28 20:25:07 +00:00
|
|
|
xtype: 'pmxDisplayEditField',
|
|
|
|
name: 'id',
|
|
|
|
fieldLabel: gettext('Verify Job ID'),
|
|
|
|
emptyText: gettext('Automatic'),
|
|
|
|
renderer: Ext.htmlEncode,
|
2020-10-20 09:10:09 +00:00
|
|
|
allowBlank: true,
|
2020-10-28 20:25:07 +00:00
|
|
|
minLength: 4,
|
2020-10-20 09:10:09 +00:00
|
|
|
cbind: {
|
2020-10-28 20:25:07 +00:00
|
|
|
editable: '{isCreate}',
|
2020-10-20 09:10:09 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
column2: [
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxcheckbox',
|
|
|
|
name: 'ignore-verified',
|
2020-10-28 20:25:07 +00:00
|
|
|
fieldLabel: gettext('Skip verified snapshots'),
|
|
|
|
labelWidth: 150,
|
2020-10-20 09:10:09 +00:00
|
|
|
uncheckedValue: false,
|
|
|
|
value: true,
|
2020-10-28 20:25:07 +00:00
|
|
|
bind: {
|
|
|
|
value: '{ignore-verified}',
|
|
|
|
},
|
2020-10-20 09:10:09 +00:00
|
|
|
},
|
|
|
|
{
|
2020-10-28 20:25:07 +00:00
|
|
|
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}',
|
|
|
|
},
|
2020-10-20 09:10:09 +00:00
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
columnB: [
|
|
|
|
{
|
|
|
|
fieldLabel: gettext('Comment'),
|
|
|
|
xtype: 'proxmoxtextfield',
|
|
|
|
name: 'comment',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|