open-webui/src/lib/components/admin/Users/Groups/General.svelte

81 lines
2.1 KiB
Svelte
Raw Normal View History

2024-11-14 05:21:50 +00:00
<script lang="ts">
import { getContext } from 'svelte';
import Textarea from '$lib/components/common/Textarea.svelte';
import Tooltip from '$lib/components/common/Tooltip.svelte';
const i18n = getContext('i18n');
export let name = '';
export let color = '';
export let description = '';
2025-11-20 23:39:30 +00:00
export let config = {};
2025-11-18 08:54:19 +00:00
export let edit = false;
export let onDelete: Function = () => {};
2024-11-14 05:21:50 +00:00
</script>
<div class="flex gap-2">
<div class="flex flex-col w-full">
<div class=" mb-0.5 text-xs text-gray-500">{$i18n.t('Name')}</div>
<div class="flex-1">
<input
2025-02-16 03:27:25 +00:00
class="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
2024-11-14 05:21:50 +00:00
type="text"
bind:value={name}
placeholder={$i18n.t('Group Name')}
autocomplete="off"
required
/>
</div>
</div>
</div>
<!-- <div class="flex flex-col w-full mt-2">
<div class=" mb-1 text-xs text-gray-500">{$i18n.t('Color')}</div>
<div class="flex-1">
<Tooltip content={$i18n.t('Hex Color - Leave empty for default color')} placement="top-start">
<div class="flex gap-0.5">
<div class="text-gray-500">#</div>
<input
2025-02-16 03:27:25 +00:00
class="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
2024-11-14 05:21:50 +00:00
type="text"
bind:value={color}
placeholder={$i18n.t('Hex Color')}
autocomplete="off"
/>
</div>
</Tooltip>
</div>
</div> -->
<div class="flex flex-col w-full mt-2">
<div class=" mb-1 text-xs text-gray-500">{$i18n.t('Description')}</div>
<div class="flex-1">
<Textarea
2025-02-16 03:27:25 +00:00
className="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden resize-none"
2024-11-14 05:21:50 +00:00
rows={4}
bind:value={description}
placeholder={$i18n.t('Group Description')}
/>
</div>
</div>
2025-11-18 08:54:19 +00:00
{#if edit}
<div class="flex flex-col w-full mt-2">
<div class=" mb-0.5 text-xs text-gray-500">{$i18n.t('Actions')}</div>
<div class="flex-1">
<button
class="text-xs bg-transparent hover:underline cursor-pointer"
on:click={() => onDelete()}
>
{$i18n.t('Delete')}
</button>
</div>
</div>
{/if}