Files
function/templates/dashboard/timer_functions/edit.html
Peter Stockings e09437c7b8 Implement timer functions with full CRUD functionality and enhanced UI
- Add comprehensive routes for creating, editing, deleting, and toggling timer functions
- Create new HTML templates for timer function overview, new, and edit pages
- Extend Mithril editor component to support timer-specific settings like trigger type, frequency, and enabled status
- Implement database schema and versioning for timer functions
- Add UI improvements for timer function listing with detailed schedule and status information
2025-02-16 19:50:58 +11:00

42 lines
1.3 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=True,
show_history=True,
edit_url=url_for('timer.edit', function_id=function_id),
cancel_url=url_for('timer.overview')) }}
<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 %}