Skip to content

Commit 309caf3

Browse files
authored
Merge pull request ceph#51591 from rhcs-dashboard/add-helpers-pool-compression
mgr/dashboard: add helpers for compression in pool form Reviewed-by: Pedro Gonzalez Gomez <[email protected]> Reviewed-by: afreen23 <NOT@FOUND> Reviewed-by: Ankush Behl <[email protected]> Reviewed-by: Nizamudeen A <[email protected]> Reviewed-by: Pere Diaz Bou <[email protected]>
2 parents f59f876 + 3d1b5e5 commit 309caf3

File tree

3 files changed

+47
-30
lines changed

3 files changed

+47
-30
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,10 @@
421421

422422
<!-- Compression Mode -->
423423
<div class="form-group row">
424-
<label i18n
425-
class="cd-col-form-label"
426-
for="mode">Mode</label>
424+
<label class="cd-col-form-label"
425+
for="mode"
426+
i18n>Mode
427+
</label>
427428
<div class="cd-col-form-input">
428429
<select class="form-select"
429430
id="mode"
@@ -434,14 +435,16 @@
434435
{{ mode }}
435436
</option>
436437
</select>
438+
<cd-help-text>Policy used for compression algorithm</cd-help-text>
437439
</div>
438440
</div>
439441
<div *ngIf="hasCompressionEnabled()">
440442
<!-- Compression algorithm selection -->
441443
<div class="form-group row">
442-
<label i18n
443-
class="cd-col-form-label"
444-
for="algorithm">Algorithm</label>
444+
<label class="cd-col-form-label"
445+
for="algorithm">
446+
<ng-container i18n>Algorithm</ng-container>
447+
</label>
445448
<div class="cd-col-form-input">
446449
<select class="form-select"
447450
id="algorithm"
@@ -458,14 +461,18 @@
458461
{{ algorithm }}
459462
</option>
460463
</select>
464+
<cd-help-text>
465+
<span i18n>Compression algorithm used</span>
466+
</cd-help-text>
461467
</div>
462468
</div>
463469

464470
<!-- Compression min blob size -->
465471
<div class="form-group row">
466-
<label i18n
467-
class="cd-col-form-label"
468-
for="minBlobSize">Minimum blob size</label>
472+
<label class="cd-col-form-label"
473+
for="minBlobSize">
474+
<ng-container i18n>Minimum blob size</ng-container>
475+
</label>
469476
<div class="cd-col-form-input">
470477
<input id="minBlobSize"
471478
name="minBlobSize"
@@ -477,6 +484,9 @@
477484
placeholder="e.g., 128KiB"
478485
defaultUnit="KiB"
479486
cdDimlessBinary>
487+
<cd-help-text>
488+
<span i18n>Chunks smaller than Minimum blob size are never compressed</span>
489+
</cd-help-text>
480490
<span class="invalid-feedback"
481491
*ngIf="form.showError('minBlobSize', formDir, 'min')"
482492
i18n>Value should be greater than 0</span>
@@ -491,9 +501,10 @@
491501

492502
<!-- Compression max blob size -->
493503
<div class="form-group row">
494-
<label i18n
495-
class="cd-col-form-label"
496-
for="maxBlobSize">Maximum blob size</label>
504+
<label class="cd-col-form-label"
505+
for="maxBlobSize">
506+
<ng-container i18n>Maximum blob size</ng-container>
507+
</label>
497508
<div class="cd-col-form-input">
498509
<input id="maxBlobSize"
499510
type="text"
@@ -504,6 +515,9 @@
504515
placeholder="e.g., 512KiB"
505516
defaultUnit="KiB"
506517
cdDimlessBinary>
518+
<cd-help-text>
519+
<span i18n>Chunks larger than `Maximum Blob Size` are broken into smaller blobs of size mentioned before being compressed.</span>
520+
</cd-help-text>
507521
<span class="invalid-feedback"
508522
*ngIf="form.showError('maxBlobSize', formDir, 'min')"
509523
i18n>Value should be greater than 0</span>
@@ -518,9 +532,10 @@
518532

