Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions src/lib/components/ui/dashboardCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,19 @@
.then((res) => res.json())
.then((data) => {
return data;
}).catch((err) => {
return [];
})
.catch((err) => {
return [];
});
}
};

const latestDeviceData = async (device) => {
if (!device.data || !device.dev_eui) {
return await fetch(`/api/v1/devices/${device.dev_eui}/data/latest`)
.then((res) => res.json())
.then((data) => {
return data;
});
}
return await fetch(`/api/v1/devices/${device.dev_eui}/data/latest`)
.then((res) => res.json())
.then((data) => {
return data;
});
};

onMount(async () => {
Expand Down Expand Up @@ -162,12 +161,12 @@
<ProgressCircle />
{$_('app.loading_message')}
</div>
{:then data}
{#each Object.keys(data) as dataPointKey}
{:then latestData}
{#each Object.keys(latestData) as dataPointKey}
<div class="px-3 pb-3 flex border-b">
<p class="basis-1/2 text-base">{$_(dataPointKey)}</p>
<p class="basis-1/2 text-base flex flex-row">
{data[dataPointKey]}
{latestData[dataPointKey]}
<span class="text-sm text-slate-500 flex-grow"
>{nameToNotation(dataPointKey)}</span
>
Expand Down
6 changes: 0 additions & 6 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts">
import { SvelteToast } from '@zerodevx/svelte-toast';
import '../app.css';
import { dev } from '$app/environment';

import { settings } from 'svelte-ux';

Expand All @@ -27,9 +26,4 @@
</script>

<SvelteToast />
{#if dev}
<div class="w-full h-fit bg-orange-300 text-center">
🔨 DEVELOP ENVIRONMENT
</div>
{/if}
<slot />
6 changes: 6 additions & 0 deletions src/routes/app/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { ProgressCircle, Drawer, Button } from 'svelte-ux';
import { navigating } from '$app/stores';
import Close from '$lib/images/UI/cw_Close Button.svg';
import { dev } from '$app/environment';

export let data;
$: ({ session, supabase } = data);
Expand Down Expand Up @@ -115,6 +116,11 @@
</div>
</nav>
</div>
{#if dev}
<div class="w-full h-fit bg-orange-300 text-center">
🔨 DEVELOP ENVIRONMENT
</div>
{/if}
<div class="app background-gradient">
{#if $navigating || $isLoading}
<div
Expand Down