Add device-edit dropdown and jump-to-device button on todos list
Deploy to LXC / deploy (push) Successful in 24s

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-24 15:35:53 +07:00
parent 03e23cf0c0
commit 8ab4673059
+17 -1
View File
@@ -181,9 +181,17 @@
class="rounded-md border border-gray-300 px-2 py-1.5 text-sm dark:border-gray-600 dark:bg-gray-700 dark:text-white" />
</div>
</div>
<div class="grid gap-2 sm:grid-cols-2">
<textarea name="description" rows="2" placeholder="Description..."
class="w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm focus:border-blue-500 focus:ring-1 focus:ring-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white">{todo.description ?? ''}</textarea>
<input type="hidden" name="deviceId" value={todo.deviceId ?? ''} />
<select name="deviceId"
class="rounded-md border border-gray-300 px-3 py-1.5 text-sm dark:border-gray-600 dark:bg-gray-700 dark:text-white">
<option value="">No linked device</option>
{#each data.devices as d}
<option value={d.id} selected={d.id === todo.deviceId}>{d.title}</option>
{/each}
</select>
</div>
<div class="flex gap-2">
<button type="submit" class="rounded-md bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700">Save</button>
<button type="button" onclick={() => (editingId = null)} class="rounded-md px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700">Cancel</button>
@@ -240,6 +248,14 @@
</div>
<div class="flex items-center gap-1">
{#if todo.deviceId}
<a href="/devices/{todo.deviceId}"
class="rounded p-1 text-gray-400 hover:text-blue-600 dark:text-gray-500 dark:hover:text-blue-400" title="Open linked device">
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
</svg>
</a>
{/if}
<button type="button" onclick={() => (editingId = todo.id)}
class="rounded p-1 text-gray-400 hover:text-blue-600 dark:text-gray-500 dark:hover:text-blue-400" title="Edit">
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">