feat(kube): add Kubernetes management GUI components #71
@ -159,6 +159,17 @@ pub async fn list_port_forwards(
|
|||||||
Ok(forwards)
|
Ok(forwards)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn delete_port_forward(id: String, state: State<'_, AppState>) -> Result<(), String> {
|
||||||
|
let mut port_forwards = state.port_forwards.lock().await;
|
||||||
|
|
||||||
|
if port_forwards.remove(&id).is_none() {
|
||||||
|
return Err(format!("Port forward session {id} not found"));
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn extract_context(_content: &str) -> Result<String, String> {
|
fn extract_context(_content: &str) -> Result<String, String> {
|
||||||
Ok("default".to_string())
|
Ok("default".to_string())
|
||||||
}
|
}
|
||||||
|
|||||||
@ -181,6 +181,7 @@ pub fn run() {
|
|||||||
commands::kube::start_port_forward,
|
commands::kube::start_port_forward,
|
||||||
commands::kube::stop_port_forward,
|
commands::kube::stop_port_forward,
|
||||||
commands::kube::list_port_forwards,
|
commands::kube::list_port_forwards,
|
||||||
|
commands::kube::delete_port_forward,
|
||||||
])
|
])
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("Error running Troubleshooting and RCA Assistant application");
|
.expect("Error running Troubleshooting and RCA Assistant application");
|
||||||
|
|||||||
@ -783,7 +783,7 @@ export const stopPortForwardCmd = (id: string) =>
|
|||||||
invoke<void>("stop_port_forward", { id });
|
invoke<void>("stop_port_forward", { id });
|
||||||
|
|
||||||
export const deletePortForwardCmd = (id: string) =>
|
export const deletePortForwardCmd = (id: string) =>
|
||||||
invoke<void>("stop_port_forward", { id });
|
invoke<void>("delete_port_forward", { id });
|
||||||
|
|
||||||
export const listPortForwardsCmd = () =>
|
export const listPortForwardsCmd = () =>
|
||||||
invoke<PortForwardResponse[]>("list_port_forwards");
|
invoke<PortForwardResponse[]>("list_port_forwards");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user