feat: update ui
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user