aboutsummaryrefslogtreecommitdiff
path: root/common/src/api.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-04-29 15:19:36 +0200
committermetamuffin <metamuffin@disroot.org>2025-04-29 15:19:36 +0200
commitf73aa32549743b2967160d38c1622199c41524a4 (patch)
tree0fa290fbf9b14d7bfd3803f8cc4618c6c9829330 /common/src/api.rs
parentf62c7f2a8cc143454779dc99334ca9fc80ddabd5 (diff)
downloadjellything-f73aa32549743b2967160d38c1622199c41524a4.tar
jellything-f73aa32549743b2967160d38c1622199c41524a4.tar.bz2
jellything-f73aa32549743b2967160d38c1622199c41524a4.tar.zst
aaaaaaa
Diffstat (limited to 'common/src/api.rs')
-rw-r--r--common/src/api.rs31
1 files changed, 30 insertions, 1 deletions
diff --git a/common/src/api.rs b/common/src/api.rs
index aaff940..c4751a3 100644
--- a/common/src/api.rs
+++ b/common/src/api.rs
@@ -3,7 +3,12 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2025 metamuffin <metamuffin.org>
*/
-use crate::{url_enum, user::NodeUserData, Node, NodeKind};
+use crate::{
+ url_enum,
+ user::{NodeUserData, User},
+ Node, NodeKind,
+};
+use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::{collections::BTreeMap, sync::Arc, time::Duration};
@@ -43,6 +48,30 @@ pub struct ApiStatsResponse {
pub total: StatsBin,
}
+#[derive(Serialize, Deserialize)]
+pub struct ApiAdminUsersResponse {
+ pub users: Vec<User>,
+}
+
+#[derive(Serialize, Deserialize)]
+pub struct LogLine {
+ pub time: DateTime<Utc>,
+ pub module: Option<&'static str>,
+ pub level: LogLevel,
+ pub message: String,
+}
+
+url_enum!(
+ #[derive(Serialize, Deserialize, Clone, Copy, PartialEq)]
+ enum LogLevel {
+ Trace = "trace",
+ Debug = "debug",
+ Info = "info",
+ Warn = "warn",
+ Error = "error",
+ }
+);
+
#[derive(Default, Serialize, Deserialize)]
pub struct StatsBin {
pub runtime: f64,