getpgdata: Flask-приложение для доступа к PostgreSQL (Nubes структура)
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Таблица — {{ schema }}.{{ name }}</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Таблица: {{ schema }}.{{ name }}</h1>
|
||||
<nav>
|
||||
<a href="{{ url_for('index') }}">Главная</a>
|
||||
<a href="{{ url_for('query') }}">SQL-консоль</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
{% if error %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% else %}
|
||||
<p>Строк всего: <strong>{{ count }}</strong>. Показано: {{ rows|length }} (стр. {{ page }}).</p>
|
||||
|
||||
{% if columns %}
|
||||
<div class="table-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{% for c in columns %}<th>{{ c }}</th>{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in rows %}
|
||||
<tr>
|
||||
{% for c in columns %}
|
||||
<td>
|
||||
{% if r[c] is none %}<span class="null">NULL</span>
|
||||
{% elif r[c] is boolean %}{{ 'true' if r[c] else 'false' }}
|
||||
{% else %}{{ r[c] }}{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<nav class="pager">
|
||||
{% if page > 1 %}
|
||||
<a href="{{ url_for('table', schema=schema, name=name, page=page-1, per_page=per_page) }}">← Назад</a>
|
||||
{% endif %}
|
||||
{% if page * per_page < count %}
|
||||
<a href="{{ url_for('table', schema=schema, name=name, page=page+1, per_page=per_page) }}">Вперёд →</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% else %}
|
||||
<p>Таблица пуста.</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user