Skip to content

Commit

Permalink
feat: 提供 Agent 包管理后台基础接口 (closed #1683)
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 22864
  • Loading branch information
ping15 committed Nov 5, 2024
1 parent a5312b4 commit 7f0cbe9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
10 changes: 5 additions & 5 deletions apps/node_man/tools/gse_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ def compare_version(a, b):
@classmethod
def match_criteria(cls, pkg_version_info, validated_data, filter_keys):
for key in filter_keys:
if key == "os" and validated_data["os"] in pkg_version_info["os_choices"]:
return True
elif key == "cpu_arch" and validated_data["cpu_arch"] in pkg_version_info["cpu_arch_choices"]:
return True
return False
if key == "os" and validated_data["os"] not in pkg_version_info["os_choices"]:
return False
elif key == "cpu_arch" and validated_data["cpu_arch"] not in pkg_version_info["cpu_arch_choices"]:
return False
return True
10 changes: 10 additions & 0 deletions apps/node_man/views/package_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@


class PackageManageOrderingFilterSet(filters.OrderingFilter):
def get_ordering(self, request, queryset, view):
params = request.data.get(self.ordering_param)
if params:
fields = [param.strip() for param in params.split(",")]
ordering = self.remove_invalid_fields(queryset, fields, view, request)
if ordering:
return ordering

return self.get_default_ordering(view)

def filter_queryset(self, request, queryset, view):
ordering = self.get_ordering(request, queryset, view)
if not ordering:
Expand Down
Binary file modified locale/en/LC_MESSAGES/django.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -1029,12 +1029,12 @@ msgstr ""
#: apps/backend/components/collections/plugin.py:1503
#: apps/backend/constants.py:137
msgid "启用"
msgstr "Enable"
msgstr "Enabled"

#: apps/backend/components/collections/plugin.py:1488
#: apps/backend/components/collections/plugin.py:1503
msgid "停用"
msgstr "Disable"
msgstr "Disabled"

#: apps/backend/components/collections/plugin.py:1499
#, python-brace-format
Expand Down

0 comments on commit 7f0cbe9

Please sign in to comment.