From c5ceb51ec404cd391ca47de65d7c6a99bfcd436e Mon Sep 17 00:00:00 2001
From: Fred Clausen <43556888+fredclausen@users.noreply.github.com>
Date: Tue, 21 May 2024 18:06:33 -0600
Subject: [PATCH 1/9] readme
---
README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/README.md b/README.md
index 589934b..3015829 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,7 @@ Sorry, there is no migration path from ACARS Hub to SDR-E Hub. The data that ACA
- [x] GitHub CI
- [ ] FIXME/TODO Cleanup
- [ ] Code documentation
+ - [ ] Unit Tests
- [ ] Alpha 2
- [ ] Connect to data providers
- [ ] ADSB
@@ -43,6 +44,7 @@ Sorry, there is no migration path from ACARS Hub to SDR-E Hub. The data that ACA
- [ ] Display data on the web interface
- [ ] FIXME/TODO Cleanup
- [ ] Code documentation
+ - [ ] Unit Tests
- [ ] Alpha 3
- [ ] Implement database storage
- [ ] RRD style data storage for relevant stats
@@ -50,10 +52,12 @@ Sorry, there is no migration path from ACARS Hub to SDR-E Hub. The data that ACA
- [ ] General stats
- [ ] FIXME/TODO Cleanup
- [ ] Code documentation
+ - [ ] Unit Tests
- [ ] Beta 1
- [ ] Focus on interface; clean it up, mobile functionality, etc
- [ ] FIXME/TODO Cleanup
- [ ] Code documentation
+ - [ ] Unit Tests
## Thank you
From 3e5bc904b79b7625d614eb03e07c6a87fafa1ee2 Mon Sep 17 00:00:00 2001
From: Fred Clausen <43556888+fredclausen@users.noreply.github.com>
Date: Wed, 22 May 2024 11:52:12 -0600
Subject: [PATCH 2/9] some css styling and related setup for settings
fix padding based on what is displayed in the panels
---
sh-frontend/src/app/live.rs | 17 +++-
sh-frontend/src/components/mod.rs | 1 +
.../src/components/setting_components/mod.rs | 9 ++
.../setting_components/sh_app_config.rs | 25 ++++++
.../setting_components/sh_data_sources.rs | 25 ++++++
.../sh_enabled_data_sources.rs | 25 ++++++
.../components/setting_components/sh_map.rs | 25 ++++++
sh-frontend/src/components/settings.rs | 13 ++-
sh-frontend/tailwind.css | 83 ++++++++++++++++++-
9 files changed, 216 insertions(+), 7 deletions(-)
create mode 100644 sh-frontend/src/components/setting_components/mod.rs
create mode 100644 sh-frontend/src/components/setting_components/sh_app_config.rs
create mode 100644 sh-frontend/src/components/setting_components/sh_data_sources.rs
create mode 100644 sh-frontend/src/components/setting_components/sh_enabled_data_sources.rs
create mode 100644 sh-frontend/src/components/setting_components/sh_map.rs
diff --git a/sh-frontend/src/app/live.rs b/sh-frontend/src/app/live.rs
index 89502f1..d778709 100644
--- a/sh-frontend/src/app/live.rs
+++ b/sh-frontend/src/app/live.rs
@@ -111,12 +111,25 @@ pub fn live() -> Html {
}
});
+ // FIXME: This feels garbage and yuck. Ideally we use tailwind classes and dynamically set them?
+ let pad_inside_left = if *left_panel == Panels::Map {
+ "padding: 0px;"
+ } else {
+ "padding: 0.5rem;"
+ };
+
+ let pad_inside_right = if *right_panel == Panels::Map {
+ "padding: 0px;"
+ } else {
+ "padding: 0.5rem;"
+ };
+
html! {
-
+
{ left_panel_show.clone() }
-
+
if visible {
{ right_panel_status.clone() }
}
diff --git a/sh-frontend/src/components/mod.rs b/sh-frontend/src/components/mod.rs
index fec5496..272ab16 100644
--- a/sh-frontend/src/components/mod.rs
+++ b/sh-frontend/src/components/mod.rs
@@ -10,5 +10,6 @@ pub mod map;
pub mod map_display;
pub mod nav;
pub mod search;
+pub mod setting_components;
pub mod settings;
pub mod stats;
diff --git a/sh-frontend/src/components/setting_components/mod.rs b/sh-frontend/src/components/setting_components/mod.rs
new file mode 100644
index 0000000..53c0f7e
--- /dev/null
+++ b/sh-frontend/src/components/setting_components/mod.rs
@@ -0,0 +1,9 @@
+// Copyright (C) 2024 Fred Clausen
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file or at
+// https://opensource.org/licenses/MIT.
+
+pub mod sh_app_config;
+pub mod sh_data_sources;
+pub mod sh_enabled_data_sources;
+pub mod sh_map;
diff --git a/sh-frontend/src/components/setting_components/sh_app_config.rs b/sh-frontend/src/components/setting_components/sh_app_config.rs
new file mode 100644
index 0000000..b57dd19
--- /dev/null
+++ b/sh-frontend/src/components/setting_components/sh_app_config.rs
@@ -0,0 +1,25 @@
+// Copyright (C) 2024 Fred Clausen
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file or at
+// https://opensource.org/licenses/MIT.
+
+use yew::prelude::*;
+
+#[function_component(ShAppConfig)]
+pub fn sh_app_config() -> Html {
+ html! {
+ <>
+
+
+
+
+
+ {"QUnit is by calling one of the object that are embedded in JavaScript, and faster JavaScript program could also used with
+ its elegant, well documented, and functional programming using JS, HTML pages Modernizr is a popular browsers without
+ plug-ins. Test-Driven Development."}
+
+
+
+ >
+ }
+}
diff --git a/sh-frontend/src/components/setting_components/sh_data_sources.rs b/sh-frontend/src/components/setting_components/sh_data_sources.rs
new file mode 100644
index 0000000..e186a6e
--- /dev/null
+++ b/sh-frontend/src/components/setting_components/sh_data_sources.rs
@@ -0,0 +1,25 @@
+// Copyright (C) 2024 Fred Clausen
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file or at
+// https://opensource.org/licenses/MIT.
+
+use yew::prelude::*;
+
+#[function_component(ShDataSourcesConfig)]
+pub fn sh_data_sources_config() -> Html {
+ html! {
+ <>
+
+
+
+
+
+ {"QUnit is by calling one of the object that are embedded in JavaScript, and faster JavaScript program could also used with
+ its elegant, well documented, and functional programming using JS, HTML pages Modernizr is a popular browsers without
+ plug-ins. Test-Driven Development."}
+
+
+
+ >
+ }
+}
diff --git a/sh-frontend/src/components/setting_components/sh_enabled_data_sources.rs b/sh-frontend/src/components/setting_components/sh_enabled_data_sources.rs
new file mode 100644
index 0000000..756d7bc
--- /dev/null
+++ b/sh-frontend/src/components/setting_components/sh_enabled_data_sources.rs
@@ -0,0 +1,25 @@
+// Copyright (C) 2024 Fred Clausen
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file or at
+// https://opensource.org/licenses/MIT.
+
+use yew::prelude::*;
+
+#[function_component(ShEnabledDataSourcesConfig)]
+pub fn sh_enabled_data_sources_config() -> Html {
+ html! {
+ <>
+
+
+
+
+
+ {"QUnit is by calling one of the object that are embedded in JavaScript, and faster JavaScript program could also used with
+ its elegant, well documented, and functional programming using JS, HTML pages Modernizr is a popular browsers without
+ plug-ins. Test-Driven Development."}
+
+
+
+ >
+ }
+}
diff --git a/sh-frontend/src/components/setting_components/sh_map.rs b/sh-frontend/src/components/setting_components/sh_map.rs
new file mode 100644
index 0000000..1cf85b4
--- /dev/null
+++ b/sh-frontend/src/components/setting_components/sh_map.rs
@@ -0,0 +1,25 @@
+// Copyright (C) 2024 Fred Clausen
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file or at
+// https://opensource.org/licenses/MIT.
+
+use yew::prelude::*;
+
+#[function_component(ShMapConfig)]
+pub fn sh_map_config() -> Html {
+ html! {
+ <>
+
+
+
+
+
+ {"QUnit is by calling one of the object that are embedded in JavaScript, and faster JavaScript program could also used with
+ its elegant, well documented, and functional programming using JS, HTML pages Modernizr is a popular browsers without
+ plug-ins. Test-Driven Development."}
+
+
+
+ >
+ }
+}
diff --git a/sh-frontend/src/components/settings.rs b/sh-frontend/src/components/settings.rs
index 3f107ab..e59d6a3 100644
--- a/sh-frontend/src/components/settings.rs
+++ b/sh-frontend/src/components/settings.rs
@@ -3,14 +3,21 @@
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
+use crate::components::setting_components::{
+ sh_app_config::ShAppConfig, sh_data_sources::ShDataSourcesConfig,
+ sh_enabled_data_sources::ShEnabledDataSourcesConfig, sh_map::ShMapConfig,
+};
use yew::prelude::*;
/// Home page
#[function_component(ShSettings)]
pub fn settings() -> Html {
html! {
- {
- "Settings"
- }
+ <>
+
+
+
+
+ >
}
}
diff --git a/sh-frontend/tailwind.css b/sh-frontend/tailwind.css
index 8cab95e..07a7819 100644
--- a/sh-frontend/tailwind.css
+++ b/sh-frontend/tailwind.css
@@ -7,6 +7,8 @@ h2 {
text-align: center;
}
+/* Navbar styling and animation */
+
.top-nav {
display: flex;
flex-direction: row;
@@ -52,11 +54,17 @@ h2 {
display: none;
}
+.menu-button:hover,
+.menu-button:hover::before,
+.menu-button:hover::after {
+ background-color: #73a942;
+}
+
.menu-button,
.menu-button::before,
.menu-button::after {
display: block;
- background-color: #fff;
+ background-color: #fdfdff;
position: absolute;
height: 4px;
width: 30px;
@@ -156,7 +164,7 @@ h2 {
padding: 0.5em 0;
min-width: 200px;
max-width: 767px;
- color: white;
+ color: #fdfdff;
background-color: #222;
justify-content: left;
}
@@ -188,3 +196,74 @@ h2 {
height: 100%;
z-index: 1;
}
+
+/* Settings (and more?) collapsable styling */
+
+.wrap-collabsible {
+ margin-bottom: 1.2rem 0;
+}
+
+input[type="checkbox"] {
+ display: none;
+}
+
+.lbl-toggle {
+ display: block;
+ text-transform: uppercase;
+ padding: 0.5rem;
+ margin-top: 0.25rem;
+ color: #fdfdff;
+ background-color: #8963ba;
+ background: linear-gradient(to left, #8963ba, #3c2f66);
+ cursor: pointer;
+ border-radius: 1.5rem;
+ transition: all 0.25s ease-out;
+}
+
+.lbl-toggle:hover {
+ color: #73a942;
+}
+
+.lbl-toggle::before {
+ content: " ";
+ display: inline-block;
+
+ border-top: 5px solid transparent;
+ border-bottom: 5px solid transparent;
+ border-left: 5px solid currentColor;
+ vertical-align: middle;
+ margin-right: 0.7rem;
+ transform: translateY(-2px);
+
+ transition: transform 0.2s ease-out;
+}
+
+.toggle:checked + .lbl-toggle::before {
+ transform: rotate(90deg) translateX(-3px);
+}
+
+.collapsible-content {
+ max-height: 0px;
+ overflow: hidden;
+ transition: max-height 0.25s ease-in-out;
+}
+
+.toggle:checked + .lbl-toggle + .collapsible-content {
+ max-height: 100vh;
+}
+
+.toggle:checked + .lbl-toggle {
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+}
+
+.collapsible-content .content-inner {
+ background: #101110;
+ /* FIXME: this should be a gradient that matches the element above */
+ border-bottom: 2px solid #8963ba;
+ border-left: 2px solid #8963ba;
+ border-right: 2px solid #8963ba;
+ border-bottom-left-radius: 1.5rem;
+ border-bottom-right-radius: 1.5rem;
+ padding: 0.5rem;
+}
From 0eb54205de797ee2f28f467e77cde56ce77205c2 Mon Sep 17 00:00:00 2001
From: Fred Clausen <43556888+fredclausen@users.noreply.github.com>
Date: Thu, 23 May 2024 09:49:15 -0600
Subject: [PATCH 3/9] wip
---
.../src/components/input/input_field.rs | 43 ++++++++++++++++++
sh-frontend/src/components/input/mod.rs | 6 +++
sh-frontend/src/components/mod.rs | 1 +
.../setting_components/sh_app_config.rs | 44 ++++++++++++++++---
sh-frontend/src/components/settings.rs | 10 +++--
sh-frontend/tailwind.css | 23 ++++++++++
6 files changed, 118 insertions(+), 9 deletions(-)
create mode 100644 sh-frontend/src/components/input/input_field.rs
create mode 100644 sh-frontend/src/components/input/mod.rs
diff --git a/sh-frontend/src/components/input/input_field.rs b/sh-frontend/src/components/input/input_field.rs
new file mode 100644
index 0000000..df9de9d
--- /dev/null
+++ b/sh-frontend/src/components/input/input_field.rs
@@ -0,0 +1,43 @@
+// Copyright (C) 2024 Fred Clausen
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file or at
+// https://opensource.org/licenses/MIT.
+
+use yew::prelude::*;
+
+#[derive(Clone, PartialEq, Properties)]
+pub struct InputFieldProps {
+ pub input_value: String,
+ // pub on_cautious_change: Callback,
+ pub label: String,
+ pub field_type: String,
+ pub name: String,
+ pub input_node_ref: NodeRef,
+}
+
+#[function_component(InputField)]
+pub fn input_field(props: &InputFieldProps) -> Html {
+ let InputFieldProps {
+ input_value,
+ // on_cautious_change,
+ label,
+ field_type,
+ name,
+ input_node_ref,
+ } = props;
+
+ log::debug!("InputField: {:?}", input_value);
+ html! {
+
+ }
+}
\ No newline at end of file
diff --git a/sh-frontend/src/components/input/mod.rs b/sh-frontend/src/components/input/mod.rs
new file mode 100644
index 0000000..4e99455
--- /dev/null
+++ b/sh-frontend/src/components/input/mod.rs
@@ -0,0 +1,6 @@
+// Copyright (C) 2024 Fred Clausen
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file or at
+// https://opensource.org/licenses/MIT.
+
+pub mod input_field;
\ No newline at end of file
diff --git a/sh-frontend/src/components/mod.rs b/sh-frontend/src/components/mod.rs
index 272ab16..313aaab 100644
--- a/sh-frontend/src/components/mod.rs
+++ b/sh-frontend/src/components/mod.rs
@@ -13,3 +13,4 @@ pub mod search;
pub mod setting_components;
pub mod settings;
pub mod stats;
+pub mod input;
\ No newline at end of file
diff --git a/sh-frontend/src/components/setting_components/sh_app_config.rs b/sh-frontend/src/components/setting_components/sh_app_config.rs
index b57dd19..68e0413 100644
--- a/sh-frontend/src/components/setting_components/sh_app_config.rs
+++ b/sh-frontend/src/components/setting_components/sh_app_config.rs
@@ -3,21 +3,55 @@
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
+
+use std::rc::Rc;
+
+use sh_config::web::sh_web_config::ShWebConfig;
use yew::prelude::*;
+use yewdux::prelude::*;
+use crate::services::temp_state::WebAppStateTemp;
+use crate::components::input::input_field::InputField;
#[function_component(ShAppConfig)]
pub fn sh_app_config() -> Html {
+ let (state, dispatch) = use_store::();
+
+ let config = use_selector(|state: &WebAppStateTemp | state.config.clone());
+
+ let database_url_node = use_node_ref();
+
+ let onsubmit = {
+ Callback::from(move |event: SubmitEvent| {
+ event.prevent_default();
+ log::debug!("Saving config");
+ })
+ };
+
html! {
<>
-
- {"QUnit is by calling one of the object that are embedded in JavaScript, and faster JavaScript program could also used with
- its elegant, well documented, and functional programming using JS, HTML pages Modernizr is a popular browsers without
- plug-ins. Test-Driven Development."}
-
+ {
+ if let Some(config) = config.as_ref() {
+ log::debug!("Config: {:?}", config);
+ let app = config.app.clone();
+ log::debug!("App: {:?}", app);
+ let database_url: String = app.database_url.clone();
+ html! {
+
+ }
+ } else {
+ html!{ "Still loading!" }
+ }
+ // let config = Rc::>::get_mut(&mut config).unwrap().as_ref().unwrap();
+ // let app = config.app.clone();
+ // let database_url: String = app.database_url.clone();
+ }