feat: 统计页支持一年时段和按日趋势
在线人数在新的有效访问后尽快刷新,历史查询保留一年并画出每日连接数。
This commit is contained in:
+8
-6
@@ -36,6 +36,7 @@ type App struct {
|
||||
onlineMu sync.Mutex
|
||||
onlineAt time.Time
|
||||
onlineJSON []byte
|
||||
onlinePoke chan struct{}
|
||||
|
||||
rangeMu sync.Mutex
|
||||
}
|
||||
@@ -54,12 +55,13 @@ func NewApp(cfg Config, now func() time.Time) (*App, error) {
|
||||
return nil, err
|
||||
}
|
||||
a := &App{
|
||||
cfg: cfg,
|
||||
store: st,
|
||||
rec: NewRecorder(),
|
||||
now: now,
|
||||
png: transparentPNG(),
|
||||
salt: salt,
|
||||
cfg: cfg,
|
||||
store: st,
|
||||
rec: NewRecorder(),
|
||||
now: now,
|
||||
png: transparentPNG(),
|
||||
salt: salt,
|
||||
onlinePoke: make(chan struct{}, 1),
|
||||
}
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("GET /tiles/", a.handleTile)
|
||||
|
||||
Reference in New Issue
Block a user