diff --git a/component/session/server.go b/component/session/server.go index 2001591..451b5c8 100644 --- a/component/session/server.go +++ b/component/session/server.go @@ -10,6 +10,7 @@ import ( "sort" "sync" "sync/atomic" + "time" "github.com/xjasonlyu/tun2socks/common/queue" C "github.com/xjasonlyu/tun2socks/constant" @@ -96,11 +97,11 @@ table, th, td { // Statistics table _, _ = fmt.Fprintf(w, "

Statistics

") _, _ = fmt.Fprintf(w, "") - _, _ = fmt.Fprintf(w, "\n") + _, _ = fmt.Fprintf(w, "\n") trafficUp := atomic.LoadInt64(&s.trafficUp) trafficDown := atomic.LoadInt64(&s.trafficDown) _, _ = fmt.Fprintf(w, "\n", - now(), + date(time.Now()), uptime(), byteCountSI(trafficUp+trafficDown), byteCountSI(trafficUp), diff --git a/component/session/utils.go b/component/session/utils.go index e0bf3e8..0b6d1a8 100644 --- a/component/session/utils.go +++ b/component/session/utils.go @@ -16,10 +16,6 @@ func date(t time.Time) string { return t.Format("Mon Jan 2 15:04:05") } -func now() string { - return time.Now().Format("2006-01-02 15:04:05") -} - func duration(start, end time.Time) string { var t time.Duration if end.IsZero() {
Last RefreshUptimeUploadDownloadTotal Traffic
Latest RefreshUptimeTotal TrafficUploadDownload
%s%s%s%s%s