1
0
Fork 0
MQL5-Google-Onedrive/dashboard/index.html
Vercel 2fc48d7896 Set up Vercel Web Analytics integration
# Vercel Web Analytics Implementation

## Summary
Successfully implemented Vercel Web Analytics for the MQL5 Trading Automation dashboard project. The implementation follows Vercel's recommended HTML/plain JavaScript approach, which is ideal for this Flask-based application.

## Changes Made

### Modified Files:

1. **dashboard/index.html**
   - Added Vercel Web Analytics script tags before the closing `</body>` tag
   - Implemented the standard HTML analytics tracking code that initializes the `window.va` function
   - Added deferred loading of the Vercel insights script from `/_vercel/insights/script.js`

2. **scripts/web_dashboard.py**
   - Updated the Flask application's HTML template to include Vercel Web Analytics
   - Added the same analytics script tags to the dynamically generated HTML
   - Ensures analytics tracking works on both the static and Flask-rendered pages

### Created Files:

3. **vercel.json**
   - Created Vercel deployment configuration file
   - Configured builds for both the Python Flask app and static dashboard files
   - Set up routing to properly serve the Flask app and static assets
   - Added production environment variables for Flask

## Implementation Details

The implementation uses Vercel's HTML/JavaScript approach for web analytics, which:
- Requires no package installation (no @vercel/analytics npm package needed)
- Works seamlessly with Flask and static HTML pages
- Automatically tracks page views and visitor metrics
- Uses deferred script loading for optimal performance
- Will be activated once the project is deployed to Vercel with Web Analytics enabled

## Next Steps for Deployment

To complete the Vercel Web Analytics setup:

1. **Enable Web Analytics in Vercel Dashboard:**
   - Go to your Vercel project dashboard
   - Click the "Analytics" tab
   - Click "Enable" to activate Web Analytics
   - This will make the `/_vercel/insights/*` routes available

2. **Deploy to Vercel:**
   - Run `vercel deploy` or push to your connected Git repository
   - The analytics will automatically start tracking after deployment

3. **Verify Installation:**
   - After deployment, visit your site
   - Open browser DevTools > Network tab
   - Look for a request to `/_vercel/insights/view` to confirm tracking is active

## Technical Notes

- No changes to requirements.txt were needed (Python-only dependencies)
- No package manager operations required (npm/yarn/pnpm)
- The implementation is framework-agnostic and works with plain HTML/JavaScript
- Analytics tracking is non-blocking and won't affect page load performance
- The solution supports both the static HTML dashboard and Flask-rendered pages

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
2026-02-09 04:27:33 +00:00

238 Zeilen
7,1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MQL5 Trading Automation Dashboard</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
.header {
background: white;
padding: 30px;
border-radius: 15px;
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
margin-bottom: 30px;
text-align: center;
}
.header h1 {
color: #333;
font-size: 2.5em;
margin-bottom: 10px;
}
.header p {
color: #666;
font-size: 1.1em;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.card {
background: white;
padding: 25px;
border-radius: 15px;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.card h2 {
color: #667eea;
margin-bottom: 15px;
font-size: 1.5em;
}
.card p {
color: #666;
line-height: 1.6;
margin-bottom: 15px;
}
.btn {
display: inline-block;
padding: 12px 24px;
background: #667eea;
color: white;
text-decoration: none;
border-radius: 8px;
font-weight: 600;
transition: background 0.3s;
}
.btn:hover {
background: #5568d3;
}
.status {
background: white;
padding: 25px;
border-radius: 15px;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.status-item {
display: flex;
justify-content: space-between;
padding: 15px 0;
border-bottom: 1px solid #eee;
}
.status-item:last-child {
border-bottom: none;
}
.status-label {
color: #666;
font-weight: 600;
}
.status-value {
color: #667eea;
font-weight: 700;
}
.badge {
display: inline-block;
padding: 4px 12px;
border-radius: 20px;
font-size: 0.85em;
font-weight: 600;
}
.badge-success {
background: #10b981;
color: white;
}
.badge-warning {
background: #f59e0b;
color: white;
}
.footer {
text-align: center;
color: white;
margin-top: 40px;
opacity: 0.9;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>🚀 MQL5 Trading Automation</h1>
<p>GenX FX Trading System Dashboard</p>
</div>
<div class="grid">
<div class="card">
<h2>📊 Trading Indicators</h2>
<p>SMC + Trend Breakout (MTF) indicator with BOS/CHoCH and Donchian breakout signals.</p>
<a href="#" class="btn">View Indicators</a>
</div>
<div class="card">
<h2>🤖 Expert Advisors</h2>
<p>Automated trading EAs with smart risk management and multi-timeframe confirmation.</p>
<a href="#" class="btn">Manage EAs</a>
</div>
<div class="card">
<h2>☁️ Cloud Deployment</h2>
<p>Deploy your trading automation to Fly.io, Render, Railway, or GitHub Pages.</p>
<a href="#" class="btn">Deploy Now</a>
</div>
<div class="card">
<h2>📱 Telegram Bot</h2>
<p>Control deployments and monitor trading via @GenX_FX_bot on Telegram.</p>
<a href="https://t.me/GenX_FX_bot" class="btn" target="_blank">Open Bot</a>
</div>
<div class="card">
<h2>📈 Exness Terminal</h2>
<p>Connect to Exness MT5 terminal for live trading execution.</p>
<a href="https://my.exness.global/webtrading/" class="btn" target="_blank">Open Terminal</a>
</div>
<div class="card">
<h2>🔧 Settings</h2>
<p>Configure risk parameters, notifications, and automation preferences.</p>
<a href="#" class="btn">Configure</a>
</div>
</div>
<div class="status">
<h2 style="color: #667eea; margin-bottom: 20px;">System Status</h2>
<div class="status-item">
<span class="status-label">Deployment Status</span>
<span class="badge badge-success">Active</span>
</div>
<div class="status-item">
<span class="status-label">Fly.io App</span>
<span class="status-value">mql5-automation</span>
</div>
<div class="status-item">
<span class="status-label">Telegram Bot</span>
<span class="status-value">@GenX_FX_bot</span>
</div>
<div class="status-item">
<span class="status-label">Last Updated</span>
<span class="status-value" id="lastUpdate"></span>
</div>
</div>
<div class="footer">
<p>© 2026 GenX FX Trading System | Built with ❤️ for Trading Automation</p>
</div>
</div>
<script>
// Set last update time
document.getElementById('lastUpdate').textContent = new Date().toLocaleString();
// Add interactivity
document.querySelectorAll('.card a.btn').forEach(btn => {
if (!btn.href || btn.href === '#') {
btn.addEventListener('click', (e) => {
e.preventDefault();
alert('Feature coming soon!');
});
}
});
</script>
<!-- Vercel Web Analytics -->
<script>
window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
</script>
<script defer src="/_vercel/insights/script.js"></script>
</body>
</html>