🚸 improve: 优化导航栏 close #55 close #56

This commit is contained in:
naiba
2021-01-16 11:42:12 +08:00
parent 345511e90f
commit 1c2cc5dcab
3 changed files with 28 additions and 18 deletions

View File

@@ -4,13 +4,14 @@
<div class="item">
<img src="/static/logo.png">
</div>
<a class="item{{if eq .MatchedPath " /"}} active{{end}}" href="/">首页</a>
<a class="item{{if eq .MatchedPath " /service"}} active{{end}}" href="/service">服务状态</a>
{{if .Admin}}
{{if .IsAdminPage}}
<a class="item{{if eq .MatchedPath " /server"}} active{{end}}" href="/server">服务器</a>
<a class="item{{if eq .MatchedPath " /monitor"}} active{{end}}" href="/monitor">监控</a>
<a class="item{{if eq .MatchedPath " /monitor"}} active{{end}}" href="/monitor">服务监控</a>
<a class="item{{if eq .MatchedPath " /notification"}} active{{end}}" href="/notification">通知</a>
<a class="item{{if eq .MatchedPath " /setting"}} active{{end}}" href="/setting">设置</a>
{{else}}
<a class="item{{if eq .MatchedPath " /"}} active{{end}}" href="/">首页</a>
<a class="item{{if eq .MatchedPath " /service"}} active{{end}}" href="/service">服务状态</a>
{{end}}
<div class="right menu">
<div class="item">
@@ -21,6 +22,15 @@
</div>
<i class="dropdown icon"></i>
<div class="menu">
{{if .IsAdminPage}}
<a class="item" href="/">
<i class="chart area icon"></i>返回前台
</a>
{{else}}
<a class="item" href="/server">
<i class="terminal icon"></i>管理后台
</a>
{{end}}
<button class="item" onclick="showConfirm('确认注销?','注销后您必须重新登录才能使用',logout,{{.Admin.ID}})">
<i class="logout icon"></i>注销登录
</button>