Added support for multiple clients, and a filter count display at the bottom-right of the page

This commit is contained in:
rain
2023-05-25 11:41:08 -05:00
parent 74b55a0268
commit 3a18f608aa
6 changed files with 45 additions and 21 deletions
+7 -1
View File
@@ -15,6 +15,12 @@ def post_home():
"""Render website's home page with applied filters."""
targets = db.session.query(target)
clientId = request.form.get("clientId")
if clientId:
targets = targets.where(target.clientId == clientId)
else:
clientId = "default"
os = request.form.get("os")
if os:
targets = targets.where(target.os == os)
@@ -33,7 +39,7 @@ def post_home():
targets = targets.filter(target.ports.like('%|'+port+'|%'))
return render_template('home.html', targets=targets.all(), os=os,hostname=hostname,address=address,ports=ports)
return render_template('home.html', targets=targets.all(), os=os,hostname=hostname,address=address,ports=ports,clientId=clientId)
@app.after_request