Update admin UI with real API integration and secret management
This commit is contained in:
@@ -569,6 +569,25 @@ impl WasmSupervisorClient {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get logs for a specific job
|
||||
#[wasm_bindgen]
|
||||
pub async fn get_job_logs(&self, job_id: &str, lines: Option<usize>) -> Result<JsValue, JsValue> {
|
||||
let params = if let Some(n) = lines {
|
||||
serde_json::json!([job_id, n])
|
||||
} else {
|
||||
serde_json::json!([job_id, serde_json::Value::Null])
|
||||
};
|
||||
|
||||
match self.call_method("get_job_logs", params).await {
|
||||
Ok(result) => {
|
||||
// Convert Vec<String> to JsValue
|
||||
Ok(serde_wasm_bindgen::to_value(&result)
|
||||
.map_err(|e| JsValue::from_str(&format!("Failed to convert logs: {}", e)))?)
|
||||
},
|
||||
Err(e) => Err(JsValue::from_str(&format!("Failed to get job logs: {:?}", e)))
|
||||
}
|
||||
}
|
||||
|
||||
/// Remove a runner from the supervisor
|
||||
pub async fn remove_runner(&self, actor_id: &str) -> Result<(), JsValue> {
|
||||
let params = serde_json::json!([actor_id]);
|
||||
@@ -980,10 +999,10 @@ pub fn sign_job_canonical(
|
||||
let secret_key = SecretKey::from_slice(&secret_bytes)
|
||||
.map_err(|e| JsValue::from_str(&format!("Invalid private key: {}", e)))?;
|
||||
|
||||
// Get the public key
|
||||
// Get the public key (uncompressed format)
|
||||
let secp = Secp256k1::new();
|
||||
let public_key = PublicKey::from_secret_key(&secp, &secret_key);
|
||||
let public_key_hex = hex::encode(public_key.serialize());
|
||||
let public_key_hex = hex::encode(public_key.serialize_uncompressed());
|
||||
|
||||
// Hash the canonical representation
|
||||
let mut hasher = Sha256::new();
|
||||
|
||||
Reference in New Issue
Block a user