@@ -69,7 +69,41 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
69
69
:rules =" [validateInputID]"
70
70
placeholder =" cycle/task/job"
71
71
clearable
72
- />
72
+ >
73
+ <template #prepend-inner >
74
+ <v-btn
75
+ :disabled =" !relativeTokens || jobNode === false"
76
+ v-bind =" toolbarBtnProps"
77
+ size =" medium"
78
+ variant =" plain"
79
+ @click =" () => jobNode ?? fetchJobData()"
80
+ data-cy =" job-info-btn"
81
+ >
82
+ <v-icon :icon =" $options.icons.mdiInformationOutline" />
83
+ <v-menu
84
+ activator =" parent"
85
+ :close-on-content-click =" false"
86
+ >
87
+ <v-card class =" pa-2" >
88
+ <v-skeleton-loader
89
+ v-if =" !jobNode"
90
+ type =" text@6"
91
+ />
92
+ <JobDetails
93
+ v-else
94
+ :node =" jobNode"
95
+ density =" compact"
96
+ hover
97
+ >
98
+ <template #header >
99
+ {{ new Tokens(jobNode.id).relativeID }}
100
+ </template >
101
+ </JobDetails >
102
+ </v-card >
103
+ </v-menu >
104
+ </v-btn >
105
+ </template >
106
+ </v-text-field >
73
107
<v-text-field
74
108
v-else
75
109
data-cy =" workflow-id-input"
@@ -181,6 +215,7 @@ import {
181
215
mdiWrap ,
182
216
mdiFileAlertOutline ,
183
217
mdiMouseMoveDown ,
218
+ mdiInformationOutline ,
184
219
} from ' @mdi/js'
185
220
import { btnProps } from ' @/utils/viewToolbar'
186
221
import graphqlMixin from ' @/mixins/graphql'
@@ -200,6 +235,7 @@ import { debounce } from 'lodash-es'
200
235
import CopyBtn from ' @/components/core/CopyBtn.vue'
201
236
import { Alert } from ' @/model/Alert.model'
202
237
import { getJobLogFileFromState } from ' @/model/JobState.model'
238
+ import JobDetails from ' @/components/cylc/common/JobDetails.vue'
203
239
204
240
/**
205
241
* Query used to retrieve data for the Log view.
@@ -236,10 +272,16 @@ query LogFiles($id: ID!) {
236
272
* @type {DocumentNode}
237
273
*/
238
274
const JOB_QUERY = gql `
239
- query JobState ($id : ID ! , $workflowId : ID ! ) {
275
+ query Jobs ($id : ID ! , $workflowId : ID ! ) {
240
276
jobs (live : false , ids : [$id ], workflows : [$workflowId ]) {
241
277
id
242
278
state
279
+ platform
280
+ jobId
281
+ jobRunnerName
282
+ submittedTime
283
+ startedTime
284
+ finishedTime
243
285
}
244
286
}
245
287
`
@@ -306,6 +348,7 @@ export default {
306
348
CopyBtn,
307
349
LogComponent,
308
350
ViewToolbar,
351
+ JobDetails,
309
352
},
310
353
emits: [
311
354
updateInitialOptionsEvent,
@@ -400,6 +443,7 @@ export default {
400
443
inputID,
401
444
validateInputID,
402
445
relativeTokens,
446
+ Tokens,
403
447
file,
404
448
// the label for the file input
405
449
fileLabel: ref (' Select File' ),
@@ -414,6 +458,7 @@ export default {
414
458
reset,
415
459
toolbarBtnSize,
416
460
toolbarBtnProps: btnProps (toolbarBtnSize),
461
+ jobNode: ref (null ),
417
462
}
418
463
},
419
464
@@ -508,12 +553,13 @@ export default {
508
553
)
509
554
},
510
555
/**
511
- * Query the job state and return the appropriate default log file based on the result .
556
+ * Query job data .
512
557
*
513
- * @returns {?string}
558
+ * @returns {Object|false} The job node, or false if no data/the query failed.
514
559
*/
515
- async getDefaultJobLog () {
560
+ async fetchJobData () {
516
561
let result
562
+ this .jobNode = null
517
563
try {
518
564
if (this .relativeTokens ) {
519
565
// get the latest job state
@@ -528,9 +574,10 @@ export default {
528
574
} catch (err) {
529
575
// the query failed
530
576
console .error (err)
531
- return
577
+ return false
532
578
}
533
- return getJobLogFileFromState (result? .data ? .jobs ? .[0 ]? .state )
579
+ this .jobNode = result? .data ? .jobs ? .[0 ] ?? false
580
+ return this .jobNode
534
581
},
535
582
/**
536
583
* Get the default workflow log file from the given log filenames, if there is a
@@ -593,7 +640,9 @@ export default {
593
640
if (this .jobLog && ! initialLoad) {
594
641
// (Don't query job state on initial load, as it will either be pre-populated or empty)
595
642
promises .push (
596
- this .getDefaultJobLog ().then ((result ) => { this .file = result })
643
+ this .fetchJobData ().then ((result ) => {
644
+ this .file = getJobLogFileFromState (result? .state )
645
+ })
597
646
)
598
647
}
599
648
// Simultaneously wait for the log file list and the job state result
@@ -626,7 +675,8 @@ export default {
626
675
mdiFolderRefresh,
627
676
mdiPowerPlug,
628
677
mdiPowerPlugOff,
629
- mdiFileAlertOutline
678
+ mdiFileAlertOutline,
679
+ mdiInformationOutline,
630
680
}
631
681
}
632
682
< / script>
0 commit comments