{% extends "base.html" %} {% macro env_label(env) -%} {%- if env.key == 'default' and env.title == '默认' -%}{{ t('默认') }}{%- else -%}{{ env.title }}{%- endif -%} {%- endmacro %} {% 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 stats.key_issues %}
{{ t('{count} 个目标的密钥不可用', count=stats.key_issues) }}{{ t('请在对应目标里重新录入密钥,否则工具会拒绝使用它。') }}
{% endif %} {% if has_targets %} {% endif %} {% if not environments %}

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

{{ t('先新建环境,再在里面登记目标。') }}

{{ t('新建环境') }}
{% elif not has_targets %}

{% if has_any_targets or environments|length > 1 %}{{ t('这个环境还没有目标') }}{% else %}{{ t('还没有登记任何目标') }}{% endif %}

{{ t('选一个类型,填写连接和允许访问的范围。') }}

{% for card in type_cards %} {{ t(card.label) }} {% endfor %}
{% elif not rows %}

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

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

{{ t('清除筛选') }}
{% else %}
{% for target in rows %} {% endfor %}
{{ t('名称') }} {{ t('类型') }} {{ t('端点') }} {{ t('授权范围') }} {{ t('状态') }} {{ t('最近测试') }} {{ t('操作') }}
{{ target.name }} {% if target.secret_fields and not target.secret_ok %}{{ t('密钥异常') }}{% endif %} {{ t(target.type_label) }} {{ t(target.endpoint) }} {{ t(target.scope_source, **target.scope_params) }}
{{ 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" data-test-time') }}{% else %}{% endif %}
{{ t('失败详情') }}
{% if target.last_test_message %}

{{ target.last_test_message }}

{% endif %} {% if target.last_test_command and target.client_extra %}
{% endif %}
{{ t('编辑') }} {{ t('删除') }}
{% for target in rows %} {% if target.client_extra %} {% endif %} {% endfor %} {% endif %} {% set env_return = 'targets' %} {% set context_env = current_env.key if current_env else '' %} {% include "_environment_drawer.html" %} {% endblock %}