Skip to content

Commit bc1d110

Browse files
workflows: add is_retry and is_held indicators
* Closes cylc#2350 * Adds workflow indicator icons which appear if the workflow contains any tasks in the retry and held states.
1 parent 64f2f18 commit bc1d110

File tree

7 files changed

+49
-3
lines changed

7 files changed

+49
-3
lines changed

changes.d/2378.feat.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added held and retry icons to the workflows sidebar, these will indicate if any n=0 tasks are in these states.

src/components/cylc/TaskStateBadge.vue

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@
1717

1818
<template>
1919
<div
20-
class="task-state-badge d-flex justify-center align-center px-1 font-weight-medium"
20+
class="task-state-badge d-flex justify-center align-center font-weight-medium"
2121
:class="state"
2222
>
23-
{{ value }}
23+
<v-icon v-if="isModifier" >{{ icon }}</v-icon>
24+
{{ isModifier ? '' : value }}
2425
<v-tooltip
2526
location="top"
2627
:open-delay="400"
2728
>
28-
{{ value }} {{ displayName }} task{{ value > 1 ? 's': '' }}.
29+
{{ displayText }}
2930
<template v-if="latestTasks?.length">
3031
Latest:
3132
<span
@@ -42,6 +43,7 @@
4243

4344
<script setup>
4445
import { computed } from 'vue'
46+
import { taskHeld, taskRetry } from '@/utils/icons'
4547
4648
const props = defineProps({
4749
state: {
@@ -58,7 +60,28 @@ const props = defineProps({
5860
},
5961
})
6062
63+
const icons = {
64+
held: taskHeld,
65+
retry: taskRetry,
66+
}
67+
68+
const isModifier = computed(
69+
() => ['held', 'retry'].includes(props.state)
70+
)
71+
6172
const displayName = computed(
6273
() => props.state === 'submitted' ? 'preparing/submitted' : props.state
6374
)
75+
76+
const displayText = computed(
77+
() => isModifier.value
78+
? `One or more ${props.state} task(s).`
79+
: `${props.value} ${displayName.value} task${props.value > 1 ? 's' : ''}`
80+
)
81+
82+
const icon = computed(
83+
() => isModifier.value
84+
? icons[props.state]
85+
: null
86+
)
6487
</script>

src/components/cylc/tree/GScanTreeItem.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ function getStatesInfo (node, stateTotals = {}) {
117117
} else if (node.type === 'workflow' && node.node.stateTotals) {
118118
// if we hit a workflow node, stop and merge state
119119
120+
if (node.node.containsHeld) {
121+
stateTotals.held = true
122+
}
123+
if (node.node.containsRetry) {
124+
stateTotals.retry = true
125+
}
126+
120127
// the non-zero state totals from this node with all the others from the tree
121128
for (const state of taskStatesOrdered) {
122129
let nodeTotal = node.node.stateTotals[state]

src/services/mock/json/workflows/one.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"failed": 2,
2222
"succeeded": 2
2323
},
24+
"containsHeld": true,
25+
"containsRetry": true,
2426
"latestStateTasks": {
2527
"submitted": [],
2628
"running": [

src/styles/cylc/_job.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,12 @@ $themes: (
102102
}
103103
}
104104
}
105+
106+
.task-state-badge.retry, .task-state-badge.held {
107+
font-size: 0.8em;
108+
min-width: 0;
109+
background: none;
110+
border: none;
111+
padding: 0 0 0.2em 0;
112+
margin: none;
113+
}

src/utils/icons.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@
3030
import { siJupyter } from 'simple-icons'
3131

3232
export const jupyterLogo = siJupyter.svg.replace(/.*d="(.*)".*/, '$1')
33+
export const taskRetry = 'm14.7 2.5c-0.179-0.0044-0.358-0.0037-0.538 0.0021-0.958 0.031-1.92 0.208-2.86 0.539-3.3 1.17-5.65 4.05-6.2 7.44l-5.13-1.23 6.86 9.23 6.86-9.23-5.35 1.19c0.511-2.02 2-3.69 4.02-4.41 2.5-0.886 5.28-0.124 6.98 1.91 1.7 2.04 1.95 4.91 0.625 7.21-1.32 2.3-3.93 3.53-6.54 3.09a1.58 1.58 0 0 0-1.82 1.3 1.58 1.58 0 0 0 1.3 1.82c3.91 0.661 7.84-1.19 9.81-4.63 1.98-3.44 1.6-7.76-0.938-10.8-1.79-2.14-4.39-3.35-7.07-3.41z'
34+
export const taskHeld = 'm12 0.5c-6.34 0-11.5 5.17-11.5 11.5-1.9e-7 6.33 5.16 11.5 11.5 11.5 6.34 0 11.5-5.17 11.5-11.5 0-6.33-5.16-11.5-11.5-11.5zm0 2.74c4.85 0 8.76 3.9 8.76 8.76 0 4.85-3.9 8.76-8.76 8.76-4.85 0-8.76-3.9-8.76-8.76 0-4.85 3.9-8.76 8.76-8.76zm-3.2 2.36a2.05 2.05 0 0 0-2.05 2.05v8.7a2.05 2.05 0 0 0 2.05 2.05 2.05 2.05 0 0 0 2.05-2.05v-8.7a2.05 2.05 0 0 0-2.05-2.05zm6.4 0a2.05 2.05 0 0 0-2.05 2.05v8.7a2.05 2.05 0 0 0 2.05 2.05 2.05 2.05 0 0 0 2.05-2.05v-8.7a2.05 2.05 0 0 0-2.05-2.05z'

src/views/Workflows.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ fragment WorkflowData on Workflow {
6161
status
6262
statusMsg
6363
stateTotals
64+
containsHeld
65+
containsRetry
6466
logRecords {
6567
level
6668
message

0 commit comments

Comments
 (0)