From 2e5c1b506e25b22f5d62ffbc15811773a04a3582 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Thu, 2 May 2024 09:35:08 +0100 Subject: [PATCH] metadata view: introduce a minimal task metadata view * Bare bones task metadata view. * Display task metadata, prerequisites and outputs. * Support for viewing task configuration, broadcasts, etc to follow in future PRs. * Support for markup (e.g. markdown & reStructured text) to arrive in future PRs (pending a decision on how to configure the markup language). --- src/components/cylc/commandMenu/Menu.vue | 19 +- src/utils/aotf.js | 16 +- src/views/Info.vue | 445 +++++++++++++++++++++++ src/views/Workspace.vue | 5 +- src/views/views.js | 26 +- 5 files changed, 499 insertions(+), 12 deletions(-) create mode 100644 src/views/Info.vue diff --git a/src/components/cylc/commandMenu/Menu.vue b/src/components/cylc/commandMenu/Menu.vue index 185c2e207..2f8d64ca9 100644 --- a/src/components/cylc/commandMenu/Menu.vue +++ b/src/components/cylc/commandMenu/Menu.vue @@ -222,7 +222,7 @@ export default { methods: { isEditable (mutation, authorised) { - return mutation.name !== 'log' && !this.isDisabled(mutation, authorised) + return mutation.name !== 'log' && mutation.name !== 'info' && !this.isDisabled(mutation, authorised) }, isDisabled (mutation, authorised) { if (!authorised) { @@ -269,6 +269,23 @@ export default { } ) }) + } else if (mutation.name === 'info') { + this.$router.push({ + name: 'Workspace', + params: { + workflowName: this.node.tokens.workflow + } + }).then(() => { + eventBus.emit( + 'add-view', + { + name: 'Info', + initialOptions: { + requestedTokens: this.node.tokens || undefined + } + } + ) + }) } else { mutate( mutation, diff --git a/src/utils/aotf.js b/src/utils/aotf.js index 20747d37a..f0ffad7ba 100644 --- a/src/utils/aotf.js +++ b/src/utils/aotf.js @@ -35,7 +35,7 @@ import { mdiDelete, mdiEmail, mdiFileDocumentOutline, - mdiVectorPolylineEdit, + mdiInformationOutline, mdiMinusCircleOutline, mdiPause, mdiPauseCircleOutline, @@ -44,7 +44,8 @@ import { mdiPlaylistEdit, mdiRefreshCircle, mdiReload, - mdiStop + mdiStop, + mdiVectorPolylineEdit, } from '@mdi/js' import { Alert } from '@/model/Alert.model' @@ -128,6 +129,7 @@ export function getMutationIcon (name) { case 'clean': return mdiDelete case 'editRuntime': return mdiPlaylistEdit case 'hold': return mdiPauseCircleOutline // to distinguish from pause + case 'info': return mdiInformationOutline case 'kill': return mdiCloseCircle case 'log': return mdiFileDocumentOutline case 'message': return mdiEmail @@ -188,6 +190,7 @@ export const primaryMutations = { 'trigger', 'kill', 'log', + 'info', 'set' ] } @@ -313,6 +316,13 @@ export const dummyMutations = [ _requiresInfo: false, _validStates: WorkflowStateNames, }, + { + name: 'info', + description: 'View task information.', + args: [], + _appliesTo: [cylcObjects.Namespace], + _requiresInfo: false + }, ] /** @@ -322,7 +332,7 @@ export const dummyMutations = [ */ const dummyMutationsPermissionsMap = Object.freeze({ broadcast: Object.freeze(['editRuntime']), - read: Object.freeze(['log']) + read: Object.freeze(['log', 'info']) }) /** diff --git a/src/views/Info.vue b/src/views/Info.vue new file mode 100644 index 000000000..c362c0cbf --- /dev/null +++ b/src/views/Info.vue @@ -0,0 +1,445 @@ + + + + + + + diff --git a/src/views/Workspace.vue b/src/views/Workspace.vue index 2e6a60d96..b2ce3d0c0 100644 --- a/src/views/Workspace.vue +++ b/src/views/Workspace.vue @@ -18,7 +18,7 @@ along with this program. If not, see .