Backport: Agentic Shell Command Execution (v1.0.0 → v1.0.8) #66
@ -325,6 +325,7 @@ pub async fn initiate_oauth(
|
|||||||
let app_data_dir = app_state.app_data_dir.clone();
|
let app_data_dir = app_state.app_data_dir.clone();
|
||||||
let integration_webviews = app_state.integration_webviews.clone();
|
let integration_webviews = app_state.integration_webviews.clone();
|
||||||
let mcp_connections = app_state.mcp_connections.clone();
|
let mcp_connections = app_state.mcp_connections.clone();
|
||||||
|
let pending_approvals = app_state.pending_approvals.clone();
|
||||||
|
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let app_state_for_callback = AppState {
|
let app_state_for_callback = AppState {
|
||||||
@ -333,9 +334,7 @@ pub async fn initiate_oauth(
|
|||||||
app_data_dir,
|
app_data_dir,
|
||||||
integration_webviews,
|
integration_webviews,
|
||||||
mcp_connections,
|
mcp_connections,
|
||||||
pending_approvals: Arc::new(tokio::sync::Mutex::new(
|
pending_approvals,
|
||||||
std::collections::HashMap::new(),
|
|
||||||
)),
|
|
||||||
};
|
};
|
||||||
while let Some(callback) = callback_rx.recv().await {
|
while let Some(callback) = callback_rx.recv().await {
|
||||||
tracing::info!("Received OAuth callback for state: {}", callback.state);
|
tracing::info!("Received OAuth callback for state: {}", callback.state);
|
||||||
|
|||||||
@ -97,11 +97,16 @@ pub fn activate_kubeconfig(id: String, state: State<'_, AppState>) -> Result<(),
|
|||||||
.map_err(|e| format!("Failed to deactivate configs: {e}"))?;
|
.map_err(|e| format!("Failed to deactivate configs: {e}"))?;
|
||||||
|
|
||||||
// Activate the specified config
|
// Activate the specified config
|
||||||
db.execute(
|
let rows_updated = db
|
||||||
"UPDATE kubeconfig_files SET is_active = 1 WHERE id = ?1",
|
.execute(
|
||||||
params![&id],
|
"UPDATE kubeconfig_files SET is_active = 1 WHERE id = ?1",
|
||||||
)
|
params![&id],
|
||||||
.map_err(|e| format!("Failed to activate config: {e}"))?;
|
)
|
||||||
|
.map_err(|e| format!("Failed to activate config: {e}"))?;
|
||||||
|
|
||||||
|
if rows_updated == 0 {
|
||||||
|
return Err(format!("Kubeconfig with id '{}' not found", id));
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user