]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix readonly landingpage 57747/head
authorPedro Gonzalez Gomez <pegonzal@redhat.com>
Wed, 24 Apr 2024 08:48:11 +0000 (10:48 +0200)
committerPedro Gonzalez Gomez <pegonzal@redhat.com>
Tue, 28 May 2024 15:04:34 +0000 (17:04 +0200)
Conflicts:
mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts
mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.ts
- Hardware status and multi-cluster features are not included in squid, therefore this only affects the telemetry status

Fixes: https://tracker.ceph.com/issues/65643
Signed-off-by: Pedro Gonzalez Gomez <pegonzal@redhat.com>
(cherry picked from commit 7abae5c982ee1fd7de74653bdd5ad46dbc4ae388)

src/pybind/mgr/dashboard/controllers/health.py
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/health.service.ts
src/pybind/mgr/dashboard/openapi.yaml

index 633d37a327eaf8d04ccd2fe2ea9bfe52be9e5b29..3edc386b01232bfdda8f135c19ba9b3b9eda9f22 100644 (file)
@@ -300,3 +300,7 @@ class Health(BaseController):
     @Endpoint()
     def get_cluster_fsid(self):
         return mgr.get('config')['fsid']
+
+    @Endpoint()
+    def get_telemetry_status(self):
+        return mgr.get_module_option_ex('telemetry', 'enabled', False)
index 3c44bd36a8905d7b90db9716d550dc9beaab260f..484bf08292ceb74753ad50f0caea128b832654b2 100644 (file)
@@ -22,7 +22,6 @@ import { SummaryService } from '~/app/shared/services/summary.service';
 import { PrometheusListHelper } from '~/app/shared/helpers/prometheus-list-helper';
 import { PrometheusAlertService } from '~/app/shared/services/prometheus-alert.service';
 import { OrchestratorService } from '~/app/shared/api/orchestrator.service';
-import { MgrModuleService } from '~/app/shared/api/mgr-module.service';
 import { AlertClass } from '~/app/shared/enum/health-icon.enum';
 
 @Component({
@@ -78,7 +77,6 @@ export class DashboardV3Component extends PrometheusListHelper implements OnInit
     private featureToggles: FeatureTogglesService,
     private healthService: HealthService,
     public prometheusService: PrometheusService,
-    private mgrModuleService: MgrModuleService,
     private refreshIntervalService: RefreshIntervalService,
     public prometheusAlertService: PrometheusAlertService
   ) {
@@ -155,8 +153,8 @@ export class DashboardV3Component extends PrometheusListHelper implements OnInit
   }
 
   private getTelemetryReport() {
-    this.mgrModuleService.getConfig('telemetry').subscribe((resp: any) => {
-      this.telemetryEnabled = resp?.enabled;
+    this.healthService.getTelemetryStatus().subscribe((enabled: boolean) => {
+      this.telemetryEnabled = enabled;
     });
   }
 
index 42634a1481cf2fb596630e4508231df85ebe8915..b04a27b644d50c055ff62b4d02b177825f1caa24 100644 (file)
@@ -26,4 +26,8 @@ export class HealthService {
   getOrchestratorName() {
     return this.http.get('api/health/get_orchestrator_name');
   }
+
+  getTelemetryStatus() {
+    return this.http.get('api/health/get_telemetry_status');
+  }
 }
index 5810d55b329d9b656954ffe67b89206995447cd2..1b7d012eb84652b528bb05ff0798dad53ae6509c 100644 (file)
@@ -4838,6 +4838,28 @@ paths:
       - jwt: []
       tags:
       - Health
+  /api/health/get_telemetry_status:
+    get:
+      parameters: []
+      responses:
+        '200':
+          content:
+            application/vnd.ceph.api.v1.0+json:
+              type: object
+          description: OK
+        '400':
+          description: Operation exception. Please check the response body for details.
+        '401':
+          description: Unauthenticated access. Please login first.
+        '403':
+          description: Unauthorized access. Please check your permissions.
+        '500':
+          description: Unexpected error. Please check the response body for the stack
+            trace.
+      security:
+      - jwt: []
+      tags:
+      - Health
   /api/health/minimal:
     get:
       parameters: []