]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: add verification job edit window
authorHannes Laimer <h.laimer@proxmox.com>
Tue, 20 Oct 2020 09:10:09 +0000 (11:10 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Oct 2020 10:51:35 +0000 (12:51 +0200)
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
www/Makefile
www/window/VerifyJobEdit.js [new file with mode: 0644]

index a6c46718fa89eea463fe6d948c22ed397435a415..e04af930be32e0856cdab2feb48ca74d979e8a12 100644 (file)
@@ -20,6 +20,7 @@ JSSRC=                                                        \
        config/DataStoreConfig.js                       \
        window/UserEdit.js                              \
        window/UserPassword.js                          \
+       window/VerifyJobEdit.js                         \
        window/RemoteEdit.js                            \
        window/SyncJobEdit.js                           \
        window/ACLEdit.js                               \
diff --git a/www/window/VerifyJobEdit.js b/www/window/VerifyJobEdit.js
new file mode 100644 (file)
index 0000000..9d29eba
--- /dev/null
@@ -0,0 +1,93 @@
+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 },
+
+    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 { };
+    },
+
+    items: {
+       xtype: 'inputpanel',
+       column1: [
+           {
+               fieldLabel: gettext('Verify Job ID'),
+               xtype: 'pmxDisplayEditField',
+               name: 'id',
+               renderer: Ext.htmlEncode,
+               allowBlank: false,
+               minLength: 4,
+               cbind: {
+                   editable: '{isCreate}',
+               },
+           },
+           {
+               fieldLabel: gettext('Datastore'),
+               xtype: 'pbsDataStoreSelector',
+               allowBlank: false,
+               name: 'store',
+           },
+           {
+               xtype: 'proxmoxintegerfield',
+               fieldLabel: gettext('Days valid'),
+               minValue: 1,
+               value: '',
+               allowBlank: true,
+               name: 'outdated-after',
+               emptyText: gettext('no expiration'),
+               cbind: {
+                   deleteEmpty: '{!isCreate}',
+               },
+           },
+       ],
+
+       column2: [
+           {
+               fieldLabel: gettext('Ignore verified'),
+               xtype: 'proxmoxcheckbox',
+               name: 'ignore-verified',
+               uncheckedValue: false,
+               value: true,
+           },
+           {
+               fieldLabel: gettext('Schedule'),
+               xtype: 'pbsCalendarEvent',
+               name: 'schedule',
+               emptyText: gettext('none'),
+               cbind: {
+                   deleteEmpty: '{!isCreate}',
+               },
+           },
+       ],
+
+       columnB: [
+           {
+               fieldLabel: gettext('Comment'),
+               xtype: 'proxmoxtextfield',
+               name: 'comment',
+               cbind: {
+                   deleteEmpty: '{!isCreate}',
+               },
+           },
+       ],
+    },
+});