add devices list
- add DeviceController - add getDevices to DeviceRegistryService - add WebClient deviceRegistryDevices to DeviceRegisterWebClientCalls.kt - add device list.html - fix no items found for device type list.html - add device to main menu in layout.html - add device to AdminPaths.kt
This commit is contained in:
53
src/main/resources/templates/device/list.html
Normal file
53
src/main/resources/templates/device/list.html
Normal file
@@ -0,0 +1,53 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<title>Hlæja Management</title>
|
||||
<th:block th:replace="~{layout.html :: metadata}"/>
|
||||
</head>
|
||||
<body class="bg-gray-900 text-green-400 min-h-screen flex flex-col">
|
||||
<th:block th:replace="~{layout.html :: header}"/>
|
||||
<main class="container mx-auto p-4 flex-grow">
|
||||
<div class="bg-gray-800 p-6 rounded-lg border border-green-900">
|
||||
<h1 class="text-lg sm:text-xl mb-4 terminal-glow">Device</h1>
|
||||
<hr class="border-green-900 mb-4">
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<div th:if="${pagination.start > pagination.size}" class="text-sm">
|
||||
Show page <span th:text="${pagination.page}"/> items 0 - 0
|
||||
</div>
|
||||
<div th:unless="${pagination.start > pagination.size}" class="text-sm">
|
||||
Show page <span th:text="${pagination.page}"/>
|
||||
items <span th:text="${pagination.start}"/> -
|
||||
<span th:text="${pagination.size}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-sm">
|
||||
<thead>
|
||||
<tr class="border-b border-green-900">
|
||||
<th class="py-2 px-4 text-left">ID</th>
|
||||
<th class="py-2 px-4 text-left">Time</th>
|
||||
<th class="py-2 px-4 text-left">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:if="${items.isEmpty()}">
|
||||
<td colspan="4" class="py-2 px-4 text-center text-green-600">No devices found</td>
|
||||
</tr>
|
||||
<tr th:each="item : ${items}" class="border-b border-gray-700 hover:bg-gray-700">
|
||||
<td th:text="${item.id}" class="py-2 px-4"></td>
|
||||
<td th:data-timestamp="${item.timestamp}" class="py-2 px-4 utcTimestamp"></td>
|
||||
<td th:text="${item.type}" class="py-2 px-4"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<th:block th:replace="~{pagination :: pagination('/device', ${pagination})}"/>
|
||||
</div>
|
||||
</main>
|
||||
<th:block th:replace="~{layout.html :: footer}"/>
|
||||
<th:block th:replace="~{layout.html :: script}"/>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => makeLocalTime(document.querySelectorAll('.utcTimestamp')));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -35,7 +35,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:if="${items.isEmpty()}">
|
||||
<td colspan="4" class="py-2 px-4 text-center text-green-600">No accounts found</td>
|
||||
<td colspan="4" class="py-2 px-4 text-center text-green-600">No device types found</td>
|
||||
</tr>
|
||||
<tr th:each="item : ${items}" class="border-b border-gray-700 hover:bg-gray-700">
|
||||
<td th:text="${item.name}" class="py-2 px-4"></td>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<th:block th:if="${remoteUser.hasRole('admin')}">
|
||||
<a href="/account" class="block px-4 py-2 text-sm hover:bg-gray-700 hover:text-green-300 transition-colors">Account</a>
|
||||
<a href="/type" class="block px-4 py-2 text-sm hover:bg-gray-700 hover:text-green-300 transition-colors">Device Type</a>
|
||||
<a href="/device" class="block px-4 py-2 text-sm hover:bg-gray-700 hover:text-green-300 transition-colors">Device</a>
|
||||
<a href="#" class="block px-4 py-2 text-sm hover:bg-gray-700 hover:text-green-300 transition-colors">$ Device</a>
|
||||
<hr class="dropdown-divider">
|
||||
</th:block>
|
||||
|
||||
Reference in New Issue
Block a user