GUI buttons
This commit is contained in:
parent
7d93c1973a
commit
177ba13497
3 changed files with 12 additions and 9 deletions
9
Makefile
9
Makefile
|
|
@ -1,6 +1,9 @@
|
||||||
DUSER=aceberg
|
DUSER=aceberg
|
||||||
DNAME=watchyourlan
|
DNAME=watchyourlan
|
||||||
|
|
||||||
|
IFACE=virbr-bw
|
||||||
|
DBPATH=data/hosts.db
|
||||||
|
|
||||||
mod:
|
mod:
|
||||||
cd src && \
|
cd src && \
|
||||||
rm go.mod && \
|
rm go.mod && \
|
||||||
|
|
@ -9,7 +12,9 @@ mod:
|
||||||
|
|
||||||
run:
|
run:
|
||||||
cd src && \
|
cd src && \
|
||||||
sudo go run .
|
sudo \
|
||||||
|
env IFACE=$(IFACE) DBPATH=$(DBPATH) \
|
||||||
|
go run .
|
||||||
|
|
||||||
go-build:
|
go-build:
|
||||||
cd src && \
|
cd src && \
|
||||||
|
|
@ -21,7 +26,7 @@ docker-build:
|
||||||
docker-run:
|
docker-run:
|
||||||
docker rm wyl || true
|
docker rm wyl || true
|
||||||
docker run --name wyl \
|
docker run --name wyl \
|
||||||
-e "IFACE=virbr-bw" \
|
-e "IFACE=$(IFACE)" \
|
||||||
-e "TZ=Asia/Novosibirsk" \
|
-e "TZ=Asia/Novosibirsk" \
|
||||||
--network="host" \
|
--network="host" \
|
||||||
-v ~/.dockerdata/wyl:/data \
|
-v ~/.dockerdata/wyl:/data \
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,9 @@ func webgui() {
|
||||||
// fmt.Println(FoundHosts)
|
// fmt.Println(FoundHosts)
|
||||||
address := AppConfig.GuiIP + ":" + AppConfig.GuiPort
|
address := AppConfig.GuiIP + ":" + AppConfig.GuiPort
|
||||||
|
|
||||||
fmt.Println(fmt.Sprintf("http://%s", address))
|
fmt.Println("\n=================================== ")
|
||||||
|
fmt.Println(fmt.Sprintf("Web GUI at http://%s", address))
|
||||||
|
fmt.Println("=================================== \n")
|
||||||
|
|
||||||
http.HandleFunc("/", index)
|
http.HandleFunc("/", index)
|
||||||
http.HandleFunc("/update_host/", update_host)
|
http.HandleFunc("/update_host/", update_host)
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@
|
||||||
<th>Hardware</th>
|
<th>Hardware</th>
|
||||||
<th>Last seen</th>
|
<th>Last seen</th>
|
||||||
<th>Known</th>
|
<th>Known</th>
|
||||||
<th> </th>
|
|
||||||
</tr>
|
</tr>
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
<form action="/update_host/" method="post">
|
<form action="/update_host/" method="post">
|
||||||
|
|
@ -55,14 +54,11 @@
|
||||||
<td>{{ .Date }}</td>
|
<td>{{ .Date }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ if eq .Known 1 }}
|
{{ if eq .Known 1 }}
|
||||||
<input name="known" class="form-check-input" type="checkbox" checked>
|
<button value="off" name="known" type="submit" class="btn btn-success">Yes</button>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<input name="known" class="form-check-input" type="checkbox">
|
<button value="on" name="known" type="submit" class="btn btn-warning">No</button>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<button type="submit" class="btn btn-primary">Ok</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</form>
|
</form>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue