watchyourlan/internal/web/templates/config.html
2023-06-26 21:21:29 +07:00

102 lines
No EOL
4.7 KiB
HTML

{{ define "config" }}
<body>
<div class="container mt-5">
<div class="row">
<div class="col">
<table class="table">
<form action="/save_config/" method="post">
<tr>
<td>Interfaces</td>
<td><input name="iface" type="text" class="form-control" value="{{ .Config.Iface }}"></td>
</tr>
<tr>
<td>Path to DB</td>
<td><input name="dbpath" type="text" class="form-control" value="{{ .Config.DbPath }}"></td>
</tr>
<tr>
<td>Host</td>
<td><input name="host" type="text" class="form-control" value="{{ .Config.GuiIP }}"></td>
</tr>
<tr>
<td>Port</td>
<td><input name="port" type="text" class="form-control" value="{{ .Config.GuiPort }}"></td>
</tr>
<tr>
<td>Timeout (seconds)</td>
<td><input name="timeout" type="text" class="form-control" value="{{ .Config.Timeout }}"></td>
</tr>
<tr>
<td>Shoutrrr URL</td>
<td>
<textarea name="shout" class="form-control" style="width: 100%;" rows="3" wrap="soft">{{ .Config.ShoutURL }}</textarea>
</td>
</tr>
<tr>
<td>Theme</td>
<td><select name="theme" class="form-select">
<option selected>{{ .Config.Theme }}</option>
{{ range .Themes }}
<option value="{{ . }}">{{ . }}</option>
{{ end }}
</select></td>
</tr>
<tr>
<td>Color mode</td>
<td><select name="color" class="form-select">
<option selected>{{ .Config.Color }}</option>
<option value="light">light</option>
<option value="dark">dark</option>
</select></td>
</tr>
<tr>
<td>Ignore IP</td>
<td>
<select name="ignoreip" class="form-select">
<option selected value="{{ .Config.IgnoreIP }}">{{ .Config.IgnoreIP }}</option>
<option value="yes">yes</option>
<option value="no">no</option>
</select>
</td>
</tr>
<tr>
<td>Log Level</td>
<td>
<select name="loglevel" class="form-select">
<option selected value="{{ .Config.LogLevel }}">{{ .Config.LogLevel }}</option>
<option value="short">short</option>
<option value="verbose">verbose</option>
</select>
</td>
</tr>
<tr>
<td><button type="submit" class="btn btn-primary">Save</button></td>
</form>
<td>
<a href="/test_notify/"><button style="float: right;" class="btn btn-success">Test notification</button></a>
</td>
</tr>
</table>
</div>
<div class="col">
<p>Current version: {{ .Version }}</p>
<div class="alert alert-info" role="alert">
<p>● There can be one or more <b>Interfaces</b>, space separated</p>
<p>● After changing <b>Host</b>, <b>Port</b> or <b>Path to DB</b> you need to restart the app</p>
<p><b>Timeout</b> means time between scans (in seconds)</p>
<p><b>Shoutrrr URL</b> provides notifications to Discord, Email, Gotify, Telegram and other services. <a href="https://containrrr.dev/shoutrrr/v0.5/services/overview/" target="_blank">Link to documentation</a></p>
<p>● If you want to detect unknown hosts by MAC only, set <b>Ignore IP</b> to "yes"</p>
<p><b>Log Level</b> defines how much log output you want to see</p>
<p>● The <b>Clear table</b> button below will delete all records from table. If you want to delete a single host, click on its MAC and press <b>Delete host</b> button</p>
</div>
<br>
<form action="/clear/" method="post">
<button type="submit" class="btn btn-danger">Clear table</button>
</form>
</div>
</div>
</div>
{{ template "footer" }}
{{ end }}