From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 3/4] ui: ceph pool edit: disable size and crush rule for erasure pools
Date: Fri, 29 Apr 2022 16:16:54 +0200 [thread overview]
Message-ID: <20220429141655.2884387-3-a.lauterer@proxmox.com> (raw)
In-Reply-To: <20220429141655.2884387-1-a.lauterer@proxmox.com>
They cannot be changed after pool creation for erasure coded pools
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
www/manager6/ceph/Pool.js | 44 ++++++++++++++++++++++++++-------------
1 file changed, 29 insertions(+), 15 deletions(-)
diff --git a/www/manager6/ceph/Pool.js b/www/manager6/ceph/Pool.js
index 41df216e..16b903ce 100644
--- a/www/manager6/ceph/Pool.js
+++ b/www/manager6/ceph/Pool.js
@@ -19,21 +19,28 @@ Ext.define('PVE.CephPoolInputPanel', {
allowBlank: false,
},
{
- xtype: 'proxmoxintegerfield',
+ xtype: 'pmxDisplayEditField',
+ cbind: {
+ editable: '{!isErasure}',
+ },
fieldLabel: gettext('Size'),
name: 'size',
- value: 3,
- minValue: 2,
- maxValue: 7,
- allowBlank: false,
- listeners: {
- change: function(field, val) {
- let size = Math.round(val / 2);
- if (size > 1) {
- field.up('inputpanel').down('field[name=min_size]').setValue(size);
- }
+ editConfig: {
+ xtype: 'proxmoxintegerfield',
+ value: 3,
+ minValue: 2,
+ maxValue: 7,
+ allowBlank: false,
+ listeners: {
+ change: function(field, val) {
+ let size = Math.round(val / 2);
+ if (size > 1) {
+ field.up('inputpanel').down('field[name=min_size]').setValue(size);
+ }
+ },
},
},
+
},
],
column2: [
@@ -101,14 +108,18 @@ Ext.define('PVE.CephPoolInputPanel', {
hidden: true,
},
{
- xtype: 'pveCephRuleSelector',
- fieldLabel: 'Crush Rule', // do not localize
- name: 'crush_rule',
+ xtype: 'pmxDisplayEditField',
cbind: {
+ editable: '{!isErasure}',
nodename: '{nodename}',
isCreate: '{isCreate}',
},
- allowBlank: false,
+ fieldLabel: 'Crush Rule', // do not localize
+ name: 'crush_rule',
+ editConfig: {
+ xtype: 'pveCephRuleSelector',
+ allowBlank: false,
+ },
},
{
xtype: 'proxmoxintegerfield',
@@ -203,6 +214,7 @@ Ext.define('PVE.Ceph.PoolEdit', {
cbind: {
nodename: '{nodename}',
pool_name: '{pool_name}',
+ isErasure: '{isErasure}',
isCreate: '{isCreate}',
},
}],
@@ -354,6 +366,7 @@ Ext.define('PVE.node.Ceph.PoolList', {
title: gettext('Edit') + ': Ceph Pool',
nodename: nodename,
pool_name: rec.data.pool_name,
+ isErasure: rec.data.type === 'erasure',
autoShow: true,
listeners: {
destroy: () => rstore.load(),
@@ -371,6 +384,7 @@ Ext.define('PVE.node.Ceph.PoolList', {
Ext.create('PVE.Ceph.PoolEdit', {
title: gettext('Create') + ': Ceph Pool',
isCreate: true,
+ isErasure: false,
nodename: nodename,
autoShow: true,
listeners: {
--
2.30.2
next prev parent reply other threads:[~2022-04-29 14:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-29 14:16 [pve-devel] [PATCH manager 1/4] ceph tools: set_pools: filter settings for erasure code pools Aaron Lauterer
2022-04-29 14:16 ` [pve-devel] [PATCH manager 2/4] api: ceph pools: add type to returned properties Aaron Lauterer
2022-05-02 7:11 ` Dominik Csapak
2022-05-02 7:19 ` Aaron Lauterer
2022-04-29 14:16 ` Aaron Lauterer [this message]
2022-04-29 14:16 ` [pve-devel] [PATCH manager 4/4] ui: ceph pools: add pool type column Aaron Lauterer
2022-05-02 7:10 ` [pve-devel] [PATCH manager 1/4] ceph tools: set_pools: filter settings for erasure code pools Dominik Csapak
2022-05-02 7:13 ` Dominik Csapak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220429141655.2884387-3-a.lauterer@proxmox.com \
--to=a.lauterer@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox