nbroad commited on
Commit
8d5f206
·
verified ·
1 Parent(s): dc3c5d9

Upload templates/dashboard.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. templates/dashboard.html +23 -6
templates/dashboard.html CHANGED
@@ -329,14 +329,14 @@
329
  </div>
330
 
331
  <div class="chart-container">
332
- <h2>Monthly Requests Comparison</h2>
333
  <div class="chart-wrapper">
334
  <canvas id="requestsChart"></canvas>
335
  </div>
336
  </div>
337
 
338
  <div class="chart-container">
339
- <h2>Historical Trends (Last 48 Hours)</h2>
340
  <div class="chart-wrapper">
341
  <canvas id="historicalChart"></canvas>
342
  </div>
@@ -352,7 +352,7 @@
352
  <tr>
353
  <th>Provider</th>
354
  <th>Monthly Requests</th>
355
- <th>HuggingFace Profile</th>
356
  </tr>
357
  </thead>
358
  <tbody id="tableBody">
@@ -674,9 +674,14 @@
674
  x: {
675
  type: 'time',
676
  time: {
677
- unit: 'hour',
678
  displayFormats: {
679
- hour: 'MMM dd HH:mm'
 
 
 
 
 
680
  }
681
  },
682
  title: {
@@ -685,6 +690,10 @@
685
  },
686
  grid: {
687
  color: 'rgba(0, 0, 0, 0.05)'
 
 
 
 
688
  }
689
  },
690
  y: {
@@ -751,7 +760,15 @@
751
  updateStats(data);
752
  updateChart(data);
753
  updateTable(data);
754
- updateHistoricalChart(historicalData.historical_data || {});
 
 
 
 
 
 
 
 
755
 
756
  } catch (error) {
757
  showError('Failed to load provider data. Please try again.');
 
329
  </div>
330
 
331
  <div class="chart-container">
332
+ <h2>Live Comparison of Monthly Requests by Provider</h2>
333
  <div class="chart-wrapper">
334
  <canvas id="requestsChart"></canvas>
335
  </div>
336
  </div>
337
 
338
  <div class="chart-container">
339
+ <h2 id="historicalChartTitle">Historical Trends</h2>
340
  <div class="chart-wrapper">
341
  <canvas id="historicalChart"></canvas>
342
  </div>
 
352
  <tr>
353
  <th>Provider</th>
354
  <th>Monthly Requests</th>
355
+ <th>Hugging Face Profile</th>
356
  </tr>
357
  </thead>
358
  <tbody id="tableBody">
 
674
  x: {
675
  type: 'time',
676
  time: {
677
+ // Let Chart.js automatically determine the best unit
678
  displayFormats: {
679
+ minute: 'HH:mm',
680
+ hour: 'MMM dd HH:mm',
681
+ day: 'MMM dd',
682
+ week: 'MMM dd',
683
+ month: 'MMM yyyy',
684
+ year: 'yyyy'
685
  }
686
  },
687
  title: {
 
690
  },
691
  grid: {
692
  color: 'rgba(0, 0, 0, 0.05)'
693
+ },
694
+ // Use the full range of data
695
+ adapters: {
696
+ date: {}
697
  }
698
  },
699
  y: {
 
760
  updateStats(data);
761
  updateChart(data);
762
  updateTable(data);
763
+ updateHistoricalChart(historicalData);
764
+
765
+ // Update historical chart title with date range
766
+ const titleElement = document.getElementById('historicalChartTitle');
767
+ if (historicalData.data_range && historicalData.data_range !== 'No data') {
768
+ titleElement.textContent = `Historical Trends (${historicalData.data_range})`;
769
+ } else {
770
+ titleElement.textContent = 'Historical Trends';
771
+ }
772
 
773
  } catch (error) {
774
  showError('Failed to load provider data. Please try again.');