2026-10-05 09:36:20 +02:00
<!-- retoor <retoor@molodetz.nl> -->
{% extends "admin/base_admin.html" %}
{% block admin_content %}
< h1 > {{ service.title }}</ h1 >
< p class = "muted" > {{ service.description }}</ p >
< div data-service-monitor = "detail" data-service = "{{ service.name }}" >
< div class = "tabs" role = "tablist" data-tabs >
2026-10-05 11:25:41 +02:00
< button type = "button" class = "active" data-tab = "overview" > Overview</ button >
< button type = "button" data-tab = "config" > Configuration</ button >
2026-10-05 09:36:20 +02:00
< button type = "button" data-tab = "logs" > Logs</ button >
</ div >
< section data-panel = "overview" >
< p > Status: < span class = "status {{ service.status }}" data-field = "status" > {{ service.status }}</ span ></ p >
< div class = "stat-cards" data-field = "cards" >
{% for card in service.metrics.cards or [] %}< div class = "stat-card" >< span class = "value" > {{ card.value }}</ span >< span class = "name" > {{ card.label }}</ span ></ div > {% endfor %}
</ div >
< div class = "actions" >
< form method = "post" action = "/admin/services/{{ service.name }}/command" >< input type = "hidden" name = "verb" value = "{{ 'stop' if service.enabled else 'start' }}" >< button class = "button ghost small" type = "submit" > {{ 'Stop' if service.enabled else 'Start' }}</ button ></ form >
2026-10-05 11:25:41 +02:00
< form method = "post" action = "/admin/services/{{ service.name }}/command" >< input type = "hidden" name = "verb" value = "run" >< button class = "button ghost small" type = "submit" > Run now</ button ></ form >
< form method = "post" action = "/admin/services/{{ service.name }}/command" >< input type = "hidden" name = "verb" value = "clear" >< button class = "button ghost small" type = "submit" > Clear logs</ button ></ form >
2026-10-05 09:36:20 +02:00
</ div >
</ section >
< section data-panel = "config" hidden >
< form class = "form" method = "post" action = "/admin/services/{{ service.name }}/config" >
{% for group in service.fields | map(attribute='group') | unique %}
< span class = "label" > {{ group }}</ span >
{% for field in service.fields if field.group == group %}
< div class = "field" >
< label for = "f-{{ field.key }}" > {{ field.label }}</ label >
{% if field.type in ('bool', 'select') %}
< select id = "f-{{ field.key }}" name = "{{ field.key }}" >
{% for option in (field.options if field.type == 'select' else ['0', '1']) %}
< option value = "{{ option }}" {% if field . value = = option | string %} selected {% endif %} > {{ option }}</ option >
{% endfor %}
</ select >
{% elif field.type == 'text' %}
< textarea id = "f-{{ field.key }}" name = "{{ field.key }}" > {{ field.value }}</ textarea >
{% else %}
< input id = "f-{{ field.key }}" type = "{{ 'password' if field.secret else ('number' if field.type == 'int' else 'text') }}" name = "{{ field.key }}" value = "{{ field.value }}" {% if field . minimum is not none %} min = "{{ field.minimum }}" {% endif %} {% if field . maximum is not none %} max = "{{ field.maximum }}" {% endif %} >
{% endif %}
{% if field.help %}< span class = "help" > {{ field.help }}</ span > {% endif %}
</ div >
{% endfor %}
{% endfor %}
2026-10-05 11:25:41 +02:00
< div class = "actions" >< button class = "button" type = "submit" > Save</ button ></ div >
2026-10-05 09:36:20 +02:00
</ form >
</ section >
< section data-panel = "logs" hidden >
< pre class = "log-tail" data-field = "logs" > {{ service.logs | join('\n') }}</ pre >
</ section >
</ div >
{% endblock %}
{% block extra_js %}< script type = "module" src = "{{ static_url('/static/js/utils/ServiceMonitor.js') }}" ></ script > {% endblock %}