feat(connection): add dedicated ssh tunnel test button

This commit is contained in:
zipg authored and GitHub committed 2026-09-01 15:07:51 +08:00
1 parent f19439ad7a
commit 6588f27fbc
18 files changed
+228 -21

No files matched your search

+1
View File
@@ -379,6 +379,7 @@ async fn main() {
// Connection
.route("/connection/test", post(routes::connection::test_connection))
.route("/connection/test-info", post(routes::connection::test_connection_with_info))
.route("/connection/test-ssh-tunnel", post(routes::connection::test_ssh_tunnel))
.route("/connection/connect", post(routes::connection::connect_db))
.route("/connection/database-info", post(routes::connection::connected_database_info))
.route("/connection/database-info/save", post(routes::connection::save_connection_database_info))
+7
View File
@@ -373,6 +373,13 @@ pub async fn test_connection_with_info(
run_temporary_connection_test(&state.app, body.config, true).await.map(Json).map_err(AppError::from)
}
pub async fn test_ssh_tunnel(
State(state): State<Arc<WebState>>,
Json(body): Json<ConnectRequest>,
) -> Result<Json<String>, AppError> {
state.app.test_connection_ssh_tunnel(&body.config.canonicalized()).await.map(Json).map_err(AppError::from)
}
pub async fn connect_db(
State(state): State<Arc<WebState>>,
headers: HeaderMap,