Skip to content

Commit 3dbbb47

Browse files
committed
🐛 BUG修复 将当前agent配置下的功能都放在agentConfig.ts里,优化编码风格
1 parent a7f8e85 commit 3dbbb47

File tree

2 files changed

+12
-32
lines changed

2 files changed

+12
-32
lines changed

frontend/app/[locale]/setup/agentSetup/components/agent/AgentCallRelationshipModal.tsx

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
AgentCallRelationshipTool,
1313
AgentCallRelationshipModalProps,
1414
AgentCallRelationshipTreeNodeDatum,
15+
AGENT_CALL_RELATIONSHIP_THEME_CONFIG,
1516
} from "@/types/agentConfig";
1617

1718
const { Text } = Typography;
@@ -39,30 +40,9 @@ function truncateByCodePoints(s: string, max: number) {
3940
return arr.length > max ? arr.slice(0, max).join("") + "…" : s;
4041
}
4142

42-
// Enhanced color configuration with modern palette
43-
const themeConfig = {
44-
colors: {
45-
node: {
46-
main: "#1a1a2e",
47-
levels: {
48-
1: "#16213e",
49-
2: "#0f3460",
50-
3: "#533483",
51-
4: "#7209b7",
52-
},
53-
tools: {
54-
1: "#ff6b6b",
55-
2: "#4ecdc4",
56-
3: "#45b7d1",
57-
4: "#96ceb4",
58-
},
59-
},
60-
},
61-
} as const;
62-
6343
// Get node color
6444
const getNodeColor = (type: string, depth: number = 0) => {
65-
const { colors } = themeConfig;
45+
const { colors } = AGENT_CALL_RELATIONSHIP_THEME_CONFIG;
6646

6747
switch (type) {
6848
case "main":

frontend/types/agentConfig.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -281,21 +281,21 @@ export interface AgentRefreshEvent extends CustomEvent {
281281
// ========== Constants ==========
282282

283283
// Agent call relationship graph theme/colors
284-
export const AGENT_CALL_RELATIONSHIP_THEME = {
284+
export const AGENT_CALL_RELATIONSHIP_THEME_CONFIG = {
285285
colors: {
286286
node: {
287-
main: "#2c3e50",
287+
main: "#1a1a2e",
288288
levels: {
289-
1: "#3498db",
290-
2: "#9b59b6",
291-
3: "#e74c3c",
292-
4: "#f39c12",
289+
1: "#16213e",
290+
2: "#0f3460",
291+
3: "#533483",
292+
4: "#7209b7",
293293
},
294294
tools: {
295-
1: "#e67e22",
296-
2: "#1abc9c",
297-
3: "#34495e",
298-
4: "#f1c40f",
295+
1: "#ff6b6b",
296+
2: "#4ecdc4",
297+
3: "#45b7d1",
298+
4: "#96ceb4",
299299
},
300300
},
301301
},

0 commit comments

Comments
 (0)