Users/Managers only display number of shared jobs

This commit is contained in:
Christoph Kluge 2023-06-01 15:13:12 +02:00
parent 5bb5e5ed24
commit 541d54aa7c
3 changed files with 23 additions and 10 deletions

View File

@ -14,6 +14,8 @@
import { getContext } from 'svelte' import { getContext } from 'svelte'
export let dbid export let dbid
export let authlevel
export let roles
const { query: initq } = init(` const { query: initq } = init(`
job(id: "${dbid}") { job(id: "${dbid}") {
@ -103,14 +105,21 @@
</Col> </Col>
{#if $jobMetrics.data && $initq.data} {#if $jobMetrics.data && $initq.data}
{#if $initq.data.job.concurrentJobs != null} {#if $initq.data.job.concurrentJobs != null}
<Col> {#if authlevel > roles.manager}
<h5>Concurrent Jobs <Icon name="info-circle" style="cursor:help;" title="Shared jobs running on the same node with overlapping runtimes"/></h5> <Col>
<ul> <h5>Concurrent Jobs <Icon name="info-circle" style="cursor:help;" title="Shared jobs running on the same node with overlapping runtimes"/></h5>
{#each $initq.data.job.concurrentJobs.items as pjob, index} <ul>
<li><a href="/monitoring/job/{pjob.id}" target="_blank">{pjob.jobId}</a></li> {#each $initq.data.job.concurrentJobs.items as pjob, index}
{/each} <li><a href="/monitoring/job/{pjob.id}" target="_blank">{pjob.jobId}</a></li>
</ul> {/each}
</Col> </ul>
</Col>
{:else}
<Col>
<h5>{$initq.data.job.concurrentJobs.items.length} Concurrent Jobs</h5>
<p>Number of shared jobs on the same node with overlapping runtimes.</p>
</Col>
{/if}
{/if} {/if}
<Col> <Col>
<PolarPlot <PolarPlot

View File

@ -4,7 +4,9 @@ import Job from './Job.root.svelte'
new Job({ new Job({
target: document.getElementById('svelte-app'), target: document.getElementById('svelte-app'),
props: { props: {
dbid: jobInfos.id dbid: jobInfos.id,
authlevel: authlevel,
roles: roles
}, },
context: new Map([ context: new Map([
['cc-config', clusterCockpitConfig] ['cc-config', clusterCockpitConfig]

View File

@ -13,6 +13,8 @@
clusterId: "{{ .Infos.clusterId }}" clusterId: "{{ .Infos.clusterId }}"
}; };
const clusterCockpitConfig = {{ .Config }}; const clusterCockpitConfig = {{ .Config }};
const authlevel = {{ .User.GetAuthLevel }};
const roles = {{ .Roles }};
</script> </script>
<script src='/build/job.js'></script> <script src='/build/job.js'></script>
{{end}} {{end}}