Theme & favicon
This commit is contained in:
parent
2c785a8b13
commit
9e812e050a
3 changed files with 56 additions and 23 deletions
2
index.go
2
index.go
|
|
@ -10,7 +10,7 @@ var FoundHosts []Host
|
||||||
|
|
||||||
func index (w http.ResponseWriter, r *http.Request) {
|
func index (w http.ResponseWriter, r *http.Request) {
|
||||||
fmt.Println(FoundHosts)
|
fmt.Println(FoundHosts)
|
||||||
tmpl, _ := template.ParseFiles("templates/index.html")
|
tmpl, _ := template.ParseFiles("templates/index.html", "templates/header.html")
|
||||||
tmpl.ExecuteTemplate(w, "index", FoundHosts)
|
tmpl.ExecuteTemplate(w, "index", FoundHosts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
10
templates/header.html
Normal file
10
templates/header.html
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{{ define "header"}}
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Watch Your LAN</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA/6k7AP+uSQD/z50A7urjAD85MgAAOO8AWlpaAADIawAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADEREQAAAAAzEREREQAAAzEREREREAAzFxEREVERADN3d3VVVREDM3d3dYVlERMzd3d1VVUREzM3ERESERETMzcRESERERMzNxESMREREzM3ESNEQREwMzcSMxEREwAzNyM0REQzAAMzMzMzMzAAADMzMzMzAAAAADMzMwAAD4HwAA4AcAAMADAACAAQAAgAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIABAACAAQAAwAMAAOAHAAD4HwAA" rel="icon" type="image/x-icon" />
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootswatch@5.2.0/dist/solar/bootstrap.min.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
{{ end }}
|
||||||
|
|
@ -1,27 +1,50 @@
|
||||||
{{ define "index"}}
|
{{ define "index"}}
|
||||||
<html>
|
|
||||||
<head>
|
{{ template "header" }}
|
||||||
<title>Watch Your LAN</title>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootswatch@5.2.0/dist/spacelab/bootstrap.min.css" rel="stylesheet">
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<table>
|
<div class="container mt-3">
|
||||||
<tr>
|
<h2>Now online</h2>
|
||||||
<th>Name</th>
|
<table class="table table-striped">
|
||||||
<th>Ip</th>
|
<tr>
|
||||||
<th>Mac</th>
|
<th>Name</th>
|
||||||
<th>Hardware</th>
|
<th>Ip</th>
|
||||||
</tr>
|
<th>Mac</th>
|
||||||
{{ range . }}
|
<th>Hardware</th>
|
||||||
<tr>
|
<th>Known</th>
|
||||||
<td>{{ .Name }}</td>
|
</tr>
|
||||||
<td>{{ .Ip }}</td>
|
{{ range . }}
|
||||||
<td>{{ .Mac }}</td>
|
<tr>
|
||||||
<td>{{ .Hw }}</td>
|
<td>{{ .Name }}</td>
|
||||||
</tr>
|
<td>{{ .Ip }}</td>
|
||||||
{{ end }}
|
<td>{{ .Mac }}</td>
|
||||||
</table>
|
<td>{{ .Hw }}</td>
|
||||||
|
<td>{{ .Known }}</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
</table>
|
||||||
|
<h2>Log</h2>
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Ip</th>
|
||||||
|
<th>Mac</th>
|
||||||
|
<th>Hardware</th>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Known</th>
|
||||||
|
</tr>
|
||||||
|
{{ range . }}
|
||||||
|
<tr>
|
||||||
|
<td>{{ .Name }}</td>
|
||||||
|
<td>{{ .Ip }}</td>
|
||||||
|
<td>{{ .Mac }}</td>
|
||||||
|
<td>{{ .Hw }}</td>
|
||||||
|
<td>{{ .Date }}</td>
|
||||||
|
<td>{{ .Known }}</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
Loading…
Reference in a new issue