diff --git a/frontend/src/components/DiscoveryResults.jsx b/frontend/src/components/DiscoveryResults.jsx index 17e49de..039d2e1 100644 --- a/frontend/src/components/DiscoveryResults.jsx +++ b/frontend/src/components/DiscoveryResults.jsx @@ -71,7 +71,11 @@ export default function DiscoveryResults({ scanId, scan, analysis, devMode, onCo const pushMetric = result.push_metric; if (!monitorId || !pushMetric) { - console.error('Missing monitor ID or push metric for deployment'); + const errorMsg = `Missing data for deployment: monitorID=${monitorId}, push_metric=${pushMetric}`; + console.error(errorMsg, result); + setCreateResults(prev => prev.map((r, i) => + i === resultIndex ? { ...r, deployment: { status: 'failed', error: errorMsg } } : r + )); return; } @@ -375,6 +379,14 @@ export default function DiscoveryResults({ scanId, scan, analysis, devMode, onCo Script deployed to {result.deployment.script_path} > + ) : deployingScripts[index] ? ( + <> + + + + + Deploying script to {scan.hostname}... + > ) : ( <> @@ -383,10 +395,9 @@ export default function DiscoveryResults({ scanId, scan, analysis, devMode, onCo Deployment failed: {result.deployment.error} handleRetryDeploy(index, result)} - disabled={deployingScripts[index]} - className="ml-2 px-2 py-0.5 text-xs bg-purple-600 hover:bg-purple-500 disabled:bg-slate-600 text-white rounded transition-colors" + className="ml-2 px-2 py-0.5 text-xs bg-purple-600 hover:bg-purple-500 text-white rounded transition-colors" > - {deployingScripts[index] ? 'Deploying...' : 'Retry Deploy'} + Retry Deploy > )} @@ -402,17 +413,28 @@ export default function DiscoveryResults({ scanId, scan, analysis, devMode, onCo {/* Push monitor without deployment info (needs manual deploy) */} {result.type === 'push' && result.status === 'created' && !result.deployment && ( - - - - Script not deployed - handleRetryDeploy(index, result)} - disabled={deployingScripts[index]} - className="ml-2 px-2 py-0.5 text-xs bg-purple-600 hover:bg-purple-500 disabled:bg-slate-600 text-white rounded transition-colors" - > - {deployingScripts[index] ? 'Deploying...' : 'Deploy Script'} - + {deployingScripts[index] ? ( + <> + + + + + Deploying script to {scan.hostname}... + > + ) : ( + <> + + + + Script not deployed + handleRetryDeploy(index, result)} + className="ml-2 px-2 py-0.5 text-xs bg-purple-600 hover:bg-purple-500 text-white rounded transition-colors" + > + Deploy Script + + > + )} )}