Skip to content

Commit 5e07ded

Browse files
committed
fix: polish login page status text
1 parent 15dcb37 commit 5e07ded

3 files changed

Lines changed: 5 additions & 29 deletions

File tree

pages/login/app.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ const text = isEnglish
66
? {
77
title: "OpenAI subscription login",
88
intro: "Authorize with a ChatGPT device code. Credentials stay on the AstrBot server.",
9-
warning:
10-
"This Dashboard is using plain HTTP. The Dashboard session may be intercepted; HTTPS, a VPN, or an SSH tunnel is recommended.",
119
accountTitle: "Account status",
1210
checkUsage: "Check quota",
1311
checkingUsage: "Checking quota…",
@@ -49,8 +47,6 @@ const text = isEnglish
4947
: {
5048
title: "OpenAI 订阅登录",
5149
intro: "使用 ChatGPT 设备码完成授权,凭据会由 AstrBot 服务端保存。",
52-
warning:
53-
"当前 Dashboard 使用明文 HTTP,会话可能被网络窃听;建议为整个 Dashboard 使用 HTTPS、VPN 或 SSH 隧道。",
5450
accountTitle: "账号状态",
5551
checkUsage: "查询额度",
5652
checkingUsage: "正在查询额度……",
@@ -123,12 +119,6 @@ usageButton.textContent = text.checkUsage;
123119
startButton.textContent = text.start;
124120
cancelButton.textContent = text.cancel;
125121

126-
if (window.location.protocol === "http:") {
127-
const warning = byId("transport-warning");
128-
warning.hidden = false;
129-
warning.querySelector("span").textContent = text.warning;
130-
}
131-
132122
function setStatus(message) {
133123
status.textContent = message;
134124
error.hidden = true;
@@ -171,7 +161,11 @@ function formatReset(timestamp) {
171161
if (!Number.isFinite(value) || value <= 0) {
172162
return "";
173163
}
174-
return ` · ${text.reset} ${new Date(value * 1000).toLocaleString()}`;
164+
const date = new Date(value * 1000);
165+
if (isEnglish) {
166+
return ` · ${text.reset} ${date.toLocaleString()}`;
167+
}
168+
return ` · 将于 ${date.toLocaleString("zh-CN", { hour12: false })} 重置`;
175169
}
176170

177171
function renderAccountStatus(result) {

pages/login/index.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
<h1 id="title">OpenAI 订阅登录</h1>
1313
<p id="intro">使用 ChatGPT 设备码完成授权,凭据会由 AstrBot 服务端保存。</p>
1414

15-
<div id="transport-warning" class="warning" role="alert" hidden>
16-
<strong>当前 Dashboard 使用明文 HTTP。</strong>
17-
<span>Dashboard 会话可能被网络窃听;建议为整个 Dashboard 使用 HTTPS、VPN 或 SSH 隧道。</span>
18-
</div>
19-
2015
<section class="account" aria-live="polite">
2116
<h2 id="account-title">账号状态</h2>
2217
<p id="account-status" class="status"></p>

pages/login/style.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,6 @@ button:disabled {
4242
opacity: 0.6;
4343
}
4444

45-
.warning {
46-
margin: 20px 0;
47-
padding: 14px 16px;
48-
border: 2px solid #d97706;
49-
border-radius: 10px;
50-
background: color-mix(in srgb, #f59e0b 18%, transparent);
51-
}
52-
53-
.warning strong,
54-
.warning span {
55-
display: block;
56-
}
57-
5845
section {
5946
margin-top: 24px;
6047
}

0 commit comments

Comments
 (0)