fix: resolve duplicate LogInfo type and method name issues

- Removed duplicate LogInfo type definition for WASM
- Fixed run_job client method to call 'job.run' instead of 'run_job'
- Removed unused imports (wasm_bindgen, PathBuf)
- Admin UI now builds successfully

All components working:
- OpenRPC client compiles for both native and WASM
- Admin UI builds without errors
- Method names aligned between client and server
This commit is contained in:
Timur Gordon
2025-10-27 15:42:27 +01:00
parent 674ae22f91
commit 5f5dd35dbc
4 changed files with 214 additions and 90 deletions

View File

@@ -32,11 +32,6 @@ use serde_json;
// Import types from the main supervisor crate
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
#[cfg(target_arch = "wasm32")]
use std::path::PathBuf;
// WASM-compatible client module
#[cfg(target_arch = "wasm32")]
@@ -198,12 +193,6 @@ pub struct SupervisorInfo {
pub runners_count: usize,
}
/// Type aliases for compatibility
#[cfg(target_arch = "wasm32")]
pub type ProcessStatus = ProcessStatusWrapper;
#[cfg(target_arch = "wasm32")]
pub type LogInfo = LogInfoWrapper;
/// Simple ProcessStatus type for native builds to avoid service manager dependency
#[cfg(not(target_arch = "wasm32"))]
pub type ProcessStatus = ProcessStatusWrapper;
@@ -216,6 +205,8 @@ pub use hero_supervisor::runner::LogInfo;
/// Type aliases for WASM compatibility
#[cfg(target_arch = "wasm32")]
pub type ProcessStatus = ProcessStatusWrapper;
#[cfg(target_arch = "wasm32")]
pub type RunnerStatus = ProcessStatusWrapper;
#[cfg(target_arch = "wasm32")]
pub type LogInfo = LogInfoWrapper;
@@ -485,7 +476,7 @@ impl SupervisorClient {
let result: JobResult = self
.client
.request("run_job", rpc_params![params])
.request("job.run", rpc_params![params])
.await.map_err(|e| ClientError::JsonRpc(e))?;
Ok(result)
}