Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.

Commit 50de391

Browse files
committed
fix assignment
1 parent ae28946 commit 50de391

File tree

7 files changed

+8
-12
lines changed

7 files changed

+8
-12
lines changed

api/item.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ type GetItemResponse struct {
8383
func (this *Web) GetItem(hostname string, resp *GetItemResponse) error {
8484
items, exists := g.DetectedItemMap.Get(hostname)
8585
if !exists {
86-
resp.Message = "no found"
86+
resp.Message = "no found item assigned to " + hostname
8787
}
8888
resp.Data = items
8989
return nil

cron/fetcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func getDetectedItem() {
3131

3232
for _, tmp := range ipIdcArr {
3333
detectedItem := newDetectedItem(s, tmp.Ip, tmp.Idc)
34-
key := utils.Getkey(tmp.Idc)
34+
key := utils.Getkey(tmp.Idc, int(detectedItem.Sid))
3535

3636
if _, exists := detectedItemMap[key]; exists {
3737
detectedItemMap[key] = append(detectedItemMap[key], &detectedItem)

model/strategy.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package model
22

33
import (
4-
"log"
5-
64
. "github.com/urlooker/web/store"
75
)
86

@@ -27,16 +25,13 @@ func GetAllStrategyCount(mine int, query, username string) (int64, error) {
2725
return Orm.Where("url LIKE ? AND creator = ? ORDER BY id", "%"+query+"%", username).Count(new(Strategy))
2826
} else {
2927
num, err := Orm.Where("creator = ?", username).Count(new(Strategy))
30-
log.Println(err)
3128
return num, err
3229
}
3330
} else {
3431
if query != "" {
3532
return Orm.Where("url LIKE ? ORDER BY id", "%"+query+"%").Count(new(Strategy))
3633
} else {
37-
log.Println("orm:", Orm)
3834
num, err := Orm.Count(new(Strategy))
39-
log.Println(err)
4035
return num, err
4136
}
4237
}

utils/utils.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ import (
1111
"github.com/urlooker/web/g"
1212
)
1313

14-
func Getkey(idc string) string {
14+
func Getkey(idc string, sid int) string {
1515
keys := g.Config.MonitorMap[idc]
1616
count := len(keys)
17-
now := int(time.Now().Unix())
18-
return keys[now%count]
17+
return keys[sid%count]
1918
}
2019

2120
func IsIP(ip string) bool {

views/chart/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<thead>
1616
<tr>
1717
<th>Status</th>
18+
<th>上报值</th>
1819
<th>Url</th>
1920
<th>Ip</th>
2021
<th>返回码</th>
@@ -26,6 +27,7 @@
2627
{{range .Events}}
2728
<tr>
2829
<td width="20%">{{.Status}}</td>
30+
<td width="10%">{{.Results}}</td>
2931
<td id="item_target" width="35%" style="word-wrap:break-word;word-break:break-all;">{{.Url}}</td>
3032
<td width="10%">{{.Ip}}</td>
3133
<td width="10%">{{.RespCode}}</td>

views/inc/nav.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</li>
4848
<li role="separator" class="divider"></li>
4949
<li>
50-
<a href="/help" target="_blank">
50+
<a href="https://github.com/710leo/urlooker" target="_blank">
5151
<span class="glyphicon glyphicon-question-sign"></span>
5252
帮助
5353
</a>

views/inc/nav_chart.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</li>
5656
<li role="separator" class="divider"></li>
5757
<li>
58-
<a href="/help" target="_blank">
58+
<a href="https://github.com/710leo/urlooker" target="_blank">
5959
<span class="glyphicon glyphicon-question-sign"></span>
6060
帮助
6161
</a>

0 commit comments

Comments
 (0)