Files
getpgdata/site/templates/index.html
T

63 lines
1.8 KiB
HTML

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PostgreSQL Access</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<header>
<h1>PostgreSQL Access</h1>
<nav>
<a href="{{ url_for('index') }}">Главная</a>
<a href="{{ url_for('query') }}">SQL-консоль</a>
</nav>
{% if env == 'test' %}<span class="badge test">TEST</span>{% endif %}
</header>
<main>
<section class="card">
<h2>Подключение</h2>
<table class="kv">
<tr><th>Host</th><td>{{ cfg.host }}</td></tr>
<tr><th>Port</th><td>{{ cfg.port }}</td></tr>
<tr><th>Database</th><td>{{ cfg.dbname }}</td></tr>
<tr><th>User</th><td>{{ cfg.user }}</td></tr>
</table>
{% if error %}
<p class="error">{{ error }}</p>
{% else %}
<p class="ok">✓ Подключение активно</p>
{% endif %}
</section>
{% if tables is not none and not error %}
<section class="card">
<h2>Таблицы ({{ tables|length }})</h2>
{% if tables %}
<table>
<thead>
<tr><th>Схема</th><th>Таблица</th><th></th></tr>
</thead>
<tbody>
{% for t in tables %}
<tr>
<td>{{ t.schemaname }}</td>
<td>{{ t.tablename }}</td>
<td>
<a href="{{ url_for('table', schema=t.schemaname, name=t.tablename) }}">открыть</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>Доступных таблиц нет.</p>
{% endif %}
</section>
{% endif %}
</main>
</body>
</html>