Embeds a DB-IP Lite country MMDB (~5MB) in the binary via go:embed, keeping the single-binary deployment story clean. Country codes are stored alongside login attempts and sessions, shown in the dashboard (Top IPs, Top Countries card, Recent/Active Sessions, session detail). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
31 lines
904 B
HTML
31 lines
904 B
HTML
{{define "active_sessions"}}
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>IP</th>
|
|
<th>Country</th>
|
|
<th>Username</th>
|
|
<th>Shell</th>
|
|
<th>Score</th>
|
|
<th>Connected</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .}}
|
|
<tr>
|
|
<td><a href="/sessions/{{.ID}}"><code>{{truncateID .ID}}</code></a></td>
|
|
<td>{{.IP}}</td>
|
|
<td>{{.Country}}</td>
|
|
<td>{{.Username}}</td>
|
|
<td>{{.ShellName}}</td>
|
|
<td>{{if .HumanScore}}{{if gt (derefFloat .HumanScore) 0.6}}<mark>{{formatScore .HumanScore}}</mark>{{else}}{{formatScore .HumanScore}}{{end}}{{else}}-{{end}}</td>
|
|
<td>{{formatTime .ConnectedAt}}</td>
|
|
</tr>
|
|
{{else}}
|
|
<tr><td colspan="7">No active sessions</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{end}}
|