proxy-go/web/templates/admin/layout.html
wood chen ecba8adbf1 refactor(templates): Update template definition names for admin pages
- Change template definition names from "Content" to specific page names
- Modify layout.html to conditionally render templates based on page name
- Ensure consistent template naming across admin page templates
2025-02-15 09:49:23 +08:00

42 lines
1.5 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">
{{if eq .Content "login.html"}}
{{template "login.html" .}}
{{else if eq .Content "metrics.html"}}
{{template "metrics.html" .}}
{{else if eq .Content "config.html"}}
{{template "config.html" .}}
{{end}}
</div>
<script src="/admin/static/js/auth.js"></script>
<script>
// 检查是否已登录(除了登录页面)
if (!window.location.pathname.includes('/login')) {
checkAuth();
}
</script>
</body>
</html>