up: UI improvments

pull/14/merge
Raphaël Vinot 2017-10-10 11:16:16 +02:00
parent 629370fc74
commit 19b0cb25f8
2 changed files with 16 additions and 2 deletions

View File

@ -57,6 +57,8 @@ def load_tree(report_dir):
def scrape(): def scrape():
if request.form.get('url'): if request.form.get('url'):
url = request.form.get('url') url = request.form.get('url')
if not url.startswith('http'):
url = 'http://{}'.format(url)
depth = request.form.get('depth') depth = request.form.get('depth')
if depth is None: if depth is None:
depth = 1 depth = 1

View File

@ -7,8 +7,20 @@
<form class="form-inline" role="form" action="scrape" method=post> <form class="form-inline" role="form" action="scrape" method=post>
<div class="form-group"> <div class="form-group">
URL to scrap: <input type="text" class="form-control" name="url" id=url placeholder="URL to scrape"> <label for="url">URL to scrape:</label>
Depth: <input type="text" class="form-control" name="depth" id=depth value=1 placeholder="Depth"> <input type="text" class="form-control" name="url" id=url placeholder="URL to scrape">
<label for="depth">Depth:</label>
<select class="form-control" name="depth" id=depth>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<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>
</div> </div>
<button type="submit" class="btn btn-default">Scrape</button> <button type="submit" class="btn btn-default">Scrape</button>
</form> </form>