This repository has been archived on 2026-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
Files
MetaLab/templates/admin/html/layout/base.html
Victor_Jay 3937945b43 feat(admin): 管理首页标题修正、角色中文显示及用户总数补全
- 修正 admin layout title 后缀为「MetaLab 管理面板」
- 当前角色从原始字符串改为中文显示(注入 RoleDisplayName)
- 补全管理首页「用户总数」统计,新增 CountUsers 方法
- 遵循 ISP 最小接口,Service 复用已有 CountSearchUsers
2026-05-26 23:21:32 +08:00

39 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{if .CSRFToken}}<meta name="csrf-token" content="{{.CSRFToken}}">{{end}}
<title>{{.Title}} - MetaLab 管理面板</title>
<link rel="stylesheet" href="/admin/static/css/common.css">
{{if .ExtraCSS}}
<link rel="stylesheet" href="{{.ExtraCSS}}">
{{end}}
</head>
<body>
<header class="admin-header">
<div class="admin-header-inner">
<a href="/admin" class="admin-logo">MetaLab <span>管理面板</span></a>
<div class="admin-header-right">
<span class="admin-user">{{.Username}}</span>
<a href="/" class="admin-back-btn"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14" style="vertical-align:-2px;margin-right:3px;"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>返回前台</a>
</div>
</div>
</header>
<div class="admin-container">
<aside class="admin-sidebar">
<nav>
<a href="/admin" class="sidebar-item {{if eq .CurrentPath "/admin/"}}active{{end}}">
<span class="sidebar-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/></svg></span>
管理首页
</a>
{{if .CanManageUsers}}
<a href="/admin/users" class="sidebar-item {{if eq .CurrentPath "/admin/users"}}active{{end}}">
<span class="sidebar-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="8" r="4"/><path d="M4 20c0-4 4-7 8-7s8 3 8 7"/></svg></span>
用户管理
</a>
{{end}}
</nav>
</aside>
<main class="admin-main">