{% extends "dashboard/base.html" %} {% block title %}{{ t.dashboard }}{% endblock %} {% block page_title %}{{ t.overview }}{% endblock %} {% block content %}
{% if is_admin is defined and is_admin %} {# ══════════════════════════════════════════════════════ #} {# ADMIN DASHBOARD #} {# ══════════════════════════════════════════════════════ #}

{{ t.total_projects }}

{{ stats.projects_count }}

{{ t.view_all }}

{{ t.active_api_keys }}

{{ stats.api_keys_count }}

{{ t.view_all }}

{{ t.total_tools }}

{{ stats.tools_count }}

{% if lang == 'fa' %}ابزارهای موجود{% else %}Available tools{% endif %}

{{ t.system_uptime }}

{{ "%.1f"|format(stats.uptime_days) }}d

{{ t.view_all }}

{{ t.recent_activity }}

{% if recent_activity %} {% for activity in recent_activity %}
{% if activity.type == 'tool_call' %}
{% elif activity.type == 'auth' %}
{% elif activity.level == 'ERROR' %}
{% else %}
{% endif %}

{{ activity.message }}

{{ activity.project if activity.project and activity.project != 'None' else '-' }}

{{ activity.timestamp[:19] if activity.timestamp else '-' }}
{% endfor %} {% else %}

{{ t.no_activity }}

{% endif %}
{% if recent_activity %} {% endif %}

{{ t.projects_by_type }}

{% set plugin_colors = { 'wordpress': 'bg-blue-500', 'woocommerce': 'bg-purple-500', 'wordpress_advanced': 'bg-indigo-500', 'gitea': 'bg-green-500', 'n8n': 'bg-orange-500', 'supabase': 'bg-emerald-500', 'openpanel': 'bg-cyan-500', 'appwrite': 'bg-pink-500', 'directus': 'bg-violet-500', } %} {% set plugin_icons = { 'wordpress': 'W', 'woocommerce': 'WC', 'wordpress_advanced': 'WA', 'gitea': 'G', 'n8n': 'n8n', 'supabase': 'SB', 'openpanel': 'OP', 'appwrite': 'AW', 'directus': 'DI', } %} {% if projects_by_type %} {% for plugin_type, count in projects_by_type.items() %}
{{ plugin_icons.get(plugin_type, plugin_type[:2]|upper) }}
{{ plugin_type|plugin_name }}
{{ count }}
{% endfor %} {% else %}

{% if lang == 'fa' %}پروژه‌ای یافت نشد{% else %}No projects found{% endif %}

{% endif %}

{{ t.health_status }}

{% for component, status in health_summary.components.items() %}
{{ component }}
{% if status == 'healthy' %} {{ t.healthy }} {% elif status == 'warning' %} {{ t.warning }} {% else %} {{ t.error }} {% endif %}
{% endfor %}

{% if lang == 'fa' %}آخرین بررسی:{% else %}Last check:{% endif %} {{ health_summary.last_check[:19] }}

{% if lang == 'fa' %}حمایت از پروژه{% else %}Support MCP Hub{% endif %}

{% if lang == 'fa' %}با حمایت مالی به توسعه این پروژه کمک کنید{% else %}Help us keep this project alive and growing{% endif %}

{% if lang == 'fa' %}حمایت با رمزارز{% else %}Donate with Crypto{% endif %}
{% else %} {# ══════════════════════════════════════════════════════ #} {# USER DASHBOARD #} {# ══════════════════════════════════════════════════════ #}

{{ t.get('my_services', 'My Services') }}

{{ stats.sites_count|default(0) }}

{{ t.view_all }}

{{ t.get('active_connections', 'Active Connections') }}

{{ stats.active_sites_count|default(0) }}

{% if lang == 'fa' %}اتصالات فعال{% else %}Active connections{% endif %}

{{ t.get('user_api_keys', 'API Keys') }}

{{ stats.api_keys_count|default(0) }}

{{ t.view_all }}

{{ t.get('available_tools', 'Available Tools') }}

{{ stats.tools_count|default(0) }}

{% if lang == 'fa' %}ابزارهای MCP قابل استفاده{% else %}MCP tools available{% endif %}

{{ t.get('site_status', 'Site Status') }}

{{ t.get('add_site', 'Add Service') }}
{% if user_sites %} {% set plugin_colors = { 'wordpress': 'bg-blue-500', 'woocommerce': 'bg-purple-500', 'wordpress_advanced': 'bg-indigo-500', 'gitea': 'bg-green-500', 'n8n': 'bg-orange-500', 'supabase': 'bg-emerald-500', 'openpanel': 'bg-cyan-500', 'appwrite': 'bg-pink-500', 'directus': 'bg-violet-500', } %} {% for site in user_sites %}
{{ site.plugin_type[:2]|upper }}

{{ site.alias }}

{{ site.plugin_type|plugin_name }} · {{ site.url[:40] }}{% if site.url|length > 40 %}...{% endif %}

{% if site.status == 'active' %} {{ t.get('active', 'Active') }} {% elif site.status == 'error' %} {{ t.get('error', 'Error') }} {% else %} Pending {% endif %}
{% endfor %} {% else %}

{{ t.get('no_services_yet', "You haven't connected any services yet.") }}

{{ t.get('add_first_service', 'Add your first service to start using MCP tools.') }}

{{ t.get('add_site', 'Add Service') }}
{% endif %}
{% endif %}
{% endblock %} {% block scripts %} {% endblock %}