{isZh ? '总计' : 'Total'}
{isZh ? '时间 / 来源' : 'Time / Source'}
+ {!pageSizeReady ? (
+ {isZh ? '正在同步分页设置...' : 'Syncing page size...'}
+ ) : null}
{usageItems.map((item) => (
@@ -644,35 +686,37 @@ export function PlatformDashboardPage({ compactMode }: PlatformDashboardPageProp
))}
- {!usageLoading && usageItems.length === 0 ? (
+ {pageSizeReady && !usageLoading && usageItems.length === 0 ? (
{isZh ? '暂无请求用量数据。' : 'No usage records yet.'}
) : null}
-
-
{isZh ? `第 ${usagePage} / ${usagePageCount} 页,共 ${usageTotal} 条` : `Page ${usagePage} / ${usagePageCount}, ${usageTotal} rows`}
-
-
void loadUsage(usagePage - 1)}
- tooltip={isZh ? '上一页' : 'Previous'}
- aria-label={isZh ? '上一页' : 'Previous'}
- >
-
-
-
= usagePageCount}
- onClick={() => void loadUsage(usagePage + 1)}
- tooltip={isZh ? '下一页' : 'Next'}
- aria-label={isZh ? '下一页' : 'Next'}
- >
-
-
+ {pageSizeReady ? (
+
+
{isZh ? `第 ${usagePage} / ${usagePageCount} 页,共 ${usageTotal} 条` : `Page ${usagePage} / ${usagePageCount}, ${usageTotal} rows`}
+
+ void loadUsage(usagePage - 1)}
+ tooltip={isZh ? '上一页' : 'Previous'}
+ aria-label={isZh ? '上一页' : 'Previous'}
+ >
+
+
+ = usagePageCount}
+ onClick={() => void loadUsage(usagePage + 1)}
+ tooltip={isZh ? '下一页' : 'Next'}
+ aria-label={isZh ? '下一页' : 'Next'}
+ >
+
+
+
-
+ ) : null}
);
@@ -720,7 +764,10 @@ export function PlatformDashboardPage({ compactMode }: PlatformDashboardPageProp
- {pagedBots.map((bot) => {
+ {!pageSizeReady ? (
+
{isZh ? '正在同步分页设置...' : 'Syncing page size...'}
+ ) : null}
+ {pageSizeReady ? pagedBots.map((bot) => {
const enabled = bot.enabled !== false;
const running = bot.docker_status === 'RUNNING';
const selected = bot.id === selectedBotId;
@@ -772,36 +819,38 @@ export function PlatformDashboardPage({ compactMode }: PlatformDashboardPageProp
);
- })}
- {filteredBots.length === 0 ? (
+ }) : null}
+ {pageSizeReady && filteredBots.length === 0 ? (
{isZh ? '暂无 Bot,或当前搜索没有结果。' : 'No bots found, or the current search returned no results.'}
) : null}
-
-
{isZh ? `第 ${botListPage} / ${botListPageCount} 页,共 ${filteredBots.length} 个 Bot` : `Page ${botListPage} / ${botListPageCount}, ${filteredBots.length} bots`}
-
-
setBotListPage((value) => Math.max(1, value - 1))}
- tooltip={isZh ? '上一页' : 'Previous'}
- aria-label={isZh ? '上一页' : 'Previous'}
- >
-
-
-
= botListPageCount}
- onClick={() => setBotListPage((value) => Math.min(botListPageCount, value + 1))}
- tooltip={isZh ? '下一页' : 'Next'}
- aria-label={isZh ? '下一页' : 'Next'}
- >
-
-
+ {pageSizeReady ? (
+
+
{isZh ? `第 ${botListPage} / ${botListPageCount} 页,共 ${filteredBots.length} 个 Bot` : `Page ${botListPage} / ${botListPageCount}, ${filteredBots.length} bots`}
+
+ setBotListPage((value) => Math.max(1, value - 1))}
+ tooltip={isZh ? '上一页' : 'Previous'}
+ aria-label={isZh ? '上一页' : 'Previous'}
+ >
+
+
+ = botListPageCount}
+ onClick={() => setBotListPage((value) => Math.min(botListPageCount, value + 1))}
+ tooltip={isZh ? '下一页' : 'Next'}
+ aria-label={isZh ? '下一页' : 'Next'}
+ >
+
+
+
-
+ ) : null}
{!compactMode ? (