[pbs-devel] [PATCH proxmox-backup 3/3] ui: datastore/Content: add 'Re-Verify after (days)' input to 'Verify All'

Dominik Csapak d.csapak at proxmox.com
Thu Jan 27 15:13:21 CET 2022


so that a user can select when snapshots should be re-verified

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/datastore/Content.js | 36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/www/datastore/Content.js b/www/datastore/Content.js
index d0498bc7..c04bf32a 100644
--- a/www/datastore/Content.js
+++ b/www/datastore/Content.js
@@ -329,17 +329,32 @@ Ext.define('PBS.DataStoreContent', {
 	verifyAll: function() {
 	    var view = this.getView();
 
-	    Proxmox.Utils.API2Request({
-		url: `/admin/datastore/${view.datastore}/verify`,
+	    Ext.create('Proxmox.window.Edit', {
+		title: Ext.String.format(gettext("Verify '{0}'"), view.datastore),
+
 		method: 'POST',
-		failure: function(response) {
-		    Ext.Msg.alert(gettext('Error'), response.htmlStatus);
-		},
-		success: function(response, options) {
-		    Ext.create('Proxmox.window.TaskViewer', {
-			upid: response.result.data,
-		    }).show();
-		},
+		submitText: gettext('OK'),
+		autoShow: true,
+		isCreate: true,
+		showTaskViewer: true,
+
+		taskDone: () => this.reload(),
+
+		url: `/api2/extjs/admin/datastore/${view.datastore}/verify`,
+
+		items: [
+		    {
+			xtype: 'proxmoxintegerfield',
+			name: 'outdated-after',
+			fieldLabel: gettext('Re-Verify After (days)'),
+			labelWidth: 150,
+			minValue: 1,
+			value: 30,
+			allowBlank: true,
+			emptyText: gettext('Never'),
+			deleteEmpty: false,
+		    },
+		],
 	    });
 	},
 
@@ -1004,7 +1019,6 @@ Ext.define('PBS.DataStoreContent', {
 	{
 	    xtype: 'proxmoxButton',
 	    text: gettext('Verify All'),
-	    confirmMsg: gettext('Do you want to verify all snapshots now?'),
 	    handler: 'verifyAll',
 	},
 	{
-- 
2.30.2






More information about the pbs-devel mailing list