mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-12-12 11:05:42 +00:00
Basic handler for diff rendering
This commit is contained in:
@@ -801,6 +801,16 @@ def changedetection_app(config=None, datastore_o=None):
|
|||||||
logs=notification_debug_log if len(notification_debug_log) else ["No errors or warnings detected"])
|
logs=notification_debug_log if len(notification_debug_log) else ["No errors or warnings detected"])
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
# render an image which contains the diff of two images
|
||||||
|
@app.route("/diff/image/<string:uuid>/<string:first_date>/<string:second_date>")
|
||||||
|
def render_diff_image(uuid, first_date, second_date):
|
||||||
|
from flask import make_response
|
||||||
|
resp = make_response("xxxxx")
|
||||||
|
resp.headers['Content-Type'] = 'image/jpeg'
|
||||||
|
return resp
|
||||||
|
|
||||||
|
|
||||||
@app.route("/api/<string:uuid>/snapshot/current", methods=['GET'])
|
@app.route("/api/<string:uuid>/snapshot/current", methods=['GET'])
|
||||||
@login_required
|
@login_required
|
||||||
def api_snapshot(uuid):
|
def api_snapshot(uuid):
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="diff-ui">
|
<div id="diff-ui">
|
||||||
|
<img src="{{ url_for('render_diff_image', uuid=uuid, first_date=versions[0], second_date=current_previous_version) }}" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user