Add version history view for timer functions
- Implement `/history/<function_id>` route in timer routes to fetch and display function versions - Create new Mithril `DiffView` component for comparing script versions - Add new history template for timer functions with version comparison - Include version diff functionality using AceDiff library - Update header and edit templates to include history URL for timer functions
This commit is contained in:
26
templates/dashboard/timer_functions/history.html
Normal file
26
templates/dashboard/timer_functions/history.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends 'dashboard.html' %}
|
||||
|
||||
{% block page %}
|
||||
|
||||
{{ render_partial('dashboard/http_functions/header.html',
|
||||
user_id=user_id,
|
||||
function_id=function_id,
|
||||
active_tab='history',
|
||||
show_edit_form=True,
|
||||
show_logs=True,
|
||||
show_history=True,
|
||||
edit_url=url_for('timer.edit', function_id=function_id),
|
||||
cancel_url=url_for('timer.overview'),
|
||||
logs_url=url_for('timer.logs', function_id=function_id),
|
||||
history_url=url_for('timer.history', function_id=function_id))
|
||||
}}
|
||||
|
||||
<div id="version-diff"></div>
|
||||
|
||||
<script>
|
||||
// Mount the Mithril component with versions as an attribute
|
||||
m.mount(document.getElementById("version-diff"), {
|
||||
view: () => m(DiffView, { versions: {{ versions| tojson }} })
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user