Add Tauri UI

This commit is contained in:
Zoltán Papp
2026-03-05 08:53:24 +01:00
parent 1451cedf86
commit f8cf994900
58 changed files with 16900 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
use serde::Serialize;
use tauri::State;
use crate::proto;
use crate::state::AppState;
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct InstallerResult {
pub success: bool,
pub error_msg: String,
}
#[tauri::command]
pub async fn trigger_update() -> Result<(), String> {
// Stub - same as the Go implementation
Ok(())
}
#[tauri::command]
pub async fn get_installer_result(state: State<'_, AppState>) -> Result<InstallerResult, String> {
let mut client = state.grpc.get_client().await?;
let resp = client
.get_installer_result(proto::InstallerResultRequest {})
.await;
match resp {
Ok(r) => {
let inner = r.into_inner();
Ok(InstallerResult {
success: inner.success,
error_msg: inner.error_msg,
})
}
Err(_) => {
// Daemon may have restarted during update - treat as success
Ok(InstallerResult {
success: true,
error_msg: String::new(),
})
}
}
}