Add Go VPN admin panel with Docker Compose and Postgres 17.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
orohi
2026-07-29 03:47:42 +03:00
co-authored by Cursor
parent 23101e355c
commit b1e31430b5
17 changed files with 1229 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{.Title}} · VPN Panel</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/static/css/app.css">
</head>
<body class="page-admin">
<aside class="sidebar">
<a class="brand" href="/admin">VPN Panel</a>
<nav>
<a class="{{if eq .Active "dashboard"}}active{{end}}" href="/admin">Обзор</a>
<a class="{{if eq .Active "protocols"}}active{{end}}" href="/admin/protocols">Протоколы</a>
</nav>
<div class="sidebar-foot">
<span class="user-chip">{{.UserName}}</span>
<form method="POST" action="/logout"><button type="submit" class="link-btn">Выйти</button></form>
</div>
</aside>
<main class="admin-main">
<header class="admin-header">
<h1>Протоколы</h1>
<p class="muted">Включение и отключение VPN-протоколов</p>
</header>
<div class="table-wrap">
<table class="data-table">
<thead>
<tr>
<th>Протокол</th>
<th>Код</th>
<th>Порт</th>
<th>Статус</th>
<th></th>
</tr>
</thead>
<tbody>
{{range .Protocols}}
<tr>
<td>
<strong>{{.Name}}</strong>
<div class="cell-desc">{{.Description}}</div>
</td>
<td><code>{{.Code}}</code></td>
<td>{{.Port}}</td>
<td>
<span class="badge {{if .Enabled}}on{{else}}off{{end}}">{{if .Enabled}}Включён{{else}}Выключен{{end}}</span>
</td>
<td class="actions">
<form method="POST" action="/admin/protocols/{{.ID}}/toggle">
<button type="submit" class="btn btn-sm {{if .Enabled}}btn-ghost{{else}}btn-primary{{end}}">
{{if .Enabled}}Выключить{{else}}Включить{{end}}
</button>
</form>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</main>
</body>
</html>