148 lines
5.8 KiB
HTML
148 lines
5.8 KiB
HTML
<!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 href="/admin">Обзор</a>
|
||
<a href="/admin/nodes">Ноды</a>
|
||
<a class="active" href="/admin/profiles">Профили</a>
|
||
<a 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 row-head">
|
||
<div>
|
||
<h1>{{.Profile.Name}}</h1>
|
||
<p class="muted">{{.Profile.InboundCount}} inbound(s) · {{.Profile.NodeCount}} node(s)</p>
|
||
</div>
|
||
<a class="btn btn-ghost" href="/admin/profiles">К списку</a>
|
||
</header>
|
||
|
||
{{if .Flash}}<div class="alert ok">{{.Flash}}</div>{{end}}
|
||
{{if .Error}}<div class="alert">{{.Error}}</div>{{end}}
|
||
|
||
<section class="panel-section">
|
||
<h2>Профиль</h2>
|
||
<form class="form-card" method="POST" action="/admin/profiles/{{.Profile.ID}}">
|
||
<div class="form-grid">
|
||
<label>Имя
|
||
<input name="name" required value="{{.Profile.Name}}">
|
||
</label>
|
||
<label>Описание
|
||
<input name="description" value="{{.Profile.Description}}">
|
||
</label>
|
||
</div>
|
||
<div class="cta-row">
|
||
<button class="btn btn-primary" type="submit">Сохранить</button>
|
||
<button class="btn btn-ghost" type="submit" form="delete-profile" onclick="return confirm('Удалить профиль и все инбаунды?');">Удалить</button>
|
||
</div>
|
||
</form>
|
||
<form id="delete-profile" method="POST" action="/admin/profiles/{{.Profile.ID}}/delete"></form>
|
||
</section>
|
||
|
||
<section class="panel-section">
|
||
<h2>Инбаунды</h2>
|
||
<div class="table-wrap">
|
||
<table class="data-table">
|
||
<thead>
|
||
<tr>
|
||
<th>Tag</th>
|
||
<th>Протокол</th>
|
||
<th>Порт</th>
|
||
<th>Network</th>
|
||
<th>Security</th>
|
||
<th>В профиле</th>
|
||
<th></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{{range .Profile.Inbounds}}
|
||
<tr>
|
||
<td><code>{{.Tag}}</code>{{if .Remark}}<div class="cell-desc">{{.Remark}}</div>{{end}}</td>
|
||
<td>{{.ProtocolName}} <code>{{.ProtocolCode}}</code></td>
|
||
<td>{{.Port}}</td>
|
||
<td>{{.Network}}</td>
|
||
<td>{{.Security}}</td>
|
||
<td><span class="badge {{if .Enabled}}on{{else}}off{{end}}">{{if .Enabled}}ON{{else}}OFF{{end}}</span></td>
|
||
<td class="actions actions-multi">
|
||
<form method="POST" action="/admin/profiles/{{$.Profile.ID}}/inbounds/{{.ID}}/toggle">
|
||
<button class="btn btn-sm btn-ghost" type="submit">{{if .Enabled}}Выкл{{else}}Вкл{{end}}</button>
|
||
</form>
|
||
<form method="POST" action="/admin/profiles/{{$.Profile.ID}}/inbounds/{{.ID}}/delete" onsubmit="return confirm('Удалить inbound?');">
|
||
<button class="btn btn-sm btn-ghost" type="submit">Удалить</button>
|
||
</form>
|
||
</td>
|
||
</tr>
|
||
{{else}}
|
||
<tr><td colspan="7"><span class="muted">Инбаундов пока нет — добавьте ниже</span></td></tr>
|
||
{{end}}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</section>
|
||
|
||
<section class="panel-section">
|
||
<h2>Добавить inbound</h2>
|
||
<form class="form-card" method="POST" action="/admin/profiles/{{.Profile.ID}}/inbounds">
|
||
<div class="form-grid">
|
||
<label>Протокол
|
||
<select name="protocol_id" required>
|
||
{{range .Protocols}}
|
||
<option value="{{.ID}}">{{.Name}} ({{.Code}})</option>
|
||
{{end}}
|
||
</select>
|
||
</label>
|
||
<label>Tag
|
||
<input name="tag" placeholder="VLESS-443 (авто если пусто)">
|
||
</label>
|
||
<label>Порт
|
||
<input name="port" type="number" placeholder="443">
|
||
</label>
|
||
<label>Listen
|
||
<input name="listen" value="0.0.0.0">
|
||
</label>
|
||
<label>Network
|
||
<select name="network">
|
||
<option value="tcp">tcp</option>
|
||
<option value="ws">ws</option>
|
||
<option value="grpc">grpc</option>
|
||
<option value="quic">quic</option>
|
||
<option value="udp">udp</option>
|
||
</select>
|
||
</label>
|
||
<label>Security
|
||
<select name="security">
|
||
<option value="none">none</option>
|
||
<option value="tls">tls</option>
|
||
<option value="reality">reality</option>
|
||
</select>
|
||
</label>
|
||
<label>Порядок
|
||
<input name="sort_order" type="number" value="0">
|
||
</label>
|
||
<label>Заметка
|
||
<input name="remark" placeholder="опционально">
|
||
</label>
|
||
</div>
|
||
<button class="btn btn-primary" type="submit">Добавить inbound</button>
|
||
</form>
|
||
</section>
|
||
</main>
|
||
</body>
|
||
</html>
|