add navigation bar to show dashboard and dva/dca pages
This commit is contained in:
+44
-1
@@ -115,7 +115,31 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark mb-4">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<a class="navbar-brand" href="/">
|
||||||
|
<i class="bi bi-graph-up-arrow me-2"></i>Finance Suite
|
||||||
|
</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||||
|
<span class="navbar-text text-light small d-none d-md-inline">
|
||||||
|
System Status: <span id="statusIndicator" class="text-warning">● Connecting...</span>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/">Dashboard</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/backtest">Backtester</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<span class="navbar-text text-light small d-none d-md-inline">
|
||||||
|
System Status: <span class="text-success">● Online</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
<div class="container-fluid p-0">
|
<div class="container-fluid p-0">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header d-flex justify-content-between align-items-center">
|
<div class="card-header d-flex justify-content-between align-items-center">
|
||||||
@@ -289,6 +313,25 @@
|
|||||||
if (loading) loading.style.display = 'none';
|
if (loading) loading.style.display = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// This checks if the Flask server is responding every 30 seconds
|
||||||
|
async function checkStatus() {
|
||||||
|
const indicator = document.getElementById('statusIndicator');
|
||||||
|
try {
|
||||||
|
const response = await fetch('/api/summary'); // Or a dedicated /health endpoint
|
||||||
|
if (response.ok) {
|
||||||
|
indicator.innerHTML = '● Online';
|
||||||
|
indicator.className = 'text-success';
|
||||||
|
} else {
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
indicator.innerHTML = '● Offline';
|
||||||
|
indicator.className = 'text-danger';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setInterval(checkStatus, 30000);
|
||||||
|
checkStatus(); // Initial check
|
||||||
|
|
||||||
// --- 5. Initial Load ---
|
// --- 5. Initial Load ---
|
||||||
window.addEventListener('load', loadData);
|
window.addEventListener('load', loadData);
|
||||||
|
|||||||
@@ -29,6 +29,31 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark mb-4">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<a class="navbar-brand" href="/">
|
||||||
|
<i class="bi bi-graph-up-arrow me-2"></i>Finance Suite
|
||||||
|
</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||||
|
<span class="navbar-text text-light small d-none d-md-inline">
|
||||||
|
System Status: <span id="statusIndicator" class="text-warning">● Connecting...</span>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/">Dashboard</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/backtest">Backtester</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<span class="navbar-text text-light small d-none d-md-inline">
|
||||||
|
System Status: <span class="text-success">● Online</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
<div class="container-fluid py-3" style="max-width: 1200px; margin-left: 0;">
|
<div class="container-fluid py-3" style="max-width: 1200px; margin-left: 0;">
|
||||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||||
<h2 class="mb-0 fw-bold" style="font-size: 1.5rem;">🛠️ Value Averaging Strategy Analysis</h2>
|
<h2 class="mb-0 fw-bold" style="font-size: 1.5rem;">🛠️ Value Averaging Strategy Analysis</h2>
|
||||||
@@ -433,6 +458,25 @@ function updateSyncBadge(dateString) {
|
|||||||
const wb = XLSX.utils.table_to_book(table);
|
const wb = XLSX.utils.table_to_book(table);
|
||||||
XLSX.writeFile(wb, "Investment_Backtest_Results.xlsx");
|
XLSX.writeFile(wb, "Investment_Backtest_Results.xlsx");
|
||||||
}
|
}
|
||||||
|
// This checks if the Flask server is responding every 30 seconds
|
||||||
|
async function checkStatus() {
|
||||||
|
const indicator = document.getElementById('statusIndicator');
|
||||||
|
try {
|
||||||
|
const response = await fetch('/api/summary'); // Or a dedicated /health endpoint
|
||||||
|
if (response.ok) {
|
||||||
|
indicator.innerHTML = '● Online';
|
||||||
|
indicator.className = 'text-success';
|
||||||
|
} else {
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
indicator.innerHTML = '● Offline';
|
||||||
|
indicator.className = 'text-danger';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setInterval(checkStatus, 30000);
|
||||||
|
checkStatus(); // Initial check
|
||||||
|
|
||||||
function resetAll() {
|
function resetAll() {
|
||||||
// 1. Reset Inputs to Defaults (Including Frequency)
|
// 1. Reset Inputs to Defaults (Including Frequency)
|
||||||
|
|||||||
Reference in New Issue
Block a user