feat(dameng): support proxy job administration
* Feature: add Dameng agent job management * fix(duckdb): stabilize worker process tests * fix(dameng): address job admin review --------- Co-authored-by: zipg <4047349+zipg@users.noreply.github.com>
This commit is contained in:
1 parent
a07f115407
commit
47d9257ac2
20 files changed
+1189
-7
No files matched your search
@@ -878,7 +878,7 @@ export const useConnectionStore = defineStore("connection", () => {
|
||||
}
|
||||
|
||||
function isConnectionUtilityNode(node: TreeNode): boolean {
|
||||
return node.type === "user-admin";
|
||||
return node.type === "user-admin" || node.type === "dameng-job-admin";
|
||||
}
|
||||
|
||||
function connectionMetadataChildren(children: TreeNode[] | undefined): TreeNode[] {
|
||||
@@ -939,10 +939,25 @@ export const useConnectionStore = defineStore("connection", () => {
|
||||
};
|
||||
}
|
||||
|
||||
function buildDamengJobAdminNode(connectionId: string, existingConnectionNode?: TreeNode): TreeNode | undefined {
|
||||
const config = getConfig(connectionId);
|
||||
if (effectiveDatabaseTypeForConnection(config) !== "dameng") return undefined;
|
||||
const existing = existingConnectionNode?.children?.find((child) => child.type === "dameng-job-admin");
|
||||
return {
|
||||
id: `${connectionId}:__dameng_jobs`,
|
||||
label: "tree.damengJobAdmin",
|
||||
type: "dameng-job-admin",
|
||||
connectionId,
|
||||
database: "",
|
||||
isExpanded: existing?.isExpanded ?? false,
|
||||
};
|
||||
}
|
||||
|
||||
function withConnectionUtilityNodes(connectionId: string, children: TreeNode[], existingConnectionNode?: TreeNode): TreeNode[] {
|
||||
const nonUtilityChildren = connectionMetadataChildren(children);
|
||||
const userAdminNode = buildUserAdminNode(connectionId, existingConnectionNode);
|
||||
return [...nonUtilityChildren, userAdminNode].filter(Boolean) as TreeNode[];
|
||||
const damengJobAdminNode = buildDamengJobAdminNode(connectionId, existingConnectionNode);
|
||||
return [...nonUtilityChildren, userAdminNode, damengJobAdminNode].filter(Boolean) as TreeNode[];
|
||||
}
|
||||
|
||||
function withSavedSqlRoot(connectionId: string, children: TreeNode[], existingConnectionNode?: TreeNode): TreeNode[] {
|
||||
|
||||
@@ -778,6 +778,31 @@ export const useQueryStore = defineStore("query", () => {
|
||||
return id;
|
||||
}
|
||||
|
||||
function openDamengJobAdmin(connectionId: string) {
|
||||
const existing = tabs.value.find((tab) => tab.mode === "dameng-jobs" && tab.connectionId === connectionId);
|
||||
if (existing) {
|
||||
activeTabId.value = existing.id;
|
||||
return existing.id;
|
||||
}
|
||||
|
||||
const conn = useConnectionStore().getConfig(connectionId);
|
||||
const id = uuid();
|
||||
const tab: QueryTab = {
|
||||
id,
|
||||
title: t("damengJobAdmin.title"),
|
||||
connectionId,
|
||||
database: conn?.database || "",
|
||||
sql: "",
|
||||
isExecuting: false,
|
||||
isCancelling: false,
|
||||
isExplaining: false,
|
||||
mode: "dameng-jobs",
|
||||
};
|
||||
tabs.value.push(tab);
|
||||
activeTabId.value = id;
|
||||
return id;
|
||||
}
|
||||
|
||||
function openMongoBucket(connectionId: string, database: string, bucketName: string) {
|
||||
const title = `${database}.${bucketName}`;
|
||||
const existing = tabs.value.find((tab) => tab.mode === "mongo-bucket" && tab.connectionId === connectionId && tab.database === database && tab.mongoBucket?.bucketName === bucketName);
|
||||
@@ -3059,6 +3084,7 @@ export const useQueryStore = defineStore("query", () => {
|
||||
openMongoGridFs,
|
||||
openMongoBucket,
|
||||
openUserAdmin,
|
||||
openDamengJobAdmin,
|
||||
openMqAdmin,
|
||||
openNacosAdmin,
|
||||
openTableStructure,
|
||||
|
||||
Reference in new issue
Block a user