mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
refactor: replace Load More with Pagination across frontend and backend
- Replace all "Load More" / "Show More" buttons with Pagination components in model-list, bot-compaction, and bot-heartbeat views - Convert backend log APIs (compaction, heartbeat, schedule) from cursor-based (before+limit) to offset+limit pagination with total_count - Update SQL queries to use OFFSET+LIMIT and add COUNT queries - Add shared parseOffsetLimit helper in handler_helpers.go - Regenerate sqlc, Swagger docs, and TypeScript SDK - Clean up unused i18n keys (loadMore, showMore, history.loadMore)
This commit is contained in:
+37
-24
@@ -851,18 +851,19 @@ const docTemplate = `{
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Before timestamp (RFC3339)",
|
||||
"name": "before",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 50,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -2374,18 +2375,19 @@ const docTemplate = `{
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Before timestamp (RFC3339)",
|
||||
"name": "before",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 50,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -3909,18 +3911,19 @@ const docTemplate = `{
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Before timestamp (RFC3339)",
|
||||
"name": "before",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 50,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -4122,18 +4125,19 @@ const docTemplate = `{
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Before timestamp (RFC3339)",
|
||||
"name": "before",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 50,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -10213,6 +10217,9 @@ const docTemplate = `{
|
||||
"items": {
|
||||
"$ref": "#/definitions/compaction.Log"
|
||||
}
|
||||
},
|
||||
"total_count": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -11386,6 +11393,9 @@ const docTemplate = `{
|
||||
"items": {
|
||||
"$ref": "#/definitions/heartbeat.Log"
|
||||
}
|
||||
},
|
||||
"total_count": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -12068,6 +12078,9 @@ const docTemplate = `{
|
||||
"items": {
|
||||
"$ref": "#/definitions/schedule.Log"
|
||||
}
|
||||
},
|
||||
"total_count": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+37
-24
@@ -842,18 +842,19 @@
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Before timestamp (RFC3339)",
|
||||
"name": "before",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 50,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -2365,18 +2366,19 @@
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Before timestamp (RFC3339)",
|
||||
"name": "before",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 50,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -3900,18 +3902,19 @@
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Before timestamp (RFC3339)",
|
||||
"name": "before",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 50,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -4113,18 +4116,19 @@
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Before timestamp (RFC3339)",
|
||||
"name": "before",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 50,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -10204,6 +10208,9 @@
|
||||
"items": {
|
||||
"$ref": "#/definitions/compaction.Log"
|
||||
}
|
||||
},
|
||||
"total_count": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -11377,6 +11384,9 @@
|
||||
"items": {
|
||||
"$ref": "#/definitions/heartbeat.Log"
|
||||
}
|
||||
},
|
||||
"total_count": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -12059,6 +12069,9 @@
|
||||
"items": {
|
||||
"$ref": "#/definitions/schedule.Log"
|
||||
}
|
||||
},
|
||||
"total_count": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+26
-16
@@ -957,6 +957,8 @@ definitions:
|
||||
items:
|
||||
$ref: '#/definitions/compaction.Log'
|
||||
type: array
|
||||
total_count:
|
||||
type: integer
|
||||
type: object
|
||||
compaction.Log:
|
||||
properties:
|
||||
@@ -1723,6 +1725,8 @@ definitions:
|
||||
items:
|
||||
$ref: '#/definitions/heartbeat.Log'
|
||||
type: array
|
||||
total_count:
|
||||
type: integer
|
||||
type: object
|
||||
heartbeat.Log:
|
||||
properties:
|
||||
@@ -2174,6 +2178,8 @@ definitions:
|
||||
items:
|
||||
$ref: '#/definitions/schedule.Log'
|
||||
type: array
|
||||
total_count:
|
||||
type: integer
|
||||
type: object
|
||||
schedule.ListResponse:
|
||||
properties:
|
||||
@@ -3173,15 +3179,16 @@ paths:
|
||||
name: bot_id
|
||||
required: true
|
||||
type: string
|
||||
- description: Before timestamp (RFC3339)
|
||||
in: query
|
||||
name: before
|
||||
type: string
|
||||
- default: 50
|
||||
description: Limit
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- default: 0
|
||||
description: Offset
|
||||
in: query
|
||||
name: offset
|
||||
type: integer
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@@ -4179,15 +4186,16 @@ paths:
|
||||
name: bot_id
|
||||
required: true
|
||||
type: string
|
||||
- description: Before timestamp (RFC3339)
|
||||
in: query
|
||||
name: before
|
||||
type: string
|
||||
- default: 50
|
||||
description: Limit
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- default: 0
|
||||
description: Offset
|
||||
in: query
|
||||
name: offset
|
||||
type: integer
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@@ -5274,15 +5282,16 @@ paths:
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: Before timestamp (RFC3339)
|
||||
in: query
|
||||
name: before
|
||||
type: string
|
||||
- default: 50
|
||||
description: Limit
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- default: 0
|
||||
description: Offset
|
||||
in: query
|
||||
name: offset
|
||||
type: integer
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@@ -5330,15 +5339,16 @@ paths:
|
||||
name: bot_id
|
||||
required: true
|
||||
type: string
|
||||
- description: Before timestamp (RFC3339)
|
||||
in: query
|
||||
name: before
|
||||
type: string
|
||||
- default: 50
|
||||
description: Limit
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- default: 0
|
||||
description: Offset
|
||||
in: query
|
||||
name: offset
|
||||
type: integer
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
|
||||
Reference in New Issue
Block a user