| | |
| | | {% block header %}Чаты{% endblock %} |
| | | {% block content %} |
| | | |
| | | <div class="overflow-hidden rounded-xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm"> |
| | | <table class="w-full text-sm"> |
| | | <thead class="bg-gray-50 dark:bg-gray-900/60 text-gray-500 dark:text-gray-400"> |
| | | <tr> |
| | | <th class="px-5 py-3 text-left font-medium">Чат</th> |
| | | <th class="px-5 py-3 text-left font-medium">Капча</th> |
| | | <th class="px-5 py-3 text-left font-medium">Варны</th> |
| | | <th class="px-5 py-3 text-right font-medium"></th> |
| | | </tr> |
| | | </thead> |
| | | <tbody class="divide-y divide-gray-100 dark:divide-gray-800"> |
| | | {% for c in chats %} |
| | | {% set cfg = cfgs.get(c.chat_id) %} |
| | | <tr class="hover:bg-gray-50 dark:hover:bg-gray-800/50"> |
| | | <td class="px-5 py-3"> |
| | | <div class="flex items-center gap-3"> |
| | | <img src="/avatar/{{ c.chat_id }}" alt="" class="h-8 w-8 rounded-full bg-gray-200 object-cover dark:bg-gray-700" onerror="this.style.visibility='hidden'"> |
| | | <div> |
| | | <div class="font-medium">{{ c.title or c.chat_id }}</div> |
| | | <div class="text-xs text-gray-500">id {{ c.chat_id }} · {{ c.type }}</div> |
| | | </div> |
| | | </div> |
| | | </td> |
| | | <td class="px-5 py-3 text-gray-500">{{ cfg.btn_count }} кнопки · {{ cfg.timeout }} с · {{ cfg.max_attempts }} попытки</td> |
| | | <td class="px-5 py-3 text-gray-500">{{ cfg.warn_limit }} · {{ "бан" if cfg.warn_action == "ban" else "мут" }}</td> |
| | | <td class="px-5 py-3 text-right"> |
| | | <a href="/chats/{{ c.chat_id }}" class="rounded-lg border border-gray-200 dark:border-gray-700 px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-800">Открыть</a> |
| | | </td> |
| | | </tr> |
| | | {% else %} |
| | | <tr><td colspan="4" class="px-5 py-8 text-center text-gray-500">Нет доступных чатов.</td></tr> |
| | | {% endfor %} |
| | | </tbody> |
| | | </table> |
| | | <div class="grid gap-4 sm:grid-cols-2 xl:grid-cols-3"> |
| | | {% for c in chats %} |
| | | {% set cfg = cfgs.get(c.chat_id) %} |
| | | <a href="/chats/{{ c.chat_id }}" |
| | | class="block rounded-xl border bg-white p-4 shadow-sm transition hover:shadow-md dark:bg-gray-900 |
| | | {% if alarms.get(c.chat_id) %}border-red-500 ring-1 ring-red-500{% else %}border-gray-200 hover:border-brand-400 dark:border-gray-800 dark:hover:border-brand-500{% endif %}"> |
| | | <div class="flex items-center gap-3"> |
| | | <img src="/avatar/{{ c.chat_id }}" alt="" |
| | | class="h-11 w-11 shrink-0 rounded-full bg-gray-200 object-cover dark:bg-gray-700" |
| | | onerror="this.style.visibility='hidden'"> |
| | | <div class="min-w-0 flex-1"> |
| | | <div class="truncate font-semibold">{{ c.title or c.chat_id }}</div> |
| | | <div class="truncate text-xs text-gray-500">id {{ c.chat_id }} · {{ c.type }}</div> |
| | | </div> |
| | | {% if alarms.get(c.chat_id) %} |
| | | <span class="shrink-0 rounded-full bg-red-600 px-2 py-0.5 text-[10px] font-bold text-white">ТРЕВОГА</span> |
| | | {% endif %} |
| | | </div> |
| | | <dl class="mt-4 grid grid-cols-2 gap-x-4 gap-y-2 text-xs text-gray-500"> |
| | | <div><dt class="text-gray-400">Капча</dt><dd class="text-gray-700 dark:text-gray-300">{{ cfg.btn_count }} кнопки / {{ cfg.timeout }} с</dd></div> |
| | | <div><dt class="text-gray-400">Попыток</dt><dd class="text-gray-700 dark:text-gray-300">{{ cfg.max_attempts }}</dd></div> |
| | | <div><dt class="text-gray-400">Варны</dt><dd class="text-gray-700 dark:text-gray-300">{{ cfg.warn_limit }} · {{ "бан" if cfg.warn_action == "ban" else "мут" }}</dd></div> |
| | | <div><dt class="text-gray-400">Действие</dt><dd class="text-gray-700 dark:text-gray-300">{{ cfg.warn_duration }} с</dd></div> |
| | | </dl> |
| | | </a> |
| | | {% else %} |
| | | <div class="rounded-xl border border-gray-200 bg-white p-8 text-center text-gray-500 dark:border-gray-800 dark:bg-gray-900 sm:col-span-2 xl:col-span-3"> |
| | | Нет доступных чатов. |
| | | </div> |
| | | {% endfor %} |
| | | </div> |
| | | |
| | | {% endblock %} |