Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def get_dashboard_data(db_path=DB_PATH):

// Hourly aggregation (filtered by model + range, then bucketed by UTC hour)
const hourlySrc = (rawData.hourly_by_model || []).filter(r =>
selectedModels.has(r.model) && (!cutoff || r.day >= cutoff)
selectedModels.has(r.model) && (!start || r.day >= start) && (!end || r.day <= end)
);
const hourlyAgg = aggregateHourly(hourlySrc, hourlyTZ);

Expand Down Expand Up @@ -1242,13 +1242,15 @@ def log_message(self, format, *args):
pass

def do_GET(self):
if self.path in ("/", "/index.html"):
from urllib.parse import urlparse
parsed_path = urlparse(self.path).path
if parsed_path in ("/", "/index.html"):
self.send_response(200)
self.send_header("Content-Type", "text/html; charset=utf-8")
self.end_headers()
self.wfile.write(HTML_TEMPLATE.encode("utf-8"))

elif self.path == "/api/data":
elif parsed_path == "/api/data":
data = get_dashboard_data()
body = json.dumps(data).encode("utf-8")
self.send_response(200)
Expand Down
2 changes: 2 additions & 0 deletions scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ def scan(projects_dir=None, projects_dirs=None, db_path=DB_PATH, verbose=True):
meta = new_session_metas[session_id]
if timestamp and (not meta["last_timestamp"] or timestamp > meta["last_timestamp"]):
meta["last_timestamp"] = timestamp
if timestamp and (not meta["first_timestamp"] or timestamp < meta["first_timestamp"]):
meta["first_timestamp"] = timestamp

if rtype == "assistant":
msg = record.get("message", {})
Expand Down