Make work
This commit is contained in:
parent
efeb2d56dc
commit
3b0eb7fc1c
@ -15,9 +15,5 @@ actix-web-actors = "3.0.0"
|
|||||||
rust-embed="6.0.0"
|
rust-embed="6.0.0"
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
# actix-web-static-files = "3.0"
|
|
||||||
live-view = { path = "./liveview-rust/" }
|
live-view = { path = "./liveview-rust/" }
|
||||||
askama = "0.10.5"
|
askama = "0.10.5"
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
actix-web-static-files = "3.0"
|
|
||||||
|
@ -13,12 +13,9 @@ use actix_web::{
|
|||||||
web::JsonConfig,
|
web::JsonConfig,
|
||||||
App, HttpServer, Responder, Result,
|
App, HttpServer, Responder, Result,
|
||||||
};
|
};
|
||||||
// use actix_web_static_files::ResourceFiles;
|
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::sync::{mpsc::Sender, Arc, Mutex};
|
use std::sync::{mpsc::Sender, Arc, Mutex};
|
||||||
|
|
||||||
// include!(concat!(env!("OUT_DIR"), "/generated.rs"));
|
|
||||||
|
|
||||||
struct AppState {
|
struct AppState {
|
||||||
strip_tx: Arc<Mutex<Sender<strip::Message>>>,
|
strip_tx: Arc<Mutex<Sender<strip::Message>>>,
|
||||||
}
|
}
|
||||||
@ -44,7 +41,6 @@ pub async fn start(
|
|||||||
) -> std::io::Result<()> {
|
) -> std::io::Result<()> {
|
||||||
let _ = message_tx.send(errors::Message::String(String::from("Starting webui")));
|
let _ = message_tx.send(errors::Message::String(String::from("Starting webui")));
|
||||||
HttpServer::new(move || {
|
HttpServer::new(move || {
|
||||||
// let generated = generate();
|
|
||||||
App::new()
|
App::new()
|
||||||
.data(AppState {
|
.data(AppState {
|
||||||
strip_tx: Arc::new(Mutex::new(strip_tx.clone())),
|
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(web::resource("/ws/").route(web::get().to(start_socket)))
|
||||||
.service(initial_load)
|
.service(initial_load)
|
||||||
// .service(ResourceFiles::new("/", generated))
|
|
||||||
})
|
})
|
||||||
.bind(("0.0.0.0", 8080))?
|
.bind(("0.0.0.0", 8080))?
|
||||||
.run()
|
.run()
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
In control
|
In control
|
||||||
{{ count }}
|
{{ count }}
|
||||||
<button rust-click="inc">Inc</button>
|
<button rust-click="inc">Inc</button>
|
||||||
|
{% match 'a' %}
|
||||||
|
{% when 'a' %}
|
||||||
|
Found literal a
|
||||||
|
{% when 'b' %}
|
||||||
|
Found literal b
|
||||||
|
{% else %}
|
||||||
|
Else found nothing
|
||||||
|
{% endmatch %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user