562d8b32de
- Add CreateUserRequest, UpdateUserRequest, ChangePasswordRequest - Implement list_users_handler, create_user_handler - Implement delete_user_handler, update_user_handler - Implement change_password_handler - All handlers use SQLite (data/auth.sqlite) - No PostgreSQL dependency - Routes: /api/v2/admin/users/* - Integrated from M5Max48 into M4Mini architecture - Fix duplicate dependencies in Cargo.toml - Resolve merge conflicts in web.rs and Cargo.lock
27 lines
819 B
Rust
27 lines
819 B
Rust
use clap::Subcommand;
|
|
use std::path::PathBuf;
|
|
|
|
#[derive(Subcommand)]
|
|
pub enum WebCommand {
|
|
#[command(name = "web-start")]
|
|
Start {
|
|
#[arg(short, long, default_value = "11438")]
|
|
port: u16,
|
|
#[arg(short, long)]
|
|
file: Option<String>,
|
|
#[arg(short = 'H', long, help = "User home directory for data storage (default: current user's home)")]
|
|
home: Option<PathBuf>,
|
|
},
|
|
}
|
|
|
|
pub async fn handle_web_command(cmd: WebCommand) -> anyhow::Result<()> {
|
|
match cmd {
|
|
WebCommand::Start { port, file, home } => {
|
|
let home = home.unwrap_or_else(|| dirs::home_dir().unwrap_or_else(|| PathBuf::from(".")));
|
|
log::info!("Using home directory: {}", home.display());
|
|
crate::server::run(port, file, home).await?;
|
|
}
|
|
}
|
|
Ok(())
|
|
}
|