Spaces:
Runtime error
Runtime error
| {% extends "base.html" %} | |
| {% block title %}Tổng Quan Thị Trường - Market Overview{% endblock %} | |
| {% block head %} | |
| {{ super() }} | |
| <style> | |
| .container-fluid { | |
| padding: 20px; | |
| } | |
| .section-title { | |
| font-size: 2.2em; | |
| color: #2c3e50; | |
| border-bottom: 3px solid #3498db; | |
| padding-bottom: 10px; | |
| margin-bottom: 30px; | |
| font-weight: 600; | |
| } | |
| .card { | |
| background: #ffffff; | |
| border-radius: 12px; | |
| box-shadow: 0 6px 12px rgba(0,0,0,0.08); | |
| padding: 25px; | |
| margin-bottom: 30px; | |
| border: 1px solid #e9ecef; | |
| transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; | |
| } | |
| .card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 12px 24px rgba(0,0,0,0.1); | |
| } | |
| .card-title { | |
| font-size: 1.6em; | |
| margin-top: 0; | |
| margin-bottom: 20px; | |
| color: #34495e; | |
| font-weight: 500; | |
| } | |
| .ai-analysis { | |
| background-color: #eef7ff; | |
| border-left: 6px solid #3498db; | |
| padding: 25px; | |
| white-space: pre-wrap; | |
| font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; | |
| font-size: 0.95em; | |
| line-height: 1.6; | |
| border-radius: 8px; | |
| } | |
| .data-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); | |
| gap: 30px; | |
| } | |
| .news-list { | |
| list-style: none; | |
| padding: 0; | |
| } | |
| .news-item { | |
| border-bottom: 1px solid #e9ecef; | |
| padding: 20px 10px; | |
| transition: background-color 0.2s ease; | |
| } | |
| .news-item:last-child { | |
| border-bottom: none; | |
| } | |
| .news-item:hover { | |
| background-color: #f8f9fa; | |
| } | |
| .news-item a { | |
| text-decoration: none; | |
| color: #2980b9; | |
| font-weight: 600; | |
| font-size: 1.1em; | |
| } | |
| .news-item a:hover { | |
| color: #1c5a85; | |
| } | |
| .news-source { | |
| font-size: 0.85em; | |
| color: #7f8c8d; | |
| margin-top: 8px; | |
| } | |
| .dxy-value { | |
| font-size: 2.5em; | |
| font-weight: 700; | |
| color: #27ae60; | |
| text-align: center; | |
| } | |
| .dxy-time { | |
| text-align: center; | |
| color: #7f8c8d; | |
| } | |
| table { | |
| width: 100%; | |
| border-collapse: collapse; | |
| margin-top: 15px; | |
| } | |
| th, td { | |
| border: 1px solid #dee2e6; | |
| padding: 12px; | |
| text-align: left; | |
| } | |
| th { | |
| background-color: #f8f9fa; | |
| font-weight: 600; | |
| } | |
| </style> | |
| {% endblock %} | |
| {% block content %} | |
| <div class="container-fluid"> | |
| <h1 class="section-title">Tổng Quan Tin Tức Thị Trường</h1> | |
| <!-- AI Analysis Section --> | |
| <div class="card"> | |
| <h3 class="card-title"><i class="fas fa-robot"></i> Nhận Định & Đánh Giá từ AI</h3> | |
| <div class="ai-analysis"> | |
| {{ ai_analysis | safe if ai_analysis else "Không có phân tích từ AI." }} | |
| </div> | |
| </div> | |
| <h2 class="section-title" style="font-size: 1.8em; margin-top: 40px;">Dữ Liệu Vĩ Mô Chi Tiết</h2> | |
| <div class="data-grid"> | |
| <!-- Vietnambiz Data Section --> | |
| {% if vietnambiz_data %} | |
| <!-- M2 Supply --> | |
| {% if vietnambiz_data.m2_supply and vietnambiz_data.m2_supply|length > 0 %} | |
| <div class="card"> | |
| <h3 class="card-title"><i class="fas fa-money-bill-wave"></i> Cung tiền M2</h3> | |
| <div class="table-responsive"> | |
| <table> | |
| <thead> | |
| <tr> | |
| {% for key in vietnambiz_data.m2_supply[0].keys() %} | |
| <th>{{ key }}</th> | |
| {% endfor %} | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {% for row in vietnambiz_data.m2_supply %} | |
| <tr> | |
| {% for value in row.values() %} | |
| <td>{{ value }}</td> | |
| {% endfor %} | |
| </tr> | |
| {% endfor %} | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| {% endif %} | |
| <!-- Central Exchange Rate --> | |
| {% if vietnambiz_data.central_exchange_rate and vietnambiz_data.central_exchange_rate|length > 0 %} | |
| <div class="card"> | |
| <h3 class="card-title"><i class="fas fa-landmark"></i> Tỷ giá trung tâm</h3> | |
| <div class="table-responsive"> | |
| <table> | |
| <thead> | |
| <tr> | |
| {% for key in vietnambiz_data.central_exchange_rate[0].keys() %} | |
| <th>{{ key }}</th> | |
| {% endfor %} | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {% for row in vietnambiz_data.central_exchange_rate %} | |
| <tr> | |
| {% for value in row.values() %} | |
| <td>{{ value }}</td> | |
| {% endfor %} | |
| </tr> | |
| {% endfor %} | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| {% endif %} | |
| <!-- Interbank Interest Rate --> | |
| {% if vietnambiz_data.interbank_interest_rate and vietnambiz_data.interbank_interest_rate|length > 0 %} | |
| <div class="card"> | |
| <h3 class="card-title"><i class="fas fa-university"></i> Lãi suất liên ngân hàng</h3> | |
| <div class="table-responsive"> | |
| <table> | |
| <thead> | |
| <tr> | |
| {% for key in vietnambiz_data.interbank_interest_rate[0].keys() %} | |
| <th>{{ key }}</th> | |
| {% endfor %} | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {% for row in vietnambiz_data.interbank_interest_rate %} | |
| <tr> | |
| {% for value in row.values() %} | |
| <td>{{ value }}</td> | |
| {% endfor %} | |
| </tr> | |
| {% endfor %} | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| {% endif %} | |
| <!-- Savings Interest Rate --> | |
| {% if vietnambiz_data.savings_interest_rate and vietnambiz_data.savings_interest_rate|length > 0 %} | |
| <div class="card"> | |
| <h3 class="card-title"><i class="fas fa-piggy-bank"></i> Lãi suất huy động (tiết kiệm)</h3> | |
| <div class="table-responsive"> | |
| <table> | |
| <thead> | |
| <tr> | |
| {% for key in vietnambiz_data.savings_interest_rate[0].keys() %} | |
| <th>{{ key }}</th> | |
| {% endfor %} | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {% for row in vietnambiz_data.savings_interest_rate %} | |
| <tr> | |
| {% for value in row.values() %} | |
| <td>{{ value }}</td> | |
| {% endfor %} | |
| </tr> | |
| {% endfor %} | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% else %} | |
| <div class="card"><p>Không thể tải dữ liệu vĩ mô từ Vietnambiz.</p></div> | |
| {% endif %} | |
| <!-- USD Index Section --> | |
| <div class="card"> | |
| <h3 class="card-title"><i class="fas fa-dollar-sign"></i> Chỉ Số US Dollar Index (DXY)</h3> | |
| {% if usd_index and usd_index.usd_index %} | |
| <p class="dxy-value">{{ usd_index.usd_index }}</p> | |
| <p class="dxy-time"><small>Cập nhật lúc: {{ usd_index.last_updated }}</small></p> | |
| {% else %} | |
| <p>Không thể tải dữ liệu USD Index.</p> | |
| {% endif %} | |
| </div> | |
| <!-- Foreign Trading Data Section --> | |
| {% if foreign_trading_data %} | |
| {% for exchange, trades in foreign_trading_data.items() %} | |
| <div class="card"> | |
| <h3 class="card-title"><i class="fas fa-globe-americas"></i> Giao dịch khối ngoại - {{ exchange.replace('_', ' ') | title }}</h3> | |
| <div class="table-responsive"> | |
| <table> | |
| <thead> | |
| <tr> | |
| {% for key in trades[0].keys() %} | |
| <th>{{ key }}</th> | |
| {% endfor %} | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {% for row in trades %} | |
| <tr> | |
| {% for value in row.values() %} | |
| <td>{{ value }}</td> | |
| {% endfor %} | |
| </tr> | |
| {% endfor %} | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| {% endfor %} | |
| {% endif %} | |
| </div> | |
| <!-- Market News Section --> | |
| <div class="card"> | |
| <h3 class="card-title"><i class="fas fa-newspaper"></i> Tin Tức Thị Trường</h3> | |
| {% if market_news %} | |
| <ul class="news-list"> | |
| {% for news in market_news %} | |
| <li class="news-item"> | |
| <a href="{{ news.link }}" target="_blank">{{ news.title }}</a> | |
| <p class="news-source">Nguồn: {{ news.source }}</p> | |
| </li> | |
| {% endfor %} | |
| </ul> | |
| {% else %} | |
| <p>Không có tin tức nào.</p> | |
| {% endif %} | |
| </div> | |
| </div> | |
| {% endblock %} | |