mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac
This commit is contained in:
parent
224e4c3a61
commit
4e18c8a689
2 changed files with 21 additions and 19 deletions
|
|
@ -112,17 +112,6 @@
|
|||
}}
|
||||
/>
|
||||
|
||||
{#key selectedUser}
|
||||
<EditUserModal
|
||||
bind:show={showEditUserModal}
|
||||
{selectedUser}
|
||||
sessionUser={$user}
|
||||
on:save={async () => {
|
||||
getUserList();
|
||||
}}
|
||||
/>
|
||||
{/key}
|
||||
|
||||
<AddUserModal
|
||||
bind:show={showAddUserModal}
|
||||
on:save={async () => {
|
||||
|
|
@ -130,6 +119,15 @@
|
|||
}}
|
||||
/>
|
||||
|
||||
<EditUserModal
|
||||
bind:show={showEditUserModal}
|
||||
{selectedUser}
|
||||
sessionUser={$user}
|
||||
on:save={async () => {
|
||||
getUserList();
|
||||
}}
|
||||
/>
|
||||
|
||||
{#if selectedUser}
|
||||
<UserChatsModal bind:show={showUserChatsModal} user={selectedUser} />
|
||||
{/if}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,18 @@
|
|||
export let selectedUser;
|
||||
export let sessionUser;
|
||||
|
||||
$: if (show) {
|
||||
init();
|
||||
}
|
||||
|
||||
const init = () => {
|
||||
if (selectedUser) {
|
||||
_user = selectedUser;
|
||||
_user.password = '';
|
||||
loadUserGroups();
|
||||
}
|
||||
};
|
||||
|
||||
let _user = {
|
||||
profile_image_url: '',
|
||||
role: 'pending',
|
||||
|
|
@ -52,14 +64,6 @@
|
|||
return null;
|
||||
});
|
||||
};
|
||||
|
||||
onMount(() => {
|
||||
if (selectedUser) {
|
||||
_user = selectedUser;
|
||||
_user.password = '';
|
||||
loadUserGroups();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<Modal size="sm" bind:show>
|
||||
|
|
|
|||
Loading…
Reference in a new issue