mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-07-07 21:15:05 +00:00

Some checks failed
CI / build-test (macos-14) (push) Has been cancelled
CI / build-test (ubuntu-24.04) (push) Has been cancelled
CI / build-test (windows-latest) (push) Has been cancelled
JSR Publish / publish (push) Has been cancelled
NPM Package Publish / publish-npm (push) Has been cancelled
* feat: add drizzle orm * feat: update drizzle configuration and schema management - Added a check for DB_FILE_NAME in drizzle.config.ts to ensure it's set. - Updated package.json to change the package name to @kksh/drizzle and added exports for schema and relations. - Enhanced README.md with instructions for using the schema generation. - Refactored schema.ts for improved readability and organization of imports. * add tauri-plugin-sql * feat: add database select and execute commands - Introduced `select` and `execute` functions in the database module to facilitate querying and executing SQL commands. - Updated the Tauri plugin to expose these commands, allowing for database interactions from the frontend. - Added corresponding permissions for the new commands in the permissions configuration. - Enhanced the database library with JSON value handling for query parameters. * fix: sqlite select command * drizzle ORM verified working * refactor: clean up database module by removing unused SelectQueryResult type and disabling eslint for explicit any usage * pnpm lock update * Update enum definition for type safety - Changed enum to use 'as const' for better type inference - Ensured more robust handling of extension publish sources * reimplemented most db command functions with ORM (migrate from tauri command invoke * fixed searchExtensionData orm function * Refactor ORM commands and searchExtensionData function for improved readability and consistency - Reformatted import statements for better organization. - Cleaned up whitespace and indentation in searchExtensionData function. - Enhanced readability of SQL conditions and query building logic. - Disabled eslint for explicit any usage in the troubleshooters page. * Fix test assertions in database module to use array indexing for results format rust code * update deno lock * move drizzle from desktop to drizzle package * update pnpm version and lock * refactor: migrate db tauri commands to drizzle * refactor: remove unused extension and command CRUD operations from db module
68 lines
1.7 KiB
Svelte
68 lines
1.7 KiB
Svelte
<script lang="ts">
|
|
import Icon from "@iconify/svelte"
|
|
import { Button, ButtonModule, Collapsible, ScrollArea } from "@kksh/svelte5"
|
|
import { Error, Layouts, Shiki } from "@kksh/ui"
|
|
import { ChevronsUpDown } from "lucide-svelte"
|
|
import { type Snippet } from "svelte"
|
|
|
|
const {
|
|
title,
|
|
message,
|
|
class: className,
|
|
rawJsonError,
|
|
onGoBack,
|
|
footer: footer2
|
|
}: {
|
|
title: string
|
|
message: string
|
|
class?: string
|
|
rawJsonError: string
|
|
onGoBack?: () => void
|
|
footer?: Snippet
|
|
} = $props()
|
|
|
|
let enterDown = $state(false)
|
|
|
|
function handleKeyDown(event: KeyboardEvent) {
|
|
if (event.key === "Enter") {
|
|
enterDown = true
|
|
}
|
|
}
|
|
|
|
function handleKeyUp(event: KeyboardEvent) {
|
|
if (event.key === "Enter") {
|
|
enterDown = false
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<svelte:window on:keydown={handleKeyDown} on:keyup={handleKeyUp} />
|
|
|
|
<Error.General {title} {message} class={className}>
|
|
<Collapsible.Root class="w-full space-y-2">
|
|
<div class="flex items-center justify-between space-x-4 px-4">
|
|
<h4 class="text-sm font-semibold">Raw Error JSON</h4>
|
|
<Collapsible.Trigger
|
|
class={ButtonModule.buttonVariants({ variant: "ghost", size: "sm", class: "w-9 p-0" })}
|
|
>
|
|
<ChevronsUpDown class="size-4" />
|
|
</Collapsible.Trigger>
|
|
</div>
|
|
<Collapsible.Content class="space-y-2">
|
|
<ScrollArea class="h-64" orientation="both">
|
|
<Shiki class="" code={rawJsonError} lang="json" />
|
|
</ScrollArea>
|
|
</Collapsible.Content>
|
|
</Collapsible.Root>
|
|
<br />
|
|
{#snippet footer()}
|
|
{#if footer2}
|
|
{@render footer2()}
|
|
{:else}
|
|
<Button variant="default" class="w-full" onclick={onGoBack} disabled={enterDown}>
|
|
Go Back
|
|
<Icon icon="mi:enter" />
|
|
</Button>
|
|
{/if}
|
|
{/snippet}
|
|
</Error.General>
|