From: Nizamudeen A Date: Sun, 9 Jul 2023 13:36:02 +0000 (+0530) Subject: mgr/dashboard: update the upgrade layout by introducing new items X-Git-Tag: v18.2.1~369^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5ec4d167a1fb5e0ea68e56f751230f72c8ede904;p=ceph-ci.git mgr/dashboard: update the upgrade layout by introducing new items Shows Cluster Health Shows the count of mgr daemons Shows a table with all the daemon versions Display the cluster logs Fixes: https://tracker.ceph.com/issues/62016 Signed-off-by: Nizamudeen A (cherry picked from commit 7dcb06d368753faa6da7b334ee115c756fe951f7) src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard-v3.module.ts - Kept the current changes - Removed this file --- diff --git a/src/pybind/mgr/dashboard/controllers/daemon.py b/src/pybind/mgr/dashboard/controllers/daemon.py index eeea5a32625..d5c288131b9 100644 --- a/src/pybind/mgr/dashboard/controllers/daemon.py +++ b/src/pybind/mgr/dashboard/controllers/daemon.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from typing import Optional +from typing import List, Optional from ..exceptions import DashboardException from ..security import Scope @@ -31,3 +31,19 @@ class Daemon(RESTController): orch = OrchClient.instance() res = orch.daemons.action(action=action, daemon_name=daemon_name, image=container_image) return res + + @raise_if_no_orchestrator([OrchFeature.DAEMON_LIST]) + @handle_orchestrator_error('daemon') + @RESTController.MethodMap(version=APIVersion.DEFAULT) + def list(self, daemon_types: Optional[List[str]] = None): + """List all daemons in the cluster. Also filter by the daemon types specified + + :param daemon_types: List of daemon types to filter by. + :return: Returns list of daemons. + :rtype: list + """ + orch = OrchClient.instance() + daemons = [d.to_dict() for d in orch.services.list_daemons()] + if daemon_types: + daemons = [d for d in daemons if d['daemon_type'] in daemon_types] + return daemons diff --git a/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts index 595759e5d49..2a2e0e00cbf 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts @@ -286,8 +286,19 @@ const routes: Routes = [ }, { path: 'upgrade', + canActivate: [ModuleStatusGuardService], component: UpgradeComponent, - data: { breadcrumbs: 'Cluster/Upgrade' } + data: { + moduleStatusGuardConfig: { + uiApiPath: 'orchestrator', + redirectTo: 'error', + backend: 'cephadm', + section: 'orch', + section_info: 'Orchestrator', + header: 'Orchestrator is not available' + }, + breadcrumbs: 'Cluster/Upgrade' + } }, { path: 'perf_counters/:type/:id', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html index 68dc0f87faf..202e937af3a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html @@ -6,7 +6,7 @@ class="nav-tabs" cdStatefulTab="logs" [cdStatefulTabDefault]="defaultTab" - [hidden]="hideNavLinks"> + [hidden]="!showNavLinks"> Cluster Logs @@ -15,19 +15,20 @@ *ngIf="clog">
+ *ngIf="clog.length && showClusterLogs"> + *ngIf="showDownloadCopyButton"> + *ngIf="showDownloadCopyButton">
-
+

{{ line.stamp | cdDate }} {{ line.priority }} @@ -45,19 +46,19 @@ i18n>Audit Logs

+ *ngIf="audit_log && showAuditLogs">
+ *ngIf="showDownloadCopyButton"> + *ngIf="showDownloadCopyButton">
@@ -77,7 +78,7 @@ Daemon Logs - +
+ *ngIf="showFilterTools">