From 77aaf517aa57b6d44b68e9ed816fbc8974b69089 Mon Sep 17 00:00:00 2001 From: XianYuDaXian Date: Tue, 10 Mar 2026 07:06:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E9=A2=9D=E5=BA=A6?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E5=A4=B1=E6=95=88=E6=8F=90=E7=A4=BA=E5=B9=B6?= =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=9B=9E=E9=80=80=E5=88=B0=20uv=20run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/admin/pages/token.html | 2 +- app/static/common/js/toast.js | 69 ------------------------------- 2 files changed, 1 insertion(+), 70 deletions(-) diff --git a/app/static/admin/pages/token.html b/app/static/admin/pages/token.html index 73dd16b..96ce0a9 100644 --- a/app/static/admin/pages/token.html +++ b/app/static/admin/pages/token.html @@ -81,7 +81,7 @@
Image 剩余
-
无法统计
+
-
Video 剩余
diff --git a/app/static/common/js/toast.js b/app/static/common/js/toast.js index c41e6e2..0d148e2 100644 --- a/app/static/common/js/toast.js +++ b/app/static/common/js/toast.js @@ -46,72 +46,3 @@ function showToast(message, type = 'success') { }, 3000); } -(function showRateLimitNoticeOnce() { - const noticeKey = 'grok2api_rate_limits_notice_v1'; - const noticeText = 'GROK 官方网页更新后未真实暴露 rate-limits 接口,导致无法准确计算 Token 剩余,请耐心等待官方接口上线,目前自动刷新后会更新为 8 次'; - const path = window.location.pathname || ''; - - if (!path.startsWith('/admin') || path.startsWith('/admin/login')) { - return; - } - - try { - if (localStorage.getItem(noticeKey)) { - return; - } - } catch (e) { - // If storage is blocked, keep showing dialog. - } - - const show = () => { - const backdrop = document.createElement('div'); - backdrop.className = 'notice-dialog-backdrop'; - - const dialog = document.createElement('div'); - dialog.className = 'notice-dialog'; - dialog.setAttribute('role', 'dialog'); - dialog.setAttribute('aria-modal', 'true'); - - const title = document.createElement('div'); - title.className = 'notice-dialog-title'; - title.textContent = '提示'; - - const content = document.createElement('div'); - content.className = 'notice-dialog-content'; - content.textContent = noticeText; - - const actions = document.createElement('div'); - actions.className = 'notice-dialog-actions'; - - const confirmBtn = document.createElement('button'); - confirmBtn.type = 'button'; - confirmBtn.className = 'notice-dialog-confirm'; - confirmBtn.textContent = '我知道了'; - - actions.appendChild(confirmBtn); - dialog.appendChild(title); - dialog.appendChild(content); - dialog.appendChild(actions); - backdrop.appendChild(dialog); - document.body.appendChild(backdrop); - - const prevOverflow = document.body.style.overflow; - document.body.style.overflow = 'hidden'; - - confirmBtn.addEventListener('click', () => { - try { - localStorage.setItem(noticeKey, '1'); - } catch (e) { - // ignore - } - document.body.style.overflow = prevOverflow; - backdrop.remove(); - }); - }; - - if (document.readyState === 'loading') { - document.addEventListener('DOMContentLoaded', show); - } else { - show(); - } -})();