Add frontend option for bulk killing/removing clients

This commit is contained in:
raul 2024-06-13 09:23:35 +02:00
parent 7c08d039f8
commit 2c9a204ac6
2 changed files with 58 additions and 42 deletions

View File

@ -34,48 +34,61 @@
<h2 align=center>Current clients</h2> <h2 align=center>Current clients</h2>
<hr> <hr>
{{ range .Clients }} <form>
<table border=1> {{ range .Clients }}
<tr> <table border=1>
<td id="bold">ID</td> <tr>
<td id="bold">Status</td> <td id="bold" rowspan="2"><input type="checkbox" name="clients[]" value="{{ .ClientID }}"></td>
<td id="bold">Remote IP</td> <td id="bold">ID</td>
<td id="bold">Local IP</td> <td id="bold">Status</td>
<td id="bold">Username</td> <td id="bold">Remote IP</td>
<td id="bold">Hostname</td> <td id="bold">Local IP</td>
<td id="bold">Operating System</td> <td id="bold">Username</td>
<td rowspan=2> <td id="bold">Hostname</td>
<a target="_blank" href="command/{{ .ClientID }}"><b>CMD</b></a> <td id="bold">Operating System</td>
</td> <td rowspan=2>
<td rowspan=2> <a target="_blank" href="command/{{ .ClientID }}"><b>CMD</b></a>
<a href="/" hx-post="kill/{{ .ClientID }}" hx-swap="none" id="pointer"><b>KILL</b></a> </td>
</td> <td rowspan=2>
<td rowspan=2> <a href="/" hx-post="kill/{{ .ClientID }}" hx-swap="none" id="pointer"><b>KILL</b></a>
<a href="/" hx-post="remove/{{ .ClientID }}" hx-swap="none" id="pointer"><b>REMOVE</b></a> </td>
</td> <td rowspan=2>
</tr> <a href="/" hx-post="remove/{{ .ClientID }}" hx-swap="none" id="pointer"><b>REMOVE</b></a>
<tr> </td>
<td>{{ .ClientID }}</td> </tr>
<td> <tr>
{{ if .IsOnline }} <td>{{ .ClientID }}</td>
<on> <td>
OK {{ if .IsOnline }}
</on> <on>
{{ else }} OK
<off> </on>
Offline {{ else }}
</off> <off>
{{ end }} Offline
</td> </off>
<td>{{ .ClientBasicInfo.PublicIP }}</td> {{ end }}
<td>{{ .ClientBasicInfo.LocalIP }}</td> </td>
<td>{{ .ClientBasicInfo.Username }}</td> <td>{{ .ClientBasicInfo.PublicIP }}</td>
<td>{{ .ClientBasicInfo.Hostname }}</td> <td>{{ .ClientBasicInfo.LocalIP }}</td>
<td>{{ .ClientBasicInfo.OperatingSystem }}</td> <td>{{ .ClientBasicInfo.Username }}</td>
</tr> <td>{{ .ClientBasicInfo.Hostname }}</td>
</table> <td>{{ .ClientBasicInfo.OperatingSystem }}</td>
<hr> </tr>
{{ end }} </table>
<hr>
{{ end }}
<b>
<ul>
<li class="hor">
<p><a hx-post="/bulk-kill" hx-swap="none" target="_blank" id="pointer">Bulk kill</a></p>
</li>
<li class="hor">
<p><a hx-post="/bulk-remove" hx-swap="none" target="_blank" id="pointer">Bulk remove</a></p>
</li>
</ul>
</b>
</form>
</div> </div>
</div> </div>
</body> </body>

View File

@ -23,16 +23,19 @@ ul {
li.hor { li.hor {
display: inline-flex; display: inline-flex;
vertical-align: center;
margin-right: 20px; margin-right: 20px;
} }
td.left { td.left {
text-align: left; text-align: left;
vertical-align: center;
padding-left: 5px; padding-left: 5px;
} }
td { td {
text-align: center; text-align: center;
vertical-align: center;
padding: 5px; padding: 5px;
} }