mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 08:02:53 +00:00
fix(webui): drop the zero timestamp from the quota catalog line
An unset catalog timestamp is the Go zero time; format it as a "not ready" placeholder instead of rendering 0001-01-01.
This commit is contained in:
1 file changed
+5
-1
@@ -78,7 +78,11 @@ function render() {
|
||||
const models = allModels.filter((model) => model.id.toLowerCase().includes(query));
|
||||
$("#quota-model-count").textContent = `${models.length} / ${allModels.length}`;
|
||||
const catalog = data.catalog;
|
||||
$("#quota-catalog-status").textContent = `${catalog?.stale ? "模型目录暂未更新,显示缓存 · " : ""}目录更新时间:${localTime(catalog?.updated_at)}`;
|
||||
const catalogUpdated =
|
||||
catalog?.updated_at && !catalog.updated_at.startsWith("0001-")
|
||||
? localTime(catalog.updated_at)
|
||||
: "尚未就绪";
|
||||
$("#quota-catalog-status").textContent = `${catalog?.stale ? "模型目录暂未更新,显示缓存 · " : ""}目录更新时间:${catalogUpdated}`;
|
||||
const host = $("#quota-models");
|
||||
host.replaceChildren();
|
||||
for (const model of models) {
|
||||
|
||||
Reference in new issue
Block a user