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,
|
|
|
|
|
2020-11-10 10:45:43 +00:00
|
|
|
onlineHelp: 'maintenance-verification',
|
2020-10-20 09:10:09 +00:00
|
|
|
|
|
|
|
isAdd: true,
|
|
|
|
|
2021-03-28 14:57:00 +00:00
|
|
|
subject: gettext('Verification Job'),
|
2020-10-20 09:10:09 +00:00
|
|
|
|
|
|
|
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';
|
2021-01-12 09:21:17 +00:00
|
|
|
me.scheduleValue = id ? null : 'daily';
|
2020-10-20 09:10:09 +00:00
|
|
|
me.autoLoad = !!id;
|
2020-11-09 15:01:25 +00:00
|
|
|
me.editDatastore = me.datastore === undefined && me.isCreate;
|
2020-10-20 09:10:09 +00:00
|
|
|
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) {
|
2020-11-11 06:30:52 +00:00
|
|
|
values.id = 'v-' + Ext.data.identifier.Uuid.Global.generate().slice(0, 13);
|
2020-10-28 20:25:07 +00:00
|
|
|
}
|
|
|
|
return values;
|
|
|
|
},
|
2020-10-20 09:10:09 +00:00
|
|
|
column1: [
|
|
|
|
{
|
2020-11-09 15:01:25 +00:00
|
|
|
xtype: 'pmxDisplayEditField',
|
|
|
|
fieldLabel: gettext('Local Datastore'),
|
2020-10-28 20:25:07 +00:00
|
|
|
name: 'store',
|
|
|
|
submitValue: true,
|
2020-10-20 09:10:09 +00:00
|
|
|
cbind: {
|
2020-11-09 15:01:25 +00:00
|
|
|
editable: '{editDatastore}',
|
2020-10-28 20:25:07 +00:00
|
|
|
value: '{datastore}',
|
2020-10-20 09:10:09 +00:00
|
|
|
},
|
2020-11-09 15:01:25 +00:00
|
|
|
editConfig: {
|
|
|
|
xtype: 'pbsDataStoreSelector',
|
|
|
|
allowBlank: false,
|
|
|
|
},
|
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)'),
|
2020-10-27 15:20:08 +00:00
|
|
|
cbind: {
|
2021-01-12 09:21:17 +00:00
|
|
|
value: '{scheduleValue}',
|
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
|
|
|
],
|
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}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|