61 lines
1.7 KiB
Plaintext
61 lines
1.7 KiB
Plaintext
<!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="/public/style.css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>PostgreSQL Access</h1>
|
|
<nav>
|
|
<a href="/">Главная</a>
|
|
<a href="/query">SQL-консоль</a>
|
|
</nav>
|
|
<% if (env === 'test') { %><span class="badge test">TEST</span><% } %>
|
|
</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.database %></td></tr>
|
|
<tr><th>User</th><td><%= cfg.user %></td></tr>
|
|
</table>
|
|
<% if (error) { %>
|
|
<p class="error"><%= error %></p>
|
|
<% } else { %>
|
|
<p class="ok">✓ Подключение активно</p>
|
|
<% } %>
|
|
</section>
|
|
|
|
<% if (tables && !error) { %>
|
|
<section class="card">
|
|
<h2>Таблицы (<%= tables.length %>)</h2>
|
|
<% if (tables.length) { %>
|
|
<table>
|
|
<thead>
|
|
<tr><th>Схема</th><th>Таблица</th><th></th></tr>
|
|
</thead>
|
|
<tbody>
|
|
<% tables.forEach(function (t) { %>
|
|
<tr>
|
|
<td><%= t.schemaname %></td>
|
|
<td><%= t.tablename %></td>
|
|
<td><a href="/table?schema=<%= t.schemaname %>&name=<%= t.tablename %>">открыть</a></td>
|
|
</tr>
|
|
<% }); %>
|
|
</tbody>
|
|
</table>
|
|
<% } else { %>
|
|
<p>Доступных таблиц нет.</p>
|
|
<% } %>
|
|
</section>
|
|
<% } %>
|
|
</main>
|
|
</body>
|
|
</html>
|