feat: 初始版本,支持 HTTP 代理和 SOCKS5 代理
This commit is contained in:
@@ -0,0 +1,623 @@
|
||||
/* ===== 全局变量与基础样式(浅色主题) ===== */
|
||||
:root {
|
||||
--bg: #f4f6fb;
|
||||
--bg-soft: #eef2f9;
|
||||
--panel: #ffffff;
|
||||
--panel-2: #fbfcfe;
|
||||
--border: #e2e8f2;
|
||||
--text: #1b2430;
|
||||
--muted: #6d7789;
|
||||
--accent: #2563eb;
|
||||
--accent-soft: rgba(37, 99, 235, 0.12);
|
||||
--ok: #0f9d63;
|
||||
--warn: #b25c00;
|
||||
--err: #d92d20;
|
||||
--radius: 14px;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background:
|
||||
radial-gradient(900px 500px at 12% -10%, rgba(37, 99, 235, 0.1), transparent 60%),
|
||||
radial-gradient(700px 420px at 92% 0%, rgba(16, 185, 129, 0.1), transparent 55%),
|
||||
var(--bg);
|
||||
color: var(--text);
|
||||
font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* ===== 顶部栏 ===== */
|
||||
.topbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
padding: 22px clamp(16px, 5vw, 48px) 10px;
|
||||
max-width: 1180px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border-radius: 12px;
|
||||
background: linear-gradient(140deg, #3b82f6, #0ea5a4);
|
||||
color: #ffffff;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.5px;
|
||||
box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
|
||||
}
|
||||
|
||||
.brand-text h1 {
|
||||
margin: 0;
|
||||
font-size: 17px;
|
||||
font-weight: 650;
|
||||
letter-spacing: 0.2px;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.brand-text .sub {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.pill {
|
||||
padding: 6px 12px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 999px;
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
background: #ffffff;
|
||||
white-space: nowrap;
|
||||
box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
|
||||
}
|
||||
|
||||
main {
|
||||
max-width: 1180px;
|
||||
margin: 0 auto;
|
||||
padding: 8px clamp(16px, 5vw, 48px) 64px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
/* ===== 状态卡片 ===== */
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 16px 18px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 24px rgba(16, 24, 40, 0.04);
|
||||
}
|
||||
|
||||
.card-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.state {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 12px;
|
||||
padding: 3px 10px;
|
||||
border-radius: 999px;
|
||||
background: rgba(15, 157, 99, 0.1);
|
||||
color: #0b7d4f;
|
||||
border: 1px solid rgba(15, 157, 99, 0.25);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.state::before {
|
||||
content: "";
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: currentColor;
|
||||
}
|
||||
|
||||
.state.off {
|
||||
background: #f1f4f9;
|
||||
color: var(--muted);
|
||||
border-color: var(--border);
|
||||
}
|
||||
|
||||
.state.bad {
|
||||
background: rgba(217, 45, 32, 0.08);
|
||||
color: #b42318;
|
||||
border-color: rgba(217, 45, 32, 0.22);
|
||||
}
|
||||
|
||||
.state.neutral {
|
||||
background: rgba(37, 99, 235, 0.08);
|
||||
color: #1d4ed8;
|
||||
border-color: rgba(37, 99, 235, 0.2);
|
||||
}
|
||||
|
||||
.addr {
|
||||
margin: 0;
|
||||
font-family: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
|
||||
font-size: 13px;
|
||||
color: #1d4ed8;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.addr.dim {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.metrics {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 8px 14px;
|
||||
}
|
||||
|
||||
.metrics > div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
padding: 8px 10px;
|
||||
border-radius: 10px;
|
||||
background: #f7f9fd;
|
||||
border: 1px solid #eef2f8;
|
||||
}
|
||||
|
||||
.metrics .label {
|
||||
font-size: 11px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.metrics strong {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
color: #111a27;
|
||||
}
|
||||
|
||||
/* 速率数值用主色突出显示 */
|
||||
.metrics strong.rate {
|
||||
color: #1d4ed8;
|
||||
}
|
||||
|
||||
/* ===== 实时带宽趋势 ===== */
|
||||
.legend {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.legend-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.legend-item b {
|
||||
color: #111a27;
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dot.down {
|
||||
background: #2563eb;
|
||||
}
|
||||
|
||||
.dot.up {
|
||||
background: #0f9d63;
|
||||
}
|
||||
|
||||
.chart {
|
||||
width: 100%;
|
||||
height: 170px;
|
||||
display: block;
|
||||
border-radius: 10px;
|
||||
background: #fbfcfe;
|
||||
border: 1px solid #eef2f8;
|
||||
}
|
||||
|
||||
.chart-tip {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.error {
|
||||
margin: 0;
|
||||
padding: 8px 10px;
|
||||
border-radius: 10px;
|
||||
font-size: 12px;
|
||||
color: #b42318;
|
||||
background: #fef3f2;
|
||||
border: 1px solid #fecdca;
|
||||
}
|
||||
|
||||
/* ===== 表单面板 ===== */
|
||||
form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 18px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03), 0 10px 24px rgba(16, 24, 40, 0.03);
|
||||
}
|
||||
|
||||
.panel-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.panel-head h2 {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.2px;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.hint-inline {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.fields {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.field.wide {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.field > span {
|
||||
font-size: 12px;
|
||||
color: #44506a;
|
||||
}
|
||||
|
||||
.field > em {
|
||||
font-style: normal;
|
||||
font-size: 11px;
|
||||
color: var(--muted);
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="number"],
|
||||
textarea {
|
||||
width: 100%;
|
||||
padding: 9px 12px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #dfe6f0;
|
||||
background: #ffffff;
|
||||
color: var(--text);
|
||||
font-size: 13px;
|
||||
font-family: inherit;
|
||||
outline: none;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
input:hover,
|
||||
textarea:hover {
|
||||
border-color: #cbd6e6;
|
||||
}
|
||||
|
||||
input:focus,
|
||||
textarea:focus {
|
||||
border-color: rgba(37, 99, 235, 0.65);
|
||||
box-shadow: 0 0 0 3px var(--accent-soft);
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
font-family: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
input::placeholder,
|
||||
textarea::placeholder {
|
||||
color: #9aa4b5;
|
||||
}
|
||||
|
||||
/* 开关 */
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 44px;
|
||||
height: 24px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.slider {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 999px;
|
||||
background: #e3e9f3;
|
||||
border: 1px solid var(--border);
|
||||
cursor: pointer;
|
||||
transition: background 0.18s ease, border-color 0.18s ease;
|
||||
}
|
||||
|
||||
.slider::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
left: 2px;
|
||||
top: 2px;
|
||||
border-radius: 50%;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 1px 3px rgba(16, 24, 40, 0.22);
|
||||
transition: transform 0.18s ease;
|
||||
}
|
||||
|
||||
.switch input:checked + .slider {
|
||||
background: rgba(37, 99, 235, 0.28);
|
||||
border-color: rgba(37, 99, 235, 0.45);
|
||||
}
|
||||
|
||||
.switch input:checked + .slider::before {
|
||||
transform: translateX(20px);
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
/* 单选 */
|
||||
.radio-row {
|
||||
display: flex;
|
||||
gap: 18px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.radio {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
color: #33415c;
|
||||
}
|
||||
|
||||
.radio input {
|
||||
accent-color: var(--accent);
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
/* 按钮 */
|
||||
.actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
button {
|
||||
font-family: inherit;
|
||||
font-size: 13px;
|
||||
border-radius: 10px;
|
||||
padding: 9px 18px;
|
||||
border: 1px solid transparent;
|
||||
cursor: pointer;
|
||||
transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
|
||||
}
|
||||
|
||||
button:active {
|
||||
transform: translateY(1px);
|
||||
}
|
||||
|
||||
.primary {
|
||||
background: linear-gradient(180deg, #3b82f6, #2563eb);
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
|
||||
}
|
||||
|
||||
.primary:hover {
|
||||
background: linear-gradient(180deg, #4f8dfa, #2f6ff0);
|
||||
}
|
||||
|
||||
.primary:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.ghost {
|
||||
background: #ffffff;
|
||||
border-color: var(--border);
|
||||
color: #33415c;
|
||||
}
|
||||
|
||||
.ghost:hover {
|
||||
border-color: rgba(37, 99, 235, 0.45);
|
||||
color: var(--accent);
|
||||
background: #f7f9fd;
|
||||
}
|
||||
|
||||
button.small {
|
||||
padding: 5px 12px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.msg {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
min-height: 18px;
|
||||
}
|
||||
|
||||
.msg.ok {
|
||||
color: #0b7d4f;
|
||||
}
|
||||
|
||||
.msg.err {
|
||||
color: var(--err);
|
||||
}
|
||||
|
||||
/* ===== 示例代码 ===== */
|
||||
.code {
|
||||
margin: 0;
|
||||
padding: 12px 14px;
|
||||
border-radius: 10px;
|
||||
background: #f7f9fd;
|
||||
border: 1px solid #e6ecf5;
|
||||
color: #0b6b63;
|
||||
font-family: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.7;
|
||||
overflow-x: auto;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
/* ===== 日志 ===== */
|
||||
.logs {
|
||||
max-height: 280px;
|
||||
overflow-y: auto;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #e6ecf5;
|
||||
background: #fafbfd;
|
||||
padding: 10px 12px;
|
||||
font-family: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.log-line {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.log-time {
|
||||
color: #98a2b3;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.log-level {
|
||||
flex: 0 0 auto;
|
||||
width: 46px;
|
||||
text-transform: uppercase;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.log-level.info {
|
||||
color: #1d4ed8;
|
||||
}
|
||||
|
||||
.log-level.warn {
|
||||
color: var(--warn);
|
||||
}
|
||||
|
||||
.log-level.error {
|
||||
color: var(--err);
|
||||
}
|
||||
|
||||
.log-level.debug {
|
||||
color: #7c8699;
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* ===== 滚动条 ===== */
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #d3dcea;
|
||||
border-radius: 999px;
|
||||
border: 2px solid transparent;
|
||||
background-clip: content-box;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #b7c4d8;
|
||||
background-clip: content-box;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.topbar {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.metrics {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user