未验证 提交 85f22cc2 编写于 作者: S shaowenchen

add total num for runs

Signed-off-by: Nshaowenchen <mail@chenshaowen.com>
上级 35989d91
......@@ -150,6 +150,12 @@ func (p *Pipeline) ListPipelineRuns() (*devops.PipelineRunList, error) {
klog.Error(err)
return nil, err
}
total, err := p.searchPipelineRunsCount()
if err != nil {
klog.Error(err)
return nil, err
}
pipelineRunList.Total = total
return &pipelineRunList, err
}
......@@ -160,7 +166,7 @@ func (p *Pipeline) searchPipelineRunsCount() (int, error) {
query.Set("depth", "-1")
//formatUrl := fmt.Sprintf(SearchPipelineRunUrl, projectName, pipelineName)
res, err := p.Jenkins.SendPureRequest(ListPipelineRunUrl+query.Encode(), p.HttpParameters)
res, err := p.Jenkins.SendPureRequest(p.Path, p.HttpParameters)
if err != nil {
klog.Error(err)
return 0, err
......
......@@ -81,6 +81,7 @@ type Pipeline struct {
// GetPipeBranchRun & SearchPipelineRuns
type PipelineRunList struct {
Items []PipelineRun `json:"items"`
Total int `json:"totalItems"`
}
// GetBranchPipeRunNodes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册