feat: update ui

This commit is contained in:
2025-08-06 11:12:16 +08:00
parent e034a2e54e
commit c4ad0c1dc9
12 changed files with 4983 additions and 226 deletions

View File

@@ -184,6 +184,14 @@ func (r *Renderer) RenderList(c fiber.Ctx, tableName string) error {
return c.Status(http.StatusInternalServerError).SendString("Failed to load table configuration")
}
// Calculate record range
startRecord := int64((data.Page-1)*data.PerPage + 1)
endRecord := startRecord + int64(len(data.Data)) - 1
if data.Total == 0 {
startRecord = 0
endRecord = 0
}
// Prepare template data
templateData := map[string]interface{}{
"Table": tableName,
@@ -199,6 +207,9 @@ func (r *Renderer) RenderList(c fiber.Ctx, tableName string) error {
"SortOrder": sortOrder,
"Tables": tables,
"CurrentPath": c.Path(),
"StartRecord": startRecord,
"EndRecord": endRecord,
"LastUpdate": time.Now().Format("2006-01-02 15:04:05"),
}
// set content-type html