Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix: lint

Wu Clan5242cbb3c6d2
diff --git a/src/components/connection/ConnectionErrorIndicator.vue b/src/components/connection/ConnectionErrorIndicator.vue
index a4ae872896..523b7e8491 100644
--- a/src/components/connection/ConnectionErrorIndicator.vue
+++ b/src/components/connection/ConnectionErrorIndicator.vue
@@ -2,73 +2,62 @@
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { AlertTriangle, X } from "lucide-vue-next";
-import {
- Popover,
- PopoverContent,
- PopoverTrigger,
-} from "@/components/ui/popover";
+import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { useConnectionStore } from "@/stores/connectionStore";
const props = withDefaults(
- defineProps<{
- connectionId?: string | null;
- triggerClass?: string;
- }>(),
- {
- connectionId: null,
- triggerClass: "",
- },
+ defineProps<{
+ connectionId?: string | null;
+ triggerClass?: string;
+ }>(),
+ {
+ connectionId: null,
+ triggerClass: "",
+ },
);
const { t } = useI18n();
const connectionStore = useConnectionStore();
-const errorMessage = computed(() =>
- props.connectionId
- ? connectionStore.connectionErrors[props.connectionId]
- : "",
-);
+const errorMessage = computed(() => (props.connectionId ? connectionStore.connectionErrors[props.connectionId] : ""));
function clearError() {
- if (props.connectionId)
- connectionStore.clearConnectionError(props.connectionId);
+ if (props.connectionId) connectionStore.clearConnectionError(props.connectionId);
}
</script>
<template>
- <Popover v-if="errorMessage">
- <PopoverTrigger as-child>
- <button
- type="button"
- class="inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-amber-500 hover:bg-amber-500/10 hover:text-amber-600 focus:outline-none focus:ring-1 focus:ring-amber-500/40"
- :class="triggerClass"
- :title="t('connection.lastError')"
- @click.stop
- >
- <AlertTriangle class="h-3.5 w-3.5" />
- </button>
- </PopoverTrigger>
- <PopoverContent side="top" class="w-72 gap-2 p-2 text-xs" @click.stop>
- <div class="flex items-start gap-2">
- <div class="min-w-0 flex-1">
- <div class="font-medium text-foreground">
- {{ t("connection.lastError") }}
- </div>
- <div
- class="mt-1 max-h-36 overflow-auto whitespace-pre-wrap break-words text-muted-foreground"
- >
- {{ errorMessage }}
- </div>
- </div>
- <button
- type="button"
- class="shrink-0 rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground"
- :title="t('connection.clearError')"
- @click="clearError"
- >
- <X class="h-3.5 w-3.5" />
- </button>
- </div>
- </PopoverContent>
- </Popover>
+ <Popover v-if="errorMessage">
+ <PopoverTrigger as-child>
+ <button
+ type="button"
+ class="inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-amber-500 hover:bg-amber-500/10 hover:text-amber-600 focus:outline-none focus:ring-1 focus:ring-amber-500/40"
+ :class="triggerClass"
+ :title="t('connection.lastError')"
+ @click.stop
+ >
+ <AlertTriangle class="h-3.5 w-3.5" />
+ </button>
+ </PopoverTrigger>
+ <PopoverContent side="top" class="w-72 gap-2 p-2 text-xs" @click.stop>
+ <div class="flex items-start gap-2">
+ <div class="min-w-0 flex-1">
+ <div class="font-medium text-foreground">
+ {{ t("connection.lastError") }}
+ </div>
+ <div class="mt-1 max-h-36 overflow-auto whitespace-pre-wrap break-words text-muted-foreground">
+ {{ errorMessage }}
+ </div>
+ </div>
+ <button
+ type="button"
+ class="shrink-0 rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground"
+ :title="t('connection.clearError')"
+ @click="clearError"
+ >
+ <X class="h-3.5 w-3.5" />
+ </button>
+ </div>
+ </PopoverContent>
+ </Popover>
</template>
diff --git a/src/components/ui/popover/Popover.vue b/src/components/ui/popover/Popover.vue
index a3fe9ac64b..e43a385bd0 100644
--- a/src/components/ui/popover/Popover.vue
+++ b/src/components/ui/popover/Popover.vue
@@ -1,19 +1,15 @@
<script setup lang="ts">
-import type { PopoverRootEmits, PopoverRootProps } from 'reka-ui'
-import { PopoverRoot, useForwardPropsEmits } from 'reka-ui'
+import type { PopoverRootEmits, PopoverRootProps } from "reka-ui";
+import { PopoverRoot, useForwardPropsEmits } from "reka-ui";
-const props = defineProps<PopoverRootProps>()
-const emits = defineEmits<PopoverRootEmits>()
+const props = defineProps<PopoverRootProps>();
+const emits = defineEmits<PopoverRootEmits>();
-const forwarded = useForwardPropsEmits(props, emits)
+const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
- <PopoverRoot
- v-slot="slotProps"
- data-slot="popover"
- v-bind="forwarded"
- >
+ <PopoverRoot v-slot="slotProps" data-slot="popover" v-bind="forwarded">
<slot v-bind="slotProps" />
</PopoverRoot>
</template>
diff --git a/src/components/ui/popover/PopoverAnchor.vue b/src/components/ui/popover/PopoverAnchor.vue
index e96a121141..44a4296583 100644
--- a/src/components/ui/popover/PopoverAnchor.vue
+++ b/src/components/ui/popover/PopoverAnchor.vue
@@ -1,15 +1,12 @@
<script setup lang="ts">
-import type { PopoverAnchorProps } from 'reka-ui'
-import { PopoverAnchor } from 'reka-ui'
+import type { PopoverAnchorProps } from "reka-ui";
+import { PopoverAnchor } from "reka-ui";
-const props = defineProps<PopoverAnchorProps>()
+const props = defineProps<PopoverAnchorProps>();
</script>
<template>
- <PopoverAnchor
- data-slot="popover-anchor"
- v-bind="props"
- >
+ <PopoverAnchor data-slot="popover-anchor" v-bind="props">
<slot />
</PopoverAnchor>
</template>
diff --git a/src/components/ui/popover/PopoverContent.vue b/src/components/ui/popover/PopoverContent.vue
index b5fccb4503..7304b6b070 100644
--- a/src/components/ui/popover/PopoverContent.vue
+++ b/src/components/ui/popover/PopoverContent.vue
@@ -1,30 +1,23 @@
<script setup lang="ts">
-import type { PopoverContentEmits, PopoverContentProps } from 'reka-ui'
-import type { HTMLAttributes } from 'vue'
-import { reactiveOmit } from '@vueuse/core'
-import {
- PopoverContent,
- PopoverPortal,
- useForwardPropsEmits,
-} from 'reka-ui'
-import { cn } from '@/lib/utils'
+import type { PopoverContentEmits, PopoverContentProps } from "reka-ui";
+import type { HTMLAttributes } from "vue";
+import { reactiveOmit } from "@vueuse/core";
+import { PopoverContent, PopoverPortal, useForwardPropsEmits } from "reka-ui";
+import { cn } from "@/lib/utils";
defineOptions({
inheritAttrs: false,
-})
+});
-const props = withDefaults(
- defineProps<PopoverContentProps & { class?: HTMLAttributes['class'] }>(),
- {
- align: 'center',
- sideOffset: 4,
- },
-)
-const emits = defineEmits<PopoverContentEmits>()
+const props = withDefaults(defineProps<PopoverContentProps & { class?: HTMLAttributes["class"] }>(), {
+ align: "center",
+ sideOffset: 4,
+});
+const emits = defineEmits<PopoverContentEmits>();
-const delegatedProps = reactiveOmit(props, 'class')
+const delegatedProps = reactiveOmit(props, "class");
-const forwarded = useForwardPropsEmits(delegatedProps, emits)
+const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
diff --git a/src/components/ui/popover/PopoverDescription.vue b/src/components/ui/popover/PopoverDescription.vue
index 4c7968a488..ed6076ce2e 100644
--- a/src/components/ui/popover/PopoverDescription.vue
+++ b/src/components/ui/popover/PopoverDescription.vue
@@ -1,17 +1,14 @@
<script setup lang="ts">
-import type { HTMLAttributes } from 'vue'
-import { cn } from '@/lib/utils'
+import type { HTMLAttributes } from "vue";
+import { cn } from "@/lib/utils";
const props = defineProps<{
- class?: HTMLAttributes['class']
-}>()
+ class?: HTMLAttributes["class"];
+}>();
</script>
<template>
- <p
- data-slot="popover-description"
- :class="cn('text-muted-foreground', props.class)"
- >
+ <p data-slot="popover-description" :class="cn('text-muted-foreground', props.class)">
<slot />
</p>
</template>
diff --git a/src/components/ui/popover/PopoverHeader.vue b/src/components/ui/popover/PopoverHeader.vue
index 61f3e0af5c..bd0a017fe6 100644
--- a/src/components/ui/popover/PopoverHeader.vue
+++ b/src/components/ui/popover/PopoverHeader.vue
@@ -1,17 +1,14 @@
<script setup lang="ts">
-import type { HTMLAttributes } from 'vue'
-import { cn } from '@/lib/utils'
+import type { HTMLAttributes } from "vue";
+import { cn } from "@/lib/utils";
const props = defineProps<{
- class?: HTMLAttributes['class']
-}>()
+ class?: HTMLAttributes["class"];
+}>();
</script>
<template>
- <div
- data-slot="popover-header"
- :class="cn('flex flex-col gap-0.5 text-sm', props.class)"
- >
+ <div data-slot="popover-header" :class="cn('flex flex-col gap-0.5 text-sm', props.class)">
<slot />
</div>
</template>
diff --git a/src/components/ui/popover/PopoverTitle.vue b/src/components/ui/popover/PopoverTitle.vue
index 2da9e87609..d54bbd5f9f 100644
--- a/src/components/ui/popover/PopoverTitle.vue
+++ b/src/components/ui/popover/PopoverTitle.vue
@@ -1,17 +1,14 @@
<script setup lang="ts">
-import type { HTMLAttributes } from 'vue'
-import { cn } from '@/lib/utils'
+import type { HTMLAttributes } from "vue";
+import { cn } from "@/lib/utils";
const props = defineProps<{
- class?: HTMLAttributes['class']
-}>()
+ class?: HTMLAttributes["class"];
+}>();
</script>
<template>
- <div
- data-slot="popover-title"
- :class="cn('font-medium cn-font-heading', props.class)"
- >
+ <div data-slot="popover-title" :class="cn('font-medium cn-font-heading', props.class)">
<slot />
</div>
</template>
diff --git a/src/components/ui/popover/PopoverTrigger.vue b/src/components/ui/popover/PopoverTrigger.vue
index 0d410658d2..748f02838c 100644
--- a/src/components/ui/popover/PopoverTrigger.vue
+++ b/src/components/ui/popover/PopoverTrigger.vue
@@ -1,15 +1,12 @@
<script setup lang="ts">
-import type { PopoverTriggerProps } from 'reka-ui'
-import { PopoverTrigger } from 'reka-ui'
+import type { PopoverTriggerProps } from "reka-ui";
+import { PopoverTrigger } from "reka-ui";
-const props = defineProps<PopoverTriggerProps>()
+const props = defineProps<PopoverTriggerProps>();
</script>
<template>
- <PopoverTrigger
- data-slot="popover-trigger"
- v-bind="props"
- >
+ <PopoverTrigger data-slot="popover-trigger" v-bind="props">
<slot />
</PopoverTrigger>
</template>
diff --git a/src/components/ui/popover/index.ts b/src/components/ui/popover/index.ts
index 16337762e2..810d158a86 100644
--- a/src/components/ui/popover/index.ts
+++ b/src/components/ui/popover/index.ts
@@ -1,7 +1,7 @@
-export { default as Popover } from './Popover.vue'
-export { default as PopoverAnchor } from './PopoverAnchor.vue'
-export { default as PopoverContent } from './PopoverContent.vue'
-export { default as PopoverDescription } from './PopoverDescription.vue'
-export { default as PopoverHeader } from './PopoverHeader.vue'
-export { default as PopoverTitle } from './PopoverTitle.vue'
-export { default as PopoverTrigger } from './PopoverTrigger.vue'
+export { default as Popover } from "./Popover.vue";
+export { default as PopoverAnchor } from "./PopoverAnchor.vue";
+export { default as PopoverContent } from "./PopoverContent.vue";
+export { default as PopoverDescription } from "./PopoverDescription.vue";
+export { default as PopoverHeader } from "./PopoverHeader.vue";
+export { default as PopoverTitle } from "./PopoverTitle.vue";
+export { default as PopoverTrigger } from "./PopoverTrigger.vue";