add management page
This commit is contained in:
parent
478de6f90a
commit
bd2c3055d1
4 changed files with 38 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
mod api;
|
mod api;
|
||||||
mod axum_ructe;
|
mod axum_ructe;
|
||||||
mod sse_handler;
|
mod sse_handler;
|
||||||
|
mod management;
|
||||||
|
|
||||||
use axum_ructe::render;
|
use axum_ructe::render;
|
||||||
|
|
||||||
|
@ -93,6 +94,7 @@ async fn main() {
|
||||||
// build our application with a route
|
// build our application with a route
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.nest("/api", api::router())
|
.nest("/api", api::router())
|
||||||
|
.nest("/management", management::router())
|
||||||
.route("/", get(root))
|
.route("/", get(root))
|
||||||
.route("/ada", get(ada))
|
.route("/ada", get(ada))
|
||||||
.route("/shift_reports", get(shift_reports))
|
.route("/shift_reports", get(shift_reports))
|
||||||
|
|
12
src/management.rs
Normal file
12
src/management.rs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
use axum::{routing::get, response::IntoResponse};
|
||||||
|
|
||||||
|
use crate::{AppState, axum_ructe::render};
|
||||||
|
|
||||||
|
pub(crate) fn router() -> axum::Router<AppState> {
|
||||||
|
axum::Router::new()
|
||||||
|
.route("/", get(home))
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn home() -> impl IntoResponse {
|
||||||
|
render!(crate::templates::management_html)
|
||||||
|
}
|
14
templates/components/management_fragment.rs.html
Normal file
14
templates/components/management_fragment.rs.html
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
@()
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<div hx-boost="true">
|
||||||
|
<a href="/">
|
||||||
|
<button>Return Home</button>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div hx-boost="true">
|
||||||
|
<a href="/shift_reports">
|
||||||
|
<button>Shift Reports</button>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</main>
|
10
templates/management.rs.html
Normal file
10
templates/management.rs.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
@use super::base_html;
|
||||||
|
@use super::components::management_fragment_html;
|
||||||
|
|
||||||
|
@()
|
||||||
|
|
||||||
|
@:base_html({
|
||||||
|
|
||||||
|
@:management_fragment_html()
|
||||||
|
|
||||||
|
})
|
Loading…
Reference in a new issue