From 3939de2752c14a2a566c4d9c186f49720ad17af9 Mon Sep 17 00:00:00 2001 From: Ashton South Date: Fri, 31 May 2024 14:35:12 -0400 Subject: [PATCH] Add system status to navigation bar (#3567) * add systemstatus to navbar * allow systemstatus route to be disabled --- apps/dashboard/config/configuration_singleton.rb | 4 ++++ apps/dashboard/config/routes.rb | 2 +- apps/systemstatus/manifest.yml | 8 ++++++++ packaging/rpm/ondemand.spec | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 apps/systemstatus/manifest.yml diff --git a/apps/dashboard/config/configuration_singleton.rb b/apps/dashboard/config/configuration_singleton.rb index 17a0554284..eab58abd4d 100644 --- a/apps/dashboard/config/configuration_singleton.rb +++ b/apps/dashboard/config/configuration_singleton.rb @@ -320,6 +320,10 @@ def can_access_projects? can_access_core_app? 'projects' end + def can_access_systemstatus? + can_access_core_app? 'systemstatus' + end + # Maximum file upload size that nginx will allow from clients in bytes # # @example No maximum upload size supplied. diff --git a/apps/dashboard/config/routes.rb b/apps/dashboard/config/routes.rb index a7a6767a5b..c5b4ff12b7 100644 --- a/apps/dashboard/config/routes.rb +++ b/apps/dashboard/config/routes.rb @@ -98,7 +98,7 @@ delete '/activejobs' => 'active_jobs#delete_job', :as => 'delete_job' end - get '/systemstatus', to: 'system_status#index', as: 'system_status' + get '/systemstatus', to: 'system_status#index', as: 'system_status' if Configuration.can_access_systemstatus? get '/jobs/info/:cluster/:id' => 'jobs#info', :defaults => { :format => 'json' }, :as => 'jobs_info' diff --git a/apps/systemstatus/manifest.yml b/apps/systemstatus/manifest.yml new file mode 100644 index 0000000000..777504ef41 --- /dev/null +++ b/apps/systemstatus/manifest.yml @@ -0,0 +1,8 @@ +--- +name: System Status +description: |- + The Open OnDemand System Status App +category: Clusters +icon: fa://tachometer +url: systemstatus +new_window: false \ No newline at end of file diff --git a/packaging/rpm/ondemand.spec b/packaging/rpm/ondemand.spec index b6bb3a8657..cc86c665d1 100644 --- a/packaging/rpm/ondemand.spec +++ b/packaging/rpm/ondemand.spec @@ -174,6 +174,7 @@ echo "%{git_tag}" > %{buildroot}/opt/ood/VERSION %__mv %{buildroot}/opt/ood/apps/shell %{buildroot}%{_localstatedir}/www/ood/apps/sys/shell %__mv %{buildroot}/opt/ood/apps/files %{buildroot}%{_localstatedir}/www/ood/apps/sys/files %__mv %{buildroot}/opt/ood/apps/projects %{buildroot}%{_localstatedir}/www/ood/apps/sys/projects +%__mv %{buildroot}/opt/ood/apps/systemstatus %{buildroot}%{_localstatedir}/www/ood/apps/sys/systemstatus %__mv %{buildroot}/opt/ood/apps/file-editor %{buildroot}%{_localstatedir}/www/ood/apps/sys/file-editor %__mv %{buildroot}/opt/ood/apps/activejobs %{buildroot}%{_localstatedir}/www/ood/apps/sys/activejobs %__mv %{buildroot}/opt/ood/apps/myjobs %{buildroot}%{_localstatedir}/www/ood/apps/sys/myjobs @@ -286,6 +287,7 @@ touch %{_localstatedir}/www/ood/apps/sys/myjobs/tmp/restart.txt %{_localstatedir}/www/ood/apps/sys/projects %dir %attr(700, root, root) %{_localstatedir}/www/ood/apps/sys/projects %{_localstatedir}/www/ood/apps/sys/projects/manifest.yml +%{_localstatedir}/www/ood/apps/sys/systemstatus %{_localstatedir}/www/ood/apps/sys/bc_desktop %exclude %{_localstatedir}/www/ood/apps/sys/*/tmp/*