From 3b0eb7fc1c1df18cd5e25d29f640926dcb81983a Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Wed, 18 Aug 2021 21:12:43 -0400 Subject: [PATCH] Make work --- Cargo.toml | 4 ---- src/webui.rs | 5 ----- templates/control.html | 8 ++++++++ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ff25ef6..e7a7288 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,9 +15,5 @@ actix-web-actors = "3.0.0" rust-embed="6.0.0" hex = "0.4.3" serde_json = "1" -# actix-web-static-files = "3.0" live-view = { path = "./liveview-rust/" } askama = "0.10.5" - -[build-dependencies] -actix-web-static-files = "3.0" diff --git a/src/webui.rs b/src/webui.rs index 34c66f7..aeb76d4 100644 --- a/src/webui.rs +++ b/src/webui.rs @@ -13,12 +13,9 @@ use actix_web::{ web::JsonConfig, App, HttpServer, Responder, Result, }; -// use actix_web_static_files::ResourceFiles; use std::io; use std::sync::{mpsc::Sender, Arc, Mutex}; -// include!(concat!(env!("OUT_DIR"), "/generated.rs")); - struct AppState { strip_tx: Arc>>, } @@ -44,7 +41,6 @@ pub async fn start( ) -> std::io::Result<()> { let _ = message_tx.send(errors::Message::String(String::from("Starting webui"))); HttpServer::new(move || { - // let generated = generate(); App::new() .data(AppState { strip_tx: Arc::new(Mutex::new(strip_tx.clone())), @@ -68,7 +64,6 @@ pub async fn start( ) .service(web::resource("/ws/").route(web::get().to(start_socket))) .service(initial_load) - // .service(ResourceFiles::new("/", generated)) }) .bind(("0.0.0.0", 8080))? .run() diff --git a/templates/control.html b/templates/control.html index aeaecdd..3bff7d6 100644 --- a/templates/control.html +++ b/templates/control.html @@ -1,3 +1,11 @@ In control {{ count }} +{% match 'a' %} + {% when 'a' %} + Found literal a + {% when 'b' %} + Found literal b + {% else %} + Else found nothing +{% endmatch %}