mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 14:29:42 +08:00
实现后台首页图表(用户在线数、网络吞量量、CPU、内存)
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"net/http/pprof"
|
||||
|
||||
"github.com/bjdgyc/anylink/base"
|
||||
"github.com/gorilla/handlers"
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
@@ -18,6 +19,7 @@ func StartAdmin() {
|
||||
|
||||
r := mux.NewRouter()
|
||||
r.Use(authMiddleware)
|
||||
r.Use(handlers.CompressHandler)
|
||||
|
||||
// 监控检测
|
||||
r.HandleFunc("/status.html", func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -64,6 +66,8 @@ func StartAdmin() {
|
||||
r.HandleFunc("/group/set", GroupSet)
|
||||
r.HandleFunc("/group/del", GroupDel)
|
||||
|
||||
r.HandleFunc("/statsinfo/list", StatsInfoList)
|
||||
|
||||
// pprof
|
||||
if base.Cfg.Pprof {
|
||||
r.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline).Name("debug")
|
||||
|
Reference in New Issue
Block a user