refac
This commit is contained in:
1 parent
212eec408c
commit
bd5d7b2e87
3 files changed
+39
-47
No files matched your search
@@ -304,51 +304,46 @@
|
|||||||
</UserSettingField>
|
</UserSettingField>
|
||||||
</UserSettingSection>
|
</UserSettingSection>
|
||||||
|
|
||||||
<UserSettingSection title={$i18n.t('User Variables')}>
|
<section class="mt-4 w-full">
|
||||||
<span slot="suffix" class="text-gray-400 dark:text-gray-600">{variableRows.length}</span>
|
<div
|
||||||
|
class="mb-0.5 flex items-center justify-between gap-2 text-xs text-gray-600 dark:text-gray-400"
|
||||||
<div>
|
>
|
||||||
<div class="flex items-center justify-between gap-2">
|
<div class="flex min-w-0 items-center gap-1.5">
|
||||||
<div class="text-[0.6875rem] text-gray-400 dark:text-gray-600">
|
{$i18n.t('User Variables')}
|
||||||
{$i18n.t('Use these in model system prompts as {{example}}.', {
|
<span class="text-gray-400 dark:text-gray-600">{variableRows.length}</span>
|
||||||
example: '{{user.variables.key_name}}'
|
</div>
|
||||||
})}
|
<button class={actionButtonClass} type="button" on:click={() => openVariableModal()}>
|
||||||
</div>
|
{$i18n.t('Add')}
|
||||||
|
</button>
|
||||||
<div class="flex shrink-0 items-center gap-2">
|
</div>
|
||||||
<button class={actionButtonClass} type="button" on:click={() => openVariableModal()}>
|
<div class="flex flex-col">
|
||||||
{$i18n.t('Add')}
|
{#each variableRows as row, idx}
|
||||||
|
<div class={variableRowClass(idx)}>
|
||||||
|
<div class="min-w-0 truncate font-mono text-xs text-gray-700 dark:text-gray-300">
|
||||||
|
{row.key || $i18n.t('key_name')}
|
||||||
|
</div>
|
||||||
|
<div class="min-w-0 flex-1 truncate text-xs text-gray-500 dark:text-gray-500">
|
||||||
|
{row.value || $i18n.t('Empty')}
|
||||||
|
</div>
|
||||||
|
<button class={actionButtonClass} type="button" on:click={() => openVariableModal(idx)}>
|
||||||
|
{$i18n.t('Edit')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/each}
|
||||||
|
|
||||||
<div class="flex flex-col">
|
{#if variableRows.length === 0}
|
||||||
{#each variableRows as row, idx}
|
<div class="text-xs text-gray-400 dark:text-gray-600">
|
||||||
<div class={variableRowClass(idx)}>
|
{$i18n.t('No user variables configured.')}
|
||||||
<div class="min-w-0 truncate font-mono text-xs text-gray-700 dark:text-gray-300">
|
</div>
|
||||||
{row.key || $i18n.t('key_name')}
|
{/if}
|
||||||
</div>
|
|
||||||
<div class="min-w-0 flex-1 truncate text-xs text-gray-500 dark:text-gray-500">
|
|
||||||
{row.value || $i18n.t('Empty')}
|
|
||||||
</div>
|
|
||||||
<button
|
|
||||||
class={actionButtonClass}
|
|
||||||
type="button"
|
|
||||||
on:click={() => openVariableModal(idx)}
|
|
||||||
>
|
|
||||||
{$i18n.t('Edit')}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{/each}
|
|
||||||
|
|
||||||
{#if variableRows.length === 0}
|
|
||||||
<div class="text-xs text-gray-400 dark:text-gray-600">
|
|
||||||
{$i18n.t('No user variables configured.')}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</UserSettingSection>
|
|
||||||
|
<div class="text-[0.6875rem] text-gray-400 dark:text-gray-600">
|
||||||
|
{$i18n.t('Use these in model system prompts as {{example}}.', {
|
||||||
|
example: '{{user.variables.key_name}}'
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
{#if $config?.features.enable_login_form && $config?.features.enable_password_change_form}
|
{#if $config?.features.enable_login_form && $config?.features.enable_password_change_form}
|
||||||
<UserSettingSection title={$i18n.t('Password')}>
|
<UserSettingSection title={$i18n.t('Password')}>
|
||||||
|
|||||||
@@ -113,10 +113,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-3 flex justify-end">
|
<div class="flex justify-end">
|
||||||
<button
|
<button class={actionButtonClass}>
|
||||||
class="px-3.5 py-1.5 text-sm font-normal bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"
|
|
||||||
>
|
|
||||||
{$i18n.t('Update password')}
|
{$i18n.t('Update password')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,9 +6,8 @@
|
|||||||
|
|
||||||
<section class="w-full {first ? '' : 'mt-4'} {className}">
|
<section class="w-full {first ? '' : 'mt-4'} {className}">
|
||||||
{#if title}
|
{#if title}
|
||||||
<h3 class="mb-2 flex items-center gap-1.5 text-xs text-gray-600 dark:text-gray-400">
|
<h3 class="mb-2 text-xs text-gray-600 dark:text-gray-400">
|
||||||
{title}
|
{title}
|
||||||
<slot name="suffix" />
|
|
||||||
</h3>
|
</h3>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user