From d7a8bbf40b5126cdca4568ac84fc7fba8605eb86 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Wed, 18 Sep 2024 17:23:29 +0200 Subject: [PATCH] Rework tag and tag edit placement, add other feedback - admin message shown primarily if exists - comment demo summary tab --- web/frontend/src/Job.root.svelte | 59 ++-- web/frontend/src/generic/helper/Tag.svelte | 22 +- .../helper}/TagManagement.svelte | 17 +- .../src/generic/joblist/JobInfo.svelte | 37 ++- web/frontend/src/job/JobSummary.svelte | 281 +++++++++--------- 5 files changed, 217 insertions(+), 199 deletions(-) rename web/frontend/src/{job => generic/helper}/TagManagement.svelte (97%) diff --git a/web/frontend/src/Job.root.svelte b/web/frontend/src/Job.root.svelte index 8e508fa..cddace1 100644 --- a/web/frontend/src/Job.root.svelte +++ b/web/frontend/src/Job.root.svelte @@ -25,7 +25,6 @@ CardHeader, CardTitle, Button, - Icon, } from "@sveltestrap/sveltestrap"; import { getContext } from "svelte"; import { @@ -35,7 +34,6 @@ transformDataForRoofline, } from "./generic/utils.js"; import Metric from "./job/Metric.svelte"; - import TagManagement from "./job/TagManagement.svelte"; import StatsTable from "./job/StatsTable.svelte"; import JobSummary from "./job/JobSummary.svelte"; import ConcurrentJobs from "./generic/helper/ConcurrentJobs.svelte"; @@ -54,12 +52,10 @@ const ccconfig = getContext("cc-config") let isMetricsSelectionOpen = false, - showFootprint = !!ccconfig[`job_view_showFootprint`], selectedMetrics = [], selectedScopes = []; let plots = {}, - jobTags, roofWidth let missingMetrics = [], @@ -240,14 +236,22 @@ {:else if $initq.data} - + {#if $initq.data?.job?.metaData?.message} + + + +
Job {$initq.data?.job?.jobId} ({$initq.data?.job?.cluster})
+ The following note was added by administrators: +
+ + {@html $initq.data.job.metaData.message} + +
+
+ {/if} + - - - - - - + {#if $initq.data.job.concurrentJobs != null && $initq.data.job.concurrentJobs.items.length != 0} @@ -260,15 +264,6 @@
{/if} - {#if $initq.data?.job?.metaData?.message} - - -

This note was added by administrators:

-
-

{@html $initq.data.job.metaData.message}

-
-
- {/if}
{:else} @@ -276,21 +271,19 @@ {/if} - - {#if showFootprint} - - {#if $initq.error} - {$initq.error.message} - {:else if $initq?.data && $jobMetrics?.data} - - {:else} - - {/if} - - {/if} + + + {#if $initq.error} + {$initq.error.message} + {:else if $initq?.data && $jobMetrics?.data} + + {:else} + + {/if} + - + {#if $initq.error || $jobMetrics.error}

Initq Error: {$initq.error?.message}

diff --git a/web/frontend/src/generic/helper/Tag.svelte b/web/frontend/src/generic/helper/Tag.svelte index b3e2d6b..7efaf63 100644 --- a/web/frontend/src/generic/helper/Tag.svelte +++ b/web/frontend/src/generic/helper/Tag.svelte @@ -23,12 +23,22 @@ if ($initialized && tag == null) tag = allTags.find(tag => tag.id == id) } + + function getScopeColor(scope) { + switch (scope) { + case "admin": + return "#19e5e6"; + case "global": + return "#c85fc8"; + default: + return "#ffc107"; + } + }