Compare commits

...

2 Commits

3 changed files with 21 additions and 3 deletions

View File

@ -1,2 +1,4 @@
Dockerfile
target
*/node_modules
*/yarn.lock

View File

@ -3,7 +3,13 @@ COPY ./ /src/
COPY ./dockerfiles/netrc /root/.netrc
RUN mkdir /root/.cargo
COPY ./dockerfiles/cargo-config /.cargo/config
RUN apt-get update && apt-get install -y strace build-essential clang
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN curl -sL https://deb.nodesource.com/setup_13.x | bash -
RUN apt-get update && apt-get install -y strace build-essential clang nodejs yarn
WORKDIR /src/react-slideshow
RUN yarn install
RUN yarn build
WORKDIR /src
RUN cargo version && cargo install --path .

View File

@ -103,9 +103,19 @@ struct Asset;
fn embedz() -> Result<impl warp::Reply, warp::Rejection> {
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() {
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()
.header("Content-Type", "text/html")