DRY pass #3: a secret setting is the text input with a password type (#5373)

SettingsView drew secret and plain text settings as two inputs differing only
in type, autocomplete and the saved-value placeholder; one input binds those.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 15:16:16 -04:00
co-authored by Claude Opus 5.5
parent 9dcdb43568
commit 1b128a9374
+3 -11
View File
@@ -139,20 +139,12 @@ onMounted(load);
>
<option v-for="c in it.choices" :key="c" :value="c">{{ c }}</option>
</select>
<input
v-else-if="it.secret"
:id="it.key"
type="password"
autocomplete="new-password"
:placeholder="it.is_set ? 'Saved — type to replace' : ''"
class="w-56 field"
:value="String(it.value)"
@input="it.value = ($event.target as HTMLInputElement).value"
/>
<input
v-else
:id="it.key"
type="text"
:type="it.secret ? 'password' : 'text'"
:autocomplete="it.secret ? 'new-password' : undefined"
:placeholder="it.secret && it.is_set ? 'Saved — type to replace' : undefined"
class="w-56 field"
:value="String(it.value)"
@input="it.value = ($event.target as HTMLInputElement).value"