claude-roi 0.4.0 → 0.5.0
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 +1 -1
- package/src/dashboard.html +6 -1
- package/src/metrics.js +6 -0
package/package.json
CHANGED
package/src/dashboard.html
CHANGED
|
@@ -1352,6 +1352,7 @@
|
|
|
1352
1352
|
<div class="meta-info">
|
|
1353
1353
|
<span class="badge" id="date-range"></span>
|
|
1354
1354
|
<span class="badge">All data stays local</span>
|
|
1355
|
+
<span class="badge">No tracking, no telemetry</span>
|
|
1355
1356
|
</div>
|
|
1356
1357
|
</header>
|
|
1357
1358
|
|
|
@@ -1516,7 +1517,11 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|
|
1516
1517
|
|
|
1517
1518
|
function render() {
|
|
1518
1519
|
const d = DATA;
|
|
1519
|
-
|
|
1520
|
+
const fmtDate = iso => new Date(iso).toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' });
|
|
1521
|
+
const dateLabel = (d.meta.startDate && d.meta.endDate)
|
|
1522
|
+
? `${fmtDate(d.meta.startDate)} – ${fmtDate(d.meta.endDate)}`
|
|
1523
|
+
: `Last ${d.meta.daysAnalyzed} days`;
|
|
1524
|
+
document.getElementById('date-range').textContent = dateLabel;
|
|
1520
1525
|
const summary = d.summary;
|
|
1521
1526
|
const t = d.tokenAnalytics;
|
|
1522
1527
|
|
package/src/metrics.js
CHANGED
|
@@ -573,6 +573,12 @@ export function computeMetrics(correlatedSessions, organicCommits, commitsByRepo
|
|
|
573
573
|
meta: {
|
|
574
574
|
generatedAt: new Date().toISOString(),
|
|
575
575
|
daysAnalyzed: days,
|
|
576
|
+
startDate: correlatedSessions.length > 0
|
|
577
|
+
? new Date(Math.min(...correlatedSessions.map(s => new Date(s.startTime).getTime()))).toISOString()
|
|
578
|
+
: null,
|
|
579
|
+
endDate: correlatedSessions.length > 0
|
|
580
|
+
? new Date(Math.max(...correlatedSessions.map(s => new Date(s.startTime).getTime()))).toISOString()
|
|
581
|
+
: null,
|
|
576
582
|
defaultBranches: Object.fromEntries(
|
|
577
583
|
Object.entries(commitsByRepo).map(([repo, a]) => [repo.split('/').pop(), a.defaultBranch]).filter(([, b]) => b)
|
|
578
584
|
),
|