VigneshVS2005 commited on
Commit
841a4fe
·
1 Parent(s): 1b2c3a0

Fix login lock: Handled missing Florence references that crashed JS, and manually forced SQLite admin creation.

Browse files
Files changed (2) hide show
  1. static/app.js +13 -12
  2. vqa.db +0 -0
static/app.js CHANGED
@@ -2,7 +2,7 @@
2
  let appState = {
3
  username: '',
4
  logs: [],
5
- stats: { total: 0, local: 0, yolo: 0, gemini: 0, groq: 0, hf_boss: 0, florence: 0 },
6
  geminiEnabled: true
7
  };
8
 
@@ -141,13 +141,15 @@ function setupEventListeners() {
141
  setupVoiceFeatures();
142
 
143
  // Admin Toggle
144
- els.toggleGemini.addEventListener('change', (e) => {
145
- appState.geminiEnabled = e.target.checked;
146
- els.geminiOption.disabled = !appState.geminiEnabled;
147
- if (!appState.geminiEnabled && els.modelSelector.value === 'gemini') {
148
- els.modelSelector.value = 'local';
149
- }
150
- });
 
 
151
 
152
  // Log search & Refresh
153
  els.logSearch.addEventListener('input', (e) => renderLogs(e.target.value));
@@ -271,8 +273,8 @@ function setupVoiceFeatures() {
271
  document.querySelectorAll('.tts-btn').forEach(btn => {
272
  btn.addEventListener('click', (e) => {
273
  const targetId = e.currentTarget.dataset.target;
274
- const textToRead = document.getElementById(targetId).innerText;
275
- speak(textToRead);
276
  });
277
  });
278
 
@@ -428,8 +430,7 @@ async function fetchLogs() {
428
  appState.stats.yolo = appState.logs.filter(l => ['yolo', 'local_yolo'].includes(l.model.toLowerCase())).length;
429
  appState.stats.gemini = appState.logs.filter(l => ['gemini', 'external'].includes(l.model.toLowerCase())).length;
430
  appState.stats.groq = appState.logs.filter(l => l.model.toLowerCase().includes('groq')).length;
431
- appState.stats.hf_boss = appState.logs.filter(l => l.model.toLowerCase().includes('hf_boss') || l.model.toLowerCase().includes('boss')).length;
432
- appState.stats.florence = appState.logs.filter(l => l.model.toLowerCase().includes('florence') || l.model.toLowerCase().includes('fusion')).length;
433
 
434
  updateDashboardView();
435
  } catch(err) {
 
2
  let appState = {
3
  username: '',
4
  logs: [],
5
+ stats: { total: 0, local: 0, yolo: 0, gemini: 0, groq: 0, hf_boss: 0 },
6
  geminiEnabled: true
7
  };
8
 
 
141
  setupVoiceFeatures();
142
 
143
  // Admin Toggle
144
+ if (els.toggleGemini) {
145
+ els.toggleGemini.addEventListener('change', (e) => {
146
+ appState.geminiEnabled = e.target.checked;
147
+ if (els.geminiOption) els.geminiOption.disabled = !appState.geminiEnabled;
148
+ if (!appState.geminiEnabled && els.modelSelector.value === 'gemini') {
149
+ els.modelSelector.value = 'local';
150
+ }
151
+ });
152
+ }
153
 
154
  // Log search & Refresh
155
  els.logSearch.addEventListener('input', (e) => renderLogs(e.target.value));
 
273
  document.querySelectorAll('.tts-btn').forEach(btn => {
274
  btn.addEventListener('click', (e) => {
275
  const targetId = e.currentTarget.dataset.target;
276
+ const targetEl = document.getElementById(targetId);
277
+ if (targetEl) speak(targetEl.innerText);
278
  });
279
  });
280
 
 
430
  appState.stats.yolo = appState.logs.filter(l => ['yolo', 'local_yolo'].includes(l.model.toLowerCase())).length;
431
  appState.stats.gemini = appState.logs.filter(l => ['gemini', 'external'].includes(l.model.toLowerCase())).length;
432
  appState.stats.groq = appState.logs.filter(l => l.model.toLowerCase().includes('groq')).length;
433
+ appState.stats.hf_boss = appState.logs.filter(l => l.model.toLowerCase().includes('hf_boss') || l.model.toLowerCase().includes('boss') || l.model.toLowerCase().includes('qwen')).length;
 
434
 
435
  updateDashboardView();
436
  } catch(err) {
vqa.db ADDED
Binary file (12.3 kB). View file