Files
bitcoin_monitor/monitor/templates/monitor/view_analysis.html
2026-01-16 22:20:18 +03:00

196 lines
6.0 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Market Analysis</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 1400px;
margin: 0 auto;
padding: 20px;
background: #f8f9fa;
}
.container {
background: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.header {
background: linear-gradient(135deg, #4e54c8 0%, #8f94fb 100%);
color: white;
padding: 20px;
border-radius: 8px;
margin-bottom: 30px;
}
.summary-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin: 30px 0;
}
.summary-card {
border: 1px solid #dee2e6;
border-radius: 8px;
padding: 20px;
background: white;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.summary-card h3 {
margin-top: 0;
color: #495057;
border-bottom: 2px solid #e9ecef;
padding-bottom: 10px;
}
.status-badge {
display: inline-block;
padding: 5px 10px;
border-radius: 20px;
font-size: 12px;
font-weight: bold;
margin-left: 10px;
}
.status-dip { background: #dc3545; color: white; }
.status-peak { background: #ffc107; color: #212529; }
.status-neutral { background: #28a745; color: white; }
.analysis-table {
width: 100%;
border-collapse: collapse;
margin: 30px 0;
}
.analysis-table th {
background: #343a40;
color: white;
padding: 12px;
text-align: left;
}
.analysis-table td {
padding: 12px;
border-bottom: 1px solid #dee2e6;
}
.analysis-table tr:hover {
background: #f8f9fa;
}
.btn {
display: inline-block;
padding: 10px 20px;
background: #007bff;
color: white;
text-decoration: none;
border-radius: 5px;
margin-right: 10px;
margin-bottom: 20px;
}
.btn:hover {
background: #0056b3;
}
.btn-run {
background: #28a745;
}
.btn-run:hover {
background: #218838;
}
.btn-secondary {
background: #6c757d;
}
.btn-secondary:hover {
background: #545b62;
}
.no-data {
text-align: center;
padding: 40px;
color: #6c757d;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>📊 Market Analysis Dashboard</h1>
<p>Comprehensive Bitcoin market analysis across different time periods</p>
</div>
<div>
<a href="{% url 'run_analysis' %}" class="btn btn-run">Run New Analysis</a>
<a href="/" class="btn">Back to Dashboard</a>
<a href="/admin/monitor/marketanalysis/" class="btn btn-secondary">Admin Panel</a>
</div>
<h2>Latest Analysis Summary</h2>
{% if summary %}
<div class="summary-grid">
{% for period, data in summary.items %}
<div class="summary-card">
<h3>{{ period|title }} Analysis
<span class="status-badge status-{{ data.status }}">
{{ data.status|upper }}
</span>
</h3>
<p><strong>Current Price:</strong> ${{ data.current_price|floatformat:2 }}</p>
<p><strong>Average Price:</strong> ${{ data.average_price|floatformat:2 }}</p>
<p><strong>Threshold:</strong> {{ data.threshold_percent }}%</p>
{% if data.is_event %}
<p><strong>⚠️ Event Active</strong></p>
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<div class="no-data">
<h3>No analysis data available</h3>
<p>Click "Run New Analysis" to generate your first analysis report.</p>
</div>
{% endif %}
<h2>Recent Analyses</h2>
{% if all_analyses %}
<table class="analysis-table">
<thead>
<tr>
<th>Time</th>
<th>Period</th>
<th>Status</th>
<th>Current Price</th>
<th>Average Price</th>
<th>Threshold</th>
<th>Event</th>
</tr>
</thead>
<tbody>
{% for analysis in all_analyses %}
<tr>
<td>{{ analysis.timestamp|date:"M d, H:i" }}</td>
<td>{{ analysis.period }}</td>
<td>
<span class="status-badge status-{{ analysis.status }}">
{{ analysis.status|upper }}
</span>
</td>
<td>${{ analysis.current_price|floatformat:2 }}</td>
<td>${{ analysis.average_price|floatformat:2 }}</td>
<td>{{ analysis.threshold_percent }}%</td>
<td>
{% if analysis.is_event %}
<span style="color: #dc3545;">{{ analysis.event_type|title }}</span>
{% else %}
-
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="no-data">
<p>No analysis records found. Run an analysis to see results here.</p>
</div>
{% endif %}
</div>
</body>
</html>