nezha/resource/template/common/menu.html

50 lines
2.5 KiB
HTML
Raw Normal View History

2019-12-08 03:59:58 -05:00
{{define "common/menu"}}
<div class="ui large top fixed menu nb-menu">
<div class="ui container">
<div class="item">
2021-08-04 01:35:41 -04:00
<img src="/static/logo.svg?v20210804">
2019-12-08 03:59:58 -05:00
</div>
{{if .IsAdminPage}}
2022-04-28 11:35:11 -04:00
<a class='item{{if eq .MatchedPath "/server"}} active{{end}}' href="/server"><i class="server icon"></i>{{tr "Server"}}</a>
<a class='item{{if eq .MatchedPath "/monitor"}} active{{end}}' href="/monitor"><i class="rss icon"></i>服务</a>
<a class='item{{if eq .MatchedPath "/cron"}} active{{end}}' href="/cron"><i class="clock icon"></i>任务</a>
<a class='item{{if eq .MatchedPath "/notification"}} active{{end}}' href="/notification"><i class="bell icon"></i>报警</a>
<a class='item{{if eq .MatchedPath "/setting"}} active{{end}}' href="/setting">
<i class="settings icon"></i>设置
</a>
{{else}}
<a class='item{{if eq .MatchedPath "/"}} active{{end}}' href="/"><i class="home icon"></i>首页</a>
<a class='item{{if eq .MatchedPath "/service"}} active{{end}}' href="/service"><i class="rss icon"></i>服务</a>
2019-12-08 10:18:29 -05:00
{{end}}
2019-12-08 03:59:58 -05:00
<div class="right menu">
<div class="item">
{{if .Admin}}
<div class="ui simple dropdown">
<div class="text">
<img class="ui avatar image" src="{{.Admin.AvatarURL}}"> {{.Admin.Name}}
</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}}
2019-12-08 03:59:58 -05:00
<button class="item" onclick="showConfirm('确认注销?','注销后您必须重新登录才能使用',logout,{{.Admin.ID}})">
<i class="logout icon"></i>注销登录
</button>
</div>
</div>
{{else}}
2021-08-05 23:48:34 -04:00
<a href="/login" class="ui large positive nezha-primary-btn button"><i class="sign-in icon"></i>登录</a>
2019-12-08 03:59:58 -05:00
{{end}}
</div>
</div>
</div>
</div>
{{template "component/confirm" .}}
{{end}}