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:
Peter Stockings
2025-02-17 19:19:45 +11:00
parent 77957a61a3
commit 17457e492e
11 changed files with 173 additions and 11 deletions

View File

@@ -59,8 +59,7 @@
{% if show_history|default(false, true) %}
<button
class="group flex flex-col items-center {% if active_tab == 'history' %}text-blue-600{% else %}text-gray-500 hover:text-blue-600{% endif %}"
hx-get="{{ url_for('get_http_function_history', function_id=function_id) }}" hx-target="#container"
hx-swap="innerHTML" hx-push-url="true">
hx-get="{{ history_url }}" hx-target="#container" hx-swap="innerHTML" hx-push-url="true">
<div
class="p-2 rounded-lg {% if active_tab == 'history' %}bg-blue-50{% else %}group-hover:bg-blue-50{% endif %}">
<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 512 512"