From bcc1e34a28e5ea743f12519d76526652773b4ca7 Mon Sep 17 00:00:00 2001 From: Dnyaneshwari Date: Wed, 16 Jul 2025 15:32:22 +0530 Subject: [PATCH] mgr/dashboard: Storage Class - Update Fixes: https://tracker.ceph.com/issues/72156 Signed-off-by: Dnyaneshwari Talwekar --- .../rgw/models/rgw-storage-class.model.ts | 24 ++++- .../rgw-storage-class-details.component.html | 4 +- .../rgw-storage-class-form.component.html | 62 ++++++----- .../rgw-storage-class-form.component.spec.ts | 8 +- .../rgw-storage-class-form.component.ts | 102 ++++++++++-------- .../rgw-storage-class-list.component.ts | 37 +++---- .../app/ceph/rgw/utils/rgw-bucket-tiering.ts | 9 +- .../mgr/dashboard/services/rgw_client.py | 9 +- 8 files changed, 141 insertions(+), 114 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-storage-class.model.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-storage-class.model.ts index 15a9a972416..d23f7967895 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-storage-class.model.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-storage-class.model.ts @@ -22,7 +22,7 @@ export interface TierTarget { read_through_restore_days: number; restore_storage_class: string; s3?: S3Details; - 's3-glacier': S3Glacier; + 's3-glacier'?: S3Glacier; }; } @@ -81,8 +81,8 @@ export interface RequestModel { } export interface PlacementTarget { - tags?: string[]; placement_id: string; + tags?: string[]; tier_type?: TIER_TYPE; tier_config?: { endpoint: string; @@ -128,6 +128,24 @@ export interface TextLabels { restoreStorageClassText: string; } +export const CLOUD_TIER_REQUIRED_FIELDS = [ + 'region', + 'target_endpoint', + 'access_key', + 'secret_key', + 'target_path' +]; + +export const GLACIER_REQUIRED_FIELDS = [ + 'region', + 'target_endpoint', + 'access_key', + 'secret_key', + 'target_path', + 'glacier_restore_tier_type', + 'restore_storage_class' +]; + export const TIER_TYPE = { LOCAL: 'local', CLOUD_TIER: 'cloud-s3', @@ -198,7 +216,7 @@ export const EXPEDITED_TIER_TYPE_TEXT = $localize`Expedited glacier restore tier export const RESTORE_DAYS_TEXT = $localize`Refers to number of days to the object will be restored on glacier/tape endpoint.`; -export const READTHROUGH_RESTORE_DAYS_TEXT = $localize`The duration for which objects restored via read-through are retained.`; +export const READTHROUGH_RESTORE_DAYS_TEXT = $localize`The days for which objects restored via read-through are retained.`; export const RESTORE_STORAGE_CLASS_TEXT = $localize`The storage class to which object data is to be restored.`; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-details/rgw-storage-class-details.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-details/rgw-storage-class-details.component.html index baa283145fd..dc8886ef5aa 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-details/rgw-storage-class-details.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-details/rgw-storage-class-details.component.html @@ -217,7 +217,7 @@ - {{ selection?.multipart_min_part_size }} + {{ selection?.multipart_min_part_size | dimlessBinary }} } @if(isTierMatch( TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER)){ @@ -231,7 +231,7 @@ - {{ selection?.multipart_sync_threshold }} + {{ selection?.multipart_sync_threshold | dimlessBinary }} } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.html index 31cf2635c95..57076071a5c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.html @@ -17,7 +17,7 @@ i18n-label for="storageClassType" formControlName="storageClassType" - [helperText]="textLabels.storageClassText" + [helperText]="helpTextLabels.storageClassText" id="storageClassType" [invalid]="storageClassForm.showError('storageClassType', formDir, 'required')" [invalidText]="storageError" @@ -141,7 +141,7 @@ i18n [invalid]="storageClassForm.showError('region', formDir, 'required')" [invalidText]="regionError" - [helperText]="textLabels.targetRegionText" + [helperText]="helpTextLabels.targetRegionText" >Target Region Target Endpoint + Target Endpoint - - + /> + This field is required. + Please enter a valid URL. @@ -200,7 +204,7 @@ labelInputID="access_key" [invalid]="storageClassForm.showError('access_key', formDir, 'required')" [invalidText]="accessError" - [helperText]="textLabels.targetAccessKeyText" + [helperText]="helpTextLabels.targetAccessKeyText" i18n >Target Access Key Target Path Allow Read Through - {{ textLabels?.allowReadThroughText }} + {{ helpTextLabels?.allowReadThroughText }}
@@ -297,7 +301,7 @@ cdOptionalField="Head Object (Stub File)" i18n >Head Object (Stub File) - {{ textLabels?.retainHeadObjectText }} + {{ helpTextLabels?.retainHeadObjectText }}