Query history: Add from and to parameters (#48212)
* Query history: Add from and to parameters * Update docs/sources/http_api/query_history.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/http_api/query_history.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/http_api/query_history.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Implement Grafana relative time range Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
This commit is contained in:
co-authored by
achatterjee-grafana
parent
17eca4505c
commit
b92fe0e0f5
@@ -2,7 +2,6 @@ package queryhistory
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -47,8 +46,8 @@ func (s QueryHistoryService) searchQueries(ctx context.Context, user *models.Sig
|
||||
var dtos []QueryHistoryDTO
|
||||
var allQueries []interface{}
|
||||
|
||||
if len(query.DatasourceUIDs) == 0 {
|
||||
return QueryHistorySearchResult{}, errors.New("no selected data source for query history search")
|
||||
if query.To <= 0 {
|
||||
query.To = time.Now().Unix()
|
||||
}
|
||||
|
||||
if query.Page <= 0 {
|
||||
|
||||
Reference in New Issue
Block a user