瀏覽代碼

always show banned host in ui

When an host is banned but the updated_time field is in the past the ui
didn't show the record.

Fixes #758

Signed-off-by: lucatiozzo91 <[email protected]>
lucatiozzo91 3 年之前
父節點
當前提交
7b86e2ac59
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dataprovider/sqlqueries.go

+ 1 - 1
dataprovider/sqlqueries.go

@@ -47,7 +47,7 @@ func getAddDefenderEventQuery() string {
 }
 
 func getDefenderHostsQuery() string {
-	return fmt.Sprintf(`SELECT id,ip,ban_time FROM %v WHERE updated_at >= %v ORDER BY updated_at DESC LIMIT %v`,
+	return fmt.Sprintf(`SELECT id,ip,ban_time FROM %v WHERE updated_at >= %v OR ban_time > 0 ORDER BY updated_at DESC LIMIT %v`,
 		sqlTableDefenderHosts, sqlPlaceholders[0], sqlPlaceholders[1])
 }