Subh775 commited on
Commit
e3ec5d6
·
1 Parent(s): 80e4f92

logo 404 fix..

Browse files
frontend/initial.html CHANGED
@@ -6,7 +6,7 @@
6
  <script>
7
  if (sessionStorage.getItem('funky_run')) {
8
  document.documentElement.style.display = 'none';
9
- fetch('/vehicles.html')
10
  .then(function (r) { return r.text(); })
11
  .then(function (html) {
12
  document.open();
@@ -18,17 +18,17 @@
18
  <meta charset="UTF-8">
19
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
20
  <title>UrbanFlow</title>
21
- <link rel="icon" type="image/png" href="/assets/rf.png">
22
  <script src="https://cdn.tailwindcss.com"></script>
23
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
24
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
25
- <link rel="stylesheet" href="/css/initial.css">
26
  </head>
27
 
28
  <body class="bg-black text-white min-h-screen w-full flex flex-col items-center selection:bg-white selection:text-black">
29
 
30
  <header class="mt-16 flex flex-col items-center flex-shrink-0 w-full z-10">
31
- <img src="/assets/uf_rf.png" alt="UrbanFlow Logo" class="h-44 md:h-52 w-auto object-contain mb-3">
32
  </header>
33
 
34
  <main class="flex-1 w-full max-w-[90rem] mx-auto grid grid-cols-1 lg:grid-cols-12 gap-12 lg:gap-20 px-10 py-6 items-center z-10">
@@ -123,7 +123,7 @@
123
  </div>
124
  </main>
125
 
126
- <script src="/js/initial.js"></script>
127
 
128
  <!-- Onboarding Walkthrough -->
129
  <div id="onboard-overlay" class="onboard-overlay" style="display:none">
 
6
  <script>
7
  if (sessionStorage.getItem('funky_run')) {
8
  document.documentElement.style.display = 'none';
9
+ fetch('vehicles.html')
10
  .then(function (r) { return r.text(); })
11
  .then(function (html) {
12
  document.open();
 
18
  <meta charset="UTF-8">
19
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
20
  <title>UrbanFlow</title>
21
+ <link rel="icon" type="image/png" href="assets/rf.png">
22
  <script src="https://cdn.tailwindcss.com"></script>
23
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
24
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
25
+ <link rel="stylesheet" href="css/initial.css">
26
  </head>
27
 
28
  <body class="bg-black text-white min-h-screen w-full flex flex-col items-center selection:bg-white selection:text-black">
29
 
30
  <header class="mt-16 flex flex-col items-center flex-shrink-0 w-full z-10">
31
+ <img src="assets/uf_rf.png" alt="UrbanFlow Logo" class="h-44 md:h-52 w-auto object-contain mb-3">
32
  </header>
33
 
34
  <main class="flex-1 w-full max-w-[90rem] mx-auto grid grid-cols-1 lg:grid-cols-12 gap-12 lg:gap-20 px-10 py-6 items-center z-10">
 
123
  </div>
124
  </main>
125
 
126
+ <script src="js/initial.js"></script>
127
 
128
  <!-- Onboarding Walkthrough -->
129
  <div id="onboard-overlay" class="onboard-overlay" style="display:none">
frontend/js/initial.js CHANGED
@@ -63,7 +63,7 @@ function uploadFile(file) {
63
 
64
  const xhr = new XMLHttpRequest();
65
  currentXHR = xhr;
66
- xhr.open('POST', '/upload');
67
 
68
  xhr.upload.onprogress = e => {
69
  if (e.lengthComputable) {
@@ -92,7 +92,7 @@ function uploadFile(file) {
92
  bar.style.width = '100%';
93
  pct.innerText = '100%';
94
 
95
- fetch('/config/' + videoId)
96
  .then(r => r.json())
97
  .then(cfg => {
98
  runConfig = cfg;
@@ -129,7 +129,7 @@ function loadFirstFrame() {
129
  }
130
  };
131
 
132
- img.src = '/first-frame/' + videoId;
133
  img.onload = () => {
134
  imgNatW = img.naturalWidth;
135
  imgNatH = img.naturalHeight;
@@ -194,7 +194,7 @@ function startRun() {
194
  line: line,
195
  config: runConfig
196
  }));
197
- window.location.href = '/';
198
  }
199
 
200
  // Onboarding
 
63
 
64
  const xhr = new XMLHttpRequest();
65
  currentXHR = xhr;
66
+ xhr.open('POST', 'upload');
67
 
68
  xhr.upload.onprogress = e => {
69
  if (e.lengthComputable) {
 
92
  bar.style.width = '100%';
93
  pct.innerText = '100%';
94
 
95
+ fetch('config/' + videoId)
96
  .then(r => r.json())
97
  .then(cfg => {
98
  runConfig = cfg;
 
129
  }
130
  };
131
 
132
+ img.src = 'first-frame/' + videoId;
133
  img.onload = () => {
134
  imgNatW = img.naturalWidth;
135
  imgNatH = img.naturalHeight;
 
194
  line: line,
195
  config: runConfig
196
  }));
197
+ window.location.href = './';
198
  }
199
 
200
  // Onboarding
frontend/js/vehicles.js CHANGED
@@ -113,7 +113,7 @@
113
  if (e.key === 'd' || e.key === 'D') {
114
  const vid = document.body.dataset.lastVideoId;
115
  if (vid) {
116
- window.open(`/bundle/${vid}`, '_blank');
117
  showToast('Download started', 'success');
118
  }
119
  }
@@ -168,7 +168,7 @@
168
  details: text,
169
  timestamp: new Date().toISOString()
170
  };
171
- const res = await fetch('/api/feedback', {
172
  method: 'POST',
173
  headers: { 'Content-Type': 'application/json' },
174
  body: JSON.stringify(payload)
@@ -658,14 +658,14 @@
658
 
659
  async function init() {
660
  const raw = sessionStorage.getItem('funky_run');
661
- if (!raw) { window.location.href = '/'; return; }
662
 
663
  _params = JSON.parse(raw);
664
 
665
  // SECURITY: Clear session storage so refresh always redirects home
666
  sessionStorage.removeItem('funky_run');
667
 
668
- const cRes = await fetch('/constants');
669
  const cData = await cRes.json();
670
  MODEL_CLASSES = cData.classes;
671
  BUSINESS_MAP = cData.business_map;
@@ -752,7 +752,8 @@
752
  const videoDuration = _params.config.duration || 10;
753
 
754
  const proto = location.protocol === 'https:' ? 'wss' : 'ws';
755
- const ws = new WebSocket(`${proto}://${location.host}/ws/run`);
 
756
 
757
  ws.onopen = () => {
758
  ws.send(JSON.stringify({
@@ -871,7 +872,7 @@
871
  // Download the full bundle ZIP via direct navigation
872
  setTimeout(() => {
873
  console.log('[UrbanFlow] Fetching ZIP bundle for:', d.video_id);
874
- window.open(`/bundle/${d.video_id}`, '_blank');
875
  }, 1000);
876
  }
877
  });
@@ -960,7 +961,7 @@
960
  };
961
 
962
  async function loadReports(videoId) {
963
- const res = await fetch(`/reports/${videoId}`, { method: 'POST' });
964
  const data = await res.json();
965
  if (!data.files || !data.files.length) return null;
966
 
@@ -973,7 +974,7 @@
973
 
974
  data.files.forEach(name => {
975
  const info = REPORT_LABELS[name] || { title: name, desc: '' };
976
- const url = `/reports/${videoId}/${name}`;
977
  const isVideo = name.endsWith('.mp4');
978
  const isPDF = name.endsWith('.pdf');
979
  const isCSV = name.endsWith('.csv');
 
113
  if (e.key === 'd' || e.key === 'D') {
114
  const vid = document.body.dataset.lastVideoId;
115
  if (vid) {
116
+ window.open(`bundle/${vid}`, '_blank');
117
  showToast('Download started', 'success');
118
  }
119
  }
 
168
  details: text,
169
  timestamp: new Date().toISOString()
170
  };
171
+ const res = await fetch('api/feedback', {
172
  method: 'POST',
173
  headers: { 'Content-Type': 'application/json' },
174
  body: JSON.stringify(payload)
 
658
 
659
  async function init() {
660
  const raw = sessionStorage.getItem('funky_run');
661
+ if (!raw) { window.location.href = './'; return; }
662
 
663
  _params = JSON.parse(raw);
664
 
665
  // SECURITY: Clear session storage so refresh always redirects home
666
  sessionStorage.removeItem('funky_run');
667
 
668
+ const cRes = await fetch('constants');
669
  const cData = await cRes.json();
670
  MODEL_CLASSES = cData.classes;
671
  BUSINESS_MAP = cData.business_map;
 
752
  const videoDuration = _params.config.duration || 10;
753
 
754
  const proto = location.protocol === 'https:' ? 'wss' : 'ws';
755
+ const wsPath = location.pathname.endsWith('/') ? location.pathname : location.pathname + '/';
756
+ const ws = new WebSocket(`${proto}://${location.host}${wsPath}ws/run`);
757
 
758
  ws.onopen = () => {
759
  ws.send(JSON.stringify({
 
872
  // Download the full bundle ZIP via direct navigation
873
  setTimeout(() => {
874
  console.log('[UrbanFlow] Fetching ZIP bundle for:', d.video_id);
875
+ window.open(`bundle/${d.video_id}`, '_blank');
876
  }, 1000);
877
  }
878
  });
 
961
  };
962
 
963
  async function loadReports(videoId) {
964
+ const res = await fetch(`reports/${videoId}`, { method: 'POST' });
965
  const data = await res.json();
966
  if (!data.files || !data.files.length) return null;
967
 
 
974
 
975
  data.files.forEach(name => {
976
  const info = REPORT_LABELS[name] || { title: name, desc: '' };
977
+ const url = `reports/${videoId}/${name}`;
978
  const isVideo = name.endsWith('.mp4');
979
  const isPDF = name.endsWith('.pdf');
980
  const isCSV = name.endsWith('.csv');
frontend/vehicles.html CHANGED
@@ -5,7 +5,7 @@
5
  <meta charset="UTF-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
  <title>UrbanFlow</title>
8
- <link rel="icon" type="image/svg+xml" href="/assets/rf.png">
9
  <script src="https://cdn.tailwindcss.com"></script>
10
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
11
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
@@ -13,7 +13,7 @@
13
  href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Montserrat:wght@400;500;600;700;800;900&display=swap"
14
  rel="stylesheet">
15
  <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
16
- <link rel="stylesheet" href="/css/vehicles.css">
17
  </head>
18
 
19
  <body class="bg-black text-white h-screen w-screen overflow-hidden flex">
@@ -21,7 +21,7 @@
21
  <!-- Sidebar -->
22
  <aside class="w-60 bg-white shadow-xl flex flex-col z-20 flex-shrink-0 border-r border-slate-200 relative">
23
  <div class="h-28 bg-black flex items-center justify-center px-4 my-2 border-b border-slate-800 flex-shrink-0">
24
- <img id="sidebar-logo-top" src="/assets/uf_rf.png" alt="UrbanFlow Logo" class="h-24 w-auto object-contain">
25
  </div>
26
  <nav class="flex-1 px-4 py-4 space-y-1.5 overflow-y-auto text-sm">
27
  <a onclick="switchTab('about')" id="nav-about"
@@ -65,7 +65,7 @@
65
 
66
  <!-- Mobile Navigation (hidden on desktop) -->
67
  <div class="mobile-nav hidden fixed top-0 left-0 right-0 z-30 bg-black border-b border-slate-800 px-2 py-1.5 items-center justify-between">
68
- <img src="/assets/uf_rf.png" alt="UF" class="h-8">
69
  <div class="flex gap-1">
70
  <button onclick="switchTab('about')" class="text-[9px] px-2 py-1 rounded" style="color:#a89f97"><i class="fa-solid fa-circle-info"></i></button>
71
  <button onclick="switchTab('overview')" class="text-[9px] px-2 py-1 rounded" style="color:#a89f97"><i class="fa-solid fa-desktop"></i></button>
@@ -843,7 +843,7 @@
843
 
844
  </main>
845
 
846
- <script src="/js/vehicles.js"></script>
847
  <!-- Privacy Modal -->
848
  <div id="appModal-privacyModal" onclick="if(event.target===this)closeAppModal('privacyModal')"
849
  style="display:none;position:fixed;inset:0;background:rgba(0,0,0,0.85);z-index:9999;align-items:center;justify-content:center;padding:24px">
 
5
  <meta charset="UTF-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
  <title>UrbanFlow</title>
8
+ <link rel="icon" type="image/png" href="assets/rf.png">
9
  <script src="https://cdn.tailwindcss.com"></script>
10
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
11
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
 
13
  href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Montserrat:wght@400;500;600;700;800;900&display=swap"
14
  rel="stylesheet">
15
  <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
16
+ <link rel="stylesheet" href="css/vehicles.css">
17
  </head>
18
 
19
  <body class="bg-black text-white h-screen w-screen overflow-hidden flex">
 
21
  <!-- Sidebar -->
22
  <aside class="w-60 bg-white shadow-xl flex flex-col z-20 flex-shrink-0 border-r border-slate-200 relative">
23
  <div class="h-28 bg-black flex items-center justify-center px-4 my-2 border-b border-slate-800 flex-shrink-0">
24
+ <img id="sidebar-logo-top" src="assets/uf_rf.png" alt="UrbanFlow Logo" class="h-24 w-auto object-contain">
25
  </div>
26
  <nav class="flex-1 px-4 py-4 space-y-1.5 overflow-y-auto text-sm">
27
  <a onclick="switchTab('about')" id="nav-about"
 
65
 
66
  <!-- Mobile Navigation (hidden on desktop) -->
67
  <div class="mobile-nav hidden fixed top-0 left-0 right-0 z-30 bg-black border-b border-slate-800 px-2 py-1.5 items-center justify-between">
68
+ <img src="assets/uf_rf.png" alt="UF" class="h-8">
69
  <div class="flex gap-1">
70
  <button onclick="switchTab('about')" class="text-[9px] px-2 py-1 rounded" style="color:#a89f97"><i class="fa-solid fa-circle-info"></i></button>
71
  <button onclick="switchTab('overview')" class="text-[9px] px-2 py-1 rounded" style="color:#a89f97"><i class="fa-solid fa-desktop"></i></button>
 
843
 
844
  </main>
845
 
846
+ <script src="js/vehicles.js"></script>
847
  <!-- Privacy Modal -->
848
  <div id="appModal-privacyModal" onclick="if(event.target===this)closeAppModal('privacyModal')"
849
  style="display:none;position:fixed;inset:0;background:rgba(0,0,0,0.85);z-index:9999;align-items:center;justify-content:center;padding:24px">