diff --git a/showbits-thermal-printer/src/server.rs b/showbits-thermal-printer/src/server.rs index dfe1777..12973be 100644 --- a/showbits-thermal-printer/src/server.rs +++ b/showbits-thermal-printer/src/server.rs @@ -29,7 +29,7 @@ pub async fn run(tx: mpsc::Sender, addr: String) -> anyhow::Result<()> .route("/calendar", post(post_calendar)) .route("/cells", post(post_cells)) .route("/chat_message", post(post_chat_message)) - .route("/egg", post(post_egg)) + .route("/egg", post(post_egg).fallback(get_static_file)) .route("/image", post(post_image).fallback(get_static_file)) .route("/photo", post(post_photo).fallback(get_static_file)) .route("/text", post(post_text)) @@ -100,8 +100,9 @@ async fn post_chat_message(server: State, request: Form) { +async fn post_egg(server: State) -> impl IntoResponse { let _ = server.tx.send(Command::draw(EggDrawing)).await; + Redirect::to("egg") } // /image diff --git a/showbits-thermal-printer/static/egg.html b/showbits-thermal-printer/static/egg.html new file mode 100644 index 0000000..295d290 --- /dev/null +++ b/showbits-thermal-printer/static/egg.html @@ -0,0 +1,50 @@ + + + + + + Osterei + + + +
+ +
+ + diff --git a/showbits-thermal-printer/static/index.html b/showbits-thermal-printer/static/index.html index 1e09797..97c3a21 100644 --- a/showbits-thermal-printer/static/index.html +++ b/showbits-thermal-printer/static/index.html @@ -10,6 +10,7 @@