115 lines
3.3 KiB
HTML
115 lines
3.3 KiB
HTML
<!doctype html>
|
|
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
|
|
<title>macnickenson</title>
|
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="container">
|
|
<h1>macnickenson</h1>
|
|
|
|
{% for message in messages %}
|
|
<div class="alert alert-{{ message.0.color() }}">{{ message.1 }}</div>
|
|
{% endfor %}
|
|
|
|
<div class="mt-5">
|
|
<h2>Your Devices:</h2>
|
|
<table class="table">
|
|
<thead><tr>
|
|
<th scope="col">Mac-Address</th>
|
|
<th scope="col">Description</th>
|
|
<th scope="col">Privacy</th>
|
|
<th scope="col">Commands</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
{% for device in my %}
|
|
<tr><form action="/change" method="POST">
|
|
<td>
|
|
{{ device.macaddr }}
|
|
{% if device.present %}
|
|
<span class="badge badge-success">on</span>
|
|
{% endif %}
|
|
<input type="hidden" name="macaddr" value="{{ device.macaddr }}" />
|
|
</td>
|
|
<td><input name="descr" required value="{{ device.descr }}" /></td>
|
|
<td>
|
|
<select name="privacy">
|
|
<option value="0"
|
|
{{ device.privacy.selected(crate::db::PrivacyLevel::ShowUserAndDevice) }}
|
|
>Show User and Device</option>
|
|
<option value="1"
|
|
{{ device.privacy.selected(crate::db::PrivacyLevel::ShowUser) }}
|
|
>Show User</option>
|
|
<option value="2"
|
|
{{ device.privacy.selected(crate::db::PrivacyLevel::ShowAnonymous) }}
|
|
>Show Anonymous</option>
|
|
<option value="3"
|
|
{{ device.privacy.selected(crate::db::PrivacyLevel::HideUser) }}
|
|
>Hide User</option>
|
|
<option value="4"
|
|
{{ device.privacy.selected(crate::db::PrivacyLevel::DontLog) }}
|
|
>Dont Log</option>
|
|
</select>
|
|
</td>
|
|
<td>
|
|
<div class="btn-group">
|
|
<button type="submit" name="action" value="update"
|
|
class="btn btn-primary">Update</button>
|
|
<button type="submit" name="action" value="delete"
|
|
class="btn btn-danger">Delete</button>
|
|
</div>
|
|
</td>
|
|
</form></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="mt-5">
|
|
<h2>Unregistred Devices:</h2>
|
|
<table class="table">
|
|
<thead><tr>
|
|
<th>MAC-Address</th>
|
|
<th>IP-Address</th>
|
|
<th>Description</th>
|
|
<th>Privacy</th>
|
|
<th>Commands</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
{% for device in unassinged %}
|
|
<tr><form action="/change" method="POST">
|
|
<td>
|
|
{{ device.macaddr }}
|
|
<input type="hidden" name="macaddr" value="{{ device.macaddr }}" />
|
|
</td>
|
|
<td>{{ device.ip() }}</td>
|
|
<td>
|
|
<input placeholder="awesome new device" required name="descr" />
|
|
</td>
|
|
<td>
|
|
<select name="privacy">
|
|
<option value="0">Show User and Device</option>
|
|
<option value="1">Show User</option>
|
|
<option value="2" selected>Show Anonymous</option>
|
|
<option value="3">Hide User</option>
|
|
<option value="4">Dont Log</option>
|
|
</select>
|
|
</td>
|
|
<td>
|
|
<button name="action" value="register" type="submit"
|
|
class="btn btn-success">Register</button>
|
|
</td>
|
|
</form></tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
<div>
|
|
footer
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|