Subh775 commited on
Commit
013fa42
·
1 Parent(s): cec4f53

feat: new analysis button in Settings, fix overview tab hidden on load

Browse files
Files changed (1) hide show
  1. frontend/vehicles.html +23 -2
frontend/vehicles.html CHANGED
@@ -754,8 +754,14 @@
754
  </button>
755
  </div>
756
 
757
-
758
-
 
 
 
 
 
 
759
  </div>
760
  </div>
761
 
@@ -1100,6 +1106,16 @@
1100
  if (wrap) wrap.style.display = 'none';
1101
  }
1102
 
 
 
 
 
 
 
 
 
 
 
1103
  function updateBreakdown(classIn, classOut) {
1104
  const container = document.getElementById('class-breakdown');
1105
  const totalAll = sumValues(classIn) + sumValues(classOut);
@@ -1303,6 +1319,11 @@
1303
  infoRow('Real-time Ratio', d.speed_vs_realtime + 'x', 'Processing speed relative to video playback rate.');
1304
 
1305
  if (d.video_id) loadReports(d.video_id);
 
 
 
 
 
1306
  return;
1307
  }
1308
 
 
754
  </button>
755
  </div>
756
 
757
+ <!-- New Analysis Button (visible only after processing completes) -->
758
+ <div class="col-span-3 pb-4 hidden" id="new-analysis-wrap">
759
+ <button onclick="startNewAnalysis()"
760
+ class="w-full py-4 bg-white text-black font-bold text-sm rounded-full hover:bg-neutral-200 active:scale-[0.99] transition flex items-center justify-center gap-2">
761
+ <i class="fa-solid fa-rotate-left text-xs"></i>
762
+ <span>New Analysis</span>
763
+ </button>
764
+ </div>
765
  </div>
766
  </div>
767
 
 
1106
  if (wrap) wrap.style.display = 'none';
1107
  }
1108
 
1109
+ function startNewAnalysis() {
1110
+ sessionStorage.clear();
1111
+ _params = null;
1112
+ [congChart, doughChart, domChart, flowChart].forEach(c => {
1113
+ c.data.labels = [];
1114
+ c.data.datasets[0].data = [];
1115
+ c.update();
1116
+ });
1117
+ window.location.href = '/';
1118
+ }
1119
  function updateBreakdown(classIn, classOut) {
1120
  const container = document.getElementById('class-breakdown');
1121
  const totalAll = sumValues(classIn) + sumValues(classOut);
 
1319
  infoRow('Real-time Ratio', d.speed_vs_realtime + 'x', 'Processing speed relative to video playback rate.');
1320
 
1321
  if (d.video_id) loadReports(d.video_id);
1322
+
1323
+ // Show New Analysis button in Settings
1324
+ const newWrap = document.getElementById('new-analysis-wrap');
1325
+ if (newWrap) newWrap.classList.remove('hidden');
1326
+
1327
  return;
1328
  }
1329