Skip to content

Commit ed50470

Browse files
committed
fix: fix bug
1 parent 84ab984 commit ed50470

11 files changed

Lines changed: 98 additions & 89 deletions

File tree

src/frontend/platform/public/locales/en-US/dashboard.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@
409409
"others": "Others",
410410
"metricCard": "Metric"
411411
},
412-
"mid_user_increment": "User Behavior Metrics Table",
412+
"mid_user_increment": "User Scale Statistics",
413413
"timestamp": {
414414
"year": "Time(Year)",
415415
"month": "Time(Month)",
@@ -423,41 +423,41 @@
423423
},
424424
"total_user_count": "Total Users",
425425
"new_user_count": "New Users",
426-
"mid_active_user": "Active Users Table",
426+
"mid_active_user": "Active User Scale Statistics",
427427
"active_user_count": "Active Users",
428-
"mid_app_increment": "Application Quantity Table",
428+
"mid_app_increment": "Application Scale Statistics",
429429
"user_id": "User ID",
430430
"user_name": "User Name",
431431
"app_type": "Application Type",
432432
"total_app_count": "Total Applications",
433433
"new_app_count": "New Applications",
434-
"mid_sessions_increment": "Session Quantity Table",
434+
"mid_sessions_increment": "Application Usage Statistics",
435435
"app_id": "Application ID",
436436
"app_name": "Application Name",
437437
"source": "Source Type (Platform/API)",
438438
"session_count": "Session Count",
439439
"platform_user_count": "Number of Users",
440440
"api_call_count": "API Call Count",
441-
"mid_session_run_dtl": "Session Duration Table",
441+
"mid_session_run_dtl": "Application Concurrency and Time Consumption",
442442
"duration_seconds": "Session Duration",
443443
"max_concurrent_sessions": "Maximum Concurrent Online Sessions",
444-
"mid_tool_call_dtl": "Tool Call Duration Table",
444+
"mid_tool_call_dtl": "Tool Call Analysis",
445445
"tool_name": "Tool Name",
446446
"tool_id": "Tool ID",
447447
"tool_type": "Tool Type",
448448
"tool_call_count": "Tool Call Count",
449449
"tool_call_success_count": "Successful Tool Calls",
450450
"tool_call_success_rate": "Tool Call Success Rate",
451-
"mid_knowledge_increment": "Knowledge Base Inventory Table",
451+
"mid_knowledge_increment": "Knowledge Base Size Statistics",
452452
"total_document_knowledge_base_count": "Total Document Knowledge Bases",
453453
"total_qa_knowledge_base_count": "Total QA Knowledge Bases",
454454
"new_document_knowledge_base_count": "New Document Knowledge Bases",
455455
"new_qa_knowledge_base_count": "New QA Knowledge Bases",
456-
"mid_knowledge_file_increment": "Knowledge Base File Statistics Table",
456+
"mid_knowledge_file_increment": "Knowledge Base File Statistics",
457457
"total_file_count": "Total Files",
458458
"total_qa_count": "Total QA Pairs",
459459
"file_size": "File Size",
460-
"mid_doc_parse_dtl": "File Parsing Event Table",
460+
"mid_doc_parse_dtl": "File Parsing Performance",
461461
"parse_type": "Parsing Type",
462462
"status": "Final File Status",
463463
"doc_parse_count": "Document Upload Count",
@@ -466,7 +466,7 @@
466466
"etl_parse_count": "ETL Processing Count",
467467
"etl_parse_success_count": "Successful ETL Processing Count",
468468
"etl_parse_success_rate": "ETL Processing Success Rate",
469-
"mid_model_call_dtl": "Model Call Event Table",
469+
"mid_model_call_dtl": "Model Cost and Performance",
470470
"user_role_infos": {
471471
"role_id": "Role ID",
472472
"role_name": "Role Name"
@@ -481,7 +481,7 @@
481481
"model_call_success_rate": "Model Call Success Rate",
482482
"max_concurrent_llm_sessions": "Maximum Concurrent LLM Sessions",
483483
"avg_first_token_cost_time": "Average First Token Response Latency",
484-
"mid_user_interact_dtl": "User Feedback Metrics Table",
484+
"mid_user_interact_dtl": "User Feedback Statistics",
485485
"like_count": "Like Count",
486486
"dislike_count": "Dislike Count",
487487
"copy_count": "Copy Count"

src/frontend/platform/public/locales/ja/dashboard.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@
410410
"others": "その他",
411411
"metricCard": "指標カード"
412412
},
413-
"mid_user_increment": "ユーザー行動指標テーブル",
413+
"mid_user_increment": "ユーザースケール統計",
414414
"timestamp": {
415415
"year": "時間(年)",
416416
"month": "時間(月)",
@@ -424,41 +424,41 @@
424424
},
425425
"total_user_count": "総ユーザー数",
426426
"new_user_count": "新規ユーザー数",
427-
"mid_active_user": "アクティブユーザーテーブル",
427+
"mid_active_user": "アクティブユーザー規模統計",
428428
"active_user_count": "アクティブユーザー数",
429-
"mid_app_increment": "アプリケーション数テーブル",
429+
"mid_app_increment": "アプリケーション規模統計",
430430
"user_id": "ユーザーID",
431431
"user_name": "ユーザー名",
432432
"app_type": "アプリケーションタイプ",
433433
"total_app_count": "総アプリケーション数",
434434
"new_app_count": "新規アプリケーション数",
435-
"mid_sessions_increment": "セッション数テーブル",
435+
"mid_sessions_increment": "アプリケーション使用状況統計",
436436
"app_id": "アプリケーションID",
437437
"app_name": "アプリケーション名",
438438
"source": "ソースタイプ(プラットフォーム/API)",
439439
"session_count": "セッション回数",
440440
"platform_user_count": "利用人数",
441441
"api_call_count": "APIコール回数",
442-
"mid_session_run_dtl": "セッション実行時間テーブル",
442+
"mid_session_run_dtl": "アプリケーションの並行処理と時間消費",
443443
"duration_seconds": "セッション実行時間",
444444
"max_concurrent_sessions": "最大同時オンラインセッション数",
445-
"mid_tool_call_dtl": "ツールコール時間テーブル",
445+
"mid_tool_call_dtl": "ツール呼び出し分析",
446446
"tool_name": "ツール名",
447447
"tool_id": "ツールID",
448448
"tool_type": "ツールタイプ",
449449
"tool_call_count": "ツールコール回数",
450450
"tool_call_success_count": "ツールコール成功回数",
451451
"tool_call_success_rate": "ツールコール成功率",
452-
"mid_knowledge_increment": "ナレッジベース在庫テーブル",
452+
"mid_knowledge_increment": "知識ベースの規模統計",
453453
"total_document_knowledge_base_count": "総ドキュメントナレッジベース数",
454454
"total_qa_knowledge_base_count": "総Q&Aナレッジベース数",
455455
"new_document_knowledge_base_count": "新規ドキュメントナレッジベース数",
456456
"new_qa_knowledge_base_count": "新規Q&Aナレッジベース数",
457-
"mid_knowledge_file_increment": "ナレッジベースファイル統計テーブル",
457+
"mid_knowledge_file_increment": "ナレッジベースファイルの統計",
458458
"total_file_count": "総ファイル数",
459459
"total_qa_count": "総Q&Aペア数",
460460
"file_size": "ファイルサイズ",
461-
"mid_doc_parse_dtl": "ファイル解析イベントテーブル",
461+
"mid_doc_parse_dtl": "ファイル解析性能",
462462
"parse_type": "解析タイプ",
463463
"status": "ファイル最終ステータス",
464464
"doc_parse_count": "ドキュメントアップロード回数",
@@ -467,7 +467,7 @@
467467
"etl_parse_count": "ETL処理回数",
468468
"etl_parse_success_count": "ETL処理成功回数",
469469
"etl_parse_success_rate": "ETL処理成功率",
470-
"mid_model_call_dtl": "モデルコールイベントテーブル",
470+
"mid_model_call_dtl": "モデルのコストと性能",
471471
"user_role_infos": {
472472
"role_id": "ロールID",
473473
"role_name": "ロール名"
@@ -482,7 +482,7 @@
482482
"model_call_success_rate": "モデルコール成功率",
483483
"max_concurrent_llm_sessions": "最大LLM同時実行数",
484484
"avg_first_token_cost_time": "平均初回Token応答遅延",
485-
"mid_user_interact_dtl": "ユーザーフィードバック指標テーブル",
485+
"mid_user_interact_dtl": "ユーザーフィードバック統計",
486486
"like_count": "いいね回数",
487487
"dislike_count": "ネガティブ評価回数",
488488
"copy_count": "コピー回数"

src/frontend/platform/public/locales/zh-Hans/dashboard.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@
387387
"metricCard": "指标卡"
388388
},
389389

