fix typo and reverse logs
This commit is contained in:
parent
58a0dc36d5
commit
1f6bb40463
3 changed files with 7 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ const (
|
|||
{{if .Login}}
|
||||
<form class="form-inline" method="post" action="/search">
|
||||
<input type="hidden" name="token" value="{{.Token}}">
|
||||
<input type="text" class="form-control mr-sm-2 menu" placeholder="Search" name="query" value="{{.Query}}" autocomplete="off">
|
||||
<input type="text" class="form-control mr-sm-2 menu" placeholder="Query" name="query" value="{{.Query}}" autocomplete="off">
|
||||
<button class="btn btn-sm btn-info" type="submit">Search</button>
|
||||
</form>
|
||||
{{end}}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
{{if .Login}}
|
||||
<form class="form-inline" method="post" action="/search">
|
||||
<input type="hidden" name="token" value="{{.Token}}">
|
||||
<input type="text" class="form-control mr-sm-2 menu" placeholder="Search" name="query" value="{{.Query}}" autocomplete="off">
|
||||
<input type="text" class="form-control mr-sm-2 menu" placeholder="Query" name="query" value="{{.Query}}" autocomplete="off">
|
||||
<button class="btn btn-sm btn-info" type="submit">Search</button>
|
||||
</form>
|
||||
{{end}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue