diff --git a/pkg/log/scanlog.go b/pkg/log/scanlog.go index 53994f4..59ba625 100644 --- a/pkg/log/scanlog.go +++ b/pkg/log/scanlog.go @@ -28,10 +28,10 @@ func (l *ScanLog) Printf(f string, v ...interface{}) { Println(s) s = core.LogTime() + s l.Lock() - logsLen := len(l.logs) - if logsLen < l.size { + llen := len(l.logs) + if llen < l.size { l.logs = append(l.logs, s) - } else if logsLen == l.size { + } else if llen == l.size { l.logs = append(l.logs[1:], s) } l.Unlock() @@ -39,8 +39,8 @@ func (l *ScanLog) Printf(f string, v ...interface{}) { func (l *ScanLog) Logs() (logs string) { l.RLock() - for _, v := range l.logs { - logs += "\n" + v + for i := len(l.logs) - 1; i >= 0; i-- { + logs += "\n" + l.logs[i] } l.RUnlock() return diff --git a/pkg/server/templates.go b/pkg/server/templates.go index b7e24aa..bafc871 100644 --- a/pkg/server/templates.go +++ b/pkg/server/templates.go @@ -312,7 +312,7 @@ const ( {{if .Login}}
- +
{{end}} diff --git a/templates/menu.html b/templates/menu.html index f680e3d..804f070 100644 --- a/templates/menu.html +++ b/templates/menu.html @@ -9,7 +9,7 @@ {{if .Login}}
- +
{{end}}