Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a86fba5
commit 36aa0a6
Showing
7 changed files
with
50 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
export let device: any; | ||
</script> | ||
|
||
<div class="card w-96 bg-primary shadow-xl"> | ||
<div class="card-body"> | ||
<h2 class="card-title">{device.name} ({device.id})</h2> | ||
<p>{device.description}</p> | ||
<p> | ||
<span>Address: </span> | ||
<span>{device.address}</span> | ||
</p> | ||
<p> | ||
<span>Created at: </span> | ||
<span>{device.created_at}</span> | ||
</p> | ||
<p> | ||
<span>Active?: </span> | ||
<span>{device.is_active}</span> | ||
</p> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script lang="ts"> | ||
import Device from './Device.svelte'; | ||
export let devices; | ||
</script> | ||
|
||
<h1>Device List</h1> | ||
|
||
{#if devices?.length} | ||
<div class="m-4"> | ||
<div class="flex flex-wrap gap-x-4 gap-y-4"> | ||
{#each devices as device} | ||
<Device {device} /> | ||
{/each} | ||
</div> | ||
</div> | ||
{:else} | ||
<div>No devices found</div> | ||
{/if} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export default function handleError(error: unknown | null) { | ||
if (!error) { | ||
return | ||
} | ||
console.error(error); | ||
} | ||
if (!error) { | ||
return; | ||
} | ||
console.error(error); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,9 @@ | ||
<script lang="ts"> | ||
import DeviceList from '$components/device/DeviceList.svelte'; | ||
import type { PageData } from './$types'; | ||
export let data: PageData; | ||
$: ({ devices } = data); | ||
</script> | ||
|
||
<div>WIP: Devices</div> | ||
|
||
{#if devices?.length} | ||
<ul> | ||
{#each devices as device} | ||
<li>{device.name}</li> | ||
{/each} | ||
</ul> | ||
{:else} | ||
<div>No devices found</div> | ||
{/if} | ||
<DeviceList {devices} /> |