Files
frost-network-proxy/public/index.html
T

240 lines
9.9 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Frost Network Proxy · 配置</title>
<link rel="stylesheet" href="/style.css">
</head>
<body>
<header class="topbar">
<div class="brand">
<span class="logo">FN</span>
<div class="brand-text">
<h1>Frost Network Proxy</h1>
<p class="sub">HTTP / SOCKS5 代理控制台</p>
</div>
</div>
<div class="topbar-right">
<span class="pill" id="uptime-pill">运行时长 --</span>
</div>
</header>
<main>
<!-- 实时状态 -->
<section class="grid">
<article class="card" id="card-http">
<div class="card-head">
<h2>HTTP 代理</h2>
<span class="state" id="http-state">加载中</span>
</div>
<p class="addr" id="http-addr">--</p>
<div class="metrics">
<div><span class="label">活跃连接</span><strong id="http-active">0</strong></div>
<div><span class="label">累计连接</span><strong id="http-total">0</strong></div>
<div><span class="label">下载速率</span><strong id="http-rate-down" class="rate">0 B/s</strong></div>
<div><span class="label">上传速率</span><strong id="http-rate-up" class="rate">0 B/s</strong></div>
<div><span class="label">累计下载</span><strong id="http-down">0 B</strong></div>
<div><span class="label">累计上传</span><strong id="http-up">0 B</strong></div>
</div>
<p class="error" id="http-error" hidden></p>
</article>
<article class="card" id="card-socks5">
<div class="card-head">
<h2>SOCKS5 代理</h2>
<span class="state" id="socks-state">加载中</span>
</div>
<p class="addr" id="socks-addr">--</p>
<div class="metrics">
<div><span class="label">活跃连接</span><strong id="socks-active">0</strong></div>
<div><span class="label">累计连接</span><strong id="socks-total">0</strong></div>
<div><span class="label">下载速率</span><strong id="socks-rate-down" class="rate">0 B/s</strong></div>
<div><span class="label">上传速率</span><strong id="socks-rate-up" class="rate">0 B/s</strong></div>
<div><span class="label">累计下载</span><strong id="socks-down">0 B</strong></div>
<div><span class="label">累计上传</span><strong id="socks-up">0 B</strong></div>
</div>
<p class="error" id="socks-error" hidden></p>
</article>
<article class="card" id="card-total">
<div class="card-head">
<h2>总览</h2>
<span class="state neutral" id="filter-state">--</span>
</div>
<p class="addr" id="filter-desc">--</p>
<div class="metrics">
<div><span class="label">活跃连接</span><strong id="total-active">0</strong></div>
<div><span class="label">累计连接</span><strong id="total-total">0</strong></div>
<div><span class="label">下载速率</span><strong id="total-rate-down" class="rate">0 B/s</strong></div>
<div><span class="label">上传速率</span><strong id="total-rate-up" class="rate">0 B/s</strong></div>
<div><span class="label">累计下载</span><strong id="total-down">0 B</strong></div>
<div><span class="label">累计上传</span><strong id="total-up">0 B</strong></div>
</div>
</article>
</section>
<!-- 实时带宽趋势 -->
<section class="panel">
<header class="panel-head">
<h2>实时网络状态</h2>
<div class="legend">
<span class="legend-item"><i class="dot down"></i>下载 <b id="chart-down">0 B/s</b></span>
<span class="legend-item"><i class="dot up"></i>上传 <b id="chart-up">0 B/s</b></span>
<span class="legend-item">峰值下载 <b id="peak-down">0 B/s</b></span>
<span class="legend-item">峰值上传 <b id="peak-up">0 B/s</b></span>
<span class="legend-item">连接数 <b id="chart-active">0</b></span>
</div>
</header>
<canvas id="bandwidth-chart" class="chart" height="170"></canvas>
<p class="muted chart-tip">最近 60 秒的上传 / 下载速率趋势,每 1 秒采样一次,纵轴为合计速率</p>
</section>
<!-- 配置表单 -->
<form id="config-form" autocomplete="off">
<section class="panel">
<header class="panel-head">
<h2>HTTP 代理</h2>
<label class="switch" title="启用 / 停用">
<input type="checkbox" id="http-enabled">
<span class="slider"></span>
</label>
</header>
<div class="fields">
<label class="field">
<span>监听地址</span>
<input type="text" id="http-host" placeholder="0.0.0.0">
<em>0.0.0.0 表示所有网卡,127.0.0.1 仅本机可用</em>
</label>
<label class="field">
<span>端口</span>
<input type="number" id="http-port" min="1" max="65535" placeholder="8080">
<em>客户端通过该端口访问 HTTP 代理</em>
</label>
<label class="field">
<span>用户名</span>
<input type="text" id="http-user" placeholder="留空表示不校验">
<em>填写后客户端必须带代理认证</em>
</label>
<label class="field">
<span>密码</span>
<input type="text" id="http-pass" placeholder="留空表示不校验">
<em>与用户名同时留空则无需认证</em>
</label>
</div>
</section>
<section class="panel">
<header class="panel-head">
<h2>SOCKS5 代理</h2>
<label class="switch" title="启用 / 停用">
<input type="checkbox" id="socks-enabled">
<span class="slider"></span>
</label>
</header>
<div class="fields">
<label class="field">
<span>监听地址</span>
<input type="text" id="socks-host" placeholder="0.0.0.0">
<em>0.0.0.0 表示所有网卡,127.0.0.1 仅本机可用</em>
</label>
<label class="field">
<span>端口</span>
<input type="number" id="socks-port" min="1" max="65535" placeholder="1080">
<em>客户端通过该端口访问 SOCKS5 代理</em>
</label>
<label class="field">
<span>用户名</span>
<input type="text" id="socks-user" placeholder="留空表示不校验">
<em>填写后启用 RFC 1929 用户名密码认证</em>
</label>
<label class="field">
<span>密码</span>
<input type="text" id="socks-pass" placeholder="留空表示不校验">
<em>与用户名同时留空则无需认证</em>
</label>
</div>
</section>
<section class="panel">
<header class="panel-head">
<h2>目标 IP 限制</h2>
<span class="hint-inline">决定允许代理到哪些目标地址</span>
</header>
<div class="radio-row">
<label class="radio">
<input type="radio" name="filter-mode" value="allowAll">
<span>允许全部目标</span>
</label>
<label class="radio">
<input type="radio" name="filter-mode" value="allowList">
<span>仅允许列表内的 IP</span>
</label>
</div>
<label class="field wide">
<span>IP / 网段列表(每行一条)</span>
<textarea id="filter-list" rows="6" placeholder="192.168.1.10&#10;10.0.0.0/8&#10;2001:db8::/32"></textarea>
<em>支持单 IP 与 CIDR 网段;域名会先解析成 IP 再判断;白名单模式下留空表示全部拒绝</em>
</label>
</section>
<section class="panel">
<header class="panel-head">
<h2>配置页面</h2>
<span class="hint-inline">修改监听地址或端口后需保存,页面会自动切换</span>
</header>
<div class="fields">
<label class="field">
<span>监听地址</span>
<input type="text" id="admin-host" placeholder="127.0.0.1">
<em>建议保持 127.0.0.1,仅本机可打开配置页面</em>
</label>
<label class="field">
<span>端口</span>
<input type="number" id="admin-port" min="1" max="65535" placeholder="8790">
<em>浏览器访问 http://该地址:端口</em>
</label>
<label class="field">
<span>用户名</span>
<input type="text" id="admin-user" placeholder="留空表示不校验">
<em>填写后打开配置页面需要登录</em>
</label>
<label class="field">
<span>密码</span>
<input type="text" id="admin-pass" placeholder="留空表示不校验">
<em>与用户名同时留空则无需登录</em>
</label>
</div>
</section>
<div class="actions">
<button class="primary" type="submit" id="save-btn">保存并应用</button>
<button class="ghost" type="button" id="reload-btn">重新读取配置</button>
<span class="msg" id="save-msg"></span>
</div>
</form>
<!-- 接入示例 -->
<section class="panel">
<header class="panel-head">
<h2>接入示例</h2>
<span class="hint-inline">复制后按需修改主机与端口</span>
</header>
<pre class="code" id="example-http">--</pre>
<pre class="code" id="example-socks">--</pre>
</section>
<!-- 日志 -->
<section class="panel">
<header class="panel-head">
<h2>运行日志</h2>
<button class="ghost small" type="button" id="logs-refresh">刷新</button>
</header>
<div class="logs" id="logs"><p class="muted">加载中…</p></div>
</section>
</main>
<script src="/app.js"></script>
</body>
</html>