Skip to content

Commit

Permalink
feat: show detailed errors when a scheduled task has failed in the ma… (
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpoensgen committed Oct 15, 2023
1 parent 3d2e259 commit db40fb2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
Expand Up @@ -18,6 +18,7 @@ Component.register('frosh-tools-tab-scheduled', {
isLoading: true,
page: 1,
limit: 25,
taskError: null
};
},

Expand Down Expand Up @@ -92,6 +93,8 @@ Component.register('frosh-tools-tab-scheduled', {
this.createNotificationError({
message: this.$tc('frosh-tools.scheduledTaskFailed', 0, {'name': item.name})
})

this.taskError = e.response.data;
}

this.createdComponent();
Expand Down
Expand Up @@ -8,31 +8,34 @@
>

<template #toolbar>
<sw-button variant="ghost" @click="refresh"><sw-icon :small="true" name="regular-undo"></sw-icon></sw-button>
<sw-button variant="primary" @click="registerScheduledTasks">{{ $tc('frosh-tools.scheduledTasksRegisterStarted') }}</sw-button>
<sw-button variant="ghost" @click="refresh">
<sw-icon :small="true" name="regular-undo"></sw-icon>
</sw-button>
<sw-button variant="primary"
@click="registerScheduledTasks">{{ $tc('frosh-tools.scheduledTasksRegisterStarted') }}</sw-button>
</template>

<sw-entity-listing
:showSelection="false"
:fullPage="false"
:allowInlineEdit="true"
:allowEdit="false"
:allowDelete="false"
:showActions="true"
:repository="scheduledRepository"
:items="items"
:columns="columns">
:showSelection="false"
:fullPage="false"
:allowInlineEdit="true"
:allowEdit="false"
:allowDelete="false"
:showActions="true"
:repository="scheduledRepository"
:items="items"
:columns="columns">

<template #column-lastExecutionTime="{ item }">
{{ item.lastExecutionTime | date({hour: '2-digit', minute: '2-digit'}) }}
</template>
<template #column-nextExecutionTime="{ item, column, compact, isInlineEdit }">
<sw-data-grid-inline-edit
v-if="isInlineEdit"
:column="column"
:compact="compact"
:value="item[column.property]"
@input="item[column.property] = $event">
v-if="isInlineEdit"
:column="column"
:compact="compact"
:value="item[column.property]"
@input="item[column.property] = $event">
</sw-data-grid-inline-edit>

<span v-else>
Expand All @@ -47,4 +50,18 @@
</template>
</sw-entity-listing>
</sw-card>

<sw-modal
v-if="taskError"
:title="$tc('global.default.error')"
@modal-close="taskError = null"
>
<pre v-if="typeof taskError === 'object'" v-text="taskError"/>
<div v-else v-html="taskError"/>
<template #modal-footer>
<sw-button size="small" @click="taskError = null">
{{ $tc('global.default.close') }}
</sw-button>
</template>
</sw-modal>
</sw-card-view>

0 comments on commit db40fb2

Please sign in to comment.