refactor 1
This commit is contained in:
65
src-tauri/src/domain/models.rs
Normal file
65
src-tauri/src/domain/models.rs
Normal file
@@ -0,0 +1,65 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::winget::{PostInstallStep, Software};
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
pub struct AppSettings {
|
||||
pub repo_url: String,
|
||||
}
|
||||
|
||||
impl Default for AppSettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
repo_url: "https://karlblue.github.io/winget-repo".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
pub struct EssentialsRepo {
|
||||
pub version: String,
|
||||
pub essentials: Vec<Software>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
pub struct InstallTask {
|
||||
pub id: String,
|
||||
pub version: Option<String>,
|
||||
#[serde(default)]
|
||||
pub use_manifest: bool,
|
||||
pub manifest_url: Option<String>,
|
||||
#[serde(default = "default_true")]
|
||||
pub enable_post_install: bool,
|
||||
}
|
||||
|
||||
fn default_true() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize)]
|
||||
pub struct LogPayload {
|
||||
pub id: String,
|
||||
pub timestamp: String,
|
||||
pub command: String,
|
||||
pub output: String,
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
pub struct SyncEssentialsResult {
|
||||
pub status: String,
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize)]
|
||||
pub struct InstallProgress {
|
||||
pub id: String,
|
||||
pub status: String,
|
||||
pub progress: f32,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ResolvedPostInstall {
|
||||
pub software: Software,
|
||||
pub steps: Vec<PostInstallStep>,
|
||||
}
|
||||
Reference in New Issue
Block a user