519533
<!-- Compression ratio -->
520534
<div class="form-group row">
521-
<label i18n
522-
class="cd-col-form-label"
523-
for="ratio">Ratio</label>
535+
<label class="cd-col-form-label"
536+
for="ratio">
537+
<ng-container i18n>Ratio</ng-container>
538+
</label>
524539
<div class="cd-col-form-input">
525540
<input id="ratio"
526541
name="ratio"
@@ -529,9 +544,10 @@
529544
min="0"
530545
max="1"
531546
step="0.1"
532-
class="form-control"
533-
i18n-placeholder
534-
placeholder="Compression ratio">
547+
class="form-control">
548+
<cd-help-text>
549+
<span i18n>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</span>
550+
</cd-help-text>
535551
<span class="invalid-feedback"
536552
*ngIf="form.showError('ratio', formDir, 'min') || form.showError('ratio', formDir, 'max')"
537553
i18n>Value should be between 0.0 and 1.0</span>
@@ -550,11 +566,6 @@
550566
<label class="cd-col-form-label"
551567
for="max_bytes">
552568
<ng-container i18n>Max bytes</ng-container>
553-
<cd-helper>
554-
<span i18n>Leave it blank or specify 0 to disable this quota.</span>
555-
<br>
556-
<span i18n>A valid quota should be greater than 0.</span>
557-
</cd-helper>
558569
</label>
559570
<div class="cd-col-form-input">
560571
<input class="form-control"
@@ -566,6 +577,11 @@
566577
placeholder="e.g., 10GiB"
567578
defaultUnit="GiB"
568579
cdDimlessBinary>
580+
<cd-help-text>
581+
<span i18n>Leave it blank or specify 0 to disable this quota.</span>
582+
<br>
583+
<span i18n>A valid quota should be greater than 0.</span>
584+
</cd-help-text>
569585
<span *ngIf="form.showError('max_bytes', formDir, 'pattern')"
570586
class="invalid-feedback"
571587
i18n>Size must be a number or in a valid format. eg: 5 GiB</span>
@@ -577,11 +593,6 @@
577593
<label class="cd-col-form-label"
578594
for="max_objects">
579595
<ng-container i18n>Max objects</ng-container>
580-
<cd-helper>
581-
<span i18n>Leave it blank or specify 0 to disable this quota.</span>
582-
<br>
583-
<span i18n>A valid quota should be greater than 0.</span>
584-
</cd-helper>
585596
</label>
586597
<div class="cd-col-form-input">
587598
<input class="form-control"
@@ -590,6 +601,11 @@
590601
name="max_objects"
591602
type="number"
592603
formControlName="max_objects">
604+
<cd-help-text>
605+
<span i18n>Leave it blank or specify 0 to disable this quota.</span>
606+
<br>
607+
<span i18n>A valid quota should be greater than 0.</span>
608+
</cd-help-text>
593609
<span class="invalid-feedback"
594610
*ngIf="form.showError('max_objects', formDir, 'min')"
595611
i18n>The value should be greater or equal to 0</span>

src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export class PoolFormComponent extends CdForm implements OnInit {
8383
crushUsage: string[] = undefined; // Will only be set if a rule is used by some pool
8484
ecpUsage: string[] = undefined; // Will only be set if a rule is used by some pool
8585
crushRuleMaxSize = 10;
86+
DEFAULT_RATIO = 0.875;
8687

8788
private modalSubscription: Subscription;
8889

@@ -128,7 +129,7 @@ export class PoolFormComponent extends CdForm implements OnInit {
128129
maxBlobSize: new UntypedFormControl('', {
129130
updateOn: 'blur'
130131
}),
131-
ratio: new UntypedFormControl('', {
132+
ratio: new UntypedFormControl(this.DEFAULT_RATIO, {
132133
updateOn: 'blur'
133134
})
134135
});

src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export class PoolListComponent extends ListWithDetails implements OnInit {
121121
{
122122
prop: 'pool_name',
123123
name: $localize`Name`,
124-
flexGrow: 4,
124+
flexGrow: 2,
125125
cellTransformation: CellTemplate.executing
126126
},
127127
{

0 commit comments

Comments
 (0)