@@ -91,19 +91,31 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
91
91
size =" small"
92
92
>
93
93
N={{ nWindow }}
94
- <v-menu activator =" parent" :close-on-content-click =" false" >
94
+ <v-menu
95
+ activator =" parent"
96
+ :close-on-content-click =" false"
97
+ max-width =" 400"
98
+ >
95
99
<v-card title =" Graph Window Depth" >
96
- <v-card-subtitle >
100
+ <v-card-text >
97
101
This changes the number of tasks which are displayed.
98
102
99
103
Higher values may impact performance.
100
- </v-card-subtitle >
104
+ </v-card-text >
101
105
<v-card-text >
102
106
<v-select
103
- density =" compact"
104
107
v-model =" nWindow"
105
108
:items =" [0,1,2,3]"
106
- />
109
+ >
110
+ <template #append-inner >
111
+ <v-progress-circular
112
+ v-if =" changingNWindow"
113
+ indeterminate
114
+ size =" 20"
115
+ width =" 2"
116
+ />
117
+ </template >
118
+ </v-select >
107
119
</v-card-text >
108
120
</v-card >
109
121
</v-menu >
@@ -198,6 +210,7 @@ import {
198
210
mdiAccount
199
211
} from ' @mdi/js'
200
212
import { startCase } from ' lodash'
213
+ import { until } from ' @/utils'
201
214
import { useToolbar , toolbarHeight } from ' @/utils/toolbar'
202
215
import WorkflowState from ' @/model/WorkflowState.model'
203
216
import graphql from ' @/mixins/graphql'
@@ -279,7 +292,7 @@ export default {
279
292
paused: null ,
280
293
stop: null
281
294
},
282
- nWindow : 1
295
+ changingNWindow : false ,
283
296
}),
284
297
285
298
computed: {
@@ -357,9 +370,20 @@ export default {
357
370
)
358
371
}
359
372
},
360
- nEdgeDistance () {
361
- // the graph window distance reported by the scheduler
362
- return this .currentWorkflow ? .node ? .nEdgeDistance
373
+ nWindow: {
374
+ get () {
375
+ // the graph window distance reported by the scheduler
376
+ return this .currentWorkflow ? .node ? .nEdgeDistance ?? 1
377
+ },
378
+ async set (val) {
379
+ if (val == null || this .isStopped ) return
380
+
381
+ this .changingNWindow = true
382
+ if (await this .setGraphWindow (val)) {
383
+ await until (() => this .currentWorkflow ? .node ? .nEdgeDistance === val)
384
+ }
385
+ this .changingNWindow = false
386
+ },
363
387
}
364
388
},
365
389
@@ -373,16 +397,6 @@ export default {
373
397
isStopped () {
374
398
this .expecting .stop = null
375
399
},
376
- nWindow (newVal ) {
377
- // the user has requested to change the window size
378
- this .setGraphWindow (newVal)
379
- },
380
- nEdgeDistance (newVal ) {
381
- // the scheduler has reported that the window size has changed
382
- if (newVal !== undefined ) {
383
- this .nWindow = newVal
384
- }
385
- }
386
400
},
387
401
388
402
methods: {
@@ -416,12 +430,13 @@ export default {
416
430
}
417
431
})
418
432
},
419
- setGraphWindow (nWindow ) {
420
- this .$workflowService .mutate (
433
+ async setGraphWindow (nWindow ) {
434
+ const { status } = await this .$workflowService .mutate (
421
435
' setGraphWindowExtent' ,
422
436
this .currentWorkflow .id ,
423
437
{ nEdgeDistance: nWindow }
424
438
)
439
+ return status === mutationStatus .SUCCEEDED
425
440
},
426
441
startCase,
427
442
},
0 commit comments