- 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
45 lines
1.5 KiB
HTML
45 lines
1.5 KiB
HTML
{% extends 'dashboard.html' %}
|
|
|
|
{% block page %}
|
|
|
|
{{ render_partial('dashboard/http_functions/header.html',
|
|
function_id=function_id,
|
|
active_tab='edit',
|
|
show_edit_form=True,
|
|
show_logs=True,
|
|
show_client=False,
|
|
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="app" class="p-1">
|
|
<!-- The Editor component will be mounted here -->
|
|
</div>
|
|
|
|
<script>
|
|
// Mount the component
|
|
m.mount(document.getElementById("app"), {
|
|
view: () => m(Editor, {
|
|
name: '{{ timer_function.name }}',
|
|
functionId: {{ timer_function.id }},
|
|
jsValue: {{ timer_function.code | tojson | safe }},
|
|
jsonValue: {{ timer_function.environment | tojson | safe }},
|
|
isEdit: true,
|
|
showHeader: true,
|
|
versionNumber: {{ timer_function.version_number }},
|
|
isEnabled: {{ timer_function.enabled | tojson }},
|
|
executeUrl: "{{ url_for('execute_code', playground='true') }}",
|
|
saveUrl: "{{ url_for('timer.edit', function_id=function_id) }}",
|
|
deleteUrl: "{{ url_for('timer.delete', function_id=function_id) }}",
|
|
showDeleteButton: true,
|
|
isTimer: true,
|
|
showTimerSettings: true,
|
|
cancelUrl: "{{ url_for('timer.overview') }}"
|
|
})
|
|
})
|
|
</script>
|
|
|
|
{% endblock %} |