mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
accessibility: labels and placeholder contrast
This commit is contained in:
parent
27f7df8ad6
commit
3ff5db229b
@ -3,6 +3,7 @@
|
|||||||
import { getContext, onMount } from 'svelte';
|
import { getContext, onMount } from 'svelte';
|
||||||
const i18n = getContext('i18n');
|
const i18n = getContext('i18n');
|
||||||
|
|
||||||
|
import { settings } from '$lib/stores';
|
||||||
import Modal from '$lib/components/common/Modal.svelte';
|
import Modal from '$lib/components/common/Modal.svelte';
|
||||||
import Plus from '$lib/components/icons/Plus.svelte';
|
import Plus from '$lib/components/icons/Plus.svelte';
|
||||||
import Minus from '$lib/components/icons/Minus.svelte';
|
import Minus from '$lib/components/icons/Minus.svelte';
|
||||||
@ -194,13 +195,17 @@
|
|||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<div class="flex flex-col w-full">
|
<div class="flex flex-col w-full">
|
||||||
<div class="flex justify-between mb-0.5">
|
<div class="flex justify-between mb-0.5">
|
||||||
<label for="api-base-url" class=" text-xs text-gray-500">{$i18n.t('URL')}</label>
|
<label
|
||||||
|
for="api-base-url"
|
||||||
|
class={`text-xs ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100' : 'text-gray-500'}`}
|
||||||
|
>{$i18n.t('URL')}</label
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-1 items-center">
|
<div class="flex flex-1 items-center">
|
||||||
<input
|
<input
|
||||||
id="api-base-url"
|
id="api-base-url"
|
||||||
class="w-full flex-1 text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
|
class={`w-full flex-1 text-sm bg-transparent ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : 'outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-700'}`}
|
||||||
type="text"
|
type="text"
|
||||||
bind:value={url}
|
bind:value={url}
|
||||||
placeholder={$i18n.t('API Base URL')}
|
placeholder={$i18n.t('API Base URL')}
|
||||||
@ -246,7 +251,7 @@
|
|||||||
>{$i18n.t('openapi.json URL or Path')}</label
|
>{$i18n.t('openapi.json URL or Path')}</label
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
class="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
|
class={`w-full text-sm bg-transparent ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : 'outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-700'}`}
|
||||||
type="text"
|
type="text"
|
||||||
id="url-or-path"
|
id="url-or-path"
|
||||||
bind:value={path}
|
bind:value={path}
|
||||||
@ -258,7 +263,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-xs text-gray-500 mt-1">
|
<div
|
||||||
|
class={`text-xs mt-1 ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100' : 'text-gray-500'}`}
|
||||||
|
>
|
||||||
{$i18n.t(`WebUI will make requests to "{{url}}"`, {
|
{$i18n.t(`WebUI will make requests to "{{url}}"`, {
|
||||||
url: path.includes('://') ? path : `${url}${path.startsWith('/') ? '' : '/'}${path}`
|
url: path.includes('://') ? path : `${url}${path.startsWith('/') ? '' : '/'}${path}`
|
||||||
})}
|
})}
|
||||||
@ -266,7 +273,9 @@
|
|||||||
|
|
||||||
<div class="flex gap-2 mt-2">
|
<div class="flex gap-2 mt-2">
|
||||||
<div class="flex flex-col w-full">
|
<div class="flex flex-col w-full">
|
||||||
<label for="select-bearer-or-session" class="text-xs text-gray-500"
|
<label
|
||||||
|
for="select-bearer-or-session"
|
||||||
|
class={`text-xs ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100' : 'text-gray-500'}`}
|
||||||
>{$i18n.t('Auth')}</label
|
>{$i18n.t('Auth')}</label
|
||||||
>
|
>
|
||||||
|
|
||||||
@ -274,7 +283,7 @@
|
|||||||
<div class="flex-shrink-0 self-start">
|
<div class="flex-shrink-0 self-start">
|
||||||
<select
|
<select
|
||||||
id="select-bearer-or-session"
|
id="select-bearer-or-session"
|
||||||
class="w-full text-sm bg-transparent dark:bg-gray-900 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden pr-5"
|
class={`w-full text-sm bg-transparent pr-5 ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : 'outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-700'}`}
|
||||||
bind:value={auth_type}
|
bind:value={auth_type}
|
||||||
>
|
>
|
||||||
<option value="bearer">Bearer</option>
|
<option value="bearer">Bearer</option>
|
||||||
@ -285,13 +294,14 @@
|
|||||||
<div class="flex flex-1 items-center">
|
<div class="flex flex-1 items-center">
|
||||||
{#if auth_type === 'bearer'}
|
{#if auth_type === 'bearer'}
|
||||||
<SensitiveInput
|
<SensitiveInput
|
||||||
className="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
|
|
||||||
bind:value={key}
|
bind:value={key}
|
||||||
placeholder={$i18n.t('API Key')}
|
placeholder={$i18n.t('API Key')}
|
||||||
required={false}
|
required={false}
|
||||||
/>
|
/>
|
||||||
{:else if auth_type === 'session'}
|
{:else if auth_type === 'session'}
|
||||||
<div class="text-xs text-gray-500 self-center translate-y-[1px]">
|
<div
|
||||||
|
class={`text-xs self-center translate-y-[1px] ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100' : 'text-gray-500'}`}
|
||||||
|
>
|
||||||
{$i18n.t('Forwards system user session credentials to authenticate')}
|
{$i18n.t('Forwards system user session credentials to authenticate')}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@ -305,14 +315,16 @@
|
|||||||
|
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<div class="flex flex-col w-full">
|
<div class="flex flex-col w-full">
|
||||||
<label for="enter-name" class=" mb-0.5 text-xs text-gray-500"
|
<label
|
||||||
|
for="enter-name"
|
||||||
|
class={`mb-0.5 text-xs" ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100' : 'text-gray-500'}`}
|
||||||
>{$i18n.t('Name')}</label
|
>{$i18n.t('Name')}</label
|
||||||
>
|
>
|
||||||
|
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<input
|
<input
|
||||||
id="enter-name"
|
id="enter-name"
|
||||||
class="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
|
class={`w-full text-sm bg-transparent ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : 'outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-700'}`}
|
||||||
type="text"
|
type="text"
|
||||||
bind:value={name}
|
bind:value={name}
|
||||||
placeholder={$i18n.t('Enter name')}
|
placeholder={$i18n.t('Enter name')}
|
||||||
@ -324,14 +336,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col w-full mt-2">
|
<div class="flex flex-col w-full mt-2">
|
||||||
<label for="description" class=" mb-1 text-xs text-gray-500"
|
<label
|
||||||
|
for="description"
|
||||||
|
class={`mb-1 text-xs ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100 placeholder:text-gray-700 dark:placeholder:text-gray-100' : 'outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-700 text-gray-500'}`}
|
||||||
>{$i18n.t('Description')}</label
|
>{$i18n.t('Description')}</label
|
||||||
>
|
>
|
||||||
|
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<input
|
<input
|
||||||
id="description"
|
id="description"
|
||||||
class="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
|
class={`w-full text-sm bg-transparent ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : 'outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-700'}`}
|
||||||
type="text"
|
type="text"
|
||||||
bind:value={description}
|
bind:value={description}
|
||||||
placeholder={$i18n.t('Enter description')}
|
placeholder={$i18n.t('Enter description')}
|
||||||
|
Loading…
Reference in New Issue
Block a user