diff --git a/web/src/lib/components/DeviceCard.svelte b/web/src/lib/components/DeviceCard.svelte new file mode 100644 index 0000000..4b17006 --- /dev/null +++ b/web/src/lib/components/DeviceCard.svelte @@ -0,0 +1,166 @@ + + + + + + + + + + + + + {status === 'online' ? 'Online' : 'Offline'} + + {#if batteryLevel !== null && batteryLevel >= 0} + + + {batteryIcon(batteryLevel, isCharging)} + + + {batteryLevel}% + + + {/if} + + + + + + + + + + + + + + {model ?? name} + + {#if manufacturer} + {manufacturer} + {/if} + + + + {#if androidVersion} + + Android {androidVersion} + + {/if} + {#if screenWidth && screenHeight} + + {screenWidth}x{screenHeight} + + {/if} + + + + + + {#if lastGoal} + {lastGoal.goal} + + + {lastGoal.status === 'completed' + ? 'Success' + : lastGoal.status === 'running' + ? 'Running' + : 'Failed'} + + {relativeTime(lastGoal.startedAt)} + + {:else} + No goals yet + {/if} + + + + + +
+ {model ?? name} +
{manufacturer}
{lastGoal.goal}
No goals yet