Show protocol enable state and which nodes have each protocol installed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
orohi
2026-07-29 04:18:09 +03:00
co-authored by Cursor
parent 6510de0214
commit 1ad5125bf4
12 changed files with 745 additions and 67 deletions
+57
View File
@@ -46,12 +46,69 @@
<form method="POST" action="/admin/nodes/{{.Node.ID}}/check">
<button class="btn btn-ghost" type="submit">Проверить online</button>
</form>
<form method="POST" action="/admin/nodes/{{.Node.ID}}/sync">
<button class="btn btn-ghost" type="submit">Синхронизировать протоколы</button>
</form>
<form method="POST" action="/admin/nodes/{{.Node.ID}}/delete" onsubmit="return confirm('Удалить ноду из панели?');">
<button class="btn btn-ghost" type="submit">Удалить</button>
</form>
<a class="btn btn-ghost" href="/admin/nodes">К списку</a>
</div>
<section class="panel-section">
<h2>Протоколы на этом сервере</h2>
<div class="table-wrap">
<table class="data-table">
<thead>
<tr>
<th>Протокол</th>
<th>Порт</th>
<th>Установлен</th>
<th>Включён</th>
<th></th>
</tr>
</thead>
<tbody>
{{range .NodeProtocols}}
<tr>
<td>
<strong>{{.ProtocolName}}</strong>
<div><code>{{.ProtocolCode}}</code></div>
</td>
<td>{{.Port}}</td>
<td><span class="badge {{if .Installed}}on{{else}}off{{end}}">{{if .Installed}}Да{{else}}Нет{{end}}</span></td>
<td><span class="badge {{if .Enabled}}on{{else}}off{{end}}">{{if .Enabled}}ON{{else}}OFF{{end}}</span></td>
<td class="actions actions-multi">
{{if not .Installed}}
<form method="POST" action="/admin/nodes/{{$.Node.ID}}/protocols/{{.ProtocolID}}">
<input type="hidden" name="action" value="install">
<button class="btn btn-sm btn-primary" type="submit">Установить</button>
</form>
{{else}}
{{if .Enabled}}
<form method="POST" action="/admin/nodes/{{$.Node.ID}}/protocols/{{.ProtocolID}}">
<input type="hidden" name="action" value="disable">
<button class="btn btn-sm btn-ghost" type="submit">Выключить</button>
</form>
{{else}}
<form method="POST" action="/admin/nodes/{{$.Node.ID}}/protocols/{{.ProtocolID}}">
<input type="hidden" name="action" value="enable">
<button class="btn btn-sm btn-primary" type="submit">Включить</button>
</form>
{{end}}
<form method="POST" action="/admin/nodes/{{$.Node.ID}}/protocols/{{.ProtocolID}}">
<input type="hidden" name="action" value="uninstall">
<button class="btn btn-sm btn-ghost" type="submit">Снять</button>
</form>
{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</section>
<section class="panel-section">
<h2>Важно</h2>
<p class="muted">Откройте порт <strong>{{.Node.NodePort}}</strong> на ноде <em>только</em> для IP панели (как NODE_PORT в Remnawave).</p>