Initial commit: LoFlum FTP/SFTP client
Tauri 2 + Rust + Svelte 5. SFTP via ssh2, FTP via suppaftp. Transfer queue with async worker, SQLite site storage, keychain.
This commit is contained in:
parent
0f182ab76f
commit
79855585bd
60 changed files with 14532 additions and 18 deletions
21
src-tauri/src/commands/sites.rs
Normal file
21
src-tauri/src/commands/sites.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
use tauri::State;
|
||||
use crate::domain::site::Site;
|
||||
use crate::storage::db::Db;
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_sites(db: State<'_, Db>) -> Result<Vec<Site>, String> {
|
||||
let conn = db.0.lock().unwrap();
|
||||
crate::storage::db::get_sites(&conn).map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn save_site(db: State<'_, Db>, site: Site) -> Result<(), String> {
|
||||
let conn = db.0.lock().unwrap();
|
||||
crate::storage::db::save_site(&conn, &site).map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn delete_site(db: State<'_, Db>, id: String) -> Result<(), String> {
|
||||
let conn = db.0.lock().unwrap();
|
||||
crate::storage::db::delete_site(&conn, &id).map_err(|e| e.to_string())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue