ccusage-ui 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccusage-ui",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "main": "server.js",
5
5
  "bin": {
6
6
  "ccusage-ui": "server.js"
package/public/index.html CHANGED
@@ -587,14 +587,14 @@
587
587
  } else if (currentMetric === 'cost') {
588
588
  // Subscription plan benchmarks - higher tiers first
589
589
  if (currentView === 'monthly') {
590
- drawLine(200, '#ff3b30', '$200 Max');
591
- drawLine(100, '#ff9500', '$100 Pro');
592
- drawLine(20, '#34c759', '$20 (Free tier value)');
590
+ drawLine(200, '#ff3b30', '$200 Max (20x)');
591
+ drawLine(100, '#ff9500', '$100 Max (5x)');
592
+ drawLine(20, '#34c759', '$20 Pro');
593
593
  } else {
594
594
  // Daily cost benchmarks - higher tiers first
595
595
  drawLine(6.7, 'rgba(255, 59, 48, 0.5)', '$200 Max (~$6.7/day)');
596
- drawLine(3.3, 'rgba(255, 149, 0, 0.5)', '$100 Pro (~$3.3/day)');
597
- drawLine(0.67, 'rgba(52, 199, 89, 0.5)', '$20/mo (~$0.67/day)');
596
+ drawLine(3.3, 'rgba(255, 149, 0, 0.5)', '$100 Max (~$3.3/day)');
597
+ drawLine(0.67, 'rgba(52, 199, 89, 0.5)', '$20 Pro (~$0.67/day)');
598
598
  }
599
599
  }
600
600
  }
@@ -703,9 +703,9 @@
703
703
  const ctx = document.getElementById('modelChart').getContext('2d');
704
704
  if (modelChart) modelChart.destroy();
705
705
 
706
- // Aggregate costs by model from the last 30 days of daily data
706
+ // Aggregate costs by model from the most recent 30 days
707
707
  const modelCosts = {};
708
- dailyData.slice(-30).forEach(day => {
708
+ [...dailyData].sort((a, b) => b.date.localeCompare(a.date)).slice(0, 30).forEach(day => {
709
709
  if (day.modelBreakdowns) {
710
710
  day.modelBreakdowns.forEach(m => {
711
711
  const name = m.modelName.split('-').slice(0, 2).join(' ');
@@ -735,8 +735,8 @@
735
735
  function renderTable() {
736
736
  const tbody = document.querySelector('#dataTable tbody');
737
737
  tbody.innerHTML = '';
738
- // Show last 10 days reversed
739
- const recent = [...dailyData].reverse().slice(0, 10);
738
+ // Sort by date descending (newest first) and take top 10
739
+ const recent = [...dailyData].sort((a, b) => b.date.localeCompare(a.date)).slice(0, 10);
740
740
 
741
741
  recent.forEach(d => {
742
742
  const tr = document.createElement('tr');