Replace the entire Python/FastAPI backend with a Node.js/TypeScript stack: - Framework: Hono + @hono/node-server - Templates: Nunjucks (.njk) replacing Jinja2 (.html) - ORM: Drizzle ORM with mysql2 (same MariaDB schema, no migrations needed) - Sessions: hono-sessions with CookieStore - CSS: Pico CSS v2 replacing Bootstrap 5 (Bootstrap Icons CDN kept) - Dev: tsx watch; Prod: tsc + node dist/index.js Original Python app preserved in web-python/ as backup. Updated Dockerfile.web and docker-compose.yml for Node.js deployment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
68 lines
2.7 KiB
HTML
68 lines
2.7 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Подключения — ЭВОСИНК{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex align-items-center justify-content-between mb-4">
|
|
<h1 class="h4 mb-0">Подключения</h1>
|
|
<a href="/connections/add" class="btn btn-primary btn-sm">
|
|
<i class="bi bi-plus-lg me-1"></i>Добавить
|
|
</a>
|
|
</div>
|
|
|
|
{% if connections %}
|
|
<div class="row g-3">
|
|
{% for conn in connections %}
|
|
<div class="col-sm-6 col-lg-4">
|
|
<div class="card shadow-sm h-100">
|
|
<div class="card-body">
|
|
<div class="d-flex align-items-center mb-3">
|
|
<i class="bi {{ conn.icon }} fs-2 me-3 text-secondary"></i>
|
|
<div>
|
|
<h5 class="mb-0">{{ conn.name }}</h5>
|
|
{% if conn.details %}
|
|
<small class="text-muted">{{ conn.details }}</small>
|
|
{% endif %}
|
|
</div>
|
|
<div class="ms-auto">
|
|
{% if conn.is_online %}
|
|
<i class="bi bi-circle-fill text-success fs-5" title="Онлайн"></i>
|
|
{% else %}
|
|
<i class="bi bi-circle-fill text-danger fs-5" title="Офлайн"></i>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-flex gap-2">
|
|
<a href="{{ conn.configure_url }}" class="btn btn-outline-primary btn-sm flex-fill">Настроить</a>
|
|
<form method="post" action="/connections/delete?type={{ conn.type }}">
|
|
<button type="submit"
|
|
class="btn btn-outline-danger btn-sm"
|
|
onclick="return confirm('Вы уверены, что хотите отключить {{ conn.name }}?')">
|
|
Отключить
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="card-footer text-muted small">
|
|
{% if conn.last_checked_at %}
|
|
Проверено: {{ conn.last_checked_at.strftime("%d.%m.%Y %H:%M") }}
|
|
{% else %}
|
|
Статус ещё не проверялся
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% else %}
|
|
<div class="text-center py-5 text-muted">
|
|
<i class="bi bi-plug fs-1 mb-3 d-block"></i>
|
|
<p class="mb-3">Нет подключённых сервисов</p>
|
|
<a href="/connections/add" class="btn btn-primary">
|
|
<i class="bi bi-plus-lg me-1"></i>Добавить подключение
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|