Add Debian deployment, MariaDB storage and randomized proxy routing

This commit is contained in:
Codex
2026-10-11 19:07:27 +08:00
parent 2e3439dbb9
commit 915241a2fd
27 changed files with 896 additions and 32 deletions
+25 -5
View File
@@ -1713,6 +1713,11 @@ function ProxyPanel({ notify }: { notify: Notify }) {
? "代理池暂无可用 IP,优先代理模式已回退直连。"
: "登录、招生目录和历年考情共用该路由。"}
</p>
<p className="form-hint">
当前代理已成功请求 {data?.route_requests || 0} 次 · 已切换 {data?.rotations || 0} 次
{data?.rotate_every ? ` · 每 ${data.rotate_every} 次自动轮换` : " · 连接失败或手动切换时轮换"}
{data?.last_request_route && ` · 最近成功请求:${data.last_request_route === "direct" ? "直连" : data.last_request_route}`}
</p>
</div>
</div>
<Badge tone={data?.fallback ? "amber" : "green"}>
@@ -1972,7 +1977,7 @@ function SettingsPanel({ notify }: { notify: Notify }) {
</label>
<div className="three-fields">
<label>
请求间隔(秒)
请求间隔下限(秒)
<input
type="number"
min="0.3"
@@ -1984,6 +1989,18 @@ function SettingsPanel({ notify }: { notify: Notify }) {
}
/>
</label>
<label>
请求间隔上限(秒)
<input type="number" min={config.request_interval} max="60" step="0.1"
value={config.request_interval_max}
onChange={(e) => update("request_interval_max", Number(e.target.value))} />
</label>
<label>
自动轮换代理(请求次数)
<input type="number" min="0" max="100000" step="1"
value={config.proxy_rotate_every}
onChange={(e) => update("proxy_rotate_every", Number(e.target.value))} />
</label>
<label>
超时(秒)
<input
@@ -2005,6 +2022,7 @@ function SettingsPanel({ notify }: { notify: Notify }) {
/>
</label>
</div>
<p className="form-hint">每次请求随机取上下限之间的间隔;两者相等时固定。轮换次数填 0 可关闭自动轮换;登录会话验证期间保留当前代理。</p>
<button className="primary" disabled={!!busy}>
{busy === "save" ? (
<Loader2 className="spin" size={16} />
@@ -2048,17 +2066,19 @@ function SettingsPanel({ notify }: { notify: Notify }) {
<div>
<Globe2 size={22} />
<div>
<b>在 Edge 中完成登录</b>
<small>支持验证码,自动获取并加密保存 Cookie</small>
<b>{auth?.browser_supported === false ? "在自己电脑上完成登录" : "在 Edge 中完成登录"}</b>
<small>{auth?.browser_supported === false ? "服务器无桌面,请登录研招网后在下方粘贴 Cookie" : "支持验证码,自动获取并加密保存 Cookie"}</small>
</div>
</div>
<button
{auth?.browser_supported === false ? (
<a className="primary" href="https://yz.chsi.com.cn/zsml/a/dw.do" target="_blank" rel="noopener noreferrer">打开研招网登录页面 <ArrowUpRight size={16} /></a>
) : <button
className="primary"
disabled={!!busy || !!browserWaiting}
onClick={() => authenticate("browser")}
>
打开登录窗口 <ArrowUpRight size={16} />
</button>
</button>}
{auth?.browser_message && (
<p className="form-hint">{auth.browser_message}</p>
)}