Skip to content

Commit

Permalink
fix: filter recommend gpts
Browse files Browse the repository at this point in the history
Signed-off-by: bjwswang <[email protected]>
  • Loading branch information
bjwswang committed Mar 29, 2024
1 parent 8745bc8 commit 472d4d2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
7 changes: 6 additions & 1 deletion apiserver/pkg/gpt/gpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,19 @@ func ListGPT(ctx context.Context, c client.Client, input generated.ListGPTInput)
page := pointer.IntDeref(input.Page, 1)
pageSize := pointer.IntDeref(input.PageSize, 10)
res := &v1alpha1.ApplicationList{}
l := labels.Set{v1alpha1.AppPublicLabelKey: ""}
l := labels.Set{v1alpha1.AppPublicLabelKey: "true"}
// if category is empty,then list recommend apps
if category == "" {
l[v1alpha1.AppRecommendedLabelKey] = "true"
}
if err := c.List(ctx, res, &client.ListOptions{LabelSelector: l.AsSelector(), Namespace: ""}); err != nil {
return nil, err
}
filter := make([]common.ResourceFilter, 0)
if keyword != "" {
filter = append(filter, common.FilterApplicationByKeyword(keyword))
}
// if catetory is not empty,then filter based on category
if category != "" {
filter = append(filter, common.FilterApplicationByCategory(category))
}
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/arcadia/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: arcadia
description: A Helm chart(Also a KubeBB Component) for KubeAGI Arcadia
type: application
version: 0.3.28
version: 0.3.29
appVersion: "0.2.1"

keywords:
Expand Down
3 changes: 3 additions & 0 deletions deploy/charts/arcadia/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ data:
url: https://{{ .Values.gpts.agentportal.ingress.host }}/{{ .Values.gpts.agentportal.ingress.path }}
public_namespace: {{ .Values.gpts.public_namespace }}
categories:
- id: -1
name: "其他"
nameEn: "Other"
- id: 1
name: "通用对话"
nameEn: "General Conversation"
Expand Down
8 changes: 4 additions & 4 deletions deploy/charts/arcadia/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ config:
controller:
# 1: error 3: info 5: debug
loglevel: 3
image: kubeagi/arcadia:v0.2.1
image: kubeagi/arcadia:v0.2.1-20240329-f4655d3
imagePullPolicy: IfNotPresent
resources:
limits:
Expand All @@ -51,7 +51,7 @@ controller:
# related project: https://github.com/kubeagi/arcadia/tree/main/apiserver
apiserver:
loglevel: 3
image: kubeagi/arcadia:v0.2.1
image: kubeagi/arcadia:v0.2.1-20240329-f4655d3
enableplayground: false
port: 8081
ingress:
Expand All @@ -70,7 +70,7 @@ apiserver:
opsconsole:
enabled: true
kubebbEnabled: true
image: kubeagi/ops-console:v0.2.1-20240322-60c9820
image: kubeagi/ops-console:v0.2.1-20240329-9acdda3
ingress:
path: kubeagi-portal-public
host: portal.<replaced-ingress-nginx-ip>.nip.io
Expand All @@ -81,7 +81,7 @@ gpts:
# all gpt resources are public in this namespace
public_namespace: gpts
agentportal:
image: kubeagi/agent-portal:latest
image: kubeagi/agent-portal:v0.1.0-20240329-cc3d5f4
ingress:
path: ""
host: gpts.<replaced-ingress-nginx-ip>.nip.io
Expand Down

0 comments on commit 472d4d2

Please sign in to comment.