[PATCH manager 1/2] ui: render storage type: further improve fallback

Joshua Huber jhuber at blockbridge.com
Tue Apr 5 19:09:14 CEST 2022


Display a custom type string, if specified in the pool configuration.

After this change, the logic is:

1) Is there an entry for the type value in PVE manager's built-in
   storage schema? If yes, return the 'name' property.

2) Otherwise, does the pool configuration specify a custom type string
   (as key 'type-text')? If so, HTML-encode the string and return it.

3) Otherwise, HTML-encode the raw storage type ID and return it.

Signed-off-by: Joshua Huber <jhuber at blockbridge.com>
---
 www/manager6/Utils.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 735806aa..0f66c4ff 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -998,7 +998,7 @@ Ext.define('PVE.Utils', {
 	}
 
 	let schema = PVE.Utils.storageSchema[value];
-	return schema?.name ?? value;
+	return schema?.name ?? Ext.htmlEncode(record?.get('type-text') ?? value);
     },
 
     format_ha: function(value) {
-- 
2.34.1





More information about the pve-devel mailing list