feat: Windows stack (daemon, installer, GUI)
Components: - ostp-daemon: Windows Service with Named Pipe IPC - ostp-installer: Setup wizard with admin privileges - ostp-gui: Tauri dark theme UI (450x600) Features: - Background service management (OspabGuard) - IPC commands: CONNECT/DISCONNECT/STATUS - Firewall rules auto-configuration - Wintun driver placeholder (download from wintun.net) - Real-time stats display (upload/download/ping) Note: Requires wintun.dll download for full functionality
This commit is contained in:
37
ostp-gui/src/state.rs
Normal file
37
ostp-gui/src/state.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
//! Application state management
|
||||
|
||||
use std::sync::{Arc, Mutex};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ConnectionStatus {
|
||||
pub connected: bool,
|
||||
pub server: Option<String>,
|
||||
pub upload_speed: u64,
|
||||
pub download_speed: u64,
|
||||
pub ping: u32,
|
||||
}
|
||||
|
||||
impl Default for ConnectionStatus {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
connected: false,
|
||||
server: None,
|
||||
upload_speed: 0,
|
||||
download_speed: 0,
|
||||
ping: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct AppState {
|
||||
pub status: Arc<Mutex<ConnectionStatus>>,
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
status: Arc::new(Mutex::new(ConnectionStatus::default())),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user