Provide authenticated IP HTTPS access and clarify server UI

This commit is contained in:
Codex
2026-10-11 19:34:20 +08:00
parent 4b62c33ed9
commit fcdf6f27f2
5 changed files with 49 additions and 11 deletions
+13 -9
View File
@@ -195,6 +195,7 @@ export default function App() {
const [tab, setTab] = useState<Tab>("overview");
const [overview, setOverview] = useState<Overview | null>(null);
const [majors, setMajors] = useState<Major[]>([]);
const [serverMode, setServerMode] = useState(false);
const [version, setVersion] = useState(0);
const [notice, setNotice] = useState<{
message: string;
@@ -210,10 +211,12 @@ export default function App() {
Promise.all([
api<Overview>("/overview", { signal: controller.signal }),
api<Major[]>("/majors", { signal: controller.signal }),
api<{ platform: string }>("/health", { signal: controller.signal }),
])
.then(([o, m]) => {
.then(([o, m, health]) => {
setOverview(o);
setMajors(m);
setServerMode(health.platform === "linux");
})
.catch((e) => {
if (e.name !== "AbortError") notify(e.message, true);
@@ -247,7 +250,7 @@ export default function App() {
<small>考研数据工作台</small>
</span>
</a>
<div className="nav-label">WORKSPACE / 本地工作区</div>
<div className="nav-label">WORKSPACE / {serverMode ? "服务器工作区" : "本地工作区"}</div>
<nav aria-label="主导航">
{NAV.map((n) => (
<button
@@ -263,7 +266,7 @@ export default function App() {
</nav>
<div className="sidebar-bottom">
<div className="local-indicator">
<span /> 本机数据 · 独立保存
<span /> {serverMode ? "服务器数据 · 持续保存" : "本机数据 · 独立保存"}
</div>
<p>
把全国目录与历年考情
@@ -283,7 +286,7 @@ export default function App() {
</div>
<div className="topbar-right">
<span className="local-tag">
<ShieldCheck size={14} /> 本地运行
<ShieldCheck size={14} /> {serverMode ? "服务器运行" : "本地运行"}
</span>
<button
className="icon-button"
@@ -303,7 +306,7 @@ export default function App() {
</main>
<footer>
研途 · 数据以院校当年招生简章为准
<span>全国招生目录 / 历年考情 / 本地工作区</span>
<span>全国招生目录 / 历年考情 / {serverMode ? "服务器工作区" : "本地工作区"}</span>
</footer>
</div>
{notice && (
@@ -1754,7 +1757,7 @@ function ProxyPanel({ notify }: { notify: Notify }) {
</section>
<section className="card pool-controls">
<div className="card-title">
<h2>本机代理池服务</h2>
<h2>{services?.manager === "systemd" ? "服务器代理池服务" : "本机代理池服务"}</h2>
<Badge tone={services?.api_ready ? "green" : ""}>
{services
? services.api_ready
@@ -1763,7 +1766,7 @@ function ProxyPanel({ notify }: { notify: Notify }) {
: "正在查询"}
</Badge>
</div>
<p>查看 API、代理抓取与检测、Redis 的运行状态,管理本机服务。</p>
<p>查看 API、代理抓取与检测、Redis 的运行状态,管理{services?.manager === "systemd" ? "服务器" : "本机"}服务。</p>
{services && (
<ul className="pool-service-list">
{services.items.map((service) => (
@@ -2154,8 +2157,9 @@ function SettingsPanel({ notify }: { notify: Notify }) {
</button>
</div>
<div className="info-box">
Cookie 由当前 Windows 用户的 DPAPI
加密,保存在项目的本地数据目录中,导出文件不包含凭据。
{auth?.browser_supported === false
? "Cookie 加密保存在服务器的数据目录中,导出文件不包含凭据。"
: "Cookie 由当前 Windows 用户的 DPAPI 加密,保存在项目的本地数据目录中,导出文件不包含凭据。"}
</div>
</section>
</div>
+1
View File
@@ -113,6 +113,7 @@ export type Proxy = {
proxies: { url: string; failed: boolean; active: boolean }[];
};
export type PoolServiceStatus = {
manager?: string;
api_ready: boolean;
items: {
name: string;