fix-6: raise ring display cap to 5000 (viewer + Entries clamp); viewer default limit 1000
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017CDMFpFx84pfviCTVuGGhf
This commit is contained in:
@@ -513,7 +513,8 @@ func (s *Server) debugLogBuffer(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
limit := 200
|
limit := 200
|
||||||
if v := r.URL.Query().Get("limit"); v != "" {
|
if v := r.URL.Query().Get("limit"); v != "" {
|
||||||
if n, err := strconv.Atoi(v); err == nil && n > 0 && n <= 1000 {
|
// fix-6: allow up to the ring capacity (5000) so the viewer can pull the full retained window.
|
||||||
|
if n, err := strconv.Atoi(v); err == nil && n > 0 && n <= 5000 {
|
||||||
limit = n
|
limit = n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,8 +79,12 @@ func (lb *LogBuffer) Entries(minLevel string, limit int, after time.Time) ([]Log
|
|||||||
total = lb.pos
|
total = lb.pos
|
||||||
}
|
}
|
||||||
|
|
||||||
if limit <= 0 || limit > 1000 {
|
// fix-6: clamp to the ring's own capacity, not a hardcoded 1000 — a larger ring is useless if the
|
||||||
|
// viewer can never request more than 1000 of it. A missing/invalid limit still defaults to 200.
|
||||||
|
if limit <= 0 {
|
||||||
limit = 200
|
limit = 200
|
||||||
|
} else if limit > lb.size {
|
||||||
|
limit = lb.size
|
||||||
}
|
}
|
||||||
|
|
||||||
levelOrder := levelPriority(minLevel)
|
levelOrder := levelPriority(minLevel)
|
||||||
|
|||||||
@@ -620,7 +620,7 @@ function toggleLogAutoRefresh() {
|
|||||||
}
|
}
|
||||||
function refreshLogs(append) {
|
function refreshLogs(append) {
|
||||||
if (currentLogSource === 'agent') { refreshAgentLogs(); return; }
|
if (currentLogSource === 'agent') { refreshAgentLogs(); return; }
|
||||||
var url = '/api/debug/logs?level=' + currentLogLevel + '&limit=500';
|
var url = '/api/debug/logs?level=' + currentLogLevel + '&limit=1000';
|
||||||
if (append && lastLogTimestamp) url += '&after=' + encodeURIComponent(lastLogTimestamp);
|
if (append && lastLogTimestamp) url += '&after=' + encodeURIComponent(lastLogTimestamp);
|
||||||
fetch(url, {headers: csrfHeaders()}).then(function(r){return r.json()}).then(function(data) {
|
fetch(url, {headers: csrfHeaders()}).then(function(r){return r.json()}).then(function(data) {
|
||||||
if (!data.ok) return;
|
if (!data.ok) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user