mirror of
https://github.com/open-webui/open-webui
synced 2025-05-17 03:54:02 +00:00
refac: prompt editor styling
This commit is contained in:
parent
e78657f07e
commit
19a23a5b7d
@ -5,6 +5,8 @@
|
|||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||||
import AccessControl from '../common/AccessControl.svelte';
|
import AccessControl from '../common/AccessControl.svelte';
|
||||||
|
import LockClosed from '$lib/components/icons/LockClosed.svelte';
|
||||||
|
import AccessControlModal from '../common/AccessControlModal.svelte';
|
||||||
|
|
||||||
export let onSubmit: Function;
|
export let onSubmit: Function;
|
||||||
export let edit = false;
|
export let edit = false;
|
||||||
@ -20,6 +22,8 @@
|
|||||||
|
|
||||||
let accessControl = null;
|
let accessControl = null;
|
||||||
|
|
||||||
|
let showAccessControlModal = false;
|
||||||
|
|
||||||
$: if (!edit) {
|
$: if (!edit) {
|
||||||
command = title !== '' ? `${title.replace(/\s+/g, '-').toLowerCase()}` : '';
|
command = title !== '' ? `${title.replace(/\s+/g, '-').toLowerCase()}` : '';
|
||||||
}
|
}
|
||||||
@ -64,6 +68,8 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<AccessControlModal bind:show={showAccessControlModal} bind:accessControl />
|
||||||
|
|
||||||
<div class="w-full max-h-full flex justify-center">
|
<div class="w-full max-h-full flex justify-center">
|
||||||
<form
|
<form
|
||||||
class="flex flex-col w-full mb-10"
|
class="flex flex-col w-full mb-10"
|
||||||
@ -82,13 +88,29 @@
|
|||||||
placement="bottom-start"
|
placement="bottom-start"
|
||||||
>
|
>
|
||||||
<div class="flex flex-col w-full">
|
<div class="flex flex-col w-full">
|
||||||
<div>
|
<div class="flex items-center">
|
||||||
<input
|
<input
|
||||||
class="text-2xl font-semibold w-full bg-transparent outline-none"
|
class="text-2xl font-semibold w-full bg-transparent outline-none"
|
||||||
placeholder={$i18n.t('Title')}
|
placeholder={$i18n.t('Title')}
|
||||||
bind:value={title}
|
bind:value={title}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
class="bg-gray-50 hover:bg-gray-100 text-black transition px-2 py-1 rounded-full flex gap-1 items-center"
|
||||||
|
type="button"
|
||||||
|
on:click={() => {
|
||||||
|
showAccessControlModal = true;
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<LockClosed strokeWidth="2.5" />
|
||||||
|
|
||||||
|
<div class="text-sm font-medium flex-shrink-0">
|
||||||
|
{$i18n.t('Share')}
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-0.5 items-center text-xs text-gray-500">
|
<div class="flex gap-0.5 items-center text-xs text-gray-500">
|
||||||
@ -141,12 +163,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="px-3 py-2 bg-gray-50 dark:bg-gray-950 rounded-lg">
|
|
||||||
<AccessControl bind:accessControl />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="my-4 flex justify-end pb-20">
|
<div class="my-4 flex justify-end pb-20">
|
||||||
<button
|
<button
|
||||||
class=" text-sm w-full lg:w-fit px-4 py-2 transition rounded-lg {loading
|
class=" text-sm w-full lg:w-fit px-4 py-2 transition rounded-lg {loading
|
||||||
|
Loading…
Reference in New Issue
Block a user