diff --git a/web/src/routes/dashboard/devices/[deviceId]/+page.svelte b/web/src/routes/dashboard/devices/[deviceId]/+page.svelte index 158b5c2..a76b134 100644 --- a/web/src/routes/dashboard/devices/[deviceId]/+page.svelte +++ b/web/src/routes/dashboard/devices/[deviceId]/+page.svelte @@ -1,20 +1,27 @@ +
-

Device: {deviceId.slice(0, 8)}...

+
+

{deviceData?.model ?? deviceId.slice(0, 8)}

+ {#if deviceData?.manufacturer} +

{deviceData.manufacturer}

+ {/if} +
+ + + {deviceData?.status === 'online' ? 'Online' : 'Offline'} + +
+ + +
+ {#each [['overview', 'Overview'], ['sessions', 'Sessions'], ['run', 'Run']] as [tab, label]} + + {/each}
- -
-

Send a Goal

-
- e.key === 'Enter' && submitGoal()} - /> - -
-
- - - {#if steps.length > 0 || status === 'running'} -
-
-

- {currentGoal ? `Goal: ${currentGoal}` : 'Current Run'} + + {#if activeTab === 'overview'} +
+ +
+

+ Device Info

- {#if status === 'running'} - - - Running - - {:else if status === 'completed'} - Completed - {:else if status === 'failed'} - Failed - {/if} -
- {#if steps.length > 0} -
- {#each steps as s (s.step)} -
-
- - {s.step} - - {s.action} -
- {#if s.reasoning} -

{s.reasoning}

- {/if} +
+ {#if deviceData?.model} +
+
Model
+
{deviceData.model}
- {/each} -
- {:else} -
Waiting for first step...
- {/if} -
- {/if} - - - {#if sessions.length > 0} -
-
-

Session History

+ {/if} + {#if deviceData?.manufacturer} +
+
Manufacturer
+
{deviceData.manufacturer}
+
+ {/if} + {#if deviceData?.androidVersion} +
+
Android
+
{deviceData.androidVersion}
+
+ {/if} + {#if deviceData?.screenWidth && deviceData?.screenHeight} +
+
Resolution
+
{deviceData.screenWidth} x {deviceData.screenHeight}
+
+ {/if} + {#if battery !== null && battery >= 0} +
+
Battery
+
+ {battery}%{charging ? ' (Charging)' : ''} +
+
+ {/if} +
+
Last seen
+
+ {deviceData ? relativeTime(deviceData.lastSeen) : '—'} +
+
+
-
+ + +
+

+ Stats +

+
+
+

{stats?.totalSessions ?? 0}

+

Sessions

+
+
+

{stats?.successRate ?? 0}%

+

Success

+
+
+

{stats?.avgSteps ?? 0}

+

Avg Steps

+
+
+
+
+ + + {:else if activeTab === 'sessions'} + {#if sessions.length === 0} +

No sessions yet. Go to the Run tab to send a goal.

+ {:else} +
{#each sessions as sess (sess.id)} -
-
-

{sess.goal}

+
+
-

- {formatTime(sess.startedAt)} · {sess.stepsUsed} steps -

+ + {#if expandedSession === sess.id} +
+ {#if sessionSteps.has(sess.id)} +
+ {#each sessionSteps.get(sess.id) ?? [] as s (s.id)} +
+ + {s.stepNumber} + +
+ {JSON.stringify(s.action)} + {#if s.reasoning} +

+ {s.reasoning} +

+ {/if} +
+
+ {/each} +
+ {:else} +

Loading steps...

+ {/if} +
+ {/if}
{/each}
+ {/if} + + + {:else if activeTab === 'run'} + +
+

Send a Goal

+
+ e.key === 'Enter' && submitGoal()} + /> + +
+ + + {#if steps.length > 0 || runStatus === 'running'} +
+
+

+ {currentGoal ? `Goal: ${currentGoal}` : 'Current Run'} +

+ {#if runStatus === 'running'} + + + Running + + {:else if runStatus === 'completed'} + Completed + {:else if runStatus === 'failed'} + Failed + {/if} +
+ {#if steps.length > 0} +
+ {#each steps as s (s.step)} +
+
+ + {s.step} + + {s.action} +
+ {#if s.reasoning} +

{s.reasoning}

+ {/if} +
+ {/each} +
+ {:else} +
Waiting for first step...
+ {/if} +
+ {/if} {/if}