refactor(grid): extract column formatter workflow

This commit is contained in:
t8y2 committed 2026-09-08 22:04:49 +08:00
1 parent acb0070f9e
commit ed20ed275d
4 files changed
+685 -553

No files matched your search

+6 -26
View File
@@ -4747,13 +4747,8 @@ export const useConnectionStore = defineStore("connection", () => {
async function loadMqTenants(connectionId: string, options?: LoadTreeOptions) {
const node = findConnectionNode(connectionId);
if (!node) return;
let load = beginTreeNodeLoad(node);
try {
await ensureConnected(connectionId);
load = reclaimTreeNodeLoad(load, node);
if (useCachedChildren(node, options, load)) return;
return runConnectionTreeMetadataLoad(connectionId, node, async (load) => {
if (useCachedChildren(node!, options, load)) return;
const config = getConfig(connectionId);
if (isFlatMqConnection(config)) {
@@ -4791,23 +4786,13 @@ export const useConnectionStore = defineStore("connection", () => {
}
const liveNode = treeNodeLoadTarget(load);
if (liveNode) liveNode.isExpanded = true;
} catch (e) {
recordMetadataLoadError(connectionId, e, load);
throw e;
} finally {
finishTreeNodeLoad(load);
}
});
}
async function loadNacosNamespaces(connectionId: string, options?: LoadTreeOptions) {
const node = findConnectionNode(connectionId);
if (!node) return;
let load = beginTreeNodeLoad(node);
try {
await ensureConnected(connectionId);
load = reclaimTreeNodeLoad(load, node);
if (useCachedChildren(node, options, load)) return;
return runConnectionTreeMetadataLoad(connectionId, node, async (load) => {
if (useCachedChildren(node!, options, load)) return;
const sidebarSnapshot = await api.nacosSidebarSnapshot(connectionId);
const namespaces = normalizeNacosNamespacesForDisplay(sidebarSnapshot.namespaces);
@@ -4852,12 +4837,7 @@ export const useConnectionStore = defineStore("connection", () => {
}
setChildren(targetNode, children);
targetNode.isExpanded = true;
} catch (e) {
recordMetadataLoadError(connectionId, e, load);
throw e;
} finally {
finishTreeNodeLoad(load);
}
});
}
function updateRedisDbKeyStats(connectionId: string, db: number, stats: { loaded?: number; total?: number; totalDelta?: number }) {