{t('模型数据分析')}
+
+ {t('图表显示设置')}
+
+ {availableTabs.map((tab) => (
+
+ {t(tab.label)}
+
+ ))}
+
+ {userTabs && (
+
+ )}
+
+ }
+ trigger='click'
+ position='bottomLeft'
+ >
+ }
+ size='small'
+ type='tertiary'
+ theme='borderless'
+ aria-label={t('图表显示设置')}
+ className='text-gray-400 hover:text-gray-600'
+ />
+
- {t('消耗分布')}} itemKey='1' />
- {t('调用趋势')}} itemKey='2' />
- {t('调用次数分布')}} itemKey='3' />
- {t('调用次数排行')}} itemKey='4' />
- {isAdminUser && (
- {t('用户消耗排行')}} itemKey='5' />
- )}
- {isAdminUser && (
- {t('用户消耗趋势')}} itemKey='6' />
- )}
+ {visibleTabs.map((tab) => (
+ {t(tab.label)}}
+ itemKey={tab.key}
+ />
+ ))}
}
bodyStyle={{ padding: 0 }}
>
- {activeChartTab === '1' && (
-
- )}
- {activeChartTab === '2' && (
-
- )}
- {activeChartTab === '3' && (
-
- )}
- {activeChartTab === '4' && (
-
- )}
- {activeChartTab === '5' && isAdminUser && (
-
- )}
- {activeChartTab === '6' && isAdminUser && (
-
- )}
+ {visibleTabs.map((tab) => {
+ if (activeChartTab !== tab.key) return null;
+ const specKey = SPEC_MAP[tab.key];
+ return (
+
+ );
+ })}
);
diff --git a/web/classic/src/components/dashboard/index.jsx b/web/classic/src/components/dashboard/index.jsx
index 811e23ca760f..bf5d27869357 100644
--- a/web/classic/src/components/dashboard/index.jsx
+++ b/web/classic/src/components/dashboard/index.jsx
@@ -194,8 +194,11 @@ const Dashboard = () => {
spec_model_line={dashboardCharts.spec_model_line}
spec_pie={dashboardCharts.spec_pie}
spec_rank_bar={dashboardCharts.spec_rank_bar}
+ spec_token_bar={dashboardCharts.spec_token_bar}
spec_user_rank={dashboardCharts.spec_user_rank}
spec_user_trend={dashboardCharts.spec_user_trend}
+ spec_user_token_rank={dashboardCharts.spec_user_token_rank}
+ spec_user_token_trend={dashboardCharts.spec_user_token_trend}
isAdminUser={dashboardData.isAdminUser}
CARD_PROPS={CARD_PROPS}
CHART_CONFIG={CHART_CONFIG}
diff --git a/web/classic/src/components/dashboard/modals/SearchModal.jsx b/web/classic/src/components/dashboard/modals/SearchModal.jsx
index f619831dccbb..1632b0665ff1 100644
--- a/web/classic/src/components/dashboard/modals/SearchModal.jsx
+++ b/web/classic/src/components/dashboard/modals/SearchModal.jsx
@@ -42,7 +42,7 @@ const SearchModal = ({