fix HasModel for ServerInfo

This commit is contained in:
Aiden McClelland
2021-10-08 16:58:30 -06:00
committed by Aiden McClelland
parent f4b70f653f
commit ee8eca7038
2 changed files with 17 additions and 27 deletions

View File

@@ -51,6 +51,7 @@ impl Database {
clearnet: Vec::new(),
},
share_stats: false,
update_progress: None,
},
package_data: AllPackageData::default(),
broken_packages: Vec::new(),
@@ -71,7 +72,6 @@ pub struct ServerInfo {
pub version: Version,
pub lan_address: Url,
pub tor_address: Url,
#[serde(flatten)]
pub status: ServerStatus,
pub eos_marketplace: Url,
pub package_marketplace: Option<Url>, // None implies use eos_marketplace
@@ -79,18 +79,15 @@ pub struct ServerInfo {
pub unread_notification_count: u64,
pub connection_addresses: ConnectionAddresses,
pub share_stats: bool,
pub update_progress: Option<UpdateProgress>,
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
#[serde(tag = "status")]
pub enum ServerStatus {
Running {},
#[serde(rename_all = "kebab-case")]
Updating {
update_progress: UpdateProgress,
},
BackingUp {},
Running,
Updating,
BackingUp,
}
#[derive(Debug, Deserialize, Serialize)]