Commit b6a2be26 authored by Zixian Cai's avatar Zixian Cai

Visualizing individual commit

parent 6f6a0936
...@@ -28,6 +28,15 @@ root = Blueprint('root', __name__, ...@@ -28,6 +28,15 @@ root = Blueprint('root', __name__,
url_prefix=settings.WEB_PREFIX) 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(
return render_template("visualize.html", result=result)
@root.route("/visualize_file", methods=["POST"]) @root.route("/visualize_file", methods=["POST"])
def visualize_file(): def visualize_file():
if "logfile" not in request.files: if "logfile" not in request.files:
...@@ -16,17 +16,32 @@ ...@@ -16,17 +16,32 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% block body %} {% block body %}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Visualizing Log File</div> <div class="panel-heading">Visualizing Log File</div>
<div class="panel-body"> <div class="panel-body">
<form action="{{ url_for('root.visualize_file') }}" method="post" <form action="{{ url_for('root.visualize_file') }}" method="post"
enctype="multipart/form-data"> enctype="multipart/form-data">
<div class="form-group"> <div class="form-group">
<label for="file_1">Log File</label> <label for="file_1">Log File</label>
<input type="file" name="logfile" id="file_1"> <input type="file" name="logfile" id="file_1">
</div> </div>
<button type="submit" class="btn btn-primary">Display</button> <button type="submit" class="btn btn-primary">Display</button>
</form> </form>
</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') }}"
<div class="form-group">
<label for="commit">Log File</label>
<input type="text" name="commit" id="commit">
<button type="submit" class="btn btn-primary">Display
{% endblock %} {% 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