mirror of
https://github.com/open-webui/assistant
synced 2025-06-26 18:15:57 +00:00
feat: connection notification
This commit is contained in:
10
src/App.vue
10
src/App.vue
@@ -6,7 +6,7 @@ import { ref, onBeforeMount } from 'vue';
|
||||
const url = ref('http://localhost:3000')
|
||||
const token = ref('your_jwt')
|
||||
|
||||
const submitHandler = () => {
|
||||
const submitHandler = async () => {
|
||||
console.log(url.value, token.value)
|
||||
|
||||
|
||||
@@ -20,6 +20,12 @@ const submitHandler = () => {
|
||||
token: token.value
|
||||
})
|
||||
|
||||
const res = await window.electron.checkConnection()
|
||||
|
||||
new Notification("Open WebUI", { body: res ? 'Server Connection Verified' : 'Server Connection Failed' })
|
||||
|
||||
console.log(res)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +36,8 @@ onBeforeMount(async () => {
|
||||
url.value = res.url
|
||||
token.value = res.token
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import {
|
||||
app,
|
||||
BrowserWindow,
|
||||
globalShortcut,
|
||||
Notification,
|
||||
clipboard,
|
||||
ipcMain,
|
||||
} from "electron";
|
||||
|
||||
@@ -8,6 +8,7 @@ contextBridge.exposeInMainWorld("electron", {
|
||||
ipcRenderer.on(event, callback);
|
||||
},
|
||||
|
||||
checkConnection: () => ipcRenderer.invoke("check-connection"),
|
||||
loadConfig: () => ipcRenderer.invoke("load-config"),
|
||||
saveConfig: (data) => ipcRenderer.send("save-config", data),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user