diff --git a/apps/application/api/application_api.py b/apps/application/api/application_api.py index f1a0c952e..f59ddf5b7 100644 --- a/apps/application/api/application_api.py +++ b/apps/application/api/application_api.py @@ -88,6 +88,13 @@ class ApplicationQueryAPI(APIMixin): type=OpenApiTypes.STR, location='query', required=False, + ), + OpenApiParameter( + name="publish_status", + description=_("Publish status") + '(published|unpublished)', + type=OpenApiTypes.STR, + location='query', + required=False, ) ] diff --git a/apps/application/serializers/application.py b/apps/application/serializers/application.py index 52386639a..ca4cf5dc4 100644 --- a/apps/application/serializers/application.py +++ b/apps/application/serializers/application.py @@ -284,6 +284,9 @@ class ApplicationQueryRequest(serializers.Serializer): folder_id = serializers.CharField(required=False, label=_("folder id")) name = serializers.CharField(required=False, label=_('Application Name')) desc = serializers.CharField(required=False, label=_("Application Description")) + publish_status = serializers.ChoiceField(required=False, label=_("Publish status"), + choices=[('published', _("Published")), + ('unpublished', _("Unpublished"))]) user_id = serializers.UUIDField(required=False, label=_("User ID")) @@ -311,7 +314,11 @@ class Query(serializers.Serializer): user_id = self.data.get('user_id') desc = instance.get('desc') name = instance.get('name') + publish_status = instance.get("publish_status") create_user = instance.get('create_user') + if publish_status is not None: + is_publish = True if publish_status == "published" else False + application_query_set = application_query_set.filter(is_publish=is_publish) if workspace_id is not None: folder_query_set = folder_query_set.filter(workspace_id=workspace_id) application_query_set = application_query_set.filter(workspace_id=workspace_id) diff --git a/apps/locales/en_US/LC_MESSAGES/django.po b/apps/locales/en_US/LC_MESSAGES/django.po index 19e9268c8..60597ad5f 100644 --- a/apps/locales/en_US/LC_MESSAGES/django.po +++ b/apps/locales/en_US/LC_MESSAGES/django.po @@ -8549,4 +8549,13 @@ msgid "Failed to get WeCom department users" msgstr "" msgid "Failed to get WeCom user info" +msgstr "" + +msgid "Publish status" +msgstr "" + +msgid "Unpublished" +msgstr "" + +msgid "Published" msgstr "" \ No newline at end of file diff --git a/apps/locales/zh_CN/LC_MESSAGES/django.po b/apps/locales/zh_CN/LC_MESSAGES/django.po index 6fd7a152f..2c78c0bf7 100644 --- a/apps/locales/zh_CN/LC_MESSAGES/django.po +++ b/apps/locales/zh_CN/LC_MESSAGES/django.po @@ -8675,4 +8675,13 @@ msgid "Failed to get WeCom department users" msgstr "获取企业微信部门用户失败" msgid "Failed to get WeCom user info" -msgstr "获取企业微信用户信息失败" \ No newline at end of file +msgstr "获取企业微信用户信息失败" + +msgid "Publish status" +msgstr "发布状态" + +msgid "Unpublished" +msgstr "未发布" + +msgid "Published" +msgstr "已发布" \ No newline at end of file diff --git a/apps/locales/zh_Hant/LC_MESSAGES/django.po b/apps/locales/zh_Hant/LC_MESSAGES/django.po index b6ce6a056..48ed67d0c 100644 --- a/apps/locales/zh_Hant/LC_MESSAGES/django.po +++ b/apps/locales/zh_Hant/LC_MESSAGES/django.po @@ -8676,3 +8676,12 @@ msgstr "獲取 WeCom 部門用戶失敗" msgid "Failed to get WeCom user info" msgstr "獲取 WeCom 用戶詳情失敗" + +msgid "Publish status" +msgstr "發佈狀態" + +msgid "Unpublished" +msgstr "未發佈" + +msgid "Published" +msgstr "已發佈" \ No newline at end of file diff --git a/ui/src/locales/lang/en-US/common.ts b/ui/src/locales/lang/en-US/common.ts index 8e7c47951..bef1ebe2f 100644 --- a/ui/src/locales/lang/en-US/common.ts +++ b/ui/src/locales/lang/en-US/common.ts @@ -4,6 +4,9 @@ export default { createSuccess: 'Successful', copy: 'Copy', copySuccess: 'Successful', + publishStatus: 'Publish Status', + published: 'Published', + unpublished: 'Unpublished', copyError: 'Copy Failed', save: 'Save', saveSuccess: 'Successful', @@ -93,7 +96,8 @@ export default { notFound: { title: '404', NoService: 'Currently unable to access services', - NoPermission: 'The current user does not have permission to access, please contact the administrator', + NoPermission: + 'The current user does not have permission to access, please contact the administrator', operate: 'Back to Home', }, custom: 'Custom', diff --git a/ui/src/locales/lang/zh-CN/common.ts b/ui/src/locales/lang/zh-CN/common.ts index 7f3d3de83..4da4ccce1 100644 --- a/ui/src/locales/lang/zh-CN/common.ts +++ b/ui/src/locales/lang/zh-CN/common.ts @@ -4,6 +4,9 @@ export default { createSuccess: '创建成功', copy: '复制', copySuccess: '复制成功', + publishStatus: '发布状态', + published: '已发布', + unpublished: '未发布', copyError: '复制失败', save: '保存', saveSuccess: '保存成功', @@ -97,7 +100,7 @@ export default { notFound: { title: '404', NoService: '暂时无法访问服务', - NoPermission:'当前用户暂无权限访问,请联系管理员', + NoPermission: '当前用户暂无权限访问,请联系管理员', operate: '返回首页', }, custom: '自定义', diff --git a/ui/src/locales/lang/zh-Hant/common.ts b/ui/src/locales/lang/zh-Hant/common.ts index b9bc6f239..c2c52601b 100644 --- a/ui/src/locales/lang/zh-Hant/common.ts +++ b/ui/src/locales/lang/zh-Hant/common.ts @@ -4,6 +4,9 @@ export default { createSuccess: '創建成功', copy: '複製', copySuccess: '複製成功', + publishStatus: '發佈狀態', + published: '已發佈', + unpublished: '未發佈', copyError: '複製失敗', save: '儲存', saveSuccess: '儲存成功', diff --git a/ui/src/views/application/index.vue b/ui/src/views/application/index.vue index e161f33d1..36daff5c5 100644 --- a/ui/src/views/application/index.vue +++ b/ui/src/views/application/index.vue @@ -28,6 +28,8 @@ + + + + + + @@ -333,6 +346,7 @@ const search_type = ref('name') const search_form = ref({ name: '', create_user: '', + publish_status: undefined, }) const user_options = ref([])