claude-code-cost 0.4.0 → 0.4.1
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/public/app.js +6 -3
- package/public/index.html +4 -4
- package/server.js +1 -1
package/package.json
CHANGED
package/public/app.js
CHANGED
|
@@ -111,7 +111,7 @@ function focusPreviousRow(view) {
|
|
|
111
111
|
if (!selector) return;
|
|
112
112
|
requestAnimationFrame(() => {
|
|
113
113
|
const rows = getVisibleRows();
|
|
114
|
-
const idx = rows.findIndex(r => r.matches(selector));
|
|
114
|
+
const idx = rows.findIndex((r) => r.matches(selector));
|
|
115
115
|
selectRow(idx >= 0 ? idx : 0);
|
|
116
116
|
});
|
|
117
117
|
}
|
|
@@ -149,7 +149,9 @@ function loadSort(view) {
|
|
|
149
149
|
const { field, order } = JSON.parse(raw);
|
|
150
150
|
if (field) sortField = field;
|
|
151
151
|
if (order) sortOrder = order;
|
|
152
|
-
} catch {
|
|
152
|
+
} catch {
|
|
153
|
+
/* ignore */
|
|
154
|
+
}
|
|
153
155
|
}
|
|
154
156
|
}
|
|
155
157
|
|
|
@@ -477,7 +479,8 @@ function renderSessions() {
|
|
|
477
479
|
<th class="${thClass('lastTimestamp')}" onclick="sortBy('lastTimestamp')">Last Active ${sortArrow('lastTimestamp')}</th>
|
|
478
480
|
</tr></thead>
|
|
479
481
|
<tbody>
|
|
480
|
-
${[...sessionsData]
|
|
482
|
+
${[...sessionsData]
|
|
483
|
+
.sort((a, b) => sortCompare(a, b, sortField, sortOrder))
|
|
481
484
|
.map(
|
|
482
485
|
(s) => `
|
|
483
486
|
<tr data-clickable onclick="navigateToDetail('${esc(s.sessionId)}')">
|
package/public/index.html
CHANGED
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
<div>
|
|
82
82
|
<h4 class="shortcut-section">Table</h4>
|
|
83
83
|
<table class="shortcut-table">
|
|
84
|
-
<tr><td><kbd>
|
|
85
|
-
<tr><td><kbd>
|
|
84
|
+
<tr><td><kbd>J</kbd> / <kbd>↓</kbd></td><td>Next row</td></tr>
|
|
85
|
+
<tr><td><kbd>K</kbd> / <kbd>↑</kbd></td><td>Previous row</td></tr>
|
|
86
86
|
<tr><td><kbd>Enter</kbd></td><td>Open selected row</td></tr>
|
|
87
87
|
</table>
|
|
88
88
|
</div>
|
|
89
89
|
<div>
|
|
90
90
|
<h4 class="shortcut-section">Actions</h4>
|
|
91
91
|
<table class="shortcut-table">
|
|
92
|
-
<tr><td><kbd>
|
|
93
|
-
<tr><td><kbd>
|
|
92
|
+
<tr><td><kbd>R</kbd></td><td>Refresh data</td></tr>
|
|
93
|
+
<tr><td><kbd>T</kbd></td><td>Toggle theme</td></tr>
|
|
94
94
|
<tr><td><kbd>?</kbd></td><td>Show this help</td></tr>
|
|
95
95
|
</table>
|
|
96
96
|
</div>
|
package/server.js
CHANGED
|
@@ -538,7 +538,7 @@ async function getProjectSessionsData(encodedPath, days) {
|
|
|
538
538
|
if (cutoff) cutoff.setDate(cutoff.getDate() - days);
|
|
539
539
|
const projects = scanProjectDirs(cutoff);
|
|
540
540
|
const proj = projects.get(encodedPath);
|
|
541
|
-
if (!proj) return [];
|
|
541
|
+
if (!proj) return { sessions: [], daily: [], modelDistribution: [] };
|
|
542
542
|
|
|
543
543
|
const sessions = await loadProjectData(proj.files, pricing);
|
|
544
544
|
const cutoffStr = cutoff ? cutoff.toISOString() : null;
|