Skip to content

Commit f46ca22

Browse files
committed
fix: correct list of translations task
AdminForth/1715/translations-doesnt-work-on-li
1 parent a34d01c commit f46ca22

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

custom/TranslationJobViewComponent.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
</div>
1212
</div>
1313
<div class="grid grid-cols-3 gap-2">
14-
<div class="bg-gray-50 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700 border-gray-200 dark:border-gray-700 transition-all px-2 py-2 rounded-md border max-w-64 w-full flex items-center justify-between gap-2" v-for="(task, index) in translationTasks" :key="index">
14+
<div
15+
class="bg-gray-50 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700 border-gray-200 dark:border-gray-700 transition-all px-2 py-2 rounded-md border max-w-64 w-full flex items-center justify-between gap-2"
16+
v-for="(task, index) in translationTasks"
17+
:key="index"
18+
>
1519
<span class="truncate">
1620
{{ task.state?.taskName }} to
1721
</span>
@@ -44,7 +48,7 @@ const currentPaginationWindow = ref({limit: 25, offset: 0});
4448
const props = defineProps<{
4549
meta: any;
4650
getJobTasks: (limit?: number, offset?: number) => Promise<
47-
{tasks: {state: Record<string, any>, status: string}[], total: number}>;
51+
{state: Record<string, any>, status: string}[]>;
4852
job: {
4953
id: string;
5054
name: string;
@@ -60,9 +64,7 @@ const props = defineProps<{
6064
}>();
6165
6266
onMounted(async () => {
63-
const {tasks, total} = await props.getJobTasks(currentPaginationWindow.value.limit, currentPaginationWindow.value.offset);
64-
translationTasks.value = tasks;
65-
67+
translationTasks.value = await props.getJobTasks(currentPaginationWindow.value.limit, currentPaginationWindow.value.offset);
6668
websocket.subscribe(`/background-jobs-task-update/${props.job.id}`, (data: { taskIndex: number, status?: string, state?: Record<string, any> }) => {
6769
if ( data.taskIndex <= currentPaginationWindow.value.offset + currentPaginationWindow.value.limit && data.taskIndex >= currentPaginationWindow.value.offset ) {
6870
if (data.state) {

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
allowBuilds:
2+
adminforth: true

0 commit comments

Comments
 (0)