Files
ospab.network/ostp-gui/src/state.rs
ospab 85a2b01074 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
2026-01-02 02:17:15 +03:00

38 lines
766 B
Rust

//! 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())),
}
}
}