mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 12:51:40 +02:00
Move concurrentJobs as field to main job query
This commit is contained in:
@@ -23,8 +23,9 @@
|
||||
monitoringStatus, state, walltime,
|
||||
tags { id, type, name },
|
||||
resources { hostname, hwthreads, accelerators },
|
||||
metaData
|
||||
userData { name, email }
|
||||
metaData,
|
||||
userData { name, email },
|
||||
concurrentJobs { items { id, jobId }, count }
|
||||
}
|
||||
`)
|
||||
|
||||
@@ -95,12 +96,22 @@
|
||||
{#if $initq.error}
|
||||
<Card body color="danger">{$initq.error.message}</Card>
|
||||
{:else if $initq.data}
|
||||
<JobInfo job={$initq.data.job} jobTags={jobTags} showParallelJobs={$initq.data.job.exclusive != 1}/>
|
||||
<JobInfo job={$initq.data.job} jobTags={jobTags}/>
|
||||
{:else}
|
||||
<Spinner secondary/>
|
||||
{/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}
|
||||
<Col>
|
||||
<PolarPlot
|
||||
width={polarPlotSize} height={polarPlotSize}
|
||||
@@ -251,4 +262,10 @@
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
ul {
|
||||
columns: 2;
|
||||
-webkit-columns: 2;
|
||||
-moz-columns: 2;
|
||||
}
|
||||
</style>
|
||||
|
@@ -12,11 +12,9 @@
|
||||
<script>
|
||||
import Tag from '../Tag.svelte';
|
||||
import { Badge, Icon } from 'sveltestrap';
|
||||
import { operationStore, query} from '@urql/svelte'
|
||||
|
||||
export let job;
|
||||
export let jobTags = job.tags;
|
||||
export let showParallelJobs = false
|
||||
|
||||
function formatDuration(duration) {
|
||||
const hours = Math.floor(duration / 3600);
|
||||
@@ -27,26 +25,6 @@
|
||||
return `${hours}:${('0' + minutes).slice(-2)}:${('0' + seconds).slice(-2)}`;
|
||||
}
|
||||
|
||||
const filter = [
|
||||
{exclusive: job.exclusive},
|
||||
{sharedNode: {contains: job.resources[0].hostname }},
|
||||
{selfJobId: {neq: job.jobId }},
|
||||
{selfStartTime: job.startTime, selfDuration: job.duration}
|
||||
]
|
||||
|
||||
const parallelJobs = operationStore(`
|
||||
query($filter: [JobFilter!]!){
|
||||
jobsParallel(filter: $filter) {
|
||||
items { id, jobId }
|
||||
count
|
||||
}
|
||||
}`, {
|
||||
filter
|
||||
})
|
||||
|
||||
if (showParallelJobs) {
|
||||
query(parallelJobs)
|
||||
}
|
||||
</script>
|
||||
|
||||
<div>
|
||||
@@ -80,19 +58,6 @@
|
||||
{scrambleNames ? scramble(job.project) : job.project}
|
||||
</a>
|
||||
{/if}
|
||||
{#if showParallelJobs && $parallelJobs.data != null}
|
||||
<br/>
|
||||
<Icon name="diagram-3-fill"/>
|
||||
{#if $parallelJobs.data.jobsParallel.count == 0}
|
||||
No Parallel Jobs
|
||||
{:else}
|
||||
{#each $parallelJobs.data.jobsParallel.items as pjob, index}
|
||||
<a href="/monitoring/job/{pjob.id}" target="_blank">
|
||||
{pjob.jobId}{#if index != $parallelJobs.data.jobsParallel.count - 1},{/if}
|
||||
</a>
|
||||
{/each}
|
||||
{/if}
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
Reference in New Issue
Block a user