rundetails: show can restart option only when allowed

This commit is contained in:
Simone Gotti 2019-03-29 11:25:29 +01:00
parent 67756606fa
commit fcb3ea9b54
1 changed files with 14 additions and 3 deletions

View File

@ -15,7 +15,10 @@
<span v-if="!stillRunning(run)" class="stillrunning"></span>
</div>
<div class="run-actions column is-2 is-pulled-right">
<div class="dropdown is-hoverable is-right" v-if="run.phase == 'finished'">
<div
class="dropdown is-hoverable is-right"
v-if="run.can_restart_from_scratch || run.can_restart_from_failed_tasks"
>
<div class="dropdown-trigger">
<button class="button" aria-haspopup="true" aria-controls="dropdown-menu">
<span>Restart</span>
@ -26,8 +29,16 @@
</div>
<div class="dropdown-menu" role="menu">
<div class="dropdown-content">
<a class="dropdown-item" @click="restartRun(run, true)">From start</a>
<a class="dropdown-item" @click="restartRun(run)">From failed tasks</a>
<a
v-if="run.can_restart_from_scratch"
class="dropdown-item"
@click="restartRun(run, true)"
>From start</a>
<a
v-if="run.can_restart_from_failed_tasks"
class="dropdown-item"
@click="restartRun(run)"
>From failed tasks</a>
</div>
</div>
</div>