diff --git a/README.md b/README.md index 298e6cc..06a9a9d 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ nix build nix build .#development-environment ``` +Then, in IntelliJ use `result/bin` + +The rust source must be `/nix/store/pmih7jv9r5xfaif92bza8w05876qvnvc-rust-src/` + #### For shell ```shell diff --git a/src/main.rs b/src/main.rs index 278bcb6..006b0e9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -498,7 +498,7 @@ impl CommandLineUserLogic for ProCommandLineLogic { } fn process_events(&mut self, conn: &mut Connection, files: ValuesRef) { - process_event_files(conn, files); + process_event_files(conn, files).unwrap(); println!("fuck me"); } @@ -506,7 +506,7 @@ impl CommandLineUserLogic for ProCommandLineLogic { fn run_webui(&mut self, conn: &mut Connection, port: u16, enable_template_autoreload: bool) { info!("Serving web-ui on port {:?}", port); web_ui_main(port, - enable_template_autoreload); + enable_template_autoreload).unwrap(); } } diff --git a/src/webui/config.rs b/src/webui/config.rs new file mode 100644 index 0000000..e427909 --- /dev/null +++ b/src/webui/config.rs @@ -0,0 +1,3 @@ +struct Config { + path: str, +} \ No newline at end of file diff --git a/src/webui/mod.rs b/src/webui/mod.rs index 5d0c21b..d7f3fb1 100644 --- a/src/webui/mod.rs +++ b/src/webui/mod.rs @@ -1,4 +1,5 @@ mod views; +mod config; use actix_utils::future::{ready, Ready}; use minijinja; @@ -68,7 +69,7 @@ pub async fn web_ui_main(port: u16, enable_template_autoreload: bool) -> std::io notifier.watch_path(&tmpl_path, true); } env.set_source(minijinja::Source::from_path(tmpl_path)); - + println!("boom"); Ok(env) }); @@ -78,6 +79,8 @@ pub async fn web_ui_main(port: u16, enable_template_autoreload: bool) -> std::io App::new() .app_data(tmpl_reloader.clone()) .service(views::index) + .service(views::actions) + .service(views::overview) .wrap(ErrorHandlers::new().handler(StatusCode::NOT_FOUND, not_found)) .wrap(Logger::default()) }) diff --git a/src/webui/views.rs b/src/webui/views.rs index 7958be1..df3d2a0 100644 --- a/src/webui/views.rs +++ b/src/webui/views.rs @@ -1,5 +1,6 @@ use crate::webui::MiniJinjaRenderer; use actix_web::{web, Responder}; +use actix_web::http::header::q; use std::collections::HashMap; #[actix_web::get("/")] @@ -9,3 +10,20 @@ pub async fn index( ) -> actix_web::Result { tmpl_env.render("index.html", ()) } + +#[actix_web::get("/actions")] +pub async fn actions( + tmpl_env: MiniJinjaRenderer, + query: web::Query>, +) -> actix_web::Result { + tmpl_env.render("actions.html", ()) +} + + +#[actix_web::get("/overview")] +pub async fn overview( + tmpl_env: MiniJinjaRenderer, + query: web::Query>, +) -> actix_web::Result { + tmpl_env.render("overview.html", ()) +} diff --git a/templates/actions.html b/templates/actions.html new file mode 100644 index 0000000..7a9af12 --- /dev/null +++ b/templates/actions.html @@ -0,0 +1,47 @@ +{% set active_navbar_item = 'actions' %} + +{% extends "base.html" %} + +{% block body %} + +
+
+
+ + Legend + +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +{% endblock %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 4769fab..152c2d3 100644 --- a/templates/base.html +++ b/templates/base.html @@ -11,7 +11,14 @@
diff --git a/templates/components/navbar.html b/templates/components/navbar.html new file mode 100644 index 0000000..e69de29 diff --git a/templates/overview.html b/templates/overview.html new file mode 100644 index 0000000..da7d37b --- /dev/null +++ b/templates/overview.html @@ -0,0 +1,12 @@ +{% set active_navbar_item = 'overview' %} + +{% extends "base.html" %} + +{% block body %} + +overview + +{% for i in [{'a': 90}, 2, 3] %} +lll {{ i }} +{% endfor %} +{% endblock %}