feat(connection): add reusable tunnel profiles
This commit is contained in:
@@ -43,6 +43,7 @@ pub mod table_export;
|
||||
pub mod table_import;
|
||||
pub mod text_export;
|
||||
pub mod transfer;
|
||||
pub mod tunnel_profiles;
|
||||
pub mod update;
|
||||
pub mod xlsx_export;
|
||||
pub mod zookeeper_cmd;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use dbx_core::models::connection::TransportLayerConfig;
|
||||
use tauri::State;
|
||||
|
||||
use super::connection::AppState;
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn load_tunnel_profiles(state: State<'_, Arc<AppState>>) -> Result<Vec<TransportLayerConfig>, String> {
|
||||
state.storage.load_tunnel_profiles().await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn save_tunnel_profiles(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
profiles: Vec<TransportLayerConfig>,
|
||||
) -> Result<(), String> {
|
||||
state.storage.save_tunnel_profiles(&profiles).await
|
||||
}
|
||||
@@ -1239,6 +1239,8 @@ pub fn run() {
|
||||
commands::agents::import_agent_jar_cmd,
|
||||
commands::system_fonts::list_system_fonts,
|
||||
commands::ssh_config::list_ssh_config_hosts,
|
||||
commands::tunnel_profiles::load_tunnel_profiles,
|
||||
commands::tunnel_profiles::save_tunnel_profiles,
|
||||
])
|
||||
.build(tauri::generate_context!())
|
||||
.expect("error while building tauri application")
|
||||
|
||||
Reference in New Issue
Block a user