proxy-go/web/templates/admin/layout.html
wood chen ab8684d4c5 refactor(admin): Enhance template rendering and routing for admin pages
- Update template rendering to use a dynamic layout with configurable title
- Modify template parsing to use template.Must for simplified error handling
- Update static file serving path from /web/static to /admin/static
- Improve template execution with dynamic content mapping
- Simplify template loading and error management in main.go
2025-02-15 09:45:36 +08:00

36 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{.Title}} - 代理服务管理后台</title>
<link href="https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.css" rel="stylesheet">
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="min-h-screen bg-base-200">
<div class="navbar bg-base-100 shadow-lg mb-4">
<div class="flex-1">
<a href="/admin/metrics" class="btn btn-ghost normal-case text-xl">代理服务管理</a>
</div>
<div class="flex-none">
<ul class="menu menu-horizontal px-1">
<li><a href="/admin/metrics">监控面板</a></li>
<li><a href="/admin/config">配置管理</a></li>
<li><a onclick="logout()" class="cursor-pointer">退出登录</a></li>
</ul>
</div>
</div>
<div class="container mx-auto px-4">
{{template .Content .}}
</div>
<script src="/admin/static/js/auth.js"></script>
<script>
// 检查是否已登录(除了登录页面)
if (!window.location.pathname.includes('/login')) {
checkAuth();
}
</script>
</body>
</html>