From 6092273c7687fd843a36a9300202cba64c1b716b Mon Sep 17 00:00:00 2001 From: didier amyot Date: Wed, 1 Feb 2023 12:48:14 -0500 Subject: [PATCH] Added better empty index.html --- src/main.rs | 9 +++++---- src/webui/mod.rs | 2 +- templates/base.html | 16 ++++++++++++++-- templates/index.html | 15 ++++++++++++++- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 65de72d..278bcb6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -135,9 +135,9 @@ fn run_web_ui_command_line_parser() -> Command { .arg( Arg::new("port") .long("port") - .value_parser(clap::value_parser!(u16).range(3000..)) + .value_parser(clap::value_parser!(u16).range(2000..)) .action(ArgAction::Set) - .default_value("3200"), + .default_value("2222"), ) .arg( Arg::new("enable-template-autoreload") @@ -241,7 +241,7 @@ fn process_run_wui_command_line( logic: &mut dyn CommandLineUserLogic, ) { debug!("Processing run wui command line {:?}.", m); - let mut port = m.get_one::("port").unwrap_or(&3200); + let mut port = m.get_one::("port").unwrap_or(&2222); let enable_template_autoreload = m.get_flag("enable-template-autoreload"); logic.run_webui(conn, *port, enable_template_autoreload); } @@ -505,7 +505,8 @@ 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); + web_ui_main(port, + enable_template_autoreload); } } diff --git a/src/webui/mod.rs b/src/webui/mod.rs index 5c747b4..5d0c21b 100644 --- a/src/webui/mod.rs +++ b/src/webui/mod.rs @@ -25,7 +25,7 @@ impl MiniJinjaRenderer { &self, tmpl: &str, ctx: impl Into, - ) -> actix_web::Result { + ) -> Result { log::info!("Rendering template {:?}", tmpl); self.tmpl_env .acquire_env() diff --git a/templates/base.html b/templates/base.html index 3c712cf..4769fab 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,10 +4,22 @@ ledger - + + - {% block body %}{% endblock %} + + + +
+
+ {% block body %} + {% endblock %} +
+
+ diff --git a/templates/index.html b/templates/index.html index 786f006..4346c43 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,5 +1,18 @@ {% extends "base.html" %} {% block body %} -

Hello World!

+

Securities

+ + + + + + + + + + + +
Security
UAD
+ {% endblock %} \ No newline at end of file