chg: Pass max depth as parameter in the capture page

Related to #117
pull/122/head
Raphaël Vinot 2020-11-03 19:26:24 +01:00
parent 5ebaf74d67
commit 171cd4ecd2
2 changed files with 7 additions and 10 deletions

View File

@ -46,6 +46,7 @@ lookyloo: Lookyloo = Lookyloo()
user = get_config('generic', 'cache_clean_user') user = get_config('generic', 'cache_clean_user')
time_delta_on_index = get_config('generic', 'time_delta_on_index') time_delta_on_index = get_config('generic', 'time_delta_on_index')
blur_screenshot = get_config('generic', 'enable_default_blur_screenshot') blur_screenshot = get_config('generic', 'enable_default_blur_screenshot')
max_depth = get_config('generic', 'max_depth')
logging.basicConfig(level=get_config('generic', 'loglevel')) logging.basicConfig(level=get_config('generic', 'loglevel'))
@ -478,7 +479,7 @@ def capture_web():
if not user_agents: if not user_agents:
user_agents = get_user_agents() user_agents = get_user_agents()
user_agents.pop('by_frequency') user_agents.pop('by_frequency')
return render_template('capture.html', user_agents=user_agents) return render_template('capture.html', user_agents=user_agents, max_depth=max_depth)
@app.route('/cookies/<string:cookie_name>', methods=['GET']) @app.route('/cookies/<string:cookie_name>', methods=['GET'])

View File

@ -26,22 +26,18 @@
</div> </div>
</div> </div>
{% if max_depth >= 2 %}
<div class="form-group row"> <div class="form-group row">
<label for="depth" class="col-sm-2 col-form-label">Link Depth:</label> <label for="depth" class="col-sm-2 col-form-label">Link Depth:</label>
<div class="col-sm-1"> <div class="col-sm-1">
<select class="form-control" name="depth" id=depth> <select class="form-control" name="depth" id=depth>
<option value="1">1</option> {% for depth in range(max_depth) %}
<option value="2">2</option> <option value="{{ depth + 1 }}">{{ depth + 1 }}</option>
<option value="3">3</option> {% endfor %}
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
</select> </select>
</div> </div>
</div> </div>
{%endif%}
<div class="form-group row"> <div class="form-group row">
<label for="referer" class="col-sm-2 col-form-label">Referer (Optional):</label> <label for="referer" class="col-sm-2 col-form-label">Referer (Optional):</label>