From 6fb97ef61b06bdd933d9f9123bc296cd79fd87f3 Mon Sep 17 00:00:00 2001 From: theMackabu Date: Fri, 28 Jun 2024 21:18:45 -0700 Subject: [PATCH] minor bugfixes --- src/daemon/mod.rs | 2 +- src/main.rs | 2 +- src/webui/src/components/react/index.tsx | 4 +++- src/webui/src/components/react/modal.tsx | 4 ++-- src/webui/src/components/react/rename.tsx | 6 ++++-- src/webui/src/components/react/view.tsx | 13 ++++++++++--- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/daemon/mod.rs b/src/daemon/mod.rs index 819d644..d2b1c21 100644 --- a/src/daemon/mod.rs +++ b/src/daemon/mod.rs @@ -304,7 +304,7 @@ pub fn reset() { match largest { Some(id) => runner.set_id(Id::from(str!(id.to_string()))), - None => println!("{} Cannot reset index, no ID found", *helpers::FAIL), + None => runner.set_id(Id::new(0)), } println!("{} PMC Successfully reset (index={})", *helpers::SUCCESS, runner.id); diff --git a/src/main.rs b/src/main.rs index f3bdd00..06d1b3a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,7 +68,7 @@ enum Server { format: String, }, /// Remove server - #[command(visible_alias = "rm")] + #[command(visible_alias = "rm", visible_alias = "delete")] Remove { /// Server name name: String, diff --git a/src/webui/src/components/react/index.tsx b/src/webui/src/components/react/index.tsx index eb0c81b..65ed5b9 100644 --- a/src/webui/src/components/react/index.tsx +++ b/src/webui/src/components/react/index.tsx @@ -31,7 +31,9 @@ const Index = (props: { base: string }) => { const isRunning = (status: string): bool => (status == 'stopped' ? false : status == 'crashed' ? false : true); const action = (id: number, name: string) => api.post(`${props.base}/process/${id}/action`, { json: { method: name } }).then(() => fetch()); - useEffect(() => fetch(), []); + useEffect(() => { + fetch(); + }, []); return (