zai / app /templates /components /token_pool.html
sanbo110's picture
update sth at 2025-10-16 14:55:36
47258ea
<!-- Token 池状态卡片 -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{% for token in tokens %}
<div class="border rounded-lg p-4 hover:shadow-lg transition-shadow">
<div class="flex items-center justify-between mb-2">
<span class="text-sm font-medium text-gray-700">Token #{{ token.index }}</span>
<span class="px-2 py-1 text-xs font-semibold rounded-full {{ token.status_color }}">
{{ token.status }}
</span>
</div>
<div class="space-y-1 text-sm text-gray-600">
<div class="truncate">
<span class="font-mono text-xs bg-gray-100 px-2 py-1 rounded">{{ token.key }}</span>
</div>
<div>类型:
{% if token.token_type == 'user' %}
<span class="text-green-600 font-semibold">认证用户</span>
{% elif token.token_type == 'guest' %}
<span class="text-yellow-600 font-semibold">匿名用户</span>
{% else %}
<span class="text-gray-600">未知</span>
{% endif %}
</div>
<div>成功率: <span class="font-medium">{{ token.success_rate }}</span></div>
<div>失败次数: <span class="font-medium">{{ token.failure_count }}</span></div>
<div class="text-xs text-gray-500">最后使用: {{ token.last_used }}</div>
</div>
</div>
{% endfor %}
{% if not tokens %}
<div class="col-span-full text-center py-8 text-gray-500">
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4" />
</svg>
<p class="mt-2">暂无 Token 配置</p>
<p class="mt-1 text-sm">请在配置管理页面添加 Token</p>
</div>
{% endif %}
</div>