[pve-devel] [PATCH manager 1/5] ui: dc/Backup: never show id input field, autogenerate id

Dominik Csapak d.csapak at proxmox.com
Thu Nov 11 12:07:05 CET 2021


similar to pbs sync jobs

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/dc/Backup.js | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index e33f5e27..3f250a76 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -176,24 +176,6 @@ Ext.define('PVE.dc.BackupEdit', {
 	});
 
 	let column1 = [
-	    {
-		xtype: 'pmxDisplayEditField',
-		name: 'id',
-		fieldLabel: gettext('ID'),
-		renderer: Ext.htmlEncode,
-		fieldStyle: me.isCreate ? {} : {
-		    'text-overflow': 'ellipsis',
-		    'overflow': 'hidden',
-		    'white-space': 'nowrap',
-		},
-		editConfig: {
-		    maxLength: 20, // easier to allow more than less in the future..
-		    enforceMaxLength: true,
-		},
-		vtype: 'ConfigId',
-		allowBlank: false,
-		editable: me.isCreate,
-	    },
 	    nodesel,
 	    storagesel,
 	    {
@@ -263,6 +245,10 @@ Ext.define('PVE.dc.BackupEdit', {
 		    delete values.node;
 		}
 
+		if (!values.id && me.isCreate) {
+		    values.id = 'backup-' + Ext.data.identifier.Uuid.Global.generate().slice(0, 13);
+		}
+
 		let selMode = values.selMode;
 		delete values.selMode;
 
-- 
2.30.2






More information about the pve-devel mailing list