Add paged logs and monitoring charts

This commit is contained in:
benya
2026-06-05 02:06:14 +03:00
parent 289475c9e3
commit 6b97d59dad
8 changed files with 234 additions and 54 deletions

View File

@@ -839,7 +839,8 @@ func (a *App) handleListCommands(w http.ResponseWriter, r *http.Request) {
}
limit, _ := strconv.Atoi(r.URL.Query().Get("limit"))
commands, found, err := a.store.ListCommands(r.Context(), deviceID, store.CommandListOptions{Limit: limit})
offset, _ := strconv.Atoi(r.URL.Query().Get("offset"))
commands, found, err := a.store.ListCommands(r.Context(), deviceID, store.CommandListOptions{Limit: limit, Offset: offset})
if err != nil {
writeError(w, http.StatusInternalServerError, "failed to load commands")
return
@@ -1243,9 +1244,11 @@ func (a *App) handleCloseRemoteSession(w http.ResponseWriter, r *http.Request) {
func (a *App) handleListAuditEvents(w http.ResponseWriter, r *http.Request) {
limit, _ := strconv.Atoi(r.URL.Query().Get("limit"))
offset, _ := strconv.Atoi(r.URL.Query().Get("offset"))
events, err := a.store.ListAuditEvents(r.Context(), store.AuditListOptions{
DeviceID: r.URL.Query().Get("device_id"),
Limit: limit,
Offset: offset,
})
if err != nil {
writeError(w, http.StatusInternalServerError, "failed to load audit events")