Skip to content

Commit

Permalink
fix currentPage
Browse files Browse the repository at this point in the history
  • Loading branch information
tqh7678 committed Jan 13, 2025
1 parent 62491f1 commit e5a2935
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# 2.37 (2025-01-13)

- 修复 grafana 内部初始化 currentPage 的问题。

# 2.36 (2024-11-25)

- 支持 v4 签名,提供更高的安全性。
Expand Down
4 changes: 4 additions & 0 deletions dist/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# 2.37 (2025-01-13)

- 修复 grafana 内部初始化 currentPage 的问题。

# 2.36 (2024-11-25)

- 支持 v4 签名,提供更高的安全性。
Expand Down
Binary file modified dist/gpx_log-service-datasource_darwin_amd64
Binary file not shown.
Binary file modified dist/gpx_log-service-datasource_darwin_arm64
Binary file not shown.
Binary file modified dist/gpx_log-service-datasource_linux_amd64
Binary file not shown.
Binary file modified dist/gpx_log-service-datasource_linux_arm
Binary file not shown.
Binary file modified dist/gpx_log-service-datasource_linux_arm64
Binary file not shown.
Binary file modified dist/gpx_log-service-datasource_windows_amd64.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions dist/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
}
],
"screenshots": [],
"version": "2.36",
"updated": "2024-11-26"
"version": "2.37",
"updated": "2025-01-13"
},
"dependencies": {
"grafanaDependency": ">=7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aliyun-log-service-datasource",
"version": "2.36",
"version": "2.37",
"description": "Aliyun log service datasource (backend version)",
"scripts": {
"build": "grafana-toolkit plugin:build && mage",
Expand Down
6 changes: 5 additions & 1 deletion pkg/sls-plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,11 @@ func (ds *SlsDatasource) QueryLogs(ch chan Result, query backend.DataQuery, clie
queryCount := ds.GetQueryCount(queryInfo)
getLogsResp := &sls.GetLogsResponse{}
for i := 0; i < int(queryCount); i++ {
offset := (queryInfo.CurrentPage - 1) * queryInfo.LogsPerPage
currentPage := queryInfo.CurrentPage
if currentPage <= 0 {
currentPage = 1
}
offset := (currentPage - 1) * queryInfo.LogsPerPage
getLogsReq := &sls.GetLogRequest{
From: from,
To: to,
Expand Down

0 comments on commit e5a2935

Please sign in to comment.