From 3d1b5e55bbe327446fbbbd0e417fc800e6703c99 Mon Sep 17 00:00:00 2001 From: avanthakkar Date: Fri, 19 May 2023 17:07:28 +0530 Subject: [PATCH] mgr/dashboard: add helpers for compression in pool form Fixes: https://tracker.ceph.com/issues/61297 Signed-off-by: avanthakkar Adding helpers for compression mode, algorithm, min/max blob size and compression ratio which is set to 0.875 as default. --- .../pool/pool-form/pool-form.component.html | 72 +++++++++++-------- .../pool/pool-form/pool-form.component.ts | 3 +- .../pool/pool-list/pool-list.component.ts | 2 +- 3 files changed, 47 insertions(+), 30 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html index 13103da324aab..6a37c6a0e58c1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html @@ -421,9 +421,10 @@
- +
+ Policy used for compression algorithm
- +
+ + Compression algorithm used +
- +
+ + Chunks smaller than Minimum blob size are never compressed + Value should be greater than 0 @@ -491,9 +501,10 @@
- +
+ + Chunks larger than `Maximum Blob Size` are broken into smaller blobs of size mentioned before being compressed. + Value should be greater than 0 @@ -518,9 +532,10 @@
- +
+ class="form-control"> + + The ratio of the size of the data chunk after compression relative to the original size must be at least this small in order to store the compressed version + Value should be between 0.0 and 1.0 @@ -550,11 +566,6 @@
+ + Leave it blank or specify 0 to disable this quota. +
+ A valid quota should be greater than 0. +
Size must be a number or in a valid format. eg: 5 GiB @@ -577,11 +593,6 @@
+ + Leave it blank or specify 0 to disable this quota. +
+ A valid quota should be greater than 0. +
The value should be greater or equal to 0 diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts index c91ca76536725..a3f6b6fd16e4b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts @@ -83,6 +83,7 @@ export class PoolFormComponent extends CdForm implements OnInit { crushUsage: string[] = undefined; // Will only be set if a rule is used by some pool ecpUsage: string[] = undefined; // Will only be set if a rule is used by some pool crushRuleMaxSize = 10; + DEFAULT_RATIO = 0.875; private modalSubscription: Subscription; @@ -128,7 +129,7 @@ export class PoolFormComponent extends CdForm implements OnInit { maxBlobSize: new UntypedFormControl('', { updateOn: 'blur' }), - ratio: new UntypedFormControl('', { + ratio: new UntypedFormControl(this.DEFAULT_RATIO, { updateOn: 'blur' }) }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts index ba2d9cbe521b1..d86689c12142b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts @@ -121,7 +121,7 @@ export class PoolListComponent extends ListWithDetails implements OnInit { { prop: 'pool_name', name: $localize`Name`, - flexGrow: 4, + flexGrow: 2, cellTransformation: CellTemplate.executing }, { -- 2.39.5