Use shared form controls and enforce UI patterns (Refs #110)
CI / checks (push) Successful in 4m51s
CI / checks (push) Successful in 4m51s
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import Select from '$ui/components/primitives/Select.svelte';
|
||||
import Field from '$ui/components/primitives/Field.svelte';
|
||||
import { untrack } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { currentRound, freshServer, type FleetServer } from '$lib/fleet-overview.js';
|
||||
@@ -145,20 +147,16 @@
|
||||
<Dialog bind:open {title} {busy}>
|
||||
<div class="fields">
|
||||
{#if !initialServer}
|
||||
<label
|
||||
>Server <select
|
||||
bind:value={server}
|
||||
disabled={busy || loading}
|
||||
onchange={chooseServer}
|
||||
>
|
||||
<Field label="Server">
|
||||
<Select bind:value={server} disabled={busy || loading} onchange={chooseServer}>
|
||||
<option value="">{loading ? 'Loading servers…' : 'Choose a server'}</option>
|
||||
{#each servers as item (item.name)}<option value={item.name}
|
||||
>{serverTitle(item.name)}</option
|
||||
>{/each}
|
||||
</select></label
|
||||
</Select></Field
|
||||
>
|
||||
<label
|
||||
>Action <select
|
||||
<Field label="Action">
|
||||
<Select
|
||||
bind:value={action}
|
||||
disabled={busy || !server || loading}
|
||||
onchange={() => {
|
||||
@@ -172,7 +170,7 @@
|
||||
>{/if}
|
||||
{#each available as value}<option {value}>{actionLabels[value]}</option>{/each}
|
||||
{#if server}<option value="destroy">Destroy server</option>{/if}
|
||||
</select></label
|
||||
</Select></Field
|
||||
>
|
||||
{/if}
|
||||
{#if loading}<p role="status">Checking the latest server status…</p>
|
||||
@@ -219,13 +217,7 @@
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
select {
|
||||
padding: 10px;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--surface);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
line-height: 1.6;
|
||||
|
||||
Reference in New Issue
Block a user