mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
enh: include profile image during user import
This commit is contained in:
parent
abdde10b74
commit
33c206c15c
@ -354,7 +354,8 @@ export const addUser = async (
|
|||||||
name: string,
|
name: string,
|
||||||
email: string,
|
email: string,
|
||||||
password: string,
|
password: string,
|
||||||
role: string = 'pending'
|
role: string = 'pending',
|
||||||
|
profile_image_url: null | string = null
|
||||||
) => {
|
) => {
|
||||||
let error = null;
|
let error = null;
|
||||||
|
|
||||||
@ -368,7 +369,8 @@ export const addUser = async (
|
|||||||
name: name,
|
name: name,
|
||||||
email: email,
|
email: email,
|
||||||
password: password,
|
password: password,
|
||||||
role: role
|
role: role,
|
||||||
|
...(profile_image_url && { profile_image_url: profile_image_url })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
@ -137,7 +137,6 @@
|
|||||||
on:confirm={() => {
|
on:confirm={() => {
|
||||||
onUpdateRole(selectedUser);
|
onUpdateRole(selectedUser);
|
||||||
}}
|
}}
|
||||||
title={$i18n.t('Update User Role')}
|
|
||||||
message={$i18n.t(`Are you sure you want to update this user\'s role to **{{ROLE}}**?`, {
|
message={$i18n.t(`Are you sure you want to update this user\'s role to **{{ROLE}}**?`, {
|
||||||
ROLE:
|
ROLE:
|
||||||
selectedUser?.role === 'user'
|
selectedUser?.role === 'user'
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
import { WEBUI_BASE_URL } from '$lib/constants';
|
import { WEBUI_BASE_URL } from '$lib/constants';
|
||||||
|
|
||||||
import Modal from '$lib/components/common/Modal.svelte';
|
import Modal from '$lib/components/common/Modal.svelte';
|
||||||
|
import { generateInitialsImage } from '$lib/utils';
|
||||||
|
|
||||||
const i18n = getContext('i18n');
|
const i18n = getContext('i18n');
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
@ -47,7 +48,8 @@
|
|||||||
_user.name,
|
_user.name,
|
||||||
_user.email,
|
_user.email,
|
||||||
_user.password,
|
_user.password,
|
||||||
_user.role
|
_user.role,
|
||||||
|
generateInitialsImage(_user.name)
|
||||||
).catch((error) => {
|
).catch((error) => {
|
||||||
toast.error(`${error}`);
|
toast.error(`${error}`);
|
||||||
});
|
});
|
||||||
@ -83,7 +85,8 @@
|
|||||||
columns[0],
|
columns[0],
|
||||||
columns[1],
|
columns[1],
|
||||||
columns[2],
|
columns[2],
|
||||||
columns[3].toLowerCase()
|
columns[3].toLowerCase(),
|
||||||
|
generateInitialsImage(columns[0])
|
||||||
).catch((error) => {
|
).catch((error) => {
|
||||||
toast.error(`Row ${idx + 1}: ${error}`);
|
toast.error(`Row ${idx + 1}: ${error}`);
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user