Skip to content

Commit ab74986

Browse files
Merge branch '1.6.x' into simple-tree
2 parents 74827a0 + 3ce61a8 commit ab74986

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1772
-379
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
22
node_modules/
3+
node_modules
34
/dist/
45
/docs/jsdoc/
56

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ Renovate Bot[bot] <[email protected]>
2020
github-actions[bot] <[email protected]> <41898282+github-actions[bot]@users.noreply.github.com>
2121
2222
Aaron Cole <[email protected]>
23+
Jamie Allen <[email protected]> JAllen42 <[email protected]>

CHANGES.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,23 @@ ones in. -->
1515

1616
### Enhancements
1717

18+
[#1275](https://github.com/cylc/cylc-ui/pull/1275) -
19+
Various improvements to the log view including the ability to view prior
20+
job submissions, workflow log files and the connection status of the
21+
log file subscription.
22+
1823
[#1187](https://github.com/cylc/cylc-ui/pull/1187) - Improved the workflow
1924
filtering menu in the sidebar.
2025

26+
[#1254](https://github.com/cylc/cylc-ui/pull/1254) - Add analysis view:
27+
A new view that displays task timing statistics
28+
29+
### Fixes
30+
31+
[#1249](https://github.com/cylc/cylc-ui/pull/1249) - Fix tasks not loading
32+
when navigating between workflows in the standalone `#/tree/` and `#/table/`
33+
views.
34+
2135
-------------------------------------------------------------------------------
2236
## __cylc-ui-1.5.0 (<span actions:bind='release-date'>Released 2023-02-20</span>)__
2337

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ below.
5757
- Carol Barno
5858
- Giuliano Serrao
5959
- Aaron Cole
60+
- Jamie Allen
6061
<!-- end-shortlog -->
6162

6263
(All contributors are identifiable with email addresses in the git version

cypress/component/cylc-graph-node.cy.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ describe('graph node component', () => {
9595
propsData: { task, jobs }
9696
}
9797
)
98-
// there should be 4 jobs
98+
// there should be 4 jobs (8 svg nodes)
9999
cy.get('.c-graph-node:last .jobs')
100100
.children()
101-
.should('have.length', 4)
101+
.should('have.length', 8)
102102
// there shouldn't be a job overflow indicator
103103
cy.get('.c-graph-node:last .job-overflow').should('not.exist')
104104

@@ -120,10 +120,10 @@ describe('graph node component', () => {
120120
propsData: { task, jobs, maxJobs: 4 }
121121
}
122122
)
123-
// there should be <maxJobs> jobs
123+
// there should be <maxJobs> jobs (<maxJobs * 2 svg nodes)
124124
cy.get('.c-graph-node:last .jobs')
125125
.children()
126-
.should('have.length', 4)
126+
.should('have.length', 8)
127127
// there should be a job overflow indicator with the number of overflow jobs
128128
cy.get('.c-graph-node:last .job-overflow')
129129
.should('exist')

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "1.5.0",
44
"private": true,
55
"license": "GPL-3.0-only",
6-
76
"scripts": {
87
"build": "vue-cli-service build",
98
"build:report": "vue-cli-service build --report",
@@ -21,7 +20,6 @@
2120
"test:unit": "vue-cli-service test:unit",
2221
"test": "yarn run test:unit || exit 1; yarn run coverage:e2e --headless"
2322
},
24-
2523
"dependencies": {
2624
"@apollo/client": "^3.5.8",
2725
"@hpcc-js/wasm": "1.13",
@@ -50,7 +48,6 @@
5048
"vuetify": "^2.6.10",
5149
"vuex": "^3.6.2"
5250
},
53-
5451
"devDependencies": {
5552
"@babel/core": "^7.14.8",
5653
"@babel/eslint-parser": "^7.16.5",

src/components/cylc/GraphNode.vue

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
7777
scale(${ (index === 0) ? mostRecentJobScale : '1' })
7878
`"
7979
>
80-
<job
81-
:svg="true"
82-
:status="job.node.state"
80+
<symbol
81+
:id="`${nodeID}-${index}`"
82+
viewBox="0 0 100 100"
83+
:class="`job_theme--${jobTheme}`"
84+
>
85+
<!--
86+
Use a "symbol" for job nodes in order to make them clickable.
87+
The job theme must be set on the "symbol" for styling to work.
88+
-->
89+
<job
90+
:svg="true"
91+
:status="job.node.state"
92+
/>
93+
</symbol>
94+
<use
95+
:href="`#${nodeID}-${index}`"
96+
width="100" height="100"
97+
v-cylc-object="job"
8398
/>
8499
</g>
85100
<!-- overflow indicator if there are surplus jobs -->
@@ -130,6 +145,9 @@ export default {
130145
// the size of the most recent job icon relative to any previos jobs
131146
default: 1.2,
132147
required: false
148+
},
149+
jobTheme: {
150+
required: true
133151
}
134152
},
135153
computed: {
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
<!--
2+
Copyright (C) NIWA & British Crown (Met Office) & Contributors.
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU General Public License for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
-->
17+
18+
<template>
19+
<v-row
20+
no-gutters
21+
class="flex-grow-1 position-relative"
22+
>
23+
<v-col
24+
cols="12"
25+
class="mh-100 position-relative"
26+
>
27+
<v-container
28+
fluid
29+
class="pa-0"
30+
>
31+
<v-data-table
32+
:headers="shownHeaders"
33+
:items="tasks"
34+
:sort-by.sync="sortBy"
35+
dense
36+
:footer-props="{
37+
itemsPerPageOptions: [10, 20, 50, 100, 200, -1],
38+
showFirstLastPage: true
39+
}"
40+
:options="{ itemsPerPage: 50 }"
41+
>
42+
<!-- Use custom format for values in columns that have a specified formatter: -->
43+
<!-- Used to make durations human readable -->
44+
<!-- Durations of 0 will be undefined unless allowZeros is true -->
45+
<template
46+
v-for="header in shownHeaders.filter(header => header.hasOwnProperty('formatter'))"
47+
v-slot:[`item.${header.value}`]="{ value }"
48+
>
49+
{{ header.formatter(value, header.allowZeros) }}
50+
</template>
51+
</v-data-table>
52+
</v-container>
53+
</v-col>
54+
</v-row>
55+
</template>
56+
57+
<script>
58+
import { formatDuration } from '@/utils/tasks'
59+
60+
export default {
61+
name: 'AnalysisTableComponent',
62+
63+
props: {
64+
tasks: {
65+
type: Array,
66+
required: true
67+
},
68+
timingOption: {
69+
type: String,
70+
required: true
71+
}
72+
},
73+
74+
data () {
75+
return {
76+
sortBy: 'name',
77+
headers: [
78+
{
79+
text: 'Task',
80+
value: 'name'
81+
},
82+
{
83+
text: 'Platform',
84+
value: 'platform'
85+
},
86+
{
87+
text: 'Count',
88+
value: 'count'
89+
}
90+
]
91+
}
92+
},
93+
94+
computed: {
95+
shownHeaders () {
96+
let times
97+
if (this.timingOption === 'totalTimes') {
98+
times = 'Total'
99+
} else if (this.timingOption === 'runTimes') {
100+
times = 'Run'
101+
} else if (this.timingOption === 'queueTimes') {
102+
times = 'Queue'
103+
} else {
104+
return this.headers
105+
}
106+
const timingHeaders = [
107+
{
108+
text: `Mean T-${times}`,
109+
value: `mean${times}Time`,
110+
formatter: formatDuration,
111+
allowZeros: false
112+
},
113+
{
114+
text: `Std Dev T-${times}`,
115+
value: `stdDev${times}Time`,
116+
formatter: formatDuration,
117+
allowZeros: true
118+
},
119+
{
120+
text: `Min T-${times}`,
121+
value: `min${times}Time`,
122+
formatter: formatDuration,
123+
allowZeros: false
124+
},
125+
{
126+
text: `Q1 T-${times}`,
127+
value: `${times.toLowerCase()}Quartiles[0]`,
128+
formatter: formatDuration,
129+
allowZeros: false
130+
},
131+
{
132+
text: `Median T-${times}`,
133+
value: `${times.toLowerCase()}Quartiles[1]`,
134+
formatter: formatDuration,
135+
allowZeros: false
136+
},
137+
{
138+
text: `Q3 T-${times}`,
139+
value: `${times.toLowerCase()}Quartiles[2]`,
140+
formatter: formatDuration,
141+
allowZeros: false
142+
},
143+
{
144+
text: `Max T-${times}`,
145+
value: `max${times}Time`,
146+
formatter: formatDuration,
147+
allowZeros: false
148+
}
149+
]
150+
return this.headers.concat(timingHeaders)
151+
}
152+
}
153+
}
154+
</script>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/**
2+
* Copyright (C) NIWA & British Crown (Met Office) & Contributors.
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
/**
19+
* Function to determine if a task should be displayed given a certain filter
20+
* Checks the name includes a search string and if the platform is equal to
21+
* that chosen
22+
*
23+
* @export
24+
* @param {object} task - The task to evaluate
25+
* @param {object} tasksFilter - The filter to apply to the task
26+
* @return {boolean} Boolean determining if task should be displayed
27+
*/
28+
export function matchTask (task, tasksFilter) {
29+
let ret = true
30+
if (tasksFilter.name?.trim()) {
31+
ret &&= task.name.includes(tasksFilter.name)
32+
}
33+
if (tasksFilter.platformOption?.trim()) {
34+
ret &&= task.platform === tasksFilter.platformOption
35+
}
36+
return ret
37+
}
38+
39+
/**
40+
* Function to find the unique platforms in an array of tasks
41+
*
42+
* @export
43+
* @param {array} tasks - The tasks to search for unique platforms
44+
* @return {array} - An array of unique platform objects
45+
*/
46+
export function platformOptions (tasks) {
47+
const platformOptions = [{ text: 'All', value: null }]
48+
const platforms = []
49+
for (const task of tasks) {
50+
if (!platforms.includes(task.platform)) {
51+
platforms.push(task.platform)
52+
platformOptions.push({ text: task.platform, value: task.platform })
53+
}
54+
}
55+
return platformOptions
56+
}

src/components/cylc/cylcObject/Menu.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,19 +264,16 @@ export default {
264264
},
265265
openDialog (mutation) {
266266
if (mutation.name === 'log') {
267-
this.showMenu = false
268267
this.$eventBus.emit(
269268
'add-view',
270269
{
271-
272270
viewName: 'Log',
273271
initialOptions: {
274-
workflow: this.node.tokens.workflow,
275-
task: this.node.tokens.relative_id,
276-
file: 'job.out'
272+
tokens: this.node.tokens
277273
}
278274
}
279275
)
276+
this.showMenu = false
280277
return
281278
}
282279

0 commit comments

Comments
 (0)