Skip to content

Commit

Permalink
Ref #8 List of reports on main page
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Kaźmierczyk <kazm@ibm.com>
  • Loading branch information
kkazmierczyk committed Oct 30, 2024
1 parent 6d933e1 commit 03a4921
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion javacore_analyser_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
logging.info("Python version: " + sys.version)
logging.info("Preferred encoding: " + locale.getpreferredencoding())
reports_dir = os.getenv("REPORTS_DIR", DEFAULT_REPORTS_DIR)
logging.info("Reports directory: " + reports_dir)
logging_utils.create_file_logging(reports_dir)


@app.route('/')
def index():
return render_template('index.html')
reports = [Path(f).name for f in os.scandir(reports_dir) if f.is_dir()]
return render_template('index.html', reports=reports)


@app.route('/reports/<path:path>')
Expand Down
7 changes: 7 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@ <h1>Upload Files</h1>
<input type="file" name="files" multiple>
<input type="submit" value="Upload">
</form>

<h1>List of the reports:</h1>
<table>
{% for report in reports %}
<tr><td>{{ report }}</td></tr>
{% endfor %}
</table>
</body>
</html>

0 comments on commit 03a4921

Please sign in to comment.