initial commit
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I4a6b498153eccd5407510dd541b7f4816a6a6964
This commit is contained in:
commit
6a73d11c4b
124 changed files with 34856 additions and 0 deletions
46
crates/pinakes-ui/src/main.rs
Normal file
46
crates/pinakes-ui/src/main.rs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
use clap::Parser;
|
||||
use tracing_subscriber::EnvFilter;
|
||||
|
||||
mod app;
|
||||
mod client;
|
||||
mod components;
|
||||
mod state;
|
||||
mod styles;
|
||||
|
||||
use dioxus::prelude::*;
|
||||
|
||||
/// Pinakes desktop UI client
|
||||
#[derive(Parser)]
|
||||
#[command(name = "pinakes-ui", version, about)]
|
||||
struct Cli {
|
||||
/// Server URL to connect to
|
||||
#[arg(
|
||||
short,
|
||||
long,
|
||||
env = "PINAKES_SERVER_URL",
|
||||
default_value = "http://localhost:3000"
|
||||
)]
|
||||
server: String,
|
||||
|
||||
/// Set log level (trace, debug, info, warn, error)
|
||||
#[arg(long, default_value = "warn")]
|
||||
log_level: String,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let cli = Cli::parse();
|
||||
|
||||
let env_filter = EnvFilter::try_new(&cli.log_level).unwrap_or_else(|_| EnvFilter::new("warn"));
|
||||
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(env_filter)
|
||||
.compact()
|
||||
.init();
|
||||
|
||||
// SAFETY: Called before any threads are spawned (single-threaded at this point).
|
||||
unsafe { std::env::set_var("PINAKES_SERVER_URL", &cli.server) };
|
||||
|
||||
tracing::info!(server = %cli.server, "starting pinakes desktop UI");
|
||||
|
||||
launch(app::App);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue