Added better empty index.html

This commit is contained in:
didier amyot committed 2023-02-01 12:48:14 -05:00
1 parent 174d7e855a
commit 6092273c76
4 files changed
+34 -8

No files matched your search

+5 -4
View File
@@ -135,9 +135,9 @@ fn run_web_ui_command_line_parser() -> Command {
.arg( .arg(
Arg::new("port") Arg::new("port")
.long("port") .long("port")
.value_parser(clap::value_parser!(u16).range(3000..)) .value_parser(clap::value_parser!(u16).range(2000..))
.action(ArgAction::Set) .action(ArgAction::Set)
.default_value("3200"), .default_value("2222"),
) )
.arg( .arg(
Arg::new("enable-template-autoreload") Arg::new("enable-template-autoreload")
@@ -241,7 +241,7 @@ fn process_run_wui_command_line(
logic: &mut dyn CommandLineUserLogic, logic: &mut dyn CommandLineUserLogic,
) { ) {
debug!("Processing run wui command line {:?}.", m); debug!("Processing run wui command line {:?}.", m);
let mut port = m.get_one::<u16>("port").unwrap_or(&3200); let mut port = m.get_one::<u16>("port").unwrap_or(&2222);
let enable_template_autoreload = m.get_flag("enable-template-autoreload"); let enable_template_autoreload = m.get_flag("enable-template-autoreload");
logic.run_webui(conn, *port, 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) { fn run_webui(&mut self, conn: &mut Connection, port: u16, enable_template_autoreload: bool) {
info!("Serving web-ui on port {:?}", port); info!("Serving web-ui on port {:?}", port);
web_ui_main(port, enable_template_autoreload); web_ui_main(port,
enable_template_autoreload);
} }
} }
+1 -1
View File
@@ -25,7 +25,7 @@ impl MiniJinjaRenderer {
&self, &self,
tmpl: &str, tmpl: &str,
ctx: impl Into<minijinja::value::Value>, ctx: impl Into<minijinja::value::Value>,
) -> actix_web::Result<Html> { ) -> Result<Html> {
log::info!("Rendering template {:?}", tmpl); log::info!("Rendering template {:?}", tmpl);
self.tmpl_env self.tmpl_env
.acquire_env() .acquire_env()
+14 -2
View File
@@ -4,10 +4,22 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ledger</title> <title>ledger</title>
<script src="https://cdn.tailwindcss.com"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/uikit.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/js/uikit.min.js"></script>
<script src="https://unpkg.com/htmx.org@1.8.5"></script> <script src="https://unpkg.com/htmx.org@1.8.5"></script>
</head> </head>
<body>{% block body %}{% endblock %}</body> <body>
<nav class="uk-navbar">
<a href="" class="uk-navbar-brand">Ledger</a>
</nav>
<div class="uk-grid">
<div class="uk-width-2-3 uk-container-center">
{% block body %}
{% endblock %}
</div>
</div>
</body>
</html> </html>
+14 -1
View File
@@ -1,5 +1,18 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block body %} {% block body %}
<h1>Hello World!</h1> <h2>Securities</h2>
<table class="uk-table">
<thead>
<tr>
<th>Security</th>
</tr>
</thead>
<tbody>
<tr>
<td>UAD</td>
</tr>
</tbody>
</table>
{% endblock %} {% endblock %}