Prettier /embedz, now with sizes.
This commit is contained in:
parent
ba304c85c3
commit
f14dbff066
14
src/web.rs
14
src/web.rs
@ -103,9 +103,19 @@ struct Asset;
|
|||||||
|
|
||||||
fn embedz() -> Result<impl warp::Reply, warp::Rejection> {
|
fn embedz() -> Result<impl warp::Reply, warp::Rejection> {
|
||||||
let mut w = Vec::new();
|
let mut w = Vec::new();
|
||||||
write!(w, "<html>").unwrap();
|
write!(
|
||||||
|
w,
|
||||||
|
r#"<html><table><tbody><tr><th>size</th><th style="text-align: left;">path</th></tr>"#
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
for path in Asset::iter() {
|
for path in Asset::iter() {
|
||||||
write!(w, r#"<div><a href="{0}">{0}</a></div>"#, path).unwrap();
|
write!(
|
||||||
|
w,
|
||||||
|
r#"<tr><td style="text-align: right;">{0}</td><td><a href="{1}">{1}</a></td</tr>"#,
|
||||||
|
Asset::get(&path).unwrap().len(),
|
||||||
|
path
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
Ok(warp::http::Response::builder()
|
Ok(warp::http::Response::builder()
|
||||||
.header("Content-Type", "text/html")
|
.header("Content-Type", "text/html")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user