diff --git a/src/main.rs b/src/main.rs index e4dd26d..1b00527 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ mod api; mod axum_ructe; mod sse_handler; +mod management; use axum_ructe::render; @@ -93,6 +94,7 @@ async fn main() { // build our application with a route let app = Router::new() .nest("/api", api::router()) + .nest("/management", management::router()) .route("/", get(root)) .route("/ada", get(ada)) .route("/shift_reports", get(shift_reports)) diff --git a/src/management.rs b/src/management.rs new file mode 100644 index 0000000..f893976 --- /dev/null +++ b/src/management.rs @@ -0,0 +1,12 @@ +use axum::{routing::get, response::IntoResponse}; + +use crate::{AppState, axum_ructe::render}; + +pub(crate) fn router() -> axum::Router { + axum::Router::new() + .route("/", get(home)) +} + +async fn home() -> impl IntoResponse { + render!(crate::templates::management_html) +} diff --git a/templates/components/management_fragment.rs.html b/templates/components/management_fragment.rs.html new file mode 100644 index 0000000..67d02ac --- /dev/null +++ b/templates/components/management_fragment.rs.html @@ -0,0 +1,14 @@ +@() + +
+
+ + + +
+
+ + + +
+
diff --git a/templates/management.rs.html b/templates/management.rs.html new file mode 100644 index 0000000..301f0a4 --- /dev/null +++ b/templates/management.rs.html @@ -0,0 +1,10 @@ +@use super::base_html; +@use super::components::management_fragment_html; + +@() + +@:base_html({ + + @:management_fragment_html() + +})