mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac: access control
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
import UserCircleSolid from '$lib/components/icons/UserCircleSolid.svelte';
|
||||
import XMark from '$lib/components/icons/XMark.svelte';
|
||||
|
||||
export let onChange: Function = () => {};
|
||||
|
||||
export let accessControl = null;
|
||||
|
||||
let selectedGroupId = '';
|
||||
@@ -17,6 +19,8 @@
|
||||
onMount(async () => {
|
||||
groups = await getGroups(localStorage.token);
|
||||
});
|
||||
|
||||
$: onChange(accessControl);
|
||||
</script>
|
||||
|
||||
<div class=" rounded-lg flex flex-col gap-2">
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<script>
|
||||
import { getContext } from 'svelte';
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
import Modal from '$lib/components/common/Modal.svelte';
|
||||
import AccessControl from './AccessControl.svelte';
|
||||
|
||||
export let show = false;
|
||||
export let accessControl = null;
|
||||
|
||||
export let onChange = () => {};
|
||||
</script>
|
||||
|
||||
<Modal size="sm" bind:show>
|
||||
<div>
|
||||
<div class=" flex justify-between dark:text-gray-100 px-5 pt-3 pb-1">
|
||||
<div class=" text-lg font-medium self-center font-primary">
|
||||
{$i18n.t('Share')}
|
||||
</div>
|
||||
<button
|
||||
class="self-center"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
class="w-5 h-5"
|
||||
>
|
||||
<path
|
||||
d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="w-full px-5 pb-4">
|
||||
<AccessControl bind:accessControl {onChange} />
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
Reference in New Issue
Block a user