feat: Phase 7 — CLI complet (start/serve/stop/status/config/logs)
- Gestion PID (write/read/remove + verification processus) - cmd_start: lance watcher + dashboard avec Ctrl+C graceful shutdown - cmd_serve: dashboard seul (Linux) avec --no-watcher - cmd_stop: kill processus via SIGTERM/OpenProcess + nettoyage PID - cmd_status: affiche PID, dashboard URL, config, polling - cmd_config show/set/reset: gestion dotted keys (imago.url, watcher.*, etc.) - cmd_logs: affiche derniers logs - Fix Default derives: ImagoConfig, DedupConfig, UiConfig, LoggingConfig - Ajout dependances: open, libc (Unix) - Watcher::run(self) au lieu de &self pour Send - tests: start → API /api/health OK → stop → status OK - 0 errors, 0 warnings (cargo check + cargo build --release)
This commit is contained in:
+30
-3
@@ -72,7 +72,7 @@ fn default_exclude_apps() -> Vec<String> {
|
||||
vec!["mstsc".into()]
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct DedupConfig {
|
||||
#[serde(default = "default_dedup_method")]
|
||||
pub method: String,
|
||||
@@ -80,6 +80,15 @@ pub struct DedupConfig {
|
||||
pub cache_size: usize,
|
||||
}
|
||||
|
||||
impl Default for DedupConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
method: default_dedup_method(),
|
||||
cache_size: default_cache_size(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn default_dedup_method() -> String {
|
||||
"sha256".into()
|
||||
}
|
||||
@@ -88,7 +97,7 @@ fn default_cache_size() -> usize {
|
||||
10000
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct UiConfig {
|
||||
#[serde(default = "default_true")]
|
||||
pub show_notifications: bool,
|
||||
@@ -98,16 +107,34 @@ pub struct UiConfig {
|
||||
pub notification_timeout_sec: u64,
|
||||
}
|
||||
|
||||
impl Default for UiConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
show_notifications: true,
|
||||
show_tray_icon: true,
|
||||
notification_timeout_sec: default_notification_timeout(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn default_notification_timeout() -> u64 {
|
||||
3
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct LoggingConfig {
|
||||
#[serde(default = "default_log_level")]
|
||||
pub level: String,
|
||||
}
|
||||
|
||||
impl Default for LoggingConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
level: default_log_level(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn default_log_level() -> String {
|
||||
"info".into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user