feat(mcp): notify desktop UI to reload after connection add/remove
Add /reload-connections bridge route that emits mcp-reload-connections event, triggering the frontend to re-read connections from SQLite.
This commit is contained in:
1 parent
30b6c472ea
commit
68d8776e8f
3 files changed
+15
No files matched your search
@@ -74,6 +74,9 @@ pub fn start(app_handle: AppHandle, state: Arc<AppState>) {
|
||||
handle_open_table(&app, &st, body, &mut stream).await;
|
||||
} else if first_line.starts_with("POST /execute-query") {
|
||||
handle_execute_query(&app, &st, body, &mut stream).await;
|
||||
} else if first_line.starts_with("POST /reload-connections") {
|
||||
let _ = app.emit("mcp-reload-connections", ());
|
||||
respond(&mut stream, "200 OK", "ok").await;
|
||||
} else {
|
||||
let _ = stream.write_all(b"HTTP/1.1 404 Not Found\r\nContent-Length: 0\r\n\r\n").await;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user