mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-09-27 10:02:10 +08:00
Merge pull request #884 from Vafilor/feat/filtering.updates
feat: updated workflow/workspace fields to allow some related field queries
This commit is contained in:
@@ -2396,12 +2396,19 @@ func (c *Client) UpdateWorkflowExecutionMetrics(namespace, uid string, metrics M
|
||||
|
||||
// ListWorkflowExecutionsField loads all of the distinct field values for workflow executions
|
||||
func (c *Client) ListWorkflowExecutionsField(namespace, field string) (value []string, err error) {
|
||||
if field != "name" {
|
||||
columnName := ""
|
||||
|
||||
switch field {
|
||||
case "name":
|
||||
columnName = "we.name"
|
||||
break
|
||||
case "templateName":
|
||||
columnName = "wt.name"
|
||||
break
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported field '%v'", field)
|
||||
}
|
||||
|
||||
columnName := fmt.Sprintf("we.%v", field)
|
||||
|
||||
sb := sb.Select(columnName).
|
||||
Distinct().
|
||||
From("workflow_executions we").
|
||||
|
Reference in New Issue
Block a user