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]]
|
[[package]]
|
||||||
name = "tesla-charge-controller"
|
name = "tesla-charge-controller"
|
||||||
version = "1.0.22"
|
version = "1.0.23"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap 4.4.11",
|
"clap 4.4.11",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "tesla-charge-controller"
|
name = "tesla-charge-controller"
|
||||||
version = "1.0.22"
|
version = "1.0.23"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MITNFA"
|
license = "MITNFA"
|
||||||
description = "Controls Tesla charge rate based on solar charge data"
|
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))
|
index.respond_to(req).or_forward((data, Status::NotFound))
|
||||||
} else {
|
} else {
|
||||||
let file = UI_DIR_FILES.get_file(&p).map(|v| RawHtml {
|
let plus_index = p.join("index.html");
|
||||||
|
let file = UI_DIR_FILES
|
||||||
|
.get_file(&p)
|
||||||
|
.map(|v| RawHtml {
|
||||||
data: v.contents().to_vec(),
|
data: v.contents().to_vec(),
|
||||||
name: p,
|
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))
|
file.respond_to(req).or_forward((data, Status::NotFound))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue