MCP Servers
{% if services %}
{% for service in services %}
{% endfor %}
{% else %}
{{ service.display_name }}
official
☁️ 💻
{# Refresh button - only show if user has health_check_service permission #}
{% if can_perform_action('health_check_service', service.display_name) %}
{% endif %}
Path: {{ service.path }}
{% for tag in service.tags %}
{{ tag }}
{% endfor %}
{{ service.description | default('No description provided.') }}
{# --- Moved Status Badge Logic Here --- #} {% set initial_status = service.health_status %} {# Determine initial class and text, avoiding 'checking' text #} {% set status_class = 'status-unknown' %} {% set display_text = 'unknown' %} {% if initial_status == 'healthy' %} {% set status_class = 'status-healthy' %} {% set display_text = 'healthy' %} {% elif initial_status.startswith('unhealthy') %} {% set status_class = 'status-unhealthy' %} {% set display_text = initial_status.split('(')[0].strip() %} {% elif initial_status.startswith('error') %} {% set status_class = 'status-error' %} {% set display_text = initial_status.split('(')[0].strip() %} {% elif initial_status == 'disabled' %} {% set status_class = 'status-disabled' %} {% set display_text = 'disabled' %} {% elif initial_status == 'checking' %} {# If checking initially, display as 'unknown' until first WS update #} {# Spinner will be shown by JS if needed #} {% set status_class = 'status-unknown' %} {% set display_text = 'unknown' %} {% endif %} {# Generate IDs - REMOVE leading slash BEFORE replacing #} {% set safe_path = service.path | replace('/', '', 1) | replace('/', '_') | replace(':', '_') %} {% set badge_id = 'status-badge-' + safe_path %} {% set spinner_id = 'spinner-for-' + safe_path %} {% set last_checked_id = 'last-checked-' + safe_path %} {# Render badge with determined initial text/class #}
{{ display_text }}
{# Always render spinner, hide initially with inline style #}
{# Check if user has modify_service permission for this specific service #}
{% if can_perform_action('modify_service', service.display_name) %}
Modify
{% endif %}
{# Check if user has toggle_service permission for this specific service #}
{% if can_perform_action('toggle_service', service.display_name) %}
{# Add ID to form if needed, but action URL is sufficient #}
{% elif can_perform_action('list_service', service.display_name) %}
{# Users who can list but not toggle: show read-only status #}
📖 {{ 'Enabled' if service.is_enabled else 'Disabled' }} (Read-only)
{% endif %}
No services found matching your query, or none registered. Try rescanning.
{% endif %}