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,
|
|
|
|
|
|
|
|
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;
|
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)'),
|
|
|
|
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
|
|
|
],
|
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}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|