Skip to content

Commit eba2e90

Browse files
committed
feat: update nuxt and packages, add more UI elements, update tests
1 parent bafc3ca commit eba2e90

File tree

142 files changed

+2853
-2831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+2853
-2831
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*.db
22
dbschema.sql
3+
*.db-shm
4+
*.db-wal
5+
.data
36

47
# Nuxt dev/build outputs
58
.output

src/app.vue renamed to app/app.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
2+
import 'vue-sonner/style.css'
23
import { Toaster } from 'vue-sonner'
3-
import Header from '~/components/header.vue'
4+
import Header from './components/header.vue'
45
</script>
56
<template>
67
<Header />
@@ -11,3 +12,9 @@ import Header from '~/components/header.vue'
1112
<Toaster />
1213
</ClientOnly>
1314
</template>
15+
16+
<style>
17+
* {
18+
font-family: 'Inter', sans-serif;
19+
}
20+
</style>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import type { TaskState } from '~/types'
2+
import type { TaskState } from '~~/shared/types'
33
44
const props = defineProps<{
55
state: TaskState
Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
formatReturnValue,
66
formatDate
77
} from '~/lib/utils'
8-
import type { TaskSelect } from '~/server/db/schema'
8+
import type { TaskSelect } from '~~/shared/db/schema'
99
import {
1010
Table,
1111
TableBody,
@@ -15,16 +15,19 @@ import {
1515
TableHead,
1616
TableHeader
1717
} from '~/components/ui/table'
18-
import {
19-
ArrowDownIcon,
20-
ArrowUpIcon,
21-
CopyIcon,
22-
ArrowUpDownIcon
23-
} from 'lucide-vue-next'
18+
import { CopyIcon, Maximize2Icon } from 'lucide-vue-next'
2419
import SortableArrow from '~/components/sortable-arrow.vue'
2520
import { toast } from 'vue-sonner'
26-
import type { QueryParams } from '~/types'
21+
import type { QueryParams } from '~~/shared/types'
2722
import { inject } from 'vue'
23+
import {
24+
Dialog,
25+
DialogContent,
26+
DialogDescription,
27+
DialogHeader,
28+
DialogTitle,
29+
DialogTrigger
30+
} from '~/components/ui/dialog'
2831
2932
const { data } = defineProps<{
3033
data?: {
@@ -85,6 +88,7 @@ const searchHandler: ((value: string) => void) | undefined =
8588
<TableHead> Args </TableHead>
8689
<TableHead> Kwargs </TableHead>
8790
<TableHead> Result </TableHead>
91+
<TableHead class="text-center"> Error </TableHead>
8892
<TableHead>
8993
<div class="flex justify-between items-center gap-2">
9094
<span>Queued At</span>
@@ -130,7 +134,7 @@ const searchHandler: ((value: string) => void) | undefined =
130134
<TableCell class="underline">
131135
<div class="flex justify-between items-center gap-1">
132136
<NuxtLink :to="{ name: 'tasks-id', params: { id: task.id } }">{{
133-
limitText(task.id, 15)
137+
limitText(task.id, 13)
134138
}}</NuxtLink>
135139
<CopyIcon
136140
:size="15"
@@ -146,8 +150,45 @@ const searchHandler: ((value: string) => void) | undefined =
146150
/>
147151
</TableCell>
148152
<TableCell>{{ task.args }}</TableCell>
149-
<TableCell>{{ limitText(JSON.stringify(task.kwargs), 30) }}</TableCell>
153+
<TableCell>{{ limitText(JSON.stringify(task.kwargs), 25) }}</TableCell>
150154
<TableCell>{{ limitText(formatReturnValue(task), 10) }}</TableCell>
155+
<TableCell class="text-center">
156+
<Dialog v-if="task.state === 'failure' && task.error">
157+
<DialogTrigger as-child>
158+
<button
159+
type="button"
160+
class="inline-flex items-center rounded border border-border p-1 text-muted-foreground transition hover:text-foreground cursor-pointer"
161+
aria-label="View full error"
162+
>
163+
<Maximize2Icon :size="12" />
164+
<span class="sr-only">View error details</span>
165+
</button>
166+
</DialogTrigger>
167+
<DialogContent class="sm:max-w-[600px]">
168+
<DialogHeader>
169+
<DialogTitle>Error details</DialogTitle>
170+
<DialogDescription>
171+
{{ formatTaskName(task.name) }} •
172+
<NuxtLink
173+
class="text-primary underline"
174+
:to="{ name: 'tasks-id', params: { id: task.id } }"
175+
>{{ task.id }}</NuxtLink
176+
>
177+
</DialogDescription>
178+
</DialogHeader>
179+
<pre
180+
class="max-h-[60vh] overflow-auto rounded bg-muted p-4 text-left text-sm leading-relaxed"
181+
>{{ task.error.trim() }}</pre
182+
>
183+
</DialogContent>
184+
</Dialog>
185+
<span
186+
v-else
187+
class="text-muted-foreground"
188+
>
189+
190+
</span>
191+
</TableCell>
151192
<TableCell>{{ formatDate(String(task.queuedAt)) }}</TableCell>
152193
<TableCell>{{
153194
task.startedAt ? formatDate(String(task.startedAt)) : null
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<script setup lang="ts">
2+
import type { PrimitiveProps } from 'reka-ui'
23
import type { HTMLAttributes } from 'vue'
4+
import type { ButtonVariants } from '.'
5+
import { Primitive } from 'reka-ui'
36
import { cn } from '@/lib/utils'
4-
import { Primitive, type PrimitiveProps } from 'reka-ui'
5-
import { type ButtonVariants, buttonVariants } from '.'
7+
import { buttonVariants } from '.'
68
79
interface Props extends PrimitiveProps {
810
variant?: ButtonVariants['variant']
@@ -11,7 +13,7 @@ interface Props extends PrimitiveProps {
1113
}
1214
1315
const props = withDefaults(defineProps<Props>(), {
14-
as: 'button',
16+
as: 'button'
1517
})
1618
</script>
1719

0 commit comments

Comments
 (0)