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)
|
Println(s)
|
||||||
s = core.LogTime() + s
|
s = core.LogTime() + s
|
||||||
l.Lock()
|
l.Lock()
|
||||||
logsLen := len(l.logs)
|
llen := len(l.logs)
|
||||||
if logsLen < l.size {
|
if llen < l.size {
|
||||||
l.logs = append(l.logs, s)
|
l.logs = append(l.logs, s)
|
||||||
} else if logsLen == l.size {
|
} else if llen == l.size {
|
||||||
l.logs = append(l.logs[1:], s)
|
l.logs = append(l.logs[1:], s)
|
||||||
}
|
}
|
||||||
l.Unlock()
|
l.Unlock()
|
||||||
|
|
@ -39,8 +39,8 @@ func (l *ScanLog) Printf(f string, v ...interface{}) {
|
||||||
|
|
||||||
func (l *ScanLog) Logs() (logs string) {
|
func (l *ScanLog) Logs() (logs string) {
|
||||||
l.RLock()
|
l.RLock()
|
||||||
for _, v := range l.logs {
|
for i := len(l.logs) - 1; i >= 0; i-- {
|
||||||
logs += "\n" + v
|
logs += "\n" + l.logs[i]
|
||||||
}
|
}
|
||||||
l.RUnlock()
|
l.RUnlock()
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -312,7 +312,7 @@ const (
|
||||||
{{if .Login}}
|
{{if .Login}}
|
||||||
<form class="form-inline" method="post" action="/search">
|
<form class="form-inline" method="post" action="/search">
|
||||||
<input type="hidden" name="token" value="{{.Token}}">
|
<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>
|
<button class="btn btn-sm btn-info" type="submit">Search</button>
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
{{if .Login}}
|
{{if .Login}}
|
||||||
<form class="form-inline" method="post" action="/search">
|
<form class="form-inline" method="post" action="/search">
|
||||||
<input type="hidden" name="token" value="{{.Token}}">
|
<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>
|
<button class="btn btn-sm btn-info" type="submit">Search</button>
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue