mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-22 19:40:14 -04:00
Better Static Asset serving and fix extra header
This commit is contained in:
parent
5f4b7c3f02
commit
40b6625620
@ -69,16 +69,18 @@ async fn ui_static_assets(Path(path): Path<String>) -> impl IntoResponse {
|
|||||||
info!("Serving ui path");
|
info!("Serving ui path");
|
||||||
|
|
||||||
let mut path = path.trim_start_matches("/");
|
let mut path = path.trim_start_matches("/");
|
||||||
path = match path {
|
if UiAssets::get(path).is_none() {
|
||||||
"" | "inventory" | "plan" | "cook" | "categories" | "login" => "index.html",
|
path = match path {
|
||||||
_ => {
|
"" | "inventory" | "plan" | "cook" | "categories" | "login" => "index.html",
|
||||||
if path.starts_with("recipe") {
|
_ => {
|
||||||
"index.html"
|
if path.starts_with("recipe") {
|
||||||
} else {
|
"index.html"
|
||||||
path
|
} else {
|
||||||
|
path
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
}
|
||||||
debug!(path = path, "Serving transformed path");
|
debug!(path = path, "Serving transformed path");
|
||||||
StaticFile(path.to_owned())
|
StaticFile(path.to_owned())
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,6 @@ pub fn UI<G: Html>(cx: Scope) -> View<G> {
|
|||||||
};
|
};
|
||||||
view.set(view! { cx,
|
view.set(view! { cx,
|
||||||
div(class="app") {
|
div(class="app") {
|
||||||
Header()
|
|
||||||
Router(RouterProps {
|
Router(RouterProps {
|
||||||
route: Routes::Plan,
|
route: Routes::Plan,
|
||||||
route_select: route_switch,
|
route_select: route_switch,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user