63 lines
3.2 KiB
HTML
63 lines
3.2 KiB
HTML
<!doctype html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Машины — LPRA</title>
|
|
<link rel="stylesheet" href="/static/app.css">
|
|
</head>
|
|
<body>
|
|
<header class="topbar">
|
|
<div class="brand">LPRA · Удалённый доступ</div>
|
|
<nav>
|
|
<a href="/">Машины</a>
|
|
<a href="/settings">Настройки</a>
|
|
<form method="post" action="/logout" style="display:inline; margin-left:22px">
|
|
<button class="btn ghost small" type="submit">Выйти</button>
|
|
</form>
|
|
</nav>
|
|
</header>
|
|
<div class="wrap">
|
|
<h1>Машины-клиенты</h1>
|
|
<div class="card">
|
|
{{if .Agents}}
|
|
<table>
|
|
<thead><tr><th>Статус</th><th>Имя</th><th>Hostname</th><th>ОС / Арх</th><th>Активность</th><th></th></tr></thead>
|
|
<tbody>
|
|
{{range .Agents}}
|
|
<tr>
|
|
<td class="nowrap"><span class="dot {{if .Online}}on{{else}}off{{end}}"></span>{{if .Online}}online{{else}}offline{{end}}</td>
|
|
<td>{{.Name}}</td>
|
|
<td class="muted">{{.Hostname}}</td>
|
|
<td class="muted nowrap">{{.OS}}/{{.Arch}}</td>
|
|
<td class="muted nowrap">{{.Seen}}</td>
|
|
<td class="actions">
|
|
<div class="row" style="gap:6px">
|
|
<a class="btn small" href="/agents/{{.ID}}/terminal">Терминал</a>
|
|
<a class="btn ghost small" href="/agents/{{.ID}}/files">Файлы</a>
|
|
<a class="btn ghost small" href="/agents/{{.ID}}/forwards">Порты</a>
|
|
<a class="btn ghost small icon" href="/agents/{{.ID}}/edit" title="Изменить">
|
|
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"/><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"/></svg>
|
|
</a>
|
|
<form method="post" action="/agents/{{.ID}}/delete" style="display:inline"
|
|
onsubmit="return confirm('Удалить машину {{.Name}}? Сервис на ней продолжит работать, но перестанет быть виден. Чтобы снова подключиться — переустановите агента.')">
|
|
<input type="hidden" name="csrf" value="{{$.CSRF}}">
|
|
<button class="btn danger small icon" type="submit" title="Удалить">
|
|
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><path d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{else}}
|
|
<p class="muted">Пока нет подключённых машин. Добавьте первую в разделе
|
|
<a href="/settings">Настройки</a> — там одна команда для установки.</p>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|