mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-15 21:30:50 +08:00
update stats format
This commit is contained in:
@@ -80,7 +80,8 @@ func (s *simpleSessionStater) Start() error {
|
||||
text-align: right;
|
||||
padding: 4;
|
||||
}</style><title>Go-tun2socks Sessions</title></head>`)
|
||||
_, _ = fmt.Fprintf(w, "<h2>Now: %s Uptime: %s</h2>", now(), uptime())
|
||||
_, _ = fmt.Fprintf(w, "<h2>%s</h2>", now())
|
||||
_, _ = fmt.Fprintf(w, "<h3>Uptime: %s</h3>", uptime())
|
||||
_, _ = fmt.Fprintf(w, "<p>Active sessions %d</p>", len(sessions))
|
||||
tablePrint(w, sessions)
|
||||
_, _ = fmt.Fprintf(w, "<br/><br/>")
|
||||
|
@@ -18,6 +18,7 @@ func uptime() string {
|
||||
year, month, day, hour, min, sec := diff(startTime, now)
|
||||
|
||||
var y, m, d, h string
|
||||
|
||||
if year != 0 {
|
||||
y = fmt.Sprintf("%dY", year)
|
||||
}
|
||||
|
Reference in New Issue
Block a user