From ede86218675d19879971cc443b6f00c8d952884a Mon Sep 17 00:00:00 2001 From: Joscha Date: Sat, 1 Jun 2024 19:47:33 +0200 Subject: [PATCH] Add /typst web form --- showbits-thermal-printer/src/server.rs | 2 +- showbits-thermal-printer/static/index.html | 1 + showbits-thermal-printer/static/typst.html | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 showbits-thermal-printer/static/typst.html diff --git a/showbits-thermal-printer/src/server.rs b/showbits-thermal-printer/src/server.rs index 0a9806f..ab95e20 100644 --- a/showbits-thermal-printer/src/server.rs +++ b/showbits-thermal-printer/src/server.rs @@ -34,7 +34,7 @@ pub async fn run(tx: mpsc::Sender, addr: String) -> anyhow::Result<()> .route("/photo", post(post_photo).fallback(get_static_file)) .route("/text", post(post_text)) .route("/tictactoe", post(post_tictactoe)) - .route("/typst", post(post_typst)) + .route("/typst", post(post_typst).fallback(get_static_file)) .fallback(get(get_static_file)) .layer(DefaultBodyLimit::max(32 * 1024 * 1024)) // 32 MiB .with_state(Server { tx }); diff --git a/showbits-thermal-printer/static/index.html b/showbits-thermal-printer/static/index.html index 97c3a21..00dcfc7 100644 --- a/showbits-thermal-printer/static/index.html +++ b/showbits-thermal-printer/static/index.html @@ -10,6 +10,7 @@ diff --git a/showbits-thermal-printer/static/typst.html b/showbits-thermal-printer/static/typst.html new file mode 100644 index 0000000..0b4e08e --- /dev/null +++ b/showbits-thermal-printer/static/typst.html @@ -0,0 +1,21 @@ + + + + + + TP: Typst + + +

Print typst code

+
+ +
+ +
+ +