mirror of
https://github.com/open-webui/open-webui
synced 2025-01-19 17:26:33 +00:00
enh: native notifications
This commit is contained in:
parent
c0b93791dc
commit
afcbf2cafb
@ -10,6 +10,7 @@
|
|||||||
import {
|
import {
|
||||||
config,
|
config,
|
||||||
user,
|
user,
|
||||||
|
settings,
|
||||||
theme,
|
theme,
|
||||||
WEBUI_NAME,
|
WEBUI_NAME,
|
||||||
mobile,
|
mobile,
|
||||||
@ -107,6 +108,13 @@
|
|||||||
const { done, content, title } = data;
|
const { done, content, title } = data;
|
||||||
|
|
||||||
if (done) {
|
if (done) {
|
||||||
|
if ($settings?.notificationEnabled ?? false) {
|
||||||
|
const notification = new Notification(`${title} | Open WebUI`, {
|
||||||
|
body: content,
|
||||||
|
icon: `${WEBUI_BASE_URL}/static/favicon.png`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
toast.custom(NotificationToast, {
|
toast.custom(NotificationToast, {
|
||||||
componentProps: {
|
componentProps: {
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@ -138,6 +146,13 @@
|
|||||||
const data = event?.data?.data ?? null;
|
const data = event?.data?.data ?? null;
|
||||||
|
|
||||||
if (type === 'message') {
|
if (type === 'message') {
|
||||||
|
if ($settings?.notificationEnabled ?? false) {
|
||||||
|
new Notification(`#${event?.channel?.name} | Open WebUI`, {
|
||||||
|
body: data?.content,
|
||||||
|
icon: `${WEBUI_BASE_URL}/static/favicon.png`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
toast.custom(NotificationToast, {
|
toast.custom(NotificationToast, {
|
||||||
componentProps: {
|
componentProps: {
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user