mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
chg: [hashDecoded] add option to display decoded files, fix #271
This commit is contained in:
parent
306815a31d
commit
e93a0b637c
2 changed files with 29 additions and 15 deletions
|
@ -101,7 +101,8 @@ def all_hash_search():
|
||||||
date_to = request.form.get('date_to')
|
date_to = request.form.get('date_to')
|
||||||
type = request.form.get('type')
|
type = request.form.get('type')
|
||||||
encoding = request.form.get('encoding')
|
encoding = request.form.get('encoding')
|
||||||
return redirect(url_for('hashDecoded.hashDecoded_page', date_from=date_from, date_to=date_to, type=type, encoding=encoding))
|
show_decoded_files = request.form.get('show_decoded_files')
|
||||||
|
return redirect(url_for('hashDecoded.hashDecoded_page', date_from=date_from, date_to=date_to, type=type, encoding=encoding, show_decoded_files=show_decoded_files))
|
||||||
|
|
||||||
@hashDecoded.route("/hashDecoded/", methods=['GET'])
|
@hashDecoded.route("/hashDecoded/", methods=['GET'])
|
||||||
def hashDecoded_page():
|
def hashDecoded_page():
|
||||||
|
@ -109,6 +110,8 @@ def hashDecoded_page():
|
||||||
date_to = request.args.get('date_to')
|
date_to = request.args.get('date_to')
|
||||||
type = request.args.get('type')
|
type = request.args.get('type')
|
||||||
encoding = request.args.get('encoding')
|
encoding = request.args.get('encoding')
|
||||||
|
show_decoded_files = request.args.get('show_decoded_files')
|
||||||
|
print(show_decoded_files)
|
||||||
|
|
||||||
if type == 'All types':
|
if type == 'All types':
|
||||||
type = None
|
type = None
|
||||||
|
@ -161,6 +164,8 @@ def hashDecoded_page():
|
||||||
daily_date = None
|
daily_date = None
|
||||||
|
|
||||||
l_64 = set()
|
l_64 = set()
|
||||||
|
if show_decoded_files:
|
||||||
|
show_decoded_files = True
|
||||||
for date in date_range:
|
for date in date_range:
|
||||||
if encoding is None:
|
if encoding is None:
|
||||||
l_hash = r_serv_metadata.zrange('hash_date:' +date, 0, -1)
|
l_hash = r_serv_metadata.zrange('hash_date:' +date, 0, -1)
|
||||||
|
@ -214,7 +219,7 @@ def hashDecoded_page():
|
||||||
l_type = r_serv_metadata.smembers('hash_all_type')
|
l_type = r_serv_metadata.smembers('hash_all_type')
|
||||||
|
|
||||||
return render_template("hashDecoded.html", l_64=b64_metadata, vt_enabled=vt_enabled, l_type=l_type, type=type, daily_type_chart=daily_type_chart, daily_date=daily_date,
|
return render_template("hashDecoded.html", l_64=b64_metadata, vt_enabled=vt_enabled, l_type=l_type, type=type, daily_type_chart=daily_type_chart, daily_date=daily_date,
|
||||||
encoding=encoding, all_encoding=all_encoding, date_from=date_from, date_to=date_to)
|
encoding=encoding, all_encoding=all_encoding, date_from=date_from, date_to=date_to, show_decoded_files=show_decoded_files)
|
||||||
|
|
||||||
@hashDecoded.route('/hashDecoded/hash_by_type')
|
@hashDecoded.route('/hashDecoded/hash_by_type')
|
||||||
def hash_by_type():
|
def hash_by_type():
|
||||||
|
|
|
@ -121,7 +121,14 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<br>
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="show_decoded_files" value="True" {% if show_decoded_files %}checked{% endif %}>
|
||||||
|
<div style="color:#286090; display:inline-block">
|
||||||
|
Show decoded files <i class="fa fa-file"></i>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<button class="btn btn-primary" style="text-align:center;">
|
<button class="btn btn-primary" style="text-align:center;">
|
||||||
<i class="fa fa-files-o"></i> Search
|
<i class="fa fa-files-o"></i> Search
|
||||||
</button>
|
</button>
|
||||||
|
@ -189,12 +196,14 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
{% if show_decoded_files %}
|
||||||
{% if date_from|string == date_to|string %}
|
{% if date_from|string == date_to|string %}
|
||||||
<h3> {{ date_from }}, No Hashes</h3>
|
<h3> {{ date_from }}, No Hashes</h3>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h3> {{ date_from }} to {{ date_to }}, No Hashes</h3>
|
<h3> {{ date_from }} to {{ date_to }}, No Hashes</h3>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue