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 <luca.tiozzo91@gmail.com>
This commit is contained in:
lucatiozzo91 2022-03-16 13:53:00 +00:00 committed by Nicola Murino
parent 8502d7b051
commit 7b86e2ac59

View file

@ -47,7 +47,7 @@ func getAddDefenderEventQuery() string {
} }
func getDefenderHostsQuery() 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]) sqlTableDefenderHosts, sqlPlaceholders[0], sqlPlaceholders[1])
} }