Commit b6a2be26 authored by Zixian Cai's avatar Zixian Cai

Visualizing individual commit

parent 6f6a0936
......@@ -28,6 +28,15 @@ root = Blueprint('root', __name__,
url_prefix=settings.WEB_PREFIX)
@root.route("/visualize_commit", methods=["POST"])
def visualize_commit():
repo, host = settings.WEB_POI_REPO, settings.WEB_POI_HOST
logfile = storage.load(repo, host, request.form.get("commit"))
result = json.loads(logfile.read())
group_stats_result(result)
return render_template("visualize.html", result=result)
@root.route("/visualize_file", methods=["POST"])
def visualize_file():
if "logfile" not in request.files:
......
......@@ -16,17 +16,32 @@
{% extends 'base.html' %}
{% block body %}
<div class="panel panel-default">
<div class="panel-heading">Visualizing Log File</div>
<div class="panel-body">
<form action="{{ url_for('root.visualize_file') }}" method="post"
enctype="multipart/form-data">
<div class="form-group">
<label for="file_1">Log File</label>
<input type="file" name="logfile" id="file_1">
</div>
<button type="submit" class="btn btn-primary">Display</button>
</form>
<div class="panel panel-default">
<div class="panel-heading">Visualizing Log File</div>
<div class="panel-body">
<form action="{{ url_for('root.visualize_file') }}" method="post"
enctype="multipart/form-data">
<div class="form-group">
<label for="file_1">Log File</label>
<input type="file" name="logfile" id="file_1">
</div>
<button type="submit" class="btn btn-primary">Display</button>
</form>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Visualizing Commit/div>
<div class="panel-body">
<form action="{{ url_for('root.visualize_comment') }}"
method="post">
<div class="form-group">
<label for="commit">Log File</label>
<input type="text" name="commit" id="commit">
</div>
<button type="submit" class="btn btn-primary">Display
</button>
</form>
</div>
</div>
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment