Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,27 @@ pub struct SiomonConfig {
pub dashboard: DashboardConfig,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DashboardConfig {
/// User-defined panels. If non-empty, replaces all built-in panels.
#[serde(default)]
pub panels: Vec<PanelConfig>,
/// Chart history window in seconds (default 10).
#[serde(default = "default_chart_history_secs")]
pub chart_history_secs: u64,
}

impl Default for DashboardConfig {
fn default() -> Self {
Self {
panels: Vec::new(),
chart_history_secs: default_chart_history_secs(),
}
}
}

fn default_chart_history_secs() -> u64 {
10
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
Loading
Loading