390-
"mid_user_increment": "用户行为指标表",
390+
"mid_user_increment": "用户规模统计",
391391
"timestamp": {
392392
"year": "时间(年)",
393393
"month": "时间(月)",
@@ -401,41 +401,41 @@
401401
},
402402
"total_user_count": "总用户数",
403403
"new_user_count": "新增用户数",
404-
"mid_active_user": "活跃用户表",
404+
"mid_active_user": "活跃用户规模统计",
405405
"active_user_count": "活跃用户数",
406-
"mid_app_increment": "应用数量表",
406+
"mid_app_increment": "应用规模统计",
407407
"user_id": "用户ID",
408408
"user_name": "用户名称",
409409
"app_type": "应用类型",
410410
"total_app_count": "总应用数",
411411
"new_app_count": "新增应用数",
412-
"mid_sessions_increment": "会话数量表",
412+
"mid_sessions_increment": "应用使用情况统计",
413413
"app_id": "应用ID",
414414
"app_name": "应用名称",
415415
"source": "来源类型(平台/API)",
416416
"session_count": "会话次数",
417417
"platform_user_count": "使用人数",
418418
"api_call_count": "API调用次数",
419-
"mid_session_run_dtl": "会话运行时长表",
419+
"mid_session_run_dtl": "应用并发与耗时",
420420
"duration_seconds": "会话运行时长",
421421
"max_concurrent_sessions": "最大同时在线会话数",
422-
"mid_tool_call_dtl": "工具调用时长表",
422+
"mid_tool_call_dtl": "工具调用分析",
423423
"tool_name": "工具名称",
424424
"tool_id": "工具ID",
425425
"tool_type": "工具类型",
426426
"tool_call_count": "工具调用次数",
427427
"tool_call_success_count": "工具调用成功次数",
428428
"tool_call_success_rate": "工具调用成功率",
429-
"mid_knowledge_increment": "知识库存量表",
429+
"mid_knowledge_increment": "知识库规模统计",
430430
"total_document_knowledge_base_count": "总文档知识库数",
431431
"total_qa_knowledge_base_count": "总QA知识库数",
432432
"new_document_knowledge_base_count": "新增文档知识库数",
433433
"new_qa_knowledge_base_count": "新增QA知识库数",
434-
"mid_knowledge_file_increment": "知识库文件存量表",
434+
"mid_knowledge_file_increment": "知识库文件统计",
435435
"total_file_count": "总文件数",
436436
"total_qa_count": "总QA对数",
437437
"file_size": "文件大小",
438-
"mid_doc_parse_dtl": "文件解析事件表",
438+
"mid_doc_parse_dtl": "文件解析效能",
439439
"parse_type": "解析类型",
440440
"status": "文件最终状态",
441441
"doc_parse_count": "文档上传次数",
@@ -444,7 +444,7 @@
444444
"etl_parse_count": "ETL处理次数",
445445
"etl_parse_success_count": "ETL处理成功次数",
446446
"etl_parse_success_rate": "ETL处理成功率",
447-
"mid_model_call_dtl": "模型调用事件表",
447+
"mid_model_call_dtl": "模型成本与性能",
448448
"user_role_infos": {
449449
"role_id": "角色ID",
450450
"role_name": "角色名称"
@@ -459,7 +459,7 @@
459459
"model_call_success_rate": "模型调用成功率",
460460
"max_concurrent_llm_sessions": "最大LLM并发数",
461461
"avg_first_token_cost_time": "平均首Token响应延迟",
462-
"mid_user_interact_dtl": "用户反馈指标表",
462+
"mid_user_interact_dtl": "用户反馈统计",
463463
"like_count": "点赞次数",
464464
"dislike_count": "点踩次数",
465465
"copy_count": "复制次数"

src/frontend/platform/src/components/bs-ui/calendar/datePicker.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ export function DatePicker({
311311
})
312312
const [open, setOpen] = useState(false)
313313

314+
const isInternalChangeRef = useRef(false)
315+
314316
const dateStr = useMemo(() => {
315317
if (!date) return ''
316318
const mergedDate = new Date(date)
@@ -323,9 +325,14 @@ export function DatePicker({
323325
}, [date, time, showTime, dateFormat])
324326

325327
useEffect(() => {
328+
if (isInternalChangeRef.current) {
329+
isInternalChangeRef.current = false
330+
return
331+
}
332+
326333
const parsed = parseDate(value)
327-
console.log('Parsed date:', parsed)
328334
setDate(parsed)
335+
329336
if (showTime && parsed) {
330337
setTime({
331338
hour: parsed.getHours(),
@@ -335,6 +342,7 @@ export function DatePicker({
335342
}
336343
}, [value, showTime])
337344

345+
338346
const handleTimeChange = useCallback((newTime: { hour: number; minute: number; second: number }) => {
339347
setTime(newTime)
340348
}, [])
@@ -352,6 +360,7 @@ export function DatePicker({
352360
} else {
353361
mergedDate.setHours(0, 0, 0, 0)
354362
}
363+
isInternalChangeRef.current = true
355364
onChange?.(mergedDate)
356365
}
357366

src/frontend/platform/src/pages/Dashboard/colorSchemes.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,15 +528,15 @@ export const getDefaultMetricStyle = (title, subtitle) => ({
528528
"titleUnderline": false,
529529
subtitle,
530530
"subtitleFontSize": 14,
531-
"subtitleColor": "#666",
531+
"subtitleColor": "#000000",
532532
"subtitleAlign": "left",
533533
"subtitleBold": false,
534534
"subtitleItalic": false,
535535
"subtitleUnderline": false,
536-
"metricFontSize": 28,
537-
"metricColor": "#4882f6",
538-
"metricAlign": "end",
539-
"metricBold": true,
536+
"metricFontSize": 14,
537+
"metricColor": "#000000",
538+
"metricAlign": "left",
539+
"metricBold": false,
540540
"metricItalic": false,
541541
"metricUnderline": false,
542542
})

src/frontend/platform/src/pages/Dashboard/components/config/ComponentConfigDrawer.tsx

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ const FULL_DEFAULT_STYLE_CONFIG: ComponentStyleConfig = {
2929
bgColor: "",
3030

3131
title: "",
32-
titleFontSize: 16,
33-
titleBold: true,
32+
titleFontSize: 14,
33+
titleBold: false,
3434
titleItalic: false,
3535
titleUnderline: false,
3636
titleStrikethrough: false,
3737
titleAlign: "left",
38-
titleColor: "",
38+
titleColor: "#000000",
3939

4040
xAxisTitle: "",
4141
xAxisFontSize: 14,
@@ -56,13 +56,13 @@ const FULL_DEFAULT_STYLE_CONFIG: ComponentStyleConfig = {
5656
yAxisColor: "#000000",
5757

5858
legendPosition: "bottom",
59-
legendFontSize: 12,
59+
legendFontSize: 14,
6060
legendBold: false,
6161
legendItalic: false,
6262
legendUnderline: false,
6363
legendStrikethrough: false,
6464
legendAlign: "left",
65-
legendColor: "#999",
65+
legendColor: "#000000",
6666

6767
showSubtitle: false,
6868
subtitle: "",
@@ -72,7 +72,7 @@ const FULL_DEFAULT_STYLE_CONFIG: ComponentStyleConfig = {
7272
subtitleItalic: false,
7373
subtitleUnderline: false,
7474
subtitleAlign: "center",
75-
subtitleColor: "",
75+
subtitleColor: "#000000",
7676

7777
metricFontSize: 14,
7878
metricBold: false,
@@ -833,7 +833,14 @@ export function ComponentConfigDrawer() {
833833
const isCurrentChartStacked = currentChartHasStack;
834834

835835
let updatedDataConfig = { ...dataConfig };
836-
836+
if (isMetricChart) {
837+
updatedDataConfig = {
838+
...updatedDataConfig,
839+
stackDimension: undefined,
840+
dimensions: updatedDataConfig.dimensions || [],
841+
metrics: updatedDataConfig.metrics[0] ? [updatedDataConfig.metrics[0]] : []
842+
}
843+
}
837844
// 处理堆叠维度
838845
if (isCurrentChartStacked && !isNewChartStacked) {
839846
// 从堆叠图切换到非堆叠图:移除堆叠维度配置
@@ -847,12 +854,18 @@ export function ComponentConfigDrawer() {
847854
// 从非堆叠图切换到堆叠图:清空堆叠维度
848855
updatedDataConfig = {
849856
...updatedDataConfig,
850-
stackDimension: undefined, // 清空堆叠维度
857+
stackDimension: undefined,
851858
dimensions: updatedDataConfig.dimensions || [],
852859
metrics: updatedDataConfig.metrics || []
853860
};
854861
}
855862
if (data.type === 'metric') {
863+
const firstMetric = valueDimensions[0] ? { ...valueDimensions[0] } : null;
864+
865+
// 更新 chartState
866+
chartState.setValueDimensions(firstMetric ? [firstMetric] : []);
867+
chartState.setCategoryDimensions([]);
868+
chartState.setStackDimensions([]);
856869
updateEditingComponent({
857870
type: data.type,
858871
data_config: updatedDataConfig,
@@ -877,6 +890,7 @@ export function ComponentConfigDrawer() {
877890

878891
// 刷新图表
879892
refreshChart(editingComponent.id);
893+
880894
}
881895
}} maxHeight={400}>
882896
<div className="relative w-full group">

0 commit comments

Comments
 (0)