From 358e1ea94d18ffdce785fb81f0429c3a7c1291c5 Mon Sep 17 00:00:00 2001 From: logikonline Date: Tue, 20 Jan 2026 23:25:52 -0500 Subject: [PATCH] fix(vault): add pagination support to audit log Replace manual page/pageSize data with proper Pager object in audit handler. Add CreatedUnix and UsedCount fields to Token service struct to support complete token metadata. --- routers/web/repo/vault/vault.go | 6 ++++-- services/vault/vault.go | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/routers/web/repo/vault/vault.go b/routers/web/repo/vault/vault.go index e2baafb886..d5a0207ce5 100644 --- a/routers/web/repo/vault/vault.go +++ b/routers/web/repo/vault/vault.go @@ -362,11 +362,13 @@ func Audit(ctx *context.Context) { return } + pager := context.NewPagination(int(total), pageSize, page, 5) + pager.AddParamFromRequest(ctx.Req) + ctx.Data["PageIsVault"] = true ctx.Data["PageIsVaultAudit"] = true ctx.Data["AuditEntries"] = entries - ctx.Data["Page"] = page - ctx.Data["PageSize"] = pageSize + ctx.Data["Page"] = pager ctx.Data["Total"] = total ctx.Data["CanWrite"] = ctx.Repo.CanWrite(unit.TypeCode) ctx.Data["IsRepoAdmin"] = ctx.Repo.IsAdmin() diff --git a/services/vault/vault.go b/services/vault/vault.go index b3e5f54124..5fe80a9181 100644 --- a/services/vault/vault.go +++ b/services/vault/vault.go @@ -99,8 +99,10 @@ type Token struct { RepoID int64 Description string Scope string + CreatedUnix int64 ExpiresUnix int64 LastUsedUnix int64 + UsedCount int64 IsRevoked bool IsExpired bool }