| 17 | |
| 18 | // Function to fetch the script content |
| 19 | const fetchScriptContent = async () => { |
| 20 | try { |
| 21 | const response = await fetch('/api/script-content?name=debug_crawl4ai.sh') |
| 22 | |
| 23 | if (!response.ok) { |
| 24 | console.error('Failed to fetch script content:', response.statusText) |
| 25 | return |
| 26 | } |
| 27 | |
| 28 | const data = await response.json() |
| 29 | |
| 30 | if (data.success && data.content) { |
| 31 | setScriptContent(data.content) |
| 32 | } else { |
| 33 | console.error('Invalid script content response:', data.error || 'Unknown error') |
| 34 | } |
| 35 | } catch (error) { |
| 36 | console.error('Error fetching script content:', error) |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | const fetchDebugOutput = async () => { |
| 41 | setIsLoading(true) |