feat: unify account environments and work collection

This commit is contained in:
2026-10-06 13:00:29 +08:00
parent b72727451d
commit 950b23da32
22 changed files with 935 additions and 93 deletions
+9 -1
View File
@@ -185,7 +185,15 @@ export default function Page() {
const worksCollection = collectionStatus?.works;
const worksMeta = collectionStatusMeta[worksCollection?.status ?? 'pending'] || { label: worksCollection?.status || '待采集' };
const latestMetric = accountMetrics.length ? accountMetrics[accountMetrics.length - 1] : null;
// 与列表一致:某轮缺少字段时保留该字段最近一次实际采集的值。
const latestMetric = accountMetrics.reduce<Record<string, number>>((counts, metric) => {
for (const { key } of accountSeriesMeta) {
if (metric[key] != null) counts[key] = metric[key];
}
return counts;
}, {});
// 作品总数不受曲线查询最近 100 条记录的范围限制。
if (collectionStatus?.aweme_count != null) latestMetric.aweme_count = collectionStatus.aweme_count;
// 账号状态卡局部操作:启动/暂停两态开关留在状态卡右上角(Card extra),不进页头槽。
const paused = account.runtime_status === 'paused';