fix(websearch): hide show/copy buttons when API key is empty

Only show the inline eye/copy buttons when provider.api_key has a value.
When only api_key_configured is true (saved key, not loaded), buttons are
hidden since there's nothing to show/copy.
This commit is contained in:
erio
2026-04-12 19:46:26 +08:00
parent 5df7309979
commit 49281bbe45

View File

@@ -1796,10 +1796,11 @@
<input
v-model="provider.api_key"
:type="apiKeyVisible[pIdx] ? 'text' : 'password'"
class="input w-full pr-16 text-sm"
class="input w-full text-sm"
:class="provider.api_key ? 'pr-16' : ''"
:placeholder="provider.api_key_configured ? '••••••••' : t('admin.settings.webSearchEmulation.apiKeyPlaceholder')"
/>
<div class="absolute inset-y-0 right-0 flex items-center pr-1.5">
<div v-if="provider.api_key" class="absolute inset-y-0 right-0 flex items-center pr-1.5">
<button
type="button"
class="rounded p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300"