@@ -84,6 +84,42 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
84
84
</v-expansion-panel-text >
85
85
</v-expansion-panel >
86
86
87
+ <v-expansion-panel class =" run-mode-panel" >
88
+ <v-expansion-panel-title color =" blue-grey-lighten-2" >
89
+ Run Mode
90
+ </v-expansion-panel-title >
91
+ <v-expansion-panel-text >
92
+ <v-icon >{{ runModeIcon }}</v-icon > {{ runMode }}
93
+ </v-expansion-panel-text >
94
+ </v-expansion-panel >
95
+
96
+ <v-expansion-panel
97
+ v-if =" xtriggers.length"
98
+ class =" xtriggers-panel"
99
+ >
100
+ <v-expansion-panel-title color =" blue-grey-lighten-1" >
101
+ Xtriggers
102
+ </v-expansion-panel-title >
103
+ <v-expansion-panel-text >
104
+ <v-table density =" compact" >
105
+ <thead >
106
+ <tr >
107
+ <th >Label</th >
108
+ <th >ID</th >
109
+ <th >Is satisfied</th >
110
+ </tr >
111
+ </thead >
112
+ <tbody >
113
+ <tr v-for =" xt in xtriggers" :key =" xt.id" >
114
+ <td >{{ xt.label }}</td >
115
+ <td >{{ xt.id }}</td >
116
+ <td ><v-icon >{{ xt.satisfactionIcon }}</v-icon ></td >
117
+ </tr >
118
+ </tbody >
119
+ </v-table >
120
+ </v-expansion-panel-text >
121
+ </v-expansion-panel >
122
+
87
123
<!-- The prereqs -->
88
124
<v-expansion-panel class =" prerequisites-panel" >
89
125
<v-expansion-panel-title color =" blue-grey-lighten-2" >
@@ -169,6 +205,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
169
205
import { useJobTheme } from ' @/composables/localStorage'
170
206
import GraphNode from ' @/components/cylc/GraphNode.vue'
171
207
import { formatCompletion } from ' @/utils/outputs'
208
+ import {
209
+ mdiSkipForward ,
210
+ mdiChatQuestion ,
211
+ mdiGhostOutline ,
212
+ mdiPlay ,
213
+ mdiDramaMasks ,
214
+ mdiCheckboxOutline ,
215
+ mdiCheckboxBlankOutline
216
+ } from ' @mdi/js'
217
+ import { cloneDeep } from ' lodash-es'
172
218
173
219
export default {
174
220
name: ' InfoComponent' ,
@@ -226,6 +272,47 @@ export default {
226
272
completion () {
227
273
// Task output completion expression stuff.
228
274
return this .task ? .node ? .runtime .completion
275
+ },
276
+
277
+ runModeIcon () {
278
+ // Task Run Mode:
279
+ if (this .task ? .node ? .runtime .runMode === ' Skip' ) {
280
+ return mdiSkipForward
281
+ } else if (this .task ? .node ? .runtime .runMode === ' Live' ) {
282
+ return mdiPlay
283
+ } else if (this .task ? .node ? .runtime .runMode === ' Simulation' ) {
284
+ return mdiGhostOutline
285
+ } else if (this .task ? .node ? .runtime .runMode === ' Dummy' ) {
286
+ return mdiDramaMasks
287
+ }
288
+ return mdiChatQuestion
289
+ },
290
+
291
+ runMode () {
292
+ // Task Run Mode:
293
+ return this .task ? .node ? .runtime .runMode
294
+ },
295
+
296
+ xtriggers () {
297
+ const xtriggers = this .task ? .node ? .xtriggers ? .map ((item ) => {
298
+ const xtrigger = cloneDeep (item)
299
+ xtrigger .satisfactionIcon = xtrigger .satisfied ? mdiCheckboxOutline : mdiCheckboxBlankOutline
300
+ // Extract the trigger time from the ID
301
+ // Since we've created this date from a Unix timestamp, we can safely assume it is in UTC:
302
+ xtrigger .id = xtrigger .id .replace (
303
+ / trigger_time=(?<unixTime>[0-9 . ] + )/ ,
304
+ (match , p1 ) => ` trigger_time=${ new Date (p1 * 1000 ).toISOString ().slice (0 , - 5 )} Z`
305
+ )
306
+ return xtrigger
307
+ })
308
+ // Sort the xtriggers by label, then by ID:
309
+ xtriggers .sort (function (a , b ) {
310
+ if (a .label === b .label ) {
311
+ return a .id > b .id ? 1 : - 1
312
+ }
313
+ return a .label > b .label ? 1 : - 1
314
+ })
315
+ return xtriggers
229
316
}
230
317
231
318
},
0 commit comments