diff --git a/app/(admin)/settings/admin-settings-client.tsx b/app/(admin)/settings/admin-settings-client.tsx
index ccc572573..cf482f75b 100644
--- a/app/(admin)/settings/admin-settings-client.tsx
+++ b/app/(admin)/settings/admin-settings-client.tsx
@@ -1445,6 +1445,8 @@ type RuntimeModelCandidate = RuntimeModelMeta & {
};
const analyticsNumberFormatter = new Intl.NumberFormat("zh-CN");
+const UUID_LIKE_REGEX =
+ /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
function scoreRuntimeModelCandidate(candidate: RuntimeModelCandidate) {
return (
@@ -1511,6 +1513,17 @@ function formatAnalyticsMonthLabel(value: string) {
return `${year} 年 ${month} 月`;
}
+function formatAnalyticsModelLabel(
+ meta: RuntimeModelMeta | null | undefined,
+ modelId: string | null | undefined
+) {
+ if (meta?.modelName) return meta.modelName;
+ const normalizedModelId = String(modelId || "").trim();
+ if (!normalizedModelId) return "未知模型";
+ if (UUID_LIKE_REGEX.test(normalizedModelId)) return "未映射模型";
+ return normalizedModelId;
+}
+
const AVAILABLE_TOOLS = [
{ name: "getWeather", description: "获取天气信息" },
{ name: "createDocument", description: "创建文档" },
@@ -1851,7 +1864,7 @@ export function AdminSettingsClient() {
(modelsData?.models || []).forEach((model) => {
const providerMeta = providerMetaById.get(model.providerId);
- candidates.push({
+ const sharedMeta = {
modelId: model.modelId,
modelName: model.displayName,
providerName: providerMeta?.providerName || null,
@@ -1861,6 +1874,11 @@ export function AdminSettingsClient() {
isDefault: model.isDefault,
isSubModel: model.isSubModel,
sortOrder: model.sortOrder,
+ };
+ candidates.push(sharedMeta);
+ candidates.push({
+ ...sharedMeta,
+ modelId: model.id,
});
});
@@ -8821,12 +8839,13 @@ export function AdminSettingsClient() {
- {resolveRuntimeModelMeta(
- runtimeModelMetaById,
+ {formatAnalyticsModelLabel(
+ resolveRuntimeModelMeta(
+ runtimeModelMetaById,
+ selectedImage.modelId
+ ),
selectedImage.modelId
- ).modelName ||
- selectedImage.modelId ||
- "未知"}
+ )}
{selectedImage.recordType !== "video" ? (
@@ -8967,83 +8986,80 @@ export function AdminSettingsClient() {
{/* 🆕 数据分析 */}
-
-
-
-
-
- analytics overview
+
+
+
+
+ analytics overview
+
+
+
+
+ 生成与运营总览
+
+
+ 统一展示生成规模、活跃用户、趋势波动、模型分布和分辨率结构。
+
-
-
-
- 生成与运营总览
-
-
- 当前面板聚合最近 30 天趋势、当日峰值时段和模型使用分布。
- {selectedDate
- ? ` 当前已锁定 ${selectedDate} 的小时分布。`
- : " 点击趋势柱可联动查看某一天的小时明细。"}
-
-
-
-
- {formatAnalyticsMonthLabel(selectedMonth)}
- {selectedDate ? (
-
- {selectedDate}
-
- ) : null}
-
+
+
+ {formatAnalyticsMonthLabel(selectedMonth)}
+ {selectedDate ? (
+
+ {selectedDate}
+
+ ) : null}
-
-
-
- {analyticsOverviewCards.map((item) => {
- const Icon = item.icon;
- return (
-
-
-
-
- {item.label}
-
-
- {item.value}
-
+
+
+
+
+ {analyticsOverviewCards.map((item) => {
+ const Icon = item.icon;
+ return (
+
+
+
+
+ {item.label}
-
-
- );
- })}
-
-
-
+
+ {item.note}
+
+
+ );
+ })}
+
+
+
-
-
-
- filters & pulse
-
- 时间筛选与月度脉冲
-
- 用月份控制本月指标卡,并通过日期联动小时分布。
-
-
-
+
+
+
+ filters & pulse
+
+ 统计筛选与核心信号
+
+ 保留月份筛选,同时把高峰时段、领先模型和最近月度走势铺满在同一块工作区里。
+
+
+
+
-
-
-
-
- 高峰时段
-
-
- {analyticsPeakHour
- ? `${String(analyticsPeakHour.hour).padStart(2, "0")}:00`
- : "--:--"}
-
-
- {analyticsPeakHour
- ? `${formatAnalyticsNumber(analyticsPeakHour.count)} 次生成`
- : "暂无小时数据"}
-
+
+
+
+ 高峰时段
+
+ {analyticsPeakHour
+ ? `${String(analyticsPeakHour.hour).padStart(2, "0")}:00`
+ : "--:--"}
+
+
+ {analyticsPeakHour
+ ? `${formatAnalyticsNumber(analyticsPeakHour.count)} 次生成`
+ : "暂无小时数据"}
+
+
-
-
-
- 领先模型
-
-
- {resolveRuntimeModelMeta(
+
+
+
+ 领先模型
+
+
+ {formatAnalyticsModelLabel(
+ resolveRuntimeModelMeta(
runtimeModelMetaById,
analyticsData?.modelDetailStats?.[0]?.modelId || null
- ).modelName ||
- analyticsData?.modelDetailStats?.[0]?.modelId ||
- "暂无"}
-
-
- {analyticsData?.modelDetailStats?.[0]
- ? `${formatAnalyticsNumber(
- analyticsData.modelDetailStats[0].count
- )} 次调用`
- : "还没有模型统计结果"}
-
+ ),
+ analyticsData?.modelDetailStats?.[0]?.modelId || null
+ )}
+
+
+ {analyticsData?.modelDetailStats?.[0]
+ ? `${formatAnalyticsNumber(
+ analyticsData.modelDetailStats[0].count
+ )} 次调用`
+ : "还没有模型统计结果"}
-
-
+
+
recent months
-
- {analyticsRecentMonths.map((stat) => (
+
+ {analyticsRecentMonths.slice(-3).map((stat) => (
- {stat.month}
+ {stat.month.slice(5)}
-
+
{formatAnalyticsNumber(stat.count)}
))}
-
-
-
+
+
+
-
-
-
-
-
- throughput
-
-
生成节奏
-
- 左侧看最近 30 天总量,右侧看
- {selectedDate ? ` ${selectedDate} ` : "当前选择日期 "}
- 的小时分布。
-
-
- {selectedDate ? (
-