107 lines
2.6 KiB
Rust
107 lines
2.6 KiB
Rust
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>,
|
|
}
|
|
|
|
#[derive(Clone, Serialize, Deserialize)]
|
|
pub struct EssentialsStatusItem {
|
|
pub id: String,
|
|
pub name: String,
|
|
pub description: Option<String>,
|
|
pub version: Option<String>,
|
|
pub recommended_version: Option<String>,
|
|
pub available_version: Option<String>,
|
|
pub icon_url: Option<String>,
|
|
pub use_manifest: bool,
|
|
pub manifest_url: Option<String>,
|
|
pub post_install: Option<Vec<PostInstallStep>>,
|
|
pub post_install_url: Option<String>,
|
|
pub action_label: String,
|
|
pub target_version: Option<String>,
|
|
}
|
|
|
|
#[derive(Clone, Serialize, Deserialize)]
|
|
pub struct UpdateCandidate {
|
|
pub id: String,
|
|
pub name: String,
|
|
pub description: Option<String>,
|
|
pub version: Option<String>,
|
|
pub available_version: Option<String>,
|
|
pub icon_url: Option<String>,
|
|
pub use_manifest: bool,
|
|
pub manifest_url: Option<String>,
|
|
pub post_install: Option<Vec<PostInstallStep>>,
|
|
pub post_install_url: Option<String>,
|
|
pub action_label: String,
|
|
pub target_version: Option<String>,
|
|
}
|
|
|
|
#[derive(Clone, Serialize, Deserialize)]
|
|
pub struct DashboardSnapshot {
|
|
pub essentials_version: String,
|
|
pub essentials: Vec<EssentialsStatusItem>,
|
|
pub updates: Vec<UpdateCandidate>,
|
|
pub installed_software: Vec<Software>,
|
|
}
|