stash
This commit is contained in:
parent
796fef81be
commit
7df585d774
11 changed files with 246 additions and 72 deletions
|
|
@ -27,7 +27,7 @@
|
|||
<tbody>
|
||||
<tr v-for="workflow in activeWorkflows" :key="workflow.id">
|
||||
<td>
|
||||
<strong>{{ workflow.workflow_type }}</strong>
|
||||
<strong>{{ getWorkflowDisplayName(workflow) }}</strong>
|
||||
<br>
|
||||
<small class="text-muted">{{ workflow.payload?.workflow_config?.category || 'System' }}</small>
|
||||
</td>
|
||||
|
|
@ -215,10 +215,14 @@ export default {
|
|||
},
|
||||
isWorkflowRunning(workflowId) {
|
||||
return this.activeWorkflows.some(active =>
|
||||
active.workflow_type === workflowId &&
|
||||
active.name === workflowId &&
|
||||
active.state === 'running'
|
||||
);
|
||||
},
|
||||
getWorkflowDisplayName(workflow) {
|
||||
// `name` doubles as the workflow type identifier (e.g. 'import-items').
|
||||
return workflowRegistry.get(workflow.name)?.name || workflow.name;
|
||||
},
|
||||
async startWorkflow(workflow) {
|
||||
try {
|
||||
this.loading = true;
|
||||
|
|
@ -266,16 +270,17 @@ export default {
|
|||
});
|
||||
},
|
||||
async abortWorkflowInstance(workflow) {
|
||||
if (confirm(`Are you sure you want to abort "${workflow.workflow_type}"?`)) {
|
||||
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:', workflow.workflow_type);
|
||||
console.log('Workflow aborted successfully:', displayName);
|
||||
} catch (error) {
|
||||
console.error('Error aborting workflow:', error);
|
||||
this.error = `Failed to abort ${workflow.workflow_type}`;
|
||||
this.error = `Failed to abort ${displayName}`;
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue