mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 21:01:40 +02:00
List parallel jobs on node for jobs on shared node
- Relates to issue #97 - required GQL schema extension and regeneration - Works for archived jobs aswell
This commit is contained in:
@@ -95,7 +95,7 @@
|
||||
{#if $initq.error}
|
||||
<Card body color="danger">{$initq.error.message}</Card>
|
||||
{:else if $initq.data}
|
||||
<JobInfo job={$initq.data.job} jobTags={jobTags}/>
|
||||
<JobInfo job={$initq.data.job} jobTags={jobTags} showParallelJobs={$initq.data.job.exclusive != 1}/>
|
||||
{:else}
|
||||
<Spinner secondary/>
|
||||
{/if}
|
||||
|
@@ -12,9 +12,11 @@
|
||||
<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);
|
||||
@@ -24,6 +26,27 @@
|
||||
const seconds = duration;
|
||||
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>
|
||||
@@ -57,6 +80,19 @@
|
||||
{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