{% extends "base.html" %} {% from "_macros.html" import env_label %} {% block title %}{{ t('目标') }} · {{ product_name }}{% endblock %} {% block content %} {% if environments %} {% endif %} {% if current_env and not current_env.enabled %}
{{ t('这个环境已停用') }} {{ t('排查工具会拒绝使用其中的目标;需要管理员重新启用。') }}
{% endif %}
{{ t('目标总数') }}{{ stats.total }}
{{ t('已启用') }}{{ stats.enabled }}
{{ t('最近测试失败') }}{{ stats.failed }}
{{ t('密钥异常') }}{{ stats.key_issues }}
{% if has_targets %} {% endif %} {% if not environments %}

{{ t('还没有环境') }}

{{ t('请联系管理员创建环境并登记目标。') }}

{% elif not has_targets %}

{{ t('这个环境还没有目标') }}

{{ t('请联系管理员登记目标。') }}

{% elif not rows %}

{{ t('没有匹配的目标') }}

{{ t('调整搜索词或类型筛选后再试。') }}

{{ t('清除筛选') }}
{% else %}
{% for target in rows %} {% endfor %}
{{ t('名称') }} {{ t('类型') }} {{ t('端点') }} {{ t('授权范围') }} {{ t('状态') }} {{ t('最近测试') }}
{{ target.name }} {{ t(target.type_label) }} {{ t(target.endpoint) }} {% for group in target.scope %}
{{ t(group.label) }} {% if group.unlimited %}{{ t('不限') }} {% elif group.values %}{% for value in group.values %}{{ value }}{% endfor %} {% else %}{{ t('未授权') }}{% endif %}
{% endfor %}
{{ t('已启用') if target.enabled else t('已停用') }}
{{ t('成功') if target.last_test_ok else (t('失败') if target.last_test_at_display else t('未测试')) }} {% if target.last_test_at %}{{ local_time(target.last_test_at, extra='class="muted small"') }}{% endif %}
{% if target.last_test_error %}
{{ t('失败详情') }}

{{ target.last_test_message or target.last_test_error }}

{% if target.last_test_command %}

{{ target.last_test_command }}

{% endif %}
{% endif %}
{% endif %} {% endblock %}