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:
		
							parent
							
								
									f5e8dcfbbf
								
							
						
					
					
						commit
						51d339b8a7
					
				| @ -2,7 +2,7 @@ | |||||||
| <html> | <html> | ||||||
|   <head> |   <head> | ||||||
|     <meta charset="UTF-8" /> |     <meta charset="UTF-8" /> | ||||||
|     <title>Hello World!</title> |     <title>Open WebUI Assistant</title> | ||||||
|   </head> |   </head> | ||||||
|   <body> |   <body> | ||||||
|     <div id="app"></div> |     <div id="app"></div> | ||||||
|  | |||||||
							
								
								
									
										10
									
								
								src/App.vue
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/App.vue
									
									
									
									
									
								
							| @ -6,7 +6,7 @@ import { ref, onBeforeMount } from 'vue'; | |||||||
| const url = ref('http://localhost:3000') | const url = ref('http://localhost:3000') | ||||||
| const token = ref('your_jwt') | const token = ref('your_jwt') | ||||||
| 
 | 
 | ||||||
| const submitHandler = () => { | const submitHandler = async () => { | ||||||
|     console.log(url.value, token.value) |     console.log(url.value, token.value) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -20,6 +20,12 @@ const submitHandler = () => { | |||||||
|         token: token.value |         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 |         url.value = res.url | ||||||
|         token.value = res.token |         token.value = res.token | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -2,6 +2,7 @@ import { | |||||||
|   app, |   app, | ||||||
|   BrowserWindow, |   BrowserWindow, | ||||||
|   globalShortcut, |   globalShortcut, | ||||||
|  |   Notification, | ||||||
|   clipboard, |   clipboard, | ||||||
|   ipcMain, |   ipcMain, | ||||||
| } from "electron"; | } from "electron"; | ||||||
|  | |||||||
| @ -8,6 +8,7 @@ contextBridge.exposeInMainWorld("electron", { | |||||||
|     ipcRenderer.on(event, callback); |     ipcRenderer.on(event, callback); | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|  |   checkConnection: () => ipcRenderer.invoke("check-connection"), | ||||||
|   loadConfig: () => ipcRenderer.invoke("load-config"), |   loadConfig: () => ipcRenderer.invoke("load-config"), | ||||||
|   saveConfig: (data) => ipcRenderer.send("save-config", data), |   saveConfig: (data) => ipcRenderer.send("save-config", data), | ||||||
| }); | }); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user