From af99c406af8ee47bee38708cf23e86af826e41ba Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 16 Dec 2023 01:08:15 +0100 Subject: watch progress and some draft ui --- common/src/user.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'common/src/user.rs') diff --git a/common/src/user.rs b/common/src/user.rs index f33ca71..8807772 100644 --- a/common/src/user.rs +++ b/common/src/user.rs @@ -14,6 +14,19 @@ pub struct User { pub permissions: PermissionSet, } +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct NodeUserData { + pub watched: WatchedState, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum WatchedState { + None, + Progress(f64), + Watched, +} + #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)] #[cfg_attr(feature = "rocket", derive(FromFormField, UriDisplayQuery))] #[serde(rename_all = "snake_case")] @@ -94,3 +107,11 @@ impl Display for UserPermission { }) } } + +impl Default for NodeUserData { + fn default() -> Self { + Self { + watched: WatchedState::None, + } + } +} -- cgit v1.2.3-70-g09d2