fix: correct all-time hours value and update backend limit
This commit is contained in:
@@ -21,8 +21,8 @@ class PostgresHistory:
|
|||||||
end: datetime.datetime,
|
end: datetime.datetime,
|
||||||
limit: int = 2000,
|
limit: int = 2000,
|
||||||
) -> List[Dict]:
|
) -> List[Dict]:
|
||||||
if not 1 <= limit <= 5000:
|
if not 1 <= limit <= 10000:
|
||||||
raise ValueError("limit must be between 1 and 5000")
|
raise ValueError("limit must be between 1 and 10000")
|
||||||
if start >= end:
|
if start >= end:
|
||||||
raise ValueError("start must be before end")
|
raise ValueError("start must be before end")
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,7 @@
|
|||||||
<section class="map-card" id="history-card" style="margin-top:14px;padding:20px">
|
<section class="map-card" id="history-card" style="margin-top:14px;padding:20px">
|
||||||
<div style="display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap">
|
<div style="display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap">
|
||||||
<div><h2 id="history-title" style="margin:0;font-size:1rem">PostgreSQL history</h2><p id="history-status" class="subtitle">Select a RID flow station to load the last 7 days</p></div>
|
<div><h2 id="history-title" style="margin:0;font-size:1rem">PostgreSQL history</h2><p id="history-status" class="subtitle">Select a RID flow station to load the last 7 days</p></div>
|
||||||
<select id="history-range" style="padding:9px 12px;border:1px solid var(--border);border-radius:10px;background:white"><option value="24">24 hours</option><option value="168" selected>7 days</option><option value="720">30 days</option><option value="2160">90 days</option></select>
|
<select id="history-range" style="padding:9px 12px;border:1px solid var(--border);border-radius:10px;background:white"><option value="24">24 hours</option><option value="168" selected>7 days</option><option value="720">30 days</option><option value="2160">90 days</option><option value="876000">All time</option></select>
|
||||||
</div>
|
</div>
|
||||||
<div style="height:260px;margin-top:14px"><canvas id="history-chart" aria-label="Historical water level and discharge chart"></canvas></div>
|
<div style="height:260px;margin-top:14px"><canvas id="history-chart" aria-label="Historical water level and discharge chart"></canvas></div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Reference in New Issue
Block a user