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'
export let dbid
export let authlevel
export let roles
const { query: initq } = init(`
job(id: "${dbid}") {
@ -102,15 +104,22 @@
{/if}
</Col>
{#if $jobMetrics.data && $initq.data}
{#if $initq.data.job.concurrentJobs != null}
<Col>
<h5>Concurrent Jobs <Icon name="info-circle" style="cursor:help;" title="Shared jobs running on the same node with overlapping runtimes"/></h5>
<ul>
{#each $initq.data.job.concurrentJobs.items as pjob, index}
<li><a href="/monitoring/job/{pjob.id}" target="_blank">{pjob.jobId}</a></li>
{/each}
</ul>
</Col>
{#if $initq.data.job.concurrentJobs != null}
{#if authlevel > roles.manager}
<Col>
<h5>Concurrent Jobs <Icon name="info-circle" style="cursor:help;" title="Shared jobs running on the same node with overlapping runtimes"/></h5>
<ul>
{#each $initq.data.job.concurrentJobs.items as pjob, index}
<li><a href="/monitoring/job/{pjob.id}" target="_blank">{pjob.jobId}</a></li>
{/each}
</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}
<Col>
<PolarPlot

View File

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

View File

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