Web: Let WorkerTaskLink support undefined tasks

Fixes an error when the component is passed an undefined or missing
workerTask property.
This commit is contained in:
Francesco Siddi 2022-07-26 11:22:32 +02:00
parent 736ca103c3
commit 36e0a6052f

View File

@ -1,8 +1,11 @@
<template>
<router-link :to="{ name: 'jobs', params: { jobID: workerTask.job_id, taskID: workerTask.id } }">
{{ workerTask.name }}
(<span class="status-label" :class="'status-' + workerTask.status">{{ workerTask.status }}</span>)
</router-link>
<span>
<router-link v-if="workerTask" :to="{ name: 'jobs', params: { jobID: workerTask.job_id, taskID: workerTask.id } }">
{{ workerTask.name }}
(<span class="status-label" :class="'status-' + workerTask.status">{{ workerTask.status }}</span>)
</router-link>
<span v-else>-</span>
</span>
</template>
<script setup>