lots of stuff

This commit is contained in:
2023-08-29 21:34:00 +02:00
parent 0f6466d37c
commit 8f04947e9f
6 changed files with 215 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ impl InventoryCategoryList {
html!(
table
#category-list
."table"
."table-auto"
."border-collapse"

View File

@@ -35,6 +35,7 @@ impl Root {
hx-boost="true"
{
header
#header
."h-full"
."bg-gray-200"
."p-5"
@@ -53,7 +54,7 @@ impl Root {
."gap-3"
{
img ."h-12" src="/assets/luggage.svg";
a href="/" { "Packager" }
a #home href="/" { "Packager" }
}
nav
."grow"
@@ -64,12 +65,14 @@ impl Root {
."content-stretch"
{
a href="/inventory/"
#header-link-inventory
."h-full"
."text-lg"
."font-bold"[matches!(active_page, TopLevelPage::Inventory)]
."underline"[matches!(active_page, TopLevelPage::Inventory)]
{ "Inventory" }
a href="/trips/"
#header-link-trips
."h-full"
."text-lg"
."font-bold"[matches!(active_page, TopLevelPage::Trips)]

View File

@@ -42,6 +42,15 @@ pub struct AppState {
client_state: ClientState,
}
use clap::Parser;
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
#[arg(long)]
port: Option<u16>,
}
#[derive(Clone)]
pub struct ClientState {
pub active_category_id: Option<Uuid>,
@@ -140,7 +149,9 @@ async fn main() -> Result<(), sqlx::Error> {
// );
.with_state(state);
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
let args = Args::parse();
let addr = SocketAddr::from(([127, 0, 0, 1], args.port.unwrap_or(3000)));
tracing::debug!("listening on {}", addr);
axum::Server::bind(&addr)
.serve(app.into_make_service())