mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-16 02:31:04 +08:00
update: Workflow Template now gets a modifiedAt date, and total version count, from the the Get endpoint.
This commit is contained in:
@@ -31,6 +31,10 @@ func apiWorkflowTemplate(wft *v1.WorkflowTemplate) *api.WorkflowTemplate {
|
||||
Labels: converter.MappingToKeyValue(wft.Labels),
|
||||
}
|
||||
|
||||
if wft.ModifiedAt != nil {
|
||||
res.ModifiedAt = wft.ModifiedAt.UTC().Format(time.RFC3339)
|
||||
}
|
||||
|
||||
if wft.WorkflowExecutionStatisticReport != nil {
|
||||
res.Stats = &api.WorkflowExecutionStatisticReport{
|
||||
Total: wft.WorkflowExecutionStatisticReport.Total,
|
||||
@@ -135,6 +139,12 @@ func (s *WorkflowTemplateServer) GetWorkflowTemplate(ctx context.Context, req *a
|
||||
return nil, err
|
||||
}
|
||||
|
||||
versionsCount, err := client.CountWorkflowTemplateVersions(req.Namespace, req.Uid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
workflowTemplate.Versions = int64(versionsCount)
|
||||
|
||||
return apiWorkflowTemplate(workflowTemplate), nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user