Really-amin commited on
Commit
776a600
Β·
verified Β·
1 Parent(s): 187dce3

Upload 43 files

Browse files
Files changed (3) hide show
  1. index.html +5 -5
  2. static/css/main.css +8 -0
  3. static/js/app.js +41 -9
index.html CHANGED
@@ -14,11 +14,11 @@
14
  <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
15
 
16
  <!-- Styles -->
17
- <link rel="stylesheet" href="/static/css/main.css?v=4">
18
- <link rel="stylesheet" href="/static/css/toast.css?v=4">
19
- <script src="/static/js/trading-pairs-loader.js?v=4" defer></script>
20
- <script src="/static/js/toast.js?v=4" defer></script>
21
- <script src="/static/js/app.js?v=4" defer></script>
22
 
23
  <!-- Favicon -->
24
  <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>πŸš€</text></svg>">
 
14
  <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
15
 
16
  <!-- Styles -->
17
+ <link rel="stylesheet" href="/static/css/main.css?v=5">
18
+ <link rel="stylesheet" href="/static/css/toast.css?v=5">
19
+ <script src="/static/js/trading-pairs-loader.js?v=5" defer></script>
20
+ <script src="/static/js/toast.js?v=5" defer></script>
21
+ <script src="/static/js/app.js?v=5" defer></script>
22
 
23
  <!-- Favicon -->
24
  <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>πŸš€</text></svg>">
static/css/main.css CHANGED
@@ -726,6 +726,14 @@ table td {
726
  padding: 12px;
727
  text-align: left;
728
  border-bottom: 1px solid var(--border);
 
 
 
 
 
 
 
 
729
  }
730
 
731
  table th {
 
726
  padding: 12px;
727
  text-align: left;
728
  border-bottom: 1px solid var(--border);
729
+ white-space: nowrap;
730
+ }
731
+
732
+ table td:nth-child(3),
733
+ table td:nth-child(5),
734
+ table td:nth-child(6) {
735
+ font-family: 'JetBrains Mono', monospace;
736
+ font-size: 14px;
737
  }
738
 
739
  table th {
static/js/app.js CHANGED
@@ -230,6 +230,9 @@ function loadTabData(tabId) {
230
  case 'settings':
231
  loadSettings();
232
  break;
 
 
 
233
  default:
234
  console.log('No specific loader for tab:', tabId);
235
  }
@@ -1579,19 +1582,48 @@ function updateStatusCards(summary) {
1579
 
1580
  async function refreshDiagnosticStatus() {
1581
  try {
1582
- // Get current status from /api/diagnostics/health or similar
1583
- const response = await fetch('/api/health');
1584
- const healthData = await response.json();
1585
-
1586
- // For now, just update the last test time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1587
  const lastRun = localStorage.getItem('lastDiagnosticRun');
1588
- document.getElementById('last-test-value').textContent =
1589
- lastRun ? new Date(lastRun).toLocaleString() : 'Never';
 
 
1590
 
1591
- showToast('βœ… Status refreshed', 'success');
1592
  } catch (error) {
1593
  console.error('Error refreshing status:', error);
1594
- showToast('❌ Failed to refresh status', 'error');
1595
  }
1596
  }
1597
 
 
230
  case 'settings':
231
  loadSettings();
232
  break;
233
+ case 'diagnostics':
234
+ refreshDiagnosticStatus();
235
+ break;
236
  default:
237
  console.log('No specific loader for tab:', tabId);
238
  }
 
1582
 
1583
  async function refreshDiagnosticStatus() {
1584
  try {
1585
+ // Get models status to determine transformers and HF hub status
1586
+ const modelsResponse = await fetch('/api/models/status');
1587
+ if (modelsResponse.ok) {
1588
+ const modelsData = await modelsResponse.json();
1589
+
1590
+ // Update status cards
1591
+ const transformersStatusEl = document.getElementById('transformers-status-value');
1592
+ const hfStatusEl = document.getElementById('hf-status-value');
1593
+ const modelsLoadedEl = document.getElementById('models-status-value');
1594
+
1595
+ if (transformersStatusEl) {
1596
+ const transformersAvailable = modelsData.transformers_available || false;
1597
+ transformersStatusEl.innerHTML = transformersAvailable ?
1598
+ '<span style="color: #10b981;">βœ… Available</span>' :
1599
+ '<span style="color: #ef4444;">❌ Not Available</span>';
1600
+ }
1601
+
1602
+ if (hfStatusEl) {
1603
+ const hfMode = modelsData.hf_mode || 'off';
1604
+ const isConnected = hfMode !== 'off';
1605
+ hfStatusEl.innerHTML = isConnected ?
1606
+ '<span style="color: #10b981;">βœ… Connected (' + hfMode + ')</span>' :
1607
+ '<span style="color: #f59e0b;">⚠️ Offline Mode</span>';
1608
+ }
1609
+
1610
+ if (modelsLoadedEl) {
1611
+ const modelsLoaded = modelsData.models_loaded || 0;
1612
+ modelsLoadedEl.textContent = modelsLoaded;
1613
+ }
1614
+ }
1615
+
1616
+ // Update the last test time
1617
  const lastRun = localStorage.getItem('lastDiagnosticRun');
1618
+ const lastTestEl = document.getElementById('last-test-value');
1619
+ if (lastTestEl) {
1620
+ lastTestEl.textContent = lastRun ? new Date(lastRun).toLocaleString() : 'Never';
1621
+ }
1622
 
1623
+ getToast().success('Status refreshed');
1624
  } catch (error) {
1625
  console.error('Error refreshing status:', error);
1626
+ getToast().error('Failed to refresh status');
1627
  }
1628
  }
1629