Skip to content

Commit b484c96

Browse files
Merge pull request #2175 from MetRonnie/version-info
Add workflow Cylc version to toolbar and menu
2 parents 7f25035 + 5c14dcb commit b484c96

File tree

4 files changed

+29
-9
lines changed

4 files changed

+29
-9
lines changed

src/components/cylc/commandMenu/Menu.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ export default {
226226
ret += ''
227227
if (this.node.type === 'workflow') {
228228
ret += upperFirst(this.node.node.statusMsg || this.node.node.status || 'state unknown')
229+
if (this.node.node.cylcVersion) {
230+
ret += ` • Cylc ${this.node.node.cylcVersion}`
231+
}
229232
} else {
230233
ret += upperFirst(this.node.node.state || 'state unknown')
231234
if (this.node.node.isHeld) {

src/components/cylc/workspace/Toolbar.vue

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
8585
</div>
8686

8787
<!-- n-window selector -->
88-
<v-chip
88+
<v-btn
8989
:disabled="isStopped"
90-
link
90+
variant="tonal"
91+
rounded
9192
size="small"
9293
data-cy="n-win-selector"
9394
>
9495
N={{ nWindow }}
96+
<template #append>
97+
<v-icon
98+
:icon="$options.icons.mdiChevronDown"
99+
class="mx-n1"
100+
/>
101+
</template>
95102
<v-menu
96103
activator="parent"
97104
:close-on-content-click="false"
@@ -122,11 +129,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
122129
</v-card-text>
123130
</v-card>
124131
</v-menu>
125-
</v-chip>
132+
</v-btn>
126133

127134
<!-- workflow status message -->
128-
<span class="status-msg text-md-body-1 text-body-2">
129-
{{ statusMsg }}
135+
<span class="status-msg text-body-2">
136+
{{ statusAndVersion }}
130137
</span>
131138

132139
<v-spacer class="mx-0" />
@@ -207,7 +214,8 @@ import {
207214
mdiPlusBoxMultiple,
208215
mdiStop,
209216
mdiViewList,
210-
mdiAccount
217+
mdiAccount,
218+
mdiChevronDown,
211219
} from '@mdi/js'
212220
import { startCase } from 'lodash'
213221
import { until } from '@/utils'
@@ -221,6 +229,7 @@ import subscriptionComponentMixin from '@/mixins/subscriptionComponent'
221229
import SubscriptionQuery from '@/model/SubscriptionQuery.model'
222230
import gql from 'graphql-tag'
223231
import { eventBus } from '@/services/eventBus'
232+
import { upperFirst } from 'lodash-es'
224233
225234
const QUERY = gql(`
226235
subscription Workflow ($workflowId: ID) {
@@ -242,6 +251,7 @@ fragment WorkflowData on Workflow {
242251
status
243252
statusMsg
244253
nEdgeDistance
254+
cylcVersion
245255
}
246256
247257
fragment AddedDelta on Added {
@@ -341,8 +351,12 @@ export default {
341351
this.currentWorkflow.node.status === WorkflowState.STOPPED.name
342352
)
343353
},
344-
statusMsg () {
345-
return this.currentWorkflow.node.statusMsg || ''
354+
statusAndVersion () {
355+
let ret = upperFirst(this.currentWorkflow.node.statusMsg || '')
356+
if (this.currentWorkflow.node.cylcVersion) {
357+
ret += ` • Cylc ${this.currentWorkflow.node.cylcVersion}`
358+
}
359+
return ret
346360
},
347361
enabled () {
348362
// object holding the states of controls that are supposed to be enabled
@@ -456,7 +470,8 @@ export default {
456470
run: mdiPlay,
457471
stop: mdiStop,
458472
mdiCog,
459-
mdiAccount
473+
mdiAccount,
474+
mdiChevronDown,
460475
},
461476
}
462477
</script>

src/services/mock/json/workflows/multi.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"statusMsg": "paused",
6666
"owner": "user",
6767
"host": "ncc1701.starfleet.gov",
68+
"cylcVersion": "8.5.0.dev",
6869
"port": 43078,
6970
"stateTotals": {
7071
"waiting": 2,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"owner": "user",
88
"host": "localhost",
99
"port": 43079,
10+
"cylcVersion": "8.4.2",
1011
"status": "running",
1112
"statusMsg": "running",
1213
"stateTotals": {

0 commit comments

Comments
 (0)