mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-15 19:10:47 +02:00
# Description of Changes Makes the desktop options to sign in with your Stirling account, or sign into self-hosted: <img width="608" height="456" alt="image" src="https://github.com/user-attachments/assets/a49988ab-db3f-4333-b242-790aee5c07c6" /> The first option still runs everything locally, just enforces that you've signed in for now. Future work will enable sending operations that can't be run locally to the server.
38 lines
817 B
Rust
38 lines
817 B
Rust
use serde::{Deserialize, Serialize};
|
|
use std::sync::Mutex;
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
|
#[serde(rename_all = "lowercase")]
|
|
pub enum ConnectionMode {
|
|
SaaS,
|
|
SelfHosted,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct ServerConfig {
|
|
pub url: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct ConnectionState {
|
|
pub mode: ConnectionMode,
|
|
pub server_config: Option<ServerConfig>,
|
|
}
|
|
|
|
impl Default for ConnectionState {
|
|
fn default() -> Self {
|
|
Self {
|
|
mode: ConnectionMode::SaaS,
|
|
server_config: None,
|
|
}
|
|
}
|
|
}
|
|
|
|
pub struct AppConnectionState(pub Mutex<ConnectionState>);
|
|
|
|
impl Default for AppConnectionState {
|
|
fn default() -> Self {
|
|
Self(Mutex::new(ConnectionState::default()))
|
|
}
|
|
}
|