meta: move public crates to packages/
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I928162008cb1ba02e1aa0e7aa971e8326a6a6964
This commit is contained in:
parent
70b0113d8a
commit
00bab69598
308 changed files with 53890 additions and 53889 deletions
49
packages/pinakes-ui/src/main.rs
Normal file
49
packages/pinakes-ui/src/main.rs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
use clap::Parser;
|
||||
use tracing_subscriber::EnvFilter;
|
||||
|
||||
mod app;
|
||||
mod client;
|
||||
mod components;
|
||||
mod plugin_ui;
|
||||
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