This commit is contained in:
j3d1 2026-09-05 16:20:44 +02:00
parent 9814ec7ecd
commit 197f173097
14 changed files with 170 additions and 89 deletions

View file

@ -54,11 +54,12 @@
:disabled="loading">
<b-icon-eye></b-icon-eye>
</button>
<button class="btn btn-sm btn-outline-danger"
@click="abortWorkflowInstance(workflow)"
<guarded-button class="btn btn-sm btn-outline-danger"
:confirm-message='`Are you sure you want to abort "${getWorkflowDisplayName(workflow)}"?`'
@confirm="abortWorkflowInstance(workflow)"
:disabled="loading">
<b-icon-x-circle></b-icon-x-circle>
</button>
</guarded-button>
</td>
</tr>
</tbody>
@ -132,6 +133,7 @@
<script>
import * as BIcons from "bootstrap-icons-vue";
import BaseLayout from "@/components/BaseLayout.vue";
import GuardedButton from "@/components/GuardedButton.vue";
import {mapState, mapActions} from 'vuex';
import {getAllWorkflows, getWorkflow, buildWorkflowApiPayload} from '@/workflows.js';
@ -139,7 +141,8 @@ export default {
name: 'Workflows',
components: {
...BIcons,
BaseLayout
BaseLayout,
GuardedButton
},
data() {
return {
@ -264,19 +267,17 @@ export default {
},
async abortWorkflowInstance(workflow) {
const displayName = this.getWorkflowDisplayName(workflow);
if (confirm(`Are you sure you want to abort "${displayName}"?`)) {
try {
this.loading = true;
this.error = null;
await this.deleteWorkflow(workflow.id);
await this.loadActiveWorkflows();
console.log('Workflow aborted successfully:', displayName);
} catch (error) {
console.error('Error aborting workflow:', error);
this.error = `Failed to abort ${displayName}`;
} finally {
this.loading = false;
}
try {
this.loading = true;
this.error = null;
await this.deleteWorkflow(workflow.id);
await this.loadActiveWorkflows();
console.log('Workflow aborted successfully:', displayName);
} catch (error) {
console.error('Error aborting workflow:', error);
this.error = `Failed to abort ${displayName}`;
} finally {
this.loading = false;
}
}
}