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。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
<script setup lang="ts">
import { computed, ref } from "vue";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Button } from "@/components/ui/button";
import { RefreshCw } from "@lucide/vue";
import type { GeneratorParams } from "@/lib/dataGrid/dataGenerate";
import { generateRegexValue } from "@/lib/dataGrid/regexGenerate";
import CommonOptions from "./CommonOptions.vue";
import { useI18n } from "vue-i18n";
const props = defineProps<{ params: GeneratorParams }>();
const { t } = useI18n();
const previewKey = ref(0);
const previewVal = computed(() => {
void previewKey.value;
const result = generateRegexValue(props.params.pattern, props.params.rawPattern);
if (result.status === "ok") return result.value;
if (result.status === "empty") return t("dataGenerate.notSet");
if (result.status === "invalid") return t("dataGenerate.invalidRegex");
return t("dataGenerate.noMatch");
});
function refresh() {
previewKey.value++;
}
</script>
<template>
<div class="space-y-3">
<div class="rounded-md border bg-muted/10 p-3">
<div class="grid grid-cols-[80px_1fr] items-center gap-2 text-xs">
<Label class="text-muted-foreground">{{ t("dataGenerate.regex") }}</Label>
<Input v-model="params.pattern" type="text" placeholder="[A-Za-z0-9]{10}" class="h-7 text-xs font-mono" />
</div>
<div class="flex items-center gap-2 text-xs mt-2">
<input id="regex-raw" type="checkbox" class="h-3.5 w-3.5 accent-primary" :checked="!!params.rawPattern" @change="params.rawPattern = !params.rawPattern" />
<Label for="regex-raw" class="text-muted-foreground">{{ t("dataGenerate.rawPattern") }}</Label>
</div>
</div>
<div class="rounded-md border bg-muted/10 p-3">
<div class="flex items-center gap-2 text-xs">
<span class="text-muted-foreground shrink-0">{{ t("dataGenerate.preview") }}</span>
<span :key="previewKey" class="font-mono text-sm break-all">{{ previewVal }}</span>
<Button variant="ghost" size="icon" class="h-5 w-5 ml-auto shrink-0" @click="refresh">
<RefreshCw class="h-3 w-3" />
</Button>
</div>
</div>
<CommonOptions :params="params" />
</div>
</template>