Skip to content

Commit aad7270

Browse files
authored
Merge pull request #1077 from goodoldme/swag-dashboard
Modify SQL query to use 'bips' table instead of 'bans' for the count
2 parents 84be9ea + dfe71e3 commit aad7270

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

root/dashboard/swag-f2b.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ def _get_f2b_data(db_path):
99
con = sqlite3.connect(db_path)
1010
cur = con.cursor()
1111
results = cur.execute("""
12-
SELECT jails.name,
13-
COUNT(bans.ip) AS bans,
14-
(SELECT DISTINCT bans.ip from bans where jails.name = bans.jail ORDER BY timeofban DESC) as last_ban,
15-
(SELECT DISTINCT bans.data from bans where jails.name = bans.jail ORDER BY timeofban DESC) as data
16-
FROM jails
17-
LEFT JOIN bans ON jails.name=bans.jail
12+
SELECT jails.name,
13+
COUNT(bips.ip) AS bans,
14+
(SELECT DISTINCT bips.ip from bips where jails.name = bips.jail ORDER BY timeofban DESC) as last_ban,
15+
(SELECT DISTINCT bips.data from bips where jails.name = bips.jail ORDER BY timeofban DESC) as data
16+
FROM jails
17+
LEFT JOIN bips ON jails.name=bips.jail
1818
GROUP BY jails.name
1919
""").fetchall()
2020
con.close()

0 commit comments

Comments
 (0)