Skip to content

Commit 73aa058

Browse files
committed
fix(tasks): refresh task list after stop all
1 parent 74fdbe9 commit 73aa058

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

web/src/components/TaskList.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export default {
8787
template: Object,
8888
limit: Number,
8989
hideFooter: Boolean,
90+
needUpdate: Boolean,
9091
},
9192
data() {
9293
return {
@@ -138,6 +139,11 @@ export default {
138139
async template() {
139140
await this.loadData();
140141
},
142+
async needUpdate(val) {
143+
if (val) {
144+
await this.loadData();
145+
}
146+
},
141147
},
142148
async created() {
143149
await this.loadData();

web/src/views/project/TemplateView.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
v-on="on"
8585
color="grey"
8686
class="mr-3 pr-2"
87+
:disabled="stopAllTasksProgress"
8788
>
8889
{{ $t('stopAll') }}
8990
<v-icon>mdi-chevron-down</v-icon>
@@ -175,6 +176,7 @@
175176
:premium-features="premiumFeatures"
176177
:is-admin="isAdmin"
177178
@update-template="loadData"
179+
:need-update="needLoadData"
178180
></router-view>
179181
</div>
180182
</template>
@@ -250,6 +252,9 @@ export default {
250252
stopAllDialog: null,
251253
forceStopAllDialog: null,
252254
USER_PERMISSIONS,
255+
256+
needLoadData: false,
257+
stopAllTasksProgress: false,
253258
};
254259
},
255260
@@ -314,6 +319,7 @@ export default {
314319
315320
async stopAllTasks(force) {
316321
try {
322+
this.stopAllTasksProgress = true;
317323
await axios({
318324
method: 'post',
319325
url: `/api/project/${this.projectId}/templates/${this.itemId}/stop_all_tasks`,
@@ -327,6 +333,8 @@ export default {
327333
color: 'success',
328334
text: 'All running tasks have been requested to stop',
329335
});
336+
337+
this.needLoadData = true;
330338
} catch (err) {
331339
EventBus.$emit('i-snackbar', {
332340
color: 'error',
@@ -335,6 +343,11 @@ export default {
335343
} finally {
336344
this.stopAllDialog = false;
337345
this.forceStopAllDialog = false;
346+
this.stopAllTasksProgress = false;
347+
348+
setTimeout(() => {
349+
this.needLoadData = false;
350+
}, 100);
338351
}
339352
},
340353

0 commit comments

Comments
 (0)