Restore working dashboard and TradingView analysis

- Fixed layout conflicts by removing minimal layout.tsx in favor of complete layout.js
- Restored original AI Analysis page with full TradingView integration
- Connected enhanced screenshot API to real TradingView automation service
- Fixed screenshot gallery to handle both string and object formats
- Added image serving API route for screenshot display
- Resolved hydration mismatch issues with suppressHydrationWarning
- All navigation pages working (Analysis, Trading, Automation, Settings)
- TradingView automation successfully capturing screenshots from AI and DIY layouts
- Docker Compose v2 compatibility ensured

Working features:
- Homepage with hero section and status cards
- Navigation menu with Trading Bot branding
- Real TradingView screenshot capture
- AI-powered chart analysis
- Multi-layout support (AI + DIY module)
- Screenshot gallery with image serving
- API endpoints for balance, status, screenshots, trading
This commit is contained in:
mindesbunister
2025-07-14 14:21:19 +02:00
parent 9978760995
commit de45349baa
68 changed files with 2147 additions and 1813 deletions

View File

@@ -35,9 +35,11 @@ export default function ScreenshotGallery({
if (screenshots.length === 0) return null
// Helper function to format screenshot URL
const formatScreenshotUrl = (screenshot: string) => {
const formatScreenshotUrl = (screenshot: string | any) => {
// Handle both string URLs and screenshot objects
const screenshotUrl = typeof screenshot === 'string' ? screenshot : screenshot.url || screenshot
// Extract just the filename from the full path
const filename = screenshot.split('/').pop() || screenshot
const filename = screenshotUrl.split('/').pop() || screenshotUrl
// Use the new API route with query parameter
return `/api/image?file=${filename}`
}
@@ -60,7 +62,11 @@ export default function ScreenshotGallery({
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{screenshots.map((screenshot, index) => {
const filename = screenshot.split('/').pop() || ''
// Handle both string URLs and screenshot objects
const screenshotUrl = typeof screenshot === 'string'
? screenshot
: (screenshot as any)?.url || String(screenshot)
const filename = screenshotUrl.split('/').pop() || ''
// Extract timeframe from filename (e.g., SOLUSD_5_ai_timestamp.png -> "5m")
const extractTimeframeFromFilename = (filename: string) => {
const match = filename.match(/_(\d+|D)_/)