aa8af6c2e0
Flask + SQLite + Bootstrap5 暗色主题 - 仪表盘: 在线/离线统计 + 最近代理 + 操作日志 - 代理 CRUD: 增删改 + 启用/禁用 + 单/批量健康检测(SOCKS5) - 分组管理: 创建/删除/筛选 - 操作日志: 分页查询 - RESTful API + Web 界面 - 管理员登录认证 (SM_ADMIN_PASSWORD 环境变量)
87 lines
4.3 KiB
HTML
87 lines
4.3 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>{% block title %}SOCKS Manager{% endblock %}</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
|
|
<style>
|
|
body { background:#0f1117; color:#e2e8f0; }
|
|
.card { background:#1a1d27; border:1px solid #2a2d3a; }
|
|
.navbar { background:#151822 !important; border-bottom:1px solid #2a2d3a !important; }
|
|
.navbar-brand { color:#818cf8 !important; font-weight:700; }
|
|
.nav-link { color:#a0aec0 !important; }
|
|
.nav-link:hover, .nav-link.active { color:#818cf8 !important; }
|
|
.table { color:#e2e8f0; }
|
|
.table-dark { background:#1a1d27; }
|
|
.form-control, .form-select { background:#0f1117; border-color:#2a2d3a; color:#e2e8f0; }
|
|
.form-control:focus, .form-select:focus { background:#0f1117; border-color:#818cf8; color:#e2e8f0; }
|
|
.badge-online { background:#10b981; }
|
|
.badge-offline { background:#ef4444; }
|
|
.badge-unknown { background:#6b7280; }
|
|
.badge-error { background:#f59e0b; }
|
|
.status-dot { width:10px; height:10px; border-radius:50%; display:inline-block; margin-right:6px; }
|
|
.dot-online { background:#10b981; }
|
|
.dot-offline { background:#ef4444; }
|
|
.dot-unknown { background:#6b7280; }
|
|
.dot-error { background:#f59e0b; }
|
|
.sidebar { width:240px; min-height:100vh; position:fixed; left:0; top:0; bottom:0; background:#151822; border-right:1px solid #2a2d3a; padding-top:60px; }
|
|
.sidebar .nav-link { padding:.6rem 1.2rem; border-radius:.4rem; margin:.2rem .8rem; }
|
|
.sidebar .nav-link:hover, .sidebar .nav-link.active { background:#1e2235; }
|
|
.main-content { margin-left:240px; padding:1.5rem; }
|
|
@media (max-width:768px) { .sidebar { display:none; } .main-content { margin-left:0; } }
|
|
.stat-card .stat-value { font-size:2rem; font-weight:700; }
|
|
.toast-container { position:fixed; top:1rem; right:1rem; z-index:1060; }
|
|
</style>
|
|
{% block extra_style %}{% endblock %}
|
|
</head>
|
|
<body>
|
|
<nav class="navbar navbar-expand-lg fixed-top">
|
|
<div class="container-fluid">
|
|
<a class="navbar-brand" href="/"><i class="bi bi-hdd-rack"></i> SOCKS Manager</a>
|
|
<div class="d-flex align-items-center">
|
|
<span class="text-muted small me-3">{{ g.user if g and g.user else 'admin' }}</span>
|
|
<a href="/logout" class="btn btn-outline-secondary btn-sm">退出</a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="sidebar">
|
|
<div class="nav flex-column">
|
|
<a class="nav-link {% if 'dashboard' in request.endpoint|default('') %}active{% endif %}" href="/dashboard">
|
|
<i class="bi bi-speedometer2"></i> 仪表盘</a>
|
|
<a class="nav-link {% if 'proxy' in request.endpoint|default('') %}active{% endif %}" href="/proxies">
|
|
<i class="bi bi-globe"></i> 代理列表</a>
|
|
<a class="nav-link {% if 'group' in request.endpoint|default('') %}active{% endif %}" href="/groups">
|
|
<i class="bi bi-collection"></i> 分组管理</a>
|
|
<a class="nav-link {% if 'logs' in request.endpoint|default('') %}active{% endif %}" href="/logs">
|
|
<i class="bi bi-journal-text"></i> 日志</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="main-content">
|
|
<div class="toast-container" id="toastContainer"></div>
|
|
{% block content %}{% endblock %}
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script>
|
|
function toast(msg, type='info') {
|
|
const c = document.getElementById('toastContainer');
|
|
const t = document.createElement('div');
|
|
t.className = `toast show align-items-center text-bg-${type} border-0`;
|
|
t.setAttribute('role','alert');
|
|
t.innerHTML = `<div class="d-flex"><div class="toast-body">${msg}</div><button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast"></button></div>`;
|
|
c.appendChild(t);
|
|
setTimeout(()=>t.remove(), 4000);
|
|
}
|
|
async function apiFetch(url, opts={}) {
|
|
const r = await fetch(url, {...opts, headers:{'Content-Type':'application/json', ...opts.headers}});
|
|
return r.json();
|
|
}
|
|
</script>
|
|
{% block extra_script %}{% endblock %}
|
|
</body>
|
|
</html>
|