Spaces:
Running
Running
restored failed state x2
Browse files- frontend/vehicles.html +89 -41
frontend/vehicles.html
CHANGED
|
@@ -528,7 +528,7 @@
|
|
| 528 |
<!-- Toast Container -->
|
| 529 |
<div id="toast-container"></div>
|
| 530 |
|
| 531 |
-
<main class="flex-1 flex flex-col min-h-0 p-4 gap-4 overflow-hidden relative">
|
| 532 |
|
| 533 |
<!-- TAB: About -->
|
| 534 |
<div id="tab-about" class="hidden flex-1 min-h-0 overflow-y-auto max-h-full">
|
|
@@ -624,7 +624,7 @@
|
|
| 624 |
</li>
|
| 625 |
<li class="flex items-start gap-3"><i class="fa-solid fa-circle text-[5px] mt-1.5"
|
| 626 |
style="color:#8b5e3c"></i>
|
| 627 |
-
<span>
|
| 628 |
</li>
|
| 629 |
</ul>
|
| 630 |
</div>
|
|
@@ -760,10 +760,39 @@
|
|
| 760 |
</div>
|
| 761 |
<div class="flex-1 w-full relative min-h-[220px]">
|
| 762 |
<canvas id="flowChart"></canvas>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 763 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 764 |
</div>
|
| 765 |
</div>
|
| 766 |
</div>
|
|
|
|
| 767 |
|
| 768 |
<!-- TAB: Run -->
|
| 769 |
<div id="tab-run-details" class="hidden flex-1 min-h-0 overflow-y-auto max-h-full">
|
|
@@ -909,7 +938,7 @@
|
|
| 909 |
<span class="info-tip">Relative speed categories based on pixel displacement between frames. Slow/Normal/Fast are percentile-based within this video — not km/h.</span></span>
|
| 910 |
</h3>
|
| 911 |
</div>
|
| 912 |
-
<div class="flex-1 flex items-center justify-center" id="speed-
|
| 913 |
<div class="text-center text-slate-600 text-xs"><i class="fa-solid fa-gauge-high text-2xl mb-2"></i><br>Available after processing</div>
|
| 914 |
</div>
|
| 915 |
</div>
|
|
@@ -922,7 +951,7 @@
|
|
| 922 |
<span class="info-tip">Passenger Car Units (IRC:106-1990). Converts heterogeneous Indian traffic into standardized units for road capacity analysis.</span></span>
|
| 923 |
</h3>
|
| 924 |
</div>
|
| 925 |
-
<div class="flex-1 flex items-center justify-center" id="pcu-
|
| 926 |
<div class="text-center text-slate-600 text-xs"><i class="fa-solid fa-car text-2xl mb-2"></i><br>Available after processing</div>
|
| 927 |
</div>
|
| 928 |
</div>
|
|
@@ -1145,7 +1174,7 @@
|
|
| 1145 |
<!-- TAB: Feedback -->
|
| 1146 |
<div id="tab-feedback" class="hidden flex-1 min-h-0 overflow-y-auto max-h-full">
|
| 1147 |
<!-- Full Header Area -->
|
| 1148 |
-
<div class="max-w-
|
| 1149 |
<div class="text-center space-y-3 mb-6">
|
| 1150 |
<h2 class="text-2xl font-bold tracking-tight" style="color:#f0ece6">Share Your Feedback</h2>
|
| 1151 |
<p class="text-xs" style="color:#777">We are constantly refining UrbanFlow. Your technical insights directly drive our roadmap.</p>
|
|
@@ -1497,35 +1526,37 @@
|
|
| 1497 |
const panel = document.getElementById('insights-panel');
|
| 1498 |
panel.classList.remove('hidden');
|
| 1499 |
|
| 1500 |
-
// Speed distribution bars
|
| 1501 |
const dist = d.speed_distribution || {};
|
| 1502 |
-
const
|
| 1503 |
const colors = { slow: '#ef4444', normal: '#eab308', fast: '#22c55e' };
|
| 1504 |
const labels = { slow: 'Slow', normal: 'Normal', fast: 'Fast' };
|
| 1505 |
-
bars.innerHTML = ['slow', 'normal', 'fast'].map(cat => {
|
| 1506 |
-
const pct = dist[cat] || 0;
|
| 1507 |
-
const h = Math.max(8, pct * 1.2);
|
| 1508 |
-
return `<div class="flex flex-col items-center gap-1">
|
| 1509 |
-
<span class="text-[10px] font-bold" style="color:${colors[cat]}">${pct}%</span>
|
| 1510 |
-
<div style="width:36px;height:${h}px;background:${colors[cat]};border-radius:6px;transition:height 0.5s"></div>
|
| 1511 |
-
<span class="text-[9px] font-bold text-slate-500 uppercase">${labels[cat]}</span>
|
| 1512 |
-
</div>`;
|
| 1513 |
-
}).join('');
|
| 1514 |
|
| 1515 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1516 |
const ci = document.getElementById('congestion-insights');
|
| 1517 |
-
|
| 1518 |
-
|
| 1519 |
-
|
| 1520 |
-
|
| 1521 |
-
|
| 1522 |
-
|
| 1523 |
-
|
| 1524 |
-
|
| 1525 |
-
//
|
| 1526 |
-
const
|
| 1527 |
-
if (
|
| 1528 |
-
|
| 1529 |
${['slow', 'normal', 'fast'].map(cat => {
|
| 1530 |
const pct = dist[cat] || 0;
|
| 1531 |
const h = Math.max(12, pct * 1.0);
|
|
@@ -1537,27 +1568,44 @@
|
|
| 1537 |
}).join('')}
|
| 1538 |
</div>`;
|
| 1539 |
}
|
| 1540 |
-
|
| 1541 |
-
|
| 1542 |
-
|
| 1543 |
-
if (pcuCard) {
|
| 1544 |
-
pcuCard.innerHTML = `<div class="space-y-3 w-full">
|
| 1545 |
<div class="flex justify-between items-center">
|
| 1546 |
<span class="text-xs font-medium text-slate-500">Total PCU</span>
|
| 1547 |
-
<span class="text-2xl font-black" style="color:#
|
| 1548 |
</div>
|
| 1549 |
<div class="flex gap-3">
|
| 1550 |
-
<div class="flex-1 bg-
|
| 1551 |
-
<div class="text-lg font-bold
|
| 1552 |
-
<div class="text-[9px] font-bold text-
|
| 1553 |
</div>
|
| 1554 |
-
<div class="flex-1 bg-
|
| 1555 |
-
<div class="text-lg font-bold
|
| 1556 |
-
<div class="text-[9px] font-bold text-
|
| 1557 |
</div>
|
| 1558 |
</div>
|
| 1559 |
</div>`;
|
| 1560 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1561 |
}
|
| 1562 |
|
| 1563 |
// =========== Run Details helpers ===========
|
|
|
|
| 528 |
<!-- Toast Container -->
|
| 529 |
<div id="toast-container"></div>
|
| 530 |
|
| 531 |
+
<main class="flex-1 flex flex-col min-h-0 p-4 gap-4 overflow-hidden relative" style="height: 100vh;">
|
| 532 |
|
| 533 |
<!-- TAB: About -->
|
| 534 |
<div id="tab-about" class="hidden flex-1 min-h-0 overflow-y-auto max-h-full">
|
|
|
|
| 624 |
</li>
|
| 625 |
<li class="flex items-start gap-3"><i class="fa-solid fa-circle text-[5px] mt-1.5"
|
| 626 |
style="color:#8b5e3c"></i>
|
| 627 |
+
<span>Enterprise deployment with dedicated SLAs and onboarding</span>
|
| 628 |
</li>
|
| 629 |
</ul>
|
| 630 |
</div>
|
|
|
|
| 760 |
</div>
|
| 761 |
<div class="flex-1 w-full relative min-h-[220px]">
|
| 762 |
<canvas id="flowChart"></canvas>
|
| 763 |
+
</div>
|
| 764 |
+
</div>
|
| 765 |
+
|
| 766 |
+
<!-- Additional KPI Rows (Speed & Insights) -->
|
| 767 |
+
<div id="stats-insights-row" class="col-span-12 grid grid-cols-12 gap-4">
|
| 768 |
+
<!-- Speed Distribution -->
|
| 769 |
+
<div class="col-span-12 xl:col-span-6 bg-[#0a0a0a] rounded-xl border border-[#2a2a2a] shadow-sm flex flex-col overflow-hidden">
|
| 770 |
+
<div class="px-6 py-4 border-b border-[#2a2a2a] bg-[#0c0c0c]">
|
| 771 |
+
<h3 class="font-bold text-white text-sm flex items-center">Speed Distribution
|
| 772 |
+
<span class="info-wrap"><span class="info-btn"><i class="fa-solid fa-info"></i></span>
|
| 773 |
+
<span class="info-tip">Relative speed categories based on pixel displacement. Slow/Normal/Fast are percentile-based within this video.</span></span>
|
| 774 |
+
</h3>
|
| 775 |
+
</div>
|
| 776 |
+
<div class="p-6" id="speed-stats-card">
|
| 777 |
+
<!-- Populated by renderInsights -->
|
| 778 |
+
</div>
|
| 779 |
</div>
|
| 780 |
+
|
| 781 |
+
<!-- Congestion Insights -->
|
| 782 |
+
<div class="col-span-12 xl:col-span-6 bg-[#0a0a0a] rounded-xl border border-[#2a2a2a] shadow-sm flex flex-col overflow-hidden">
|
| 783 |
+
<div class="px-6 py-4 border-b border-[#2a2a2a] bg-[#0c0c0c]">
|
| 784 |
+
<h3 class="font-bold text-white text-sm flex items-center">Automated Peak Analysis
|
| 785 |
+
<span class="info-wrap"><span class="info-btn"><i class="fa-solid fa-info"></i></span>
|
| 786 |
+
<span class="info-tip">AI-driven detection of traffic surges and peak periods.</span></span>
|
| 787 |
+
</h3>
|
| 788 |
+
</div>
|
| 789 |
+
<div class="p-6 space-y-3" id="pcu-stats-card">
|
| 790 |
+
<!-- Populated by renderInsights -->
|
| 791 |
+
</div>
|
| 792 |
</div>
|
| 793 |
</div>
|
| 794 |
</div>
|
| 795 |
+
</div>
|
| 796 |
|
| 797 |
<!-- TAB: Run -->
|
| 798 |
<div id="tab-run-details" class="hidden flex-1 min-h-0 overflow-y-auto max-h-full">
|
|
|
|
| 938 |
<span class="info-tip">Relative speed categories based on pixel displacement between frames. Slow/Normal/Fast are percentile-based within this video — not km/h.</span></span>
|
| 939 |
</h3>
|
| 940 |
</div>
|
| 941 |
+
<div class="flex-1 flex items-center justify-center" id="speed-reports-card">
|
| 942 |
<div class="text-center text-slate-600 text-xs"><i class="fa-solid fa-gauge-high text-2xl mb-2"></i><br>Available after processing</div>
|
| 943 |
</div>
|
| 944 |
</div>
|
|
|
|
| 951 |
<span class="info-tip">Passenger Car Units (IRC:106-1990). Converts heterogeneous Indian traffic into standardized units for road capacity analysis.</span></span>
|
| 952 |
</h3>
|
| 953 |
</div>
|
| 954 |
+
<div class="flex-1 flex items-center justify-center" id="pcu-reports-card">
|
| 955 |
<div class="text-center text-slate-600 text-xs"><i class="fa-solid fa-car text-2xl mb-2"></i><br>Available after processing</div>
|
| 956 |
</div>
|
| 957 |
</div>
|
|
|
|
| 1174 |
<!-- TAB: Feedback -->
|
| 1175 |
<div id="tab-feedback" class="hidden flex-1 min-h-0 overflow-y-auto max-h-full">
|
| 1176 |
<!-- Full Header Area -->
|
| 1177 |
+
<div class="max-w-none px-6 space-y-6 w-full">
|
| 1178 |
<div class="text-center space-y-3 mb-6">
|
| 1179 |
<h2 class="text-2xl font-bold tracking-tight" style="color:#f0ece6">Share Your Feedback</h2>
|
| 1180 |
<p class="text-xs" style="color:#777">We are constantly refining UrbanFlow. Your technical insights directly drive our roadmap.</p>
|
|
|
|
| 1526 |
const panel = document.getElementById('insights-panel');
|
| 1527 |
panel.classList.remove('hidden');
|
| 1528 |
|
|
|
|
| 1529 |
const dist = d.speed_distribution || {};
|
| 1530 |
+
const pcu = d.pcu || {};
|
| 1531 |
const colors = { slow: '#ef4444', normal: '#eab308', fast: '#22c55e' };
|
| 1532 |
const labels = { slow: 'Slow', normal: 'Normal', fast: 'Fast' };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1533 |
|
| 1534 |
+
// 1. Update Run Tab Insights
|
| 1535 |
+
const bars = document.getElementById('speed-bars');
|
| 1536 |
+
if (bars) {
|
| 1537 |
+
bars.innerHTML = ['slow', 'normal', 'fast'].map(cat => {
|
| 1538 |
+
const pct = dist[cat] || 0;
|
| 1539 |
+
const h = Math.max(8, pct * 1.2);
|
| 1540 |
+
return `<div class="flex flex-col items-center gap-1">
|
| 1541 |
+
<span class="text-[10px] font-bold" style="color:${colors[cat]}">${pct}%</span>
|
| 1542 |
+
<div style="width:36px;height:${h}px;background:${colors[cat]};border-radius:6px;transition:height 0.5s"></div>
|
| 1543 |
+
<span class="text-[9px] font-bold text-slate-500 uppercase">${labels[cat]}</span>
|
| 1544 |
+
</div>`;
|
| 1545 |
+
}).join('');
|
| 1546 |
+
}
|
| 1547 |
const ci = document.getElementById('congestion-insights');
|
| 1548 |
+
if (ci) {
|
| 1549 |
+
ci.innerHTML = [
|
| 1550 |
+
infoRow('Total PCU', pcu.total_pcu || 0, 'Passenger Car Units (IRC:106-1990). Normalizes mixed traffic.'),
|
| 1551 |
+
infoRow('PCU In / Out', `${pcu.pcu_in || 0} / ${pcu.pcu_out || 0}`, 'Directional PCU split.'),
|
| 1552 |
+
infoRow('Speed Profile', `${dist.slow || 0}% slow · ${dist.normal || 0}% normal · ${dist.fast || 0}% fast`, 'Relative speed categories within this video.'),
|
| 1553 |
+
].join('');
|
| 1554 |
+
}
|
| 1555 |
+
|
| 1556 |
+
// 2. Update Stats Tab Cards
|
| 1557 |
+
const speedStats = document.getElementById('speed-stats-card');
|
| 1558 |
+
if (speedStats) {
|
| 1559 |
+
speedStats.innerHTML = `<div class="flex gap-5 items-end justify-center w-full">
|
| 1560 |
${['slow', 'normal', 'fast'].map(cat => {
|
| 1561 |
const pct = dist[cat] || 0;
|
| 1562 |
const h = Math.max(12, pct * 1.0);
|
|
|
|
| 1568 |
}).join('')}
|
| 1569 |
</div>`;
|
| 1570 |
}
|
| 1571 |
+
const pcuStats = document.getElementById('pcu-stats-card');
|
| 1572 |
+
if (pcuStats) {
|
| 1573 |
+
pcuStats.innerHTML = `<div class="space-y-3 w-full">
|
|
|
|
|
|
|
| 1574 |
<div class="flex justify-between items-center">
|
| 1575 |
<span class="text-xs font-medium text-slate-500">Total PCU</span>
|
| 1576 |
+
<span class="text-2xl font-black" style="color:#c89a6c">${pcu.total_pcu || 0}</span>
|
| 1577 |
</div>
|
| 1578 |
<div class="flex gap-3">
|
| 1579 |
+
<div class="flex-1 bg-[#111] rounded-lg p-2.5 text-center border border-[#222]">
|
| 1580 |
+
<div class="text-lg font-bold" style="color:#22c55e">${pcu.pcu_in || 0}</div>
|
| 1581 |
+
<div class="text-[9px] font-bold text-slate-500 uppercase">PCU In</div>
|
| 1582 |
</div>
|
| 1583 |
+
<div class="flex-1 bg-[#111] rounded-lg p-2.5 text-center border border-[#222]">
|
| 1584 |
+
<div class="text-lg font-bold" style="color:#ef4444">${pcu.pcu_out || 0}</div>
|
| 1585 |
+
<div class="text-[9px] font-bold text-slate-500 uppercase">PCU Out</div>
|
| 1586 |
</div>
|
| 1587 |
</div>
|
| 1588 |
</div>`;
|
| 1589 |
}
|
| 1590 |
+
|
| 1591 |
+
// 3. Update Reports Tab Insights
|
| 1592 |
+
const speedReports = document.getElementById('speed-reports-card');
|
| 1593 |
+
if (speedReports) {
|
| 1594 |
+
speedReports.innerHTML = `<div class="flex gap-3 items-end justify-center w-full h-16">
|
| 1595 |
+
${['slow', 'normal', 'fast'].map(cat => {
|
| 1596 |
+
const pct = dist[cat] || 0;
|
| 1597 |
+
const h = Math.max(6, pct * 0.6);
|
| 1598 |
+
return `<div style="width:24px;height:${h}px;background:${colors[cat]};border-radius:4px;"></div>`;
|
| 1599 |
+
}).join('')}
|
| 1600 |
+
</div>`;
|
| 1601 |
+
}
|
| 1602 |
+
const pcuReports = document.getElementById('pcu-reports-card');
|
| 1603 |
+
if (pcuReports) {
|
| 1604 |
+
pcuReports.innerHTML = `<div class="text-center">
|
| 1605 |
+
<div class="text-3xl font-black" style="color:var(--cocoa-l)">${pcu.total_pcu || 0}</div>
|
| 1606 |
+
<div class="text-[10px] font-bold text-slate-500 uppercase tracking-widest mt-1">Passenger Car Units</div>
|
| 1607 |
+
</div>`;
|
| 1608 |
+
}
|
| 1609 |
}
|
| 1610 |
|
| 1611 |
// =========== Run Details helpers ===========
|