From a001008c6181e90da842a055ba3c5827d6b4273b Mon Sep 17 00:00:00 2001 From: Tobias Reiher <15232394+treiher@users.noreply.github.com> Date: Sun, 23 Jun 2024 19:08:26 +0200 Subject: [PATCH] Add dark mode --- CHANGELOG.md | 1 + frontend/Cargo.toml | 2 +- frontend/assets/index.scss | 14 +++--- frontend/src/common.rs | 64 ++++++++++++++++++++-------- frontend/src/data.rs | 44 +++++++++++++++++++ frontend/src/main.rs | 63 ++++++++++++++++++++++++++- frontend/src/page/admin.rs | 1 + frontend/src/page/body_fat.rs | 2 + frontend/src/page/body_weight.rs | 2 + frontend/src/page/exercise.rs | 9 +++- frontend/src/page/exercises.rs | 1 + frontend/src/page/menstrual_cycle.rs | 2 + frontend/src/page/muscles.rs | 1 + frontend/src/page/routine.rs | 10 +++-- frontend/src/page/routines.rs | 1 + frontend/src/page/training.rs | 8 +++- valens/templates/frontend.html | 2 +- 17 files changed, 194 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9ce8e0..a107024 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Tracking of trained muscles +- Dark mode - Descriptions of measuring points on body fat page - Archiving of routines diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml index c6f56d6..53d779e 100644 --- a/frontend/Cargo.toml +++ b/frontend/Cargo.toml @@ -13,7 +13,7 @@ serde = "1.0" serde_json = "1.0" slice-group-by = "0.3" wasm-bindgen = "=0.2.80" -web-sys = { version = "0.3", features = ["AudioContext", "AudioDestinationNode", "AudioNode", "AudioParam", "GainNode", "Notification", "NotificationOptions", "NotificationPermission", "OscillatorNode", "ScrollBehavior", "ScrollIntoViewOptions", "ScrollLogicalPosition", "ScrollToOptions", "ServiceWorker", "ServiceWorkerContainer"] } +web-sys = { version = "0.3", features = ["AudioContext", "AudioDestinationNode", "AudioNode", "AudioParam", "GainNode", "MediaQueryList", "Notification", "NotificationOptions", "NotificationPermission", "OscillatorNode", "ScrollBehavior", "ScrollIntoViewOptions", "ScrollLogicalPosition", "ScrollToOptions", "ServiceWorker", "ServiceWorkerContainer", "Window"] } [dev-dependencies] assert_approx_eq = "1.1.0" diff --git a/frontend/assets/index.scss b/frontend/assets/index.scss index 7b5c592..c6252b9 100644 --- a/frontend/assets/index.scss +++ b/frontend/assets/index.scss @@ -112,11 +112,11 @@ input[type=number] { // Field Set -$fieldset-background-color: bulma.$scheme-main !default; -$fieldset-border-color: bulma.$border !default; -$fieldset-color: bulma.$text-strong !default; +$fieldset-background-color: var(--bulma-scheme-main); +$fieldset-border-color: var(--bulma-border); +$fieldset-color: var(--bulma-text-strong); $fieldset-padding: 1.5em; -$fieldset-radius: bulma.$radius !default; +$fieldset-radius: var(--bulma-radius); .fieldset { background-color: $fieldset-background-color; @@ -140,9 +140,9 @@ div.is-calendar { direction: ltr; tr { td { - color: bulma.$white; - background-color: bulma.$grey-lighter; - border: 1px solid bulma.$white; + color: var(--bulma-scheme-main); + background-color: var(--bulma-border); + border: 1px solid var(--bulma-scheme-main); text-align: center; div { width: 10pt; diff --git a/frontend/src/common.rs b/frontend/src/common.rs index 03df077..5370168 100644 --- a/frontend/src/common.rs +++ b/frontend/src/common.rs @@ -115,12 +115,12 @@ pub fn view_dialog( C!["modal-content"], div![ C!["message"], - C!["has-background-white"], C![format!("is-{color}")], C!["mx-2"], div![ C!["message-body"], - C!["has-text-dark"], + C!["has-text-text-bold"], + C!["has-background-scheme-main"], div![C!["title"], C![format!("has-text-{color}")], title], content ] @@ -185,7 +185,13 @@ pub fn view_delete_confirmation_dialog( C!["is-grouped-centered"], div![ C!["control"], - button![C!["button"], C!["is-light"], cancel_event, "No"] + button![ + C!["button"], + C!["is-light"], + C!["is-soft"], + cancel_event, + "No" + ] ], div![ C!["control"], @@ -470,7 +476,12 @@ pub fn automatic_icon() -> Node { St::LineHeight => "1.5em", }, i![C!["fas fa-circle fa-stack-1x"]], - i![C!["fas fa-a fa-inverse fa-stack-1x"]] + i![ + style! { + St::Color => "var(--bulma-scheme-main)", + }, + C!["fas fa-a fa-inverse fa-stack-1x"] + ] ] } @@ -547,7 +558,7 @@ pub fn view_calendar(entries: Vec<(NaiveDate, usize, f64)>, interval: &Inter } } else if *date < interval.first || *date > interval.last { style! { - St::BackgroundColor => "#FFFFFF" + St::BackgroundColor => "var(--bulma-scheme-main)" } } else { style! {} @@ -620,6 +631,7 @@ pub fn plot_line_chart( x_max: NaiveDate, y_min_opt: Option, y_max_opt: Option, + theme: &data::Theme, ) -> Result> { let (y_min, y_max, y_margin) = determine_y_bounds( data.iter() @@ -633,8 +645,9 @@ pub fn plot_line_chart( { let root = SVGBackend::with_string(&mut result, (chart_width(), 200)).into_drawing_area(); + let (color, background_color) = colors(theme); - root.fill(&WHITE)?; + root.fill(&background_color)?; let mut chart_builder = ChartBuilder::on(&root); chart_builder @@ -651,8 +664,9 @@ pub fn plot_line_chart( .configure_mesh() .disable_x_mesh() .set_all_tick_mark_size(3u32) - .axis_style(BLACK.mix(0.3)) - .light_line_style(WHITE.mix(0.0)) + .axis_style(color.mix(0.3)) + .light_line_style(color.mix(0.0)) + .label_style(&color) .x_labels(2) .y_labels(6) .draw()?; @@ -685,6 +699,7 @@ pub fn plot_dual_line_chart( secondary_data: &[(Vec<(NaiveDate, f32)>, usize)], x_min: NaiveDate, x_max: NaiveDate, + theme: &data::Theme, ) -> Result> { let (y1_min, y1_max, y1_margin) = determine_y_bounds( data.iter() @@ -706,8 +721,9 @@ pub fn plot_dual_line_chart( { let root = SVGBackend::with_string(&mut result, (chart_width(), 200)).into_drawing_area(); + let (color, background_color) = colors(theme); - root.fill(&WHITE)?; + root.fill(&background_color)?; let mut chart = ChartBuilder::on(&root) .margin(10f32) @@ -721,8 +737,9 @@ pub fn plot_dual_line_chart( .configure_mesh() .disable_x_mesh() .set_all_tick_mark_size(3u32) - .axis_style(BLACK.mix(0.3)) - .light_line_style(WHITE.mix(0.0)) + .axis_style(color.mix(0.3)) + .light_line_style(background_color.mix(0.0)) + .label_style(&color) .x_labels(2) .y_labels(6) .draw()?; @@ -730,7 +747,7 @@ pub fn plot_dual_line_chart( chart .configure_secondary_axes() .set_all_tick_mark_size(3u32) - .axis_style(BLACK.mix(0.3)) + .axis_style(color.mix(0.3)) .draw()?; for (series, color_idx) in secondary_data { @@ -780,6 +797,7 @@ pub fn plot_bar_chart( x_max: NaiveDate, y_min_opt: Option, y_max_opt: Option, + theme: &data::Theme, ) -> Result> { let (y1_min, y1_max, _) = determine_y_bounds( data.iter() @@ -802,8 +820,9 @@ pub fn plot_bar_chart( { let root = SVGBackend::with_string(&mut result, (chart_width(), 200)).into_drawing_area(); + let (color, background_color) = colors(theme); - root.fill(&WHITE)?; + root.fill(&background_color)?; let mut chart = ChartBuilder::on(&root) .margin(10f32) @@ -820,8 +839,9 @@ pub fn plot_bar_chart( .configure_mesh() .disable_x_mesh() .set_all_tick_mark_size(3u32) - .axis_style(BLACK.mix(0.3)) - .light_line_style(WHITE.mix(0.0)) + .axis_style(color.mix(0.3)) + .light_line_style(background_color.mix(0.0)) + .label_style(&color) .x_labels(2) .y_labels(6) .draw()?; @@ -829,7 +849,7 @@ pub fn plot_bar_chart( chart .configure_secondary_axes() .set_all_tick_mark_size(3u32) - .axis_style(BLACK.mix(0.3)) + .axis_style(color.mix(0.3)) .draw()?; for (series, color_idx) in data { @@ -867,6 +887,14 @@ pub fn plot_bar_chart( Ok(result) } +fn colors(theme: &data::Theme) -> (RGBColor, RGBColor) { + let dark = RGBColor(20, 22, 26); + match theme { + data::Theme::System | data::Theme::Light => (dark, WHITE), + data::Theme::Dark => (WHITE, dark), + } +} + fn determine_y_bounds( y: Vec, y_min_opt: Option, @@ -1018,7 +1046,7 @@ where span![ C!["tag"], C!["is-hoverable"], - C![if *enabled { "is-link" } else { "is-light" }], + IF![*enabled => C!["is-link"]], ev(Ev::Click, { let index = *i; let filter_changed = filter_changed.clone(); @@ -1106,7 +1134,7 @@ where } else if sets > 0.0 { groups[2].push((name, description, sets_str, vec!["is-light", "is-link"])); } else { - groups[3].push((name, description, sets_str, vec!["is-light"])); + groups[3].push((name, description, sets_str, vec![])); } } groups diff --git a/frontend/src/data.rs b/frontend/src/data.rs index 8fc647c..2f4aca9 100644 --- a/frontend/src/data.rs +++ b/frontend/src/data.rs @@ -19,6 +19,7 @@ const STORAGE_KEY_ONGOING_TRAINING_SESSION: &str = "ongoing training session"; pub fn init(url: Url, _orders: &mut impl Orders) -> Model { let settings = gloo_storage::LocalStorage::get(STORAGE_KEY_SETTINGS).unwrap_or(Settings { beep_volume: 80, + theme: Theme::Light, automatic_metronome: false, notifications: false, }); @@ -114,6 +115,36 @@ impl Model { let dates = self.training_sessions.values().map(|t| t.date); dates.clone().min().unwrap_or_default()..=dates.max().unwrap_or_default() } + + pub fn theme(&self) -> &Theme { + match self.settings.theme { + Theme::System => { + if let Some(window) = web_sys::window() { + if let Ok(prefers_dark_scheme) = + window.match_media("(prefers-color-scheme: dark)") + { + if let Some(media_query_list) = prefers_dark_scheme { + if media_query_list.matches() { + &Theme::Dark + } else { + &Theme::Light + } + } else { + error!("failed to determine preferred color scheme"); + &Theme::Light + } + } else { + error!("failed to match media to determine preferred color scheme"); + &Theme::Light + } + } else { + error!("failed to access window to determine preferred color scheme"); + &Theme::Light + } + } + Theme::Light | Theme::Dark => &self.settings.theme, + } + } } fn sort_routines_by_last_use( @@ -396,10 +427,18 @@ pub enum TrainingSessionElement { #[derive(serde::Serialize, serde::Deserialize)] pub struct Settings { pub beep_volume: u8, + pub theme: Theme, pub automatic_metronome: bool, pub notifications: bool, } +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq)] +pub enum Theme { + System, + Light, + Dark, +} + #[derive(serde::Serialize, serde::Deserialize, Clone)] pub struct OngoingTrainingSession { pub training_session_id: u32, @@ -1059,6 +1098,7 @@ pub enum Msg { TrainingSessionDeleted(Result), SetBeepVolume(u8), + SetTheme(Theme), SetAutomaticMetronome(bool), SetNotifications(bool), @@ -1919,6 +1959,10 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders) { local_storage_set(STORAGE_KEY_SETTINGS, &model.settings, &mut model.errors); orders.notify(Event::BeepVolumeChanged); } + Msg::SetTheme(theme) => { + model.settings.theme = theme; + local_storage_set(STORAGE_KEY_SETTINGS, &model.settings, &mut model.errors); + } Msg::SetAutomaticMetronome(value) => { model.settings.automatic_metronome = value; local_storage_set(STORAGE_KEY_SETTINGS, &model.settings, &mut model.errors); diff --git a/frontend/src/main.rs b/frontend/src/main.rs index 5681a32..4ce72d9 100644 --- a/frontend/src/main.rs +++ b/frontend/src/main.rs @@ -28,6 +28,10 @@ fn init(url: Url, orders: &mut impl Orders) -> Model { .stream(streams::window_event(Ev::Click, |_| Msg::HideMenu)) .notify(data::Msg::InitializeSession); + let data = data::init(url, &mut orders.proxy(Msg::Data)); + + set_theme(&data.settings.theme); + Model { navbar: Navbar { title: String::from("Valens"), @@ -36,7 +40,7 @@ fn init(url: Url, orders: &mut impl Orders) -> Model { }, page: None, settings_dialog_visible: false, - data: data::init(url, &mut orders.proxy(Msg::Data)), + data, } } @@ -250,6 +254,7 @@ enum Msg { ShowSettingsDialog, CloseSettingsDialog, BeepVolumeChanged(String), + SetTheme(data::Theme), ToggleAutomaticMetronome, ToggleNotifications, UpdateApp, @@ -321,6 +326,10 @@ fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders) { orders.send_msg(Msg::Data(data::Msg::SetBeepVolume(value))); } } + Msg::SetTheme(theme) => { + set_theme(&theme); + orders.send_msg(Msg::Data(data::Msg::SetTheme(theme))); + } Msg::ToggleAutomaticMetronome => { orders.send_msg(Msg::Data(data::Msg::SetAutomaticMetronome(not(model .data @@ -707,6 +716,44 @@ fn view_settings_dialog(data_model: &data::Model) -> Node { input_ev(Ev::Input, Msg::BeepVolumeChanged), ] ], + p![ + C!["mb-5"], + h1![C!["subtitle"], "Theme"], + div![ + C!["field"], + C!["has-addons"], + p![ + C!["control"], + button![ + C!["button"], + C![IF![data_model.settings.theme == data::Theme::Light => "is-link"]], + &ev(Ev::Click, move |_| Msg::SetTheme(data::Theme::Light)), + span![C!["icon"], C!["is-small"], i![C!["fas fa-sun"]]], + span!["Light"], + ] + ], + p![ + C!["control"], + span![ + C!["button"], + C![IF![data_model.settings.theme == data::Theme::Dark => "is-link"]], + &ev(Ev::Click, move |_| Msg::SetTheme(data::Theme::Dark)), + span![C!["icon"], i![C!["fas fa-moon"]]], + span!["Dark"], + ] + ], + p![ + C!["control"], + span![ + C!["button"], + C![IF![data_model.settings.theme == data::Theme::System => "is-link"]], + &ev(Ev::Click, move |_| Msg::SetTheme(data::Theme::System)), + span![C!["icon"], i![C!["fas fa-desktop"]]], + span!["System"], + ] + ], + ], + ], p![ C!["mb-5"], h1![C!["subtitle"], "Metronome"], @@ -784,6 +831,20 @@ fn view_settings_dialog(data_model: &data::Model) -> Node { ) } +fn set_theme(theme: &data::Theme) { + if let Some(window) = web_sys::window() { + if let Some(document) = window.document() { + if let Some(html_element) = document.document_element() { + let _ = match theme { + data::Theme::System => html_element.remove_attribute("data-theme"), + data::Theme::Light => html_element.set_attribute("data-theme", "light"), + data::Theme::Dark => html_element.set_attribute("data-theme", "dark"), + }; + } + } + } +} + // ------ ------ // Start // ------ ------ diff --git a/frontend/src/page/admin.rs b/frontend/src/page/admin.rs index 89d8fa2..21244e2 100644 --- a/frontend/src/page/admin.rs +++ b/frontend/src/page/admin.rs @@ -343,6 +343,7 @@ fn view_user_dialog(dialog: &Dialog, loading: bool) -> Node { button![ C!["button"], C!["is-light"], + C!["is-soft"], ev(Ev::Click, |_| Msg::CloseUserDialog), "Cancel", ] diff --git a/frontend/src/page/body_fat.rs b/frontend/src/page/body_fat.rs index bfdb133..3865e64 100644 --- a/frontend/src/page/body_fat.rs +++ b/frontend/src/page/body_fat.rs @@ -663,6 +663,7 @@ fn view_body_fat_dialog(dialog: &Dialog, loading: bool, sex: u8) -> Node { button![ C!["button"], C!["is-light"], + C!["is-soft"], ev(Ev::Click, |_| Msg::CloseBodyFatDialog), "Cancel", ] @@ -768,6 +769,7 @@ fn view_chart(model: &Model, data_model: &data::Model) -> Node { )], model.interval.first, model.interval.last, + data_model.theme(), ), ) } diff --git a/frontend/src/page/body_weight.rs b/frontend/src/page/body_weight.rs index c7c45ef..4dcabcf 100644 --- a/frontend/src/page/body_weight.rs +++ b/frontend/src/page/body_weight.rs @@ -331,6 +331,7 @@ fn view_body_weight_dialog(dialog: &Dialog, loading: bool) -> Node { button![ C!["button"], C!["is-light"], + C!["is-soft"], ev(Ev::Click, |_| Msg::CloseBodyWeightDialog), "Cancel", ] @@ -390,6 +391,7 @@ fn view_chart(model: &Model, data_model: &data::Model) -> Node { model.interval.last, None, None, + data_model.theme(), ), ) } diff --git a/frontend/src/page/exercise.rs b/frontend/src/page/exercise.rs index 4e38769..aa60382 100644 --- a/frontend/src/page/exercise.rs +++ b/frontend/src/page/exercise.rs @@ -272,7 +272,7 @@ pub fn view(model: &Model, data_model: &data::Model) -> Node { &exercise_interval, Msg::ChangeInterval ), - view_charts(&training_sessions, &model.interval), + view_charts(&training_sessions, &model.interval, data_model.theme()), view_calendar(&training_sessions, &model.interval), training::view_table( &training_sessions, @@ -440,6 +440,7 @@ fn view_muscles(model: &Model) -> Node { pub fn view_charts( training_sessions: &[&data::TrainingSession], interval: &common::Interval, + theme: &data::Theme, ) -> Vec> { let mut set_volume: BTreeMap = BTreeMap::new(); let mut volume_load: BTreeMap = BTreeMap::new(); @@ -497,6 +498,7 @@ pub fn view_charts( interval.last, Some(0.), Some(10.), + theme, ) ), common::view_chart( @@ -510,6 +512,7 @@ pub fn view_charts( interval.last, Some(0.), Some(10.), + theme, ) ), common::view_chart( @@ -520,6 +523,7 @@ pub fn view_charts( interval.last, Some(0.), Some(10.), + theme, ) ), common::view_chart( @@ -563,6 +567,7 @@ pub fn view_charts( interval.last, Some(0.), Some(10.), + theme, ) ), common::view_chart( @@ -582,6 +587,7 @@ pub fn view_charts( interval.last, Some(0.), Some(10.), + theme, ) ), common::view_chart( @@ -600,6 +606,7 @@ pub fn view_charts( interval.last, Some(0.), Some(10.), + theme, ) ), ] diff --git a/frontend/src/page/exercises.rs b/frontend/src/page/exercises.rs index 52f0e8e..7d7e6ae 100644 --- a/frontend/src/page/exercises.rs +++ b/frontend/src/page/exercises.rs @@ -282,6 +282,7 @@ fn view_exercise_dialog( button![ C!["button"], C!["is-light"], + C!["is-soft"], ev(Ev::Click, |_| Msg::CloseExerciseDialog), "Cancel", ] diff --git a/frontend/src/page/menstrual_cycle.rs b/frontend/src/page/menstrual_cycle.rs index 43df596..1118c58 100644 --- a/frontend/src/page/menstrual_cycle.rs +++ b/frontend/src/page/menstrual_cycle.rs @@ -313,6 +313,7 @@ fn view_period_dialog(dialog: &Dialog, loading: bool) -> Node { button![ C!["button"], C!["is-light"], + C!["is-soft"], ev(Ev::Click, |_| Msg::ClosePeriodDialog), "Cancel", ] @@ -358,6 +359,7 @@ fn view_chart(model: &Model, data_model: &data::Model) -> Node { model.interval.last, Some(0.), Some(4.), + data_model.theme(), ), ) } diff --git a/frontend/src/page/muscles.rs b/frontend/src/page/muscles.rs index af9c831..26354f4 100644 --- a/frontend/src/page/muscles.rs +++ b/frontend/src/page/muscles.rs @@ -102,6 +102,7 @@ pub fn view(model: &Model, data_model: &data::Model) -> Node { model.interval.last, Some(0.), Some(10.), + data_model.theme() ) ) ] diff --git a/frontend/src/page/routine.rs b/frontend/src/page/routine.rs index 0b0754f..149035a 100644 --- a/frontend/src/page/routine.rs +++ b/frontend/src/page/routine.rs @@ -1166,9 +1166,9 @@ fn view_routine_part( span![ C!["icon"], if *automatic { - C!["has-text-dark"] + C!["has-text-dark-bold"] } else { - C!["has-text-grey-lighter"] + C!["has-text-dark-soft"] }, common::automatic_icon() ] @@ -1301,7 +1301,7 @@ fn view_training_sessions(model: &Model, data_model: &data::Model) -> Node C!["mt-6"], common::view_title(&span!["Training sessions"], 5), common::view_interval_buttons(&model.interval, &routine_interval, Msg::ChangeInterval), - view_charts(&training_sessions, &model.interval), + view_charts(&training_sessions, &model.interval, data_model.theme()), training::view_calendar(&training_sessions, &model.interval), training::view_table( &training_sessions, @@ -1314,6 +1314,7 @@ fn view_training_sessions(model: &Model, data_model: &data::Model) -> Node pub fn view_charts( training_sessions: &[&data::TrainingSession], interval: &common::Interval, + theme: &data::Theme, ) -> Vec> { let mut load: BTreeMap = BTreeMap::new(); let mut set_volume: BTreeMap = BTreeMap::new(); @@ -1343,6 +1344,7 @@ pub fn view_charts( interval.last, Some(0.), Some(10.), + theme, ) ), common::view_chart( @@ -1356,6 +1358,7 @@ pub fn view_charts( interval.last, Some(0.), Some(10.), + theme, ) ), common::view_chart( @@ -1381,6 +1384,7 @@ pub fn view_charts( interval.last, Some(5.), Some(10.), + theme, ) ), ] diff --git a/frontend/src/page/routines.rs b/frontend/src/page/routines.rs index 87206b6..fb3017d 100644 --- a/frontend/src/page/routines.rs +++ b/frontend/src/page/routines.rs @@ -309,6 +309,7 @@ fn view_routine_dialog(dialog: &Dialog, routines: &[data::Routine], loading: boo button![ C!["button"], C!["is-light"], + C!["is-soft"], ev(Ev::Click, |_| Msg::CloseRoutineDialog), "Cancel", ] diff --git a/frontend/src/page/training.rs b/frontend/src/page/training.rs index 3b8d74f..4c803cb 100644 --- a/frontend/src/page/training.rs +++ b/frontend/src/page/training.rs @@ -328,7 +328,8 @@ pub fn view(model: &Model, data_model: &data::Model) -> Node { long_term_load, total_set_volume_per_week, avg_rpe_per_week, - &model.interval + &model.interval, + data_model.theme() ), view_calendar(&training_sessions, &model.interval), view_table( @@ -476,6 +477,7 @@ fn view_training_sessions_dialog( button![ C!["button"], C!["is-light"], + C!["is-soft"], ev(Ev::Click, |_| Msg::CloseTrainingSessionDialog), "Cancel", ] @@ -505,6 +507,7 @@ pub fn view_charts( total_set_volume_per_week: Vec<(NaiveDate, f32)>, avg_rpe_per_week: Vec<(NaiveDate, f32)>, interval: &common::Interval, + theme: &data::Theme, ) -> Vec> { let long_term_load_high = long_term_load .iter() @@ -533,6 +536,7 @@ pub fn view_charts( interval.last, Some(0.), Some(10.), + theme, ) ), common::view_chart( @@ -543,6 +547,7 @@ pub fn view_charts( interval.last, Some(0.), Some(10.), + theme, ) ), common::view_chart( @@ -553,6 +558,7 @@ pub fn view_charts( interval.last, Some(5.), Some(10.), + theme, ) ), ] diff --git a/valens/templates/frontend.html b/valens/templates/frontend.html index e9de14d..2e5f7e8 100644 --- a/valens/templates/frontend.html +++ b/valens/templates/frontend.html @@ -1,5 +1,5 @@ - +