Add feature to restore script content to a specific version on history page

This commit is contained in:
Peter Stockings
2025-11-25 15:43:12 +11:00
parent 17518c3fcc
commit c0970835ab
5 changed files with 131 additions and 6 deletions

View File

@@ -18,7 +18,11 @@ history_url=url_for('http.history', function_id=function_id)) }}
<script>
// Mount the Mithril component with versions as an attribute
m.mount(document.getElementById("history-view"), {
view: () => m(FunctionHistory, { versions: {{ versions| tojson | safe }} })
view: () => m(FunctionHistory, {
versions: {{ versions| tojson | safe }},
function_id: {{ function_id }},
restore_url: "{{ url_for('http.restore', function_id=function_id) }}"
})
});
</script>
{% endblock %}

View File

@@ -20,7 +20,11 @@ history_url=url_for('timer.history', function_id=function_id))
<script>
// Mount the Mithril component with versions as an attribute
m.mount(document.getElementById("history-view"), {
view: () => m(FunctionHistory, { versions: {{ versions| tojson | safe }} })
view: () => m(FunctionHistory, {
versions: {{ versions| tojson | safe }},
function_id: {{ function_id }},
restore_url: "{{ url_for('timer.restore', function_id=function_id) }}"
})
});
</script>
{% endblock %}