mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 11:56:53 +00:00
dashboard 备注 客户端管理优化 多客户端支持 流量显示支持 热更新支持 404错误页支持
This commit is contained in:
@@ -27,14 +27,18 @@ func (s *BaseController) Prepare() {
|
||||
//加载模板
|
||||
func (s *BaseController) display(tpl ...string) {
|
||||
var tplname string
|
||||
if s.Data["menu"] == nil {
|
||||
s.Data["menu"] = s.actionName
|
||||
}
|
||||
if len(tpl) > 0 {
|
||||
tplname = strings.Join([]string{tpl[0], "html"}, ".")
|
||||
} else {
|
||||
tplname = s.controllerName + "/" + s.actionName + ".html"
|
||||
}
|
||||
s.Data["menu"] = s.actionName
|
||||
ip := s.Ctx.Request.Host
|
||||
s.Data["ip"] = utils.GetHostByName(ip[0:strings.LastIndex(ip, ":")])
|
||||
if strings.LastIndex(ip, ":") > 0 {
|
||||
s.Data["ip"] = utils.GetHostByName(ip[0:])
|
||||
}
|
||||
s.Data["p"] = server.Bridge.TunnelPort
|
||||
s.Data["proxyPort"] = beego.AppConfig.String("hostPort")
|
||||
s.Layout = "public/layout.html"
|
||||
|
Reference in New Issue
Block a user