Skip to content

Commit

Permalink
Add fields for more information and a nicer layout
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwijos committed Jan 16, 2024
1 parent 411fff2 commit 6e913e2
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/routes/(protected)/admin/bikes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@
<tr>
<th class="px-6 py-3"><span class="sr-only">Cykel-ID</span></th>
<th class="px-6 py-3 table-cell-fit"><span class="sr-only">Aktiv</span></th>
<th class="px-6 py-3">Status</th>
<th class="px-6 py-3">Stad</th>
<th class="px-6 py-3">Batteri</th>
<th class="px-6 py-3 w-72">Status</th>
<th class="px-6 py-3 min-w-48 max-w-72">Batteri</th>
<th class="px-6 py-3 w-48">Stad</th>
<th class="px-6 py-3 w-96">Position</th>
<th class="px-6 py-3"><span class="sr-only">Redigera</span></th>
</tr>
</thead>
<tbody class="overflow-y-scroll text-sm" data-sveltekit-preload-data="false">
Expand All @@ -81,14 +83,24 @@
: 'bg-red-100 text-red-800'}">{bike.active ? '' : ''}</span
>
</td>
<td class="px-6 py-4">{statusCodes[bike.status_id]}</td>
<td class="px-6 py-4 w-48">{bike.city_id} </td>
<td class="px-6 py-4 grid gap-2 grid-cols-[1fr,auto] items-center min-w-48"
<td class="px-6 py-4 w-72">{statusCodes[bike.status_id]}</td>
<td class="px-6 py-4 grid gap-2 grid-cols-[1fr,auto] items-center min-w-48 max-w-72"
><ChargeMeter fraction={bike.charge_perc} /><span
>{Math.round(bike.charge_perc * 100)}%</span
>
</td>
</tr>
<td class="px-6 py-4 w-48">{bike.city_id} </td>
<td class="px-6 py-4 w-96 whitespace-nowrap"
>Lat. {bike.coords[1].toFixed(4)}, Lon. {bike.coords[0].toFixed(4)}</td
>
<td class="px-6 py-4 w-24">
<a
href="/admin/bikes/{bike.id}"
class="font-medium text-secondary-500 hover:underline whitespace-nowrap"
>Redigera</a
>
</td></tr
>
{/each}
</tbody>
</table>
Expand Down

0 comments on commit 6e913e2

Please sign in to comment.