Change flow so home page is device select from where you can browse to overview

This commit is contained in:
Peter Stockings
2023-01-24 20:51:53 +11:00
parent 5dc2b866f4
commit bbf67f5768
5 changed files with 107 additions and 39 deletions

View File

@@ -1,26 +1,29 @@
<div class="relative overflow-x-auto">
<table class="lg:w-1/4 sm:w-full text-sm text-left text-gray-500 dark:text-gray-400">
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
<tr>
<th scope="col" class="px-6 py-3">
Name
</th>
<th scope="col" class="px-6 py-3">
Status
</th>
</tr>
</thead>
<tbody>
{% for d in devices %}
<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 cursor-pointer">
<th scope="row" class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
{{d['name']}}
</th>
<td class="px-6 py-4">
{{d['is_active']}}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="flex justify-center">
<div class="relative overflow-x-auto">
<table class="lg:w-1/4 sm:w-full text-sm text-left text-gray-500 dark:text-gray-400">
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
<tr>
<th scope="col" class="px-6 py-3">
Name
</th>
<th scope="col" class="px-6 py-3">
Status
</th>
</tr>
</thead>
<tbody>
{% for d in devices %}
<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 cursor-pointer"
hx-get="{{ url_for('overview', device_id=d['id']) }}" hx-target="#container">
<th scope="row" class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
{{d['name']}}
</th>
<td class="px-6 py-4">
{{d['is_active']}}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>