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: {
|
2022-05-11 07:42:49 +00:00
|
|
|
'ignoreVerified': true,
|
2020-10-28 20:25:07 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
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
|
|
|
},
|
2022-05-11 07:42:49 +00:00
|
|
|
{
|
|
|
|
xtype: 'pbsNamespaceSelector',
|
|
|
|
name: 'ns',
|
|
|
|
fieldLabel: gettext('Namespace'),
|
|
|
|
cbind: {
|
|
|
|
datastore: '{datastore}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'pbsNamespaceMaxDepth',
|
|
|
|
name: 'max-depth',
|
|
|
|
fieldLabel: gettext('Max. Depth'),
|
|
|
|
deleteEmpty: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
column2: [
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxcheckbox',
|
|
|
|
name: 'ignore-verified',
|
2022-05-11 07:42:49 +00:00
|
|
|
fieldLabel: gettext('Skip Verified'),
|
2020-10-20 09:10:09 +00:00
|
|
|
uncheckedValue: false,
|
|
|
|
value: true,
|
2020-10-28 20:25:07 +00:00
|
|
|
bind: {
|
2022-05-11 07:42:49 +00:00
|
|
|
value: '{ignoreVerified}',
|
2020-10-28 20:25:07 +00:00
|
|
|
},
|
2020-10-20 09:10:09 +00:00
|
|
|
},
|
|
|
|
{
|
2022-05-11 07:42:49 +00:00
|
|
|
xtype: 'fieldcontainer',
|
|
|
|
layout: 'hbox',
|
|
|
|
fieldLabel: gettext('Re-Verify After'),
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
xtype: 'pbsVerifyOutdatedAfter',
|
|
|
|
name: 'outdated-after',
|
|
|
|
bind: {
|
|
|
|
disabled: '{!ignoreVerified}',
|
|
|
|
},
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'displayfield',
|
|
|
|
padding: '0 0 0 5',
|
|
|
|
name: 'unit',
|
|
|
|
submitValue: false,
|
|
|
|
value: gettext('days'),
|
|
|
|
bind: {
|
|
|
|
disabled: '{!ignoreVerified}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2020-10-20 09:10:09 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
columnB: [
|
|
|
|
{
|
|
|
|
fieldLabel: gettext('Comment'),
|
|
|
|
xtype: 'proxmoxtextfield',
|
|
|
|
name: 'comment',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|