fix(quota): show all Z.ai usage windows

This commit is contained in:
Bohdan Triapitsyn
2026-07-30 00:05:52 +03:00
parent f29e138556
commit 34aefb731b
6 changed files with 122 additions and 18 deletions
@@ -34,8 +34,12 @@ export const normalizeTimestamp = (value) => {
return value < 1_000_000_000_000 ? value * 1000 : value;
};
const ZAI_TOKEN_WINDOW_SECONDS = {
3: 60 * 60,
6: 7 * 24 * 60 * 60
};
export const resolveWindowSeconds = (limit) => {
const ZAI_TOKEN_WINDOW_SECONDS = { 3: 3600 };
if (!limit || !limit.number) return null;
const unitSeconds = ZAI_TOKEN_WINDOW_SECONDS[limit.unit];
if (!unitSeconds) return null;