diff options
| author | Adam Malczewski <[email protected]> | 2026-06-27 01:13:28 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-27 01:13:31 +0900 |
| commit | 2fa03f8d7410c2b8d6be8e10ad088863e83d7177 (patch) | |
| tree | 94e1923180ae38d571d34b578afecb0a18913c24 /src/features/computer/ui/ComputerSelect.svelte | |
| parent | 80f99665034a0e510300793205c162fc7a46769f (diff) | |
| parent | 08b12478636f4a5c86a1f3c40a843f2906b7c82f (diff) | |
| download | dispatch-web-2fa03f8d7410c2b8d6be8e10ad088863e83d7177.tar.gz dispatch-web-2fa03f8d7410c2b8d6be8e10ad088863e83d7177.zip | |
Merge branch 'dev' into feature/heartbeat
# Conflicts:
# src/app/App.svelte
# src/app/store.svelte.ts
# src/app/store.test.ts
# src/features/workspaces/ui/WorkspaceCard.test.ts
Diffstat (limited to 'src/features/computer/ui/ComputerSelect.svelte')
| -rw-r--r-- | src/features/computer/ui/ComputerSelect.svelte | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/features/computer/ui/ComputerSelect.svelte b/src/features/computer/ui/ComputerSelect.svelte index d693140..c580b60 100644 --- a/src/features/computer/ui/ComputerSelect.svelte +++ b/src/features/computer/ui/ComputerSelect.svelte @@ -1,39 +1,39 @@ <script lang="ts"> - import type { ComputerEntry } from "@dispatch/wire"; + import type { ComputerEntry } from "@dispatch/wire"; - let { - value, - computers, - disabled = false, - onSelect, - }: { - /** The currently selected computer alias, or null for "Local (none)". */ - value: string | null; - /** Discovered computers from `GET /computers` (read-only). */ - computers: readonly ComputerEntry[]; - disabled?: boolean; - onSelect: (computerId: string | null) => void; - } = $props(); + let { + value, + computers, + disabled = false, + onSelect, + }: { + /** The currently selected computer alias, or null for "Local (none)". */ + value: string | null; + /** Discovered computers from `GET /computers` (read-only). */ + computers: readonly ComputerEntry[]; + disabled?: boolean; + onSelect: (computerId: string | null) => void; + } = $props(); - // A `<select>` value is a string; map "" ↔ null (Local). The chosen option's - // value is the alias, with "" meaning "clear / local". - const selectValue = $derived(value ?? ""); + // A `<select>` value is a string; map "" ↔ null (Local). The chosen option's + // value is the alias, with "" meaning "clear / local". + const selectValue = $derived(value ?? ""); - function onChange(e: Event) { - const v = (e.currentTarget as HTMLSelectElement).value; - onSelect(v === "" ? null : v); - } + function onChange(e: Event) { + const v = (e.currentTarget as HTMLSelectElement).value; + onSelect(v === "" ? null : v); + } </script> <select - class="select select-bordered select-sm w-full font-mono text-xs" - value={selectValue} - disabled={disabled} - onchange={onChange} - aria-label="Computer" + class="select select-bordered select-sm w-full font-mono text-xs" + value={selectValue} + {disabled} + onchange={onChange} + aria-label="Computer" > - <option value="">Local (none)</option> - {#each computers as c (c.alias)} - <option value={c.alias}>{c.alias}{c.knownHost ? "" : " · new host"}</option> - {/each} + <option value="">Local (none)</option> + {#each computers as c (c.alias)} + <option value={c.alias}>{c.alias}{c.knownHost ? "" : " · new host"}</option> + {/each} </select> |
