- Add new Mithril components for editor (editor.js), response view (responseView.js), and alerts (alert.js) - Create new API endpoints for creating, updating, and deleting HTTP functions - Update templates to use new Mithril editor component - Improve header navigation with more consistent styling and active state indicators - Remove old edit form route and template - Add new dedicated editor route and template cursor.ai
57 lines
2.4 KiB
HTML
57 lines
2.4 KiB
HTML
{% extends 'dashboard.html' %}
|
|
|
|
{% block page %}
|
|
|
|
{{ render_partial('dashboard/http_functions/header.html', user_id=user_id, function_id=function_id,
|
|
active_tab='logs',
|
|
show_edit_form=True,
|
|
show_logs=True,
|
|
show_client=True,
|
|
show_history=True,
|
|
edit_url=url_for('http_function_editor', function_id=function_id),
|
|
cancel_url=url_for('dashboard_http_functions')) }}
|
|
|
|
<div class="block md:grid md:grid-cols-4 md:gap-4 p-4">
|
|
<!-- Headers -->
|
|
<div class="font-medium text-muted-foreground md:block hidden">Timestamp</div>
|
|
<div class="font-medium text-muted-foreground md:block hidden">Request</div>
|
|
<div class="font-medium text-muted-foreground md:block hidden">Response</div>
|
|
<div class="font-medium text-muted-foreground md:block hidden">Logs</div>
|
|
|
|
<!-- Data Rows -->
|
|
{% for invocation in http_function_invocations %}
|
|
<!-- Timestamp and Status for Mobile and Desktop -->
|
|
<div class="flex items-center md:col-span-1 py-2 border-b">
|
|
<button
|
|
class="{{ 'bg-green-400' if invocation.status == 'SUCCESS' else 'bg-red-400' }} hover:bg-opacity-75 text-white font-bold rounded-full h-fit p-2 mr-2">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="{{ 'M5 13l4 4L19 7' if invocation.status == 'SUCCESS' else 'M6 18L18 6M6 6l12 12' }}"></path>
|
|
</svg>
|
|
</button>
|
|
<span>{{ invocation.invocation_time.strftime('%Y-%m-%d %H:%M:%S') }}</span>
|
|
<span class="bg-blue-500 text-white text-xs font-semibold px-2 py-1 rounded">
|
|
v{{ invocation.version_number }}
|
|
</span>
|
|
</div>
|
|
|
|
<!-- Request Data for Mobile and Desktop -->
|
|
<div class="font-mono text-gray-400 overflow-auto md:col-span-1 py-2 border-b">
|
|
{{ invocation.request_data }}
|
|
</div>
|
|
|
|
<!-- Response Data for Mobile and Desktop -->
|
|
<div class="font-mono text-gray-400 overflow-auto md:col-span-1 py-2 border-b">
|
|
{{ invocation.response_data }}
|
|
</div>
|
|
|
|
<!-- Logs for Mobile and Desktop -->
|
|
<div class="space-y-1 md:col-span-1 py-2 border-b">
|
|
{% for log in invocation.logs %}
|
|
<div class="font-mono text-gray-400">{{ log[0] }}</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% endblock %} |