fix static handler
All checks were successful
Build .deb on release / Build-Deb (push) Successful in 1m51s
All checks were successful
Build .deb on release / Build-Deb (push) Successful in 1m51s
This commit is contained in:
parent
5dd599d93b
commit
dc234260c7
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2633,7 +2633,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tesla-charge-controller"
|
||||
version = "1.0.22"
|
||||
version = "1.0.23"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"clap 4.4.11",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "tesla-charge-controller"
|
||||
version = "1.0.22"
|
||||
version = "1.0.23"
|
||||
edition = "2021"
|
||||
license = "MITNFA"
|
||||
description = "Controls Tesla charge rate based on solar charge data"
|
||||
|
|
|
@ -45,10 +45,17 @@ impl Handler for UiStatic {
|
|||
|
||||
index.respond_to(req).or_forward((data, Status::NotFound))
|
||||
} else {
|
||||
let file = UI_DIR_FILES.get_file(&p).map(|v| RawHtml {
|
||||
data: v.contents().to_vec(),
|
||||
name: p,
|
||||
});
|
||||
let plus_index = p.join("index.html");
|
||||
let file = UI_DIR_FILES
|
||||
.get_file(&p)
|
||||
.map(|v| RawHtml {
|
||||
data: v.contents().to_vec(),
|
||||
name: p,
|
||||
})
|
||||
.or(UI_DIR_FILES.get_file(&plus_index).map(|v| RawHtml {
|
||||
data: v.contents().to_vec(),
|
||||
name: plus_index,
|
||||
}));
|
||||
file.respond_to(req).or_forward((data, Status::NotFound))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue