add AnchorDay/AnchorHour to appsettings (default: Sun 00:00, user override: Sun 20:00)

This commit is contained in:
Meleki committed 2026-02-22 21:54:35 +01:00
1 parent da327886c4
commit c245e0e374
3 files changed
+7 -5

No files matched your search

+2 -2
View File
@@ -18,8 +18,8 @@ app.UseStaticFiles();
// GET /api/settings // GET /api/settings
app.MapGet("/api/settings", (IConfiguration config) => app.MapGet("/api/settings", (IConfiguration config) =>
{ {
var anchorDay = int.TryParse(config["AnchorDay"], out var d) ? d : 4; // 0=Sun, 4=Thu var anchorDay = int.TryParse(config["AnchorDay"], out var d) ? d : 0;
var anchorHour = int.TryParse(config["AnchorHour"], out var h) ? h : 23; var anchorHour = int.TryParse(config["AnchorHour"], out var h) ? h : 0;
return Results.Ok(new { anchorDay, anchorHour }); return Results.Ok(new { anchorDay, anchorHour });
}); });
+3 -1
View File
@@ -7,5 +7,7 @@
}, },
"AllowedHosts": "*", "AllowedHosts": "*",
"Urls": "http://0.0.0.0:18684", "Urls": "http://0.0.0.0:18684",
"DbPath": "../jsonl-sync/sessions.db" "DbPath": "../jsonl-sync/sessions.db",
"AnchorDay": 0,
"AnchorHour": 0
} }
+2 -2
View File
@@ -9,8 +9,8 @@ const ZOOM_LEVELS = [
const WEEKLY_BUDGET = 500; // $ pro Woche const WEEKLY_BUDGET = 500; // $ pro Woche
// Anchor config - loaded from /api/settings, defaults: Thursday 23:00 // Anchor config - loaded from /api/settings, defaults: Thursday 23:00
let ANCHOR_DAY = 4; // 0=Sun, 1=Mon, ..., 4=Thu let ANCHOR_DAY = 0; // 0=Sun, 1=Mon, ..., 4=Thu
let ANCHOR_HOUR = 23; let ANCHOR_HOUR = 0;
const BAR_COUNT = 50; const BAR_COUNT = 50;
const CHAIN_COLORS = [ const CHAIN_COLORS = [
'#4ade80','#60a5fa','#f97316','#c084fc','#f472b6', '#4ade80','#60a5fa','#f97316','#c084fc','#f472b6',