feat(meilisearch): add workspace, key, and task management

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-08-23 02:53:52 +08:00
1 parent 93dc455c72
commit e55ee6054d
48 files changed
+3984 -18

No files matched your search

@@ -656,6 +656,8 @@ async function openDirectNavigationNode(node: TreeNode, requestId: number) {
queryStore.openNacosAdmin(node.connectionId, { namespace: node.nacosNamespace || "", namespaceName: node.nacosNamespaceName || node.label });
} else if (node.type === "nacos-access-control") {
queryStore.createTab(node.connectionId, "", `${connectionName}:access-control`, "nacos-access-control");
} else if (node.type === "meilisearch-system") {
queryStore.createTab(node.connectionId, "default", t("meilisearch.systemManagement"), "meilisearch-system");
}
}
@@ -325,6 +325,8 @@ function getIconInfo(node: TreeNode): { icon: any; colorClass: string } | null {
return { icon: TableProperties, colorClass: "text-cyan-400" };
case "elasticsearch-index":
return { icon: Table, colorClass: "text-emerald-400" };
case "meilisearch-system":
return { icon: Gauge, colorClass: "text-emerald-500" };
case "procedure":
return { icon: ScrollText, colorClass: "text-blue-500" };
case "function":
@@ -386,7 +388,7 @@ function displayLabel(node: TreeNode): string {
// Use the canonical key for persisted trees created before this label was
// internationalized; those nodes may still contain the old Chinese text.
if (node.type === "nacos-access-control") return t("nacos.accessControlSidebarLabel");
if (node.type === "user-admin" || node.type === "dameng-users" || node.type === "dameng-roles" || node.type === "dameng-job-admin") return t(node.label);
if (node.type === "user-admin" || node.type === "dameng-users" || node.type === "dameng-roles" || node.type === "dameng-job-admin" || node.type === "meilisearch-system") return t(node.label);
if (node.type === "linked-server-root") return t(node.label);
if (node.type === "saved-sql-root") return t(node.label);
if (node.type === "mqtt-topic" && node.id.endsWith(":mqtt-topic:__console__")) return t(node.label);
@@ -192,6 +192,38 @@ describe("SidebarTreeRuntimeHost expansion", () => {
expect(queryStore.openNacosAdmin).not.toHaveBeenCalled();
});
it("opens the Meilisearch system workspace from its direct-navigation node", async () => {
connectionStore.getConfig.mockReturnValue({ db_type: "meilisearch", name: "local-meilisearch" });
const systemNode: TreeNode = {
id: "meili:meilisearch-system",
label: "meilisearch.systemManagement",
type: "meilisearch-system",
connectionId: "meili",
isExpanded: true,
children: [],
};
connectionStore.treeNodes = [systemNode];
const host = ref<InstanceType<typeof SidebarTreeRuntimeHost> | null>(null);
const app = createApp(
defineComponent({
setup: () => () => h(SidebarTreeRuntimeHost, { ref: host, node: systemNode, depth: 0 }),
}),
);
mountedApps.push(app);
const container = document.createElement("div");
document.body.append(container);
app.use(i18n);
app.mount(container);
await nextTick();
host.value!.handleRowClick(systemNode, 1);
await vi.waitFor(() => expect(connectionStore.ensureConnected).toHaveBeenCalledWith("meili", undefined));
expect(queryStore.createTab).toHaveBeenCalledWith("meili", "default", expect.any(String), "meilisearch-system");
expect(systemNode.isExpanded).toBe(true);
});
it("expands an unloaded object group without leaking the regex source as a search filter", async () => {
const group: TreeNode = {
id: "mysql:basic:__tables",