mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-05 09:00:20 +00:00
1 parent
9702312d00
commit
330b1f9e6a
3 files changed
+28
-18
No files matched your search
@@ -10,9 +10,18 @@ import (
|
||||
"github.com/naiba/nezha/service/dao"
|
||||
)
|
||||
|
||||
var adminPage = map[string]bool{
|
||||
"/server": true,
|
||||
"/monitor": true,
|
||||
"/setting": true,
|
||||
"/notification": true,
|
||||
}
|
||||
|
||||
func CommonEnvironment(c *gin.Context, data map[string]interface{}) gin.H {
|
||||
data["MatchedPath"] = c.MustGet("MatchedPath")
|
||||
data["Version"] = dao.Version
|
||||
// 是否是管理页面
|
||||
data["IsAdminPage"] = adminPage[data["MatchedPath"].(string)]
|
||||
// 站点标题
|
||||
if t, has := data["Title"]; !has {
|
||||
data["Title"] = dao.Conf.Site.Brand
|
||||
|
||||
Reference in new issue
Block a user