Display more informations on the dashboard

This commit is contained in:
Kerollmops
2020-07-11 11:48:27 +02:00
parent 11c7fef80a
commit d44428fa90
4 changed files with 218 additions and 187 deletions

View File

@ -58,6 +58,13 @@ async fn main() -> anyhow::Result<()> {
.body(include_str!("../../public/bulma.min.css"))
);
let dash_style_route = warp::filters::method::get()
.and(warp::path!("style.css"))
.map(|| Response::builder()
.header("content-type", "text/css; charset=utf-8")
.body(include_str!("../../public/style.css"))
);
let dash_jquery_route = warp::filters::method::get()
.and(warp::path!("jquery-3.4.1.min.js"))
.map(|| Response::builder()
@ -72,6 +79,13 @@ async fn main() -> anyhow::Result<()> {
.body(include_str!("../../public/papaparse.min.js"))
);
let dash_script_route = warp::filters::method::get()
.and(warp::path!("script.js"))
.map(|| Response::builder()
.header("content-type", "application/javascript; charset=utf-8")
.body(include_str!("../../public/script.js"))
);
#[derive(Deserialize)]
struct QueryBody {
query: String,
@ -107,8 +121,10 @@ async fn main() -> anyhow::Result<()> {
let routes = dash_html_route
.or(dash_bulma_route)
.or(dash_style_route)
.or(dash_jquery_route)
.or(dash_papaparse_route)
.or(dash_script_route)
.or(query_route);
let addr = SocketAddr::from_str(&opt.http_listen_addr).unwrap();