[pve-devel] [PATCH manager 4/4] ceph: gui: display warning on min_size 1

Alwin Antreich a.antreich at proxmox.com
Tue Oct 27 17:47:17 CET 2020


Signed-off-by: Alwin Antreich <a.antreich at proxmox.com>
---
 www/manager6/ceph/Pool.js | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/www/manager6/ceph/Pool.js b/www/manager6/ceph/Pool.js
index 28b0b4a5..93ed667e 100644
--- a/www/manager6/ceph/Pool.js
+++ b/www/manager6/ceph/Pool.js
@@ -47,7 +47,23 @@ Ext.define('PVE.CephPoolEdit', {
 	    value: 2,
 	    minValue: 1,
 	    maxValue: 7,
-	    allowBlank: false
+	    allowBlank: false,
+	    listeners: {
+		change: function(field, val) {
+		    if (val < 2) {
+			field.up().down('field[name=min_size-warning]').setHidden(false);
+			field.setFieldLabel(gettext('Min. Size') + ' <i class="fa fa-exclamation-triangle warning"></i>');
+		    }
+		}
+	    },
+	},
+	{
+	    xtype: 'displayfield',
+	    name: 'min_size-warning',
+	    padding: '5 0 0 0',
+	    userCls: 'pmx-hint',
+	    value: 'A pool with min_size=1 could lead to data loss, incomplete PGs or unfound objects.',
+	    hidden: true,
 	},
 	{
 	    xtype: 'pveCephRuleSelector',
-- 
2.27.0






More information about the pve-devel mailing list