Files
function/templates/dashboard/http_functions/new.html
Peter Stockings aeb880ed0a Update cancel URL handling in HTTP and timer function templates
- Modify header template to use explicit `cancel_url` parameter
- Add `cancel_url` to new timer and HTTP function templates
- Remove default URL fallback in header template
2025-02-16 20:22:03 +11:00

42 lines
1.2 KiB
HTML

{% extends 'dashboard.html' %}
{% block page %}
{{ render_partial('dashboard/http_functions/header.html',
user_id=user_id,
show_name=False,
show_refresh=False,
show_logs=False,
show_client=False,
show_link=False,
dashboardUrl=url_for('dashboard_http_functions'),
cancel_url=url_for('dashboard_http_functions'),
title='New HTTP Function')
}}
<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: '{{ name }}',
jsValue: {{ script | tojson | safe }},
jsonValue: {{ environment_info | tojson | safe }},
isEdit: false,
isAdd: true,
showHeader: true,
isPublic: {{ is_public | tojson }},
logRequest: {{ log_request | tojson }},
logResponse: {{ log_response | tojson }},
executeUrl: "{{ url_for('execute_code', playground='true') }}",
saveUrl: "{{ url_for('api_create_http_function') }}",
showDeleteButton: false,
dashboardUrl: "{{ url_for('dashboard_http_functions') }}"
})
})
</script>
{% endblock %}