diff --git a/src/app/_components/InstalledScriptsTab.tsx b/src/app/_components/InstalledScriptsTab.tsx index 8aca574..f53e04f 100644 --- a/src/app/_components/InstalledScriptsTab.tsx +++ b/src/app/_components/InstalledScriptsTab.tsx @@ -377,7 +377,7 @@ export function InstalledScriptsTab() { containerStatusMutation.mutate({ serverIds }); } }, 500); - }, [containerStatusMutation]); + }, []); // Run cleanup when component mounts and scripts are loaded (only once) useEffect(() => { @@ -1365,21 +1365,17 @@ export function InstalledScriptsTab() { ) : ( script.web_ui_ip ? ( -
- - {script.container_id && script.execution_mode === 'ssh' && ( + + {containerStatuses.get(script.id) === 'running' && ( )}
@@ -1487,6 +1483,15 @@ export function InstalledScriptsTab() { Open UI )} + {script.container_id && script.execution_mode === 'ssh' && script.web_ui_ip && ( + handleAutoDetectWebUI(script)} + disabled={autoDetectWebUIMutation.isPending || containerStatuses.get(script.id) === 'stopped'} + className="text-blue-300 hover:text-blue-200 hover:bg-blue-900/20 focus:bg-blue-900/20" + > + {autoDetectWebUIMutation.isPending ? 'Re-detect...' : 'Re-detect IP/Port'} + + )} {script.container_id && script.execution_mode === 'ssh' && ( <> diff --git a/src/server/api/routers/installedScripts.ts b/src/server/api/routers/installedScripts.ts index 3a25704..15407b3 100644 --- a/src/server/api/routers/installedScripts.ts +++ b/src/server/api/routers/installedScripts.ts @@ -1137,9 +1137,11 @@ export const installedScriptsRouter = createTRPCRouter({ console.log('✅ Successfully updated database'); return { success: true, - message: `Successfully detected IP: ${detectedIp}:${detectedPort}`, + message: `Successfully detected IP: ${detectedIp}:${detectedPort} for LXC ${scriptData.container_id} on ${(server as any).name}`, detectedIp, - detectedPort: detectedPort + detectedPort: detectedPort, + containerId: scriptData.container_id, + serverName: (server as any).name }; } catch (error) { console.error('Error in autoDetectWebUI:', error);