ctucx.git: dnsmasq-lease-overview

web-overview for dhcp-leases from dnsmasq

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>{{PAGE}}</title>
		<meta charset="utf-8">
		<style>
			body {
				font-family: system-ui;
			}

			main {
				margin-left: auto;
				margin-right: auto;
				max-width: 55em;
			}

			table, th, td {
				border: 1px solid #ddd;
				border-collapse: collapse;
				padding: 5px;
			}

			table {
				width: 100%;
			}
		</style>
	</head>
	<body>
		<main>
			<h2>DHCP Leases</h2>
			<table>
				<thead>
					<tr>
						<th>Hostname</th>
						<th>IPv4 address</th>
						<th>IPv6 address</th>
						<th>MAC address</th>
						<th>Expires in</th>
					</tr>
				</thead>
				<tbody>
					{{#LEASES}}
					<tr>
						{{#HAS_HTTP}}
						<td><a href="http://{{HOSTNAME}}">{{HOSTNAME}}</a></td>
						{{/HAS_HTTP}}
						{{^HAS_HTTP}}
						<td>{{HOSTNAME}}</td>
						{{/HAS_HTTP}}
						<td>{{IP4_ADDRESS}}</td>
						<td>{{IP6_ADDRESS}}</td>
						<td>{{MAC_ADDRESS}}</td>
						<td>{{EXPIRY_TIME}}</td>
					</tr>
					{{/LEASES}}
				</tbody>
			</table>
		</main>
	</body>
</html>