mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 13:55:19 +00:00
enh: 'notification' event type
This commit is contained in:
parent
a1e4e7c007
commit
ed7db1dd41
1 changed files with 13 additions and 0 deletions
|
|
@ -321,6 +321,19 @@
|
||||||
eventConfirmationMessage = data.message;
|
eventConfirmationMessage = data.message;
|
||||||
eventConfirmationInputPlaceholder = data.placeholder;
|
eventConfirmationInputPlaceholder = data.placeholder;
|
||||||
eventConfirmationInputValue = data?.value ?? '';
|
eventConfirmationInputValue = data?.value ?? '';
|
||||||
|
} else if (type === 'notification') {
|
||||||
|
const toastType = data?.type ?? 'info';
|
||||||
|
const toastContent = data?.content ?? '';
|
||||||
|
|
||||||
|
if (toastType === 'success') {
|
||||||
|
toast.success(toastContent);
|
||||||
|
} else if (toastType === 'error') {
|
||||||
|
toast.error(toastContent);
|
||||||
|
} else if (toastType === 'warning') {
|
||||||
|
toast.warning(toastContent);
|
||||||
|
} else {
|
||||||
|
toast.info(toastContent);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('Unknown message type', data);
|
console.log('Unknown message type', data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue