mac4nick/templates/index.html
2020-08-15 09:10:47 +02:00

76 lines
2.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>macnickenson</title>
<link rel="stylesheet" href="/static/style.css">
</head>
<body class="bg-gray-100">
<div class="rounded-lg bg-white m-5 shadow-lg">
<h1 class="text-xl underline text-center p-2">
macnickenson
</h1>
<div class="p-2">
<h2 class="underline">Your Devices:</h2>
{% for device in my %}
<div class="grid grid-cols-3 grid-gap-1 p-1">
<div class="font-mono">{{ device.macaddr }}</div>
<div>
<input class="focus:shadow-outline border border-gray-300 px-2"
value="{{ device.descr }}"/>
<select class="focus:shadow-outline border border-gray-300 px-2">
<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>
</div>
<div>
<button class="rounded bg-gray-300 font-bold px-2 bg-green-500">Update</button>
<button class="rounded bg-gray-300 font-bold px-2 bg-red-500">Delete</button>
</div>
</div>
{% endfor %}
</div>
<div class="p-2">
<h2 class="underline">Unregistred Devices:</h2>
{% for device in unassinged %}
<div class="grid grid-cols-4 grid-gap-1 p-1">
<div class="font-mono">{{ device.macaddr }}</div>
<div class="font-mono">{{ device.ip() }}</div>
<div>
<input class="focus:shadow-outline border border-gray-300 px-2"
placeholder="awesome new device"/>
</div>
<div>
<button class="rounded bg-gray-300 font-bold px-2 bg-blue-300">Register</button>
</div>
</div>
{% endfor %}
</div>
<div class="shadow-lg p-2">
footer
</div>
</div>
</body>
</html>