From 102109388b8ae68c216c28702190abd8c23e5304 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Tue, 16 Dec 2025 13:54:17 +0100 Subject: [PATCH 1/2] link to public dashboard in admin options, add return button do public dashboard --- web/frontend/src/Config.root.svelte | 6 ++-- web/frontend/src/DashPublic.root.svelte | 6 ++++ web/frontend/src/config.entrypoint.js | 1 + web/frontend/src/config/AdminSettings.svelte | 6 ++-- web/frontend/src/config/admin/Options.svelte | 32 ++++++++++++++++++-- 5 files changed, 45 insertions(+), 6 deletions(-) diff --git a/web/frontend/src/Config.root.svelte b/web/frontend/src/Config.root.svelte index e8a2045..171b2a0 100644 --- a/web/frontend/src/Config.root.svelte +++ b/web/frontend/src/Config.root.svelte @@ -6,7 +6,8 @@ - `isSupport Bool!`: Is currently logged in user support authority - `isApi Bool!`: Is currently logged in user api authority - `username String!`: Empty string if auth. is disabled, otherwise the username as string - - `ncontent String!`: The currently displayed message on the homescreen + - `ncontent String!`: The currently displayed message on the homescreen + - `clusters [String]`: The available clusternames --> @@ -30,7 +32,7 @@ Admin Options - + {/if} diff --git a/web/frontend/src/DashPublic.root.svelte b/web/frontend/src/DashPublic.root.svelte index dac3f9a..676e496 100644 --- a/web/frontend/src/DashPublic.root.svelte +++ b/web/frontend/src/DashPublic.root.svelte @@ -30,6 +30,7 @@ Table, Progress, Icon, + Button } from "@sveltestrap/sveltestrap"; import Roofline from "./generic/plots/Roofline.svelte"; import Pie, { colors } from "./generic/plots/Pie.svelte"; @@ -353,6 +354,11 @@ }} /> + + + {#if $statusQuery.fetching || $statesTimed.fetching} diff --git a/web/frontend/src/config.entrypoint.js b/web/frontend/src/config.entrypoint.js index f9d8e45..5d11eed 100644 --- a/web/frontend/src/config.entrypoint.js +++ b/web/frontend/src/config.entrypoint.js @@ -10,6 +10,7 @@ mount(Config, { isApi: isApi, username: username, ncontent: ncontent, + clusters: hClusters.map((c) => c.name) // Defined in Header Template }, context: new Map([ ['cc-config', clusterCockpitConfig], diff --git a/web/frontend/src/config/AdminSettings.svelte b/web/frontend/src/config/AdminSettings.svelte index 1a426b8..79072e3 100644 --- a/web/frontend/src/config/AdminSettings.svelte +++ b/web/frontend/src/config/AdminSettings.svelte @@ -3,6 +3,7 @@ Properties: - `ncontent String`: The homepage notice content + - `clusters [String]`: The available clusternames --> -{#if data && collectData[0].length > 0} +{#if data && collectData.length > 0}
diff --git a/web/frontend/src/status/DashInternal.svelte b/web/frontend/src/status/DashInternal.svelte index c6abf06..47a841a 100644 --- a/web/frontend/src/status/DashInternal.svelte +++ b/web/frontend/src/status/DashInternal.svelte @@ -487,45 +487,51 @@ - - -
-

- Top Projects: Jobs -

- tp['totalJobs'], - )} - entities={$topJobsQuery.data.jobsStatistics.map((tp) => scrambleNames ? scramble(tp.id) : tp.id)} - /> -
- - - - - - - - - {#each $topJobsQuery.data.jobsStatistics as tp, i} - - - - + {#if topJobsQuery?.data?.jobsStatistics?.length > 0} + + +
+

+ Top Projects: Jobs +

+ tp['totalJobs'], + )} + entities={$topJobsQuery.data.jobsStatistics.map((tp) => scrambleNames ? scramble(tp.id) : tp.id)} + /> +
+ + +
ProjectJobs
- {scrambleNames ? scramble(tp.id) : tp.id} - - {tp['totalJobs']}
+ + + + - {/each} -
ProjectJobs
- -
+ {#each $topJobsQuery.data.jobsStatistics as tp, i} + + + + {scrambleNames ? scramble(tp.id) : tp.id} + + + {tp['totalJobs']} + + {/each} + + +
+ {:else} + Cannot render job status: No state data returned for Pie Chart + {/if}