mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-17 16:31:28 +00:00
perf: Suggestion api
This commit is contained in:
parent
7dfb31840e
commit
41658af8fd
@ -8,6 +8,7 @@ from rest_framework.request import Request
|
|||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
|
|
||||||
from common.const.http import POST, PUT
|
from common.const.http import POST, PUT
|
||||||
|
from orgs.models import Organization
|
||||||
from orgs.utils import current_org
|
from orgs.utils import current_org
|
||||||
|
|
||||||
__all__ = ['SuggestionMixin', 'RenderToJsonMixin']
|
__all__ = ['SuggestionMixin', 'RenderToJsonMixin']
|
||||||
@ -25,7 +26,12 @@ class SuggestionMixin:
|
|||||||
@action(methods=['get'], detail=False, url_path='suggestions')
|
@action(methods=['get'], detail=False, url_path='suggestions')
|
||||||
def match(self, request, *args, **kwargs):
|
def match(self, request, *args, **kwargs):
|
||||||
queryset = self.get_queryset()
|
queryset = self.get_queryset()
|
||||||
if not request.user.orgs.filter(id=current_org.id).exists():
|
org_id = str(current_org.id)
|
||||||
|
if (
|
||||||
|
not request.user.is_superuser and
|
||||||
|
org_id != Organization.ROOT_ID and
|
||||||
|
not request.user.orgs.filter(id=org_id).exists()
|
||||||
|
):
|
||||||
queryset = queryset.none()
|
queryset = queryset.none()
|
||||||
|
|
||||||
queryset = self.filter_queryset(queryset)
|
queryset = self.filter_queryset(queryset)
|
||||||
|
@ -646,7 +646,7 @@
|
|||||||
"HistoryDate": "日付",
|
"HistoryDate": "日付",
|
||||||
"HistoryPassword": "過去のパスワード",
|
"HistoryPassword": "過去のパスワード",
|
||||||
"HistoryRecord": "履歴記録",
|
"HistoryRecord": "履歴記録",
|
||||||
"Host": "資産",
|
"Host": "ホスト",
|
||||||
"HostCreate": "資産-ホストの作成",
|
"HostCreate": "資産-ホストの作成",
|
||||||
"HostDeployment": "リリースマシンのデプロイ",
|
"HostDeployment": "リリースマシンのデプロイ",
|
||||||
"HostUpdate": "資産-ホストの更新",
|
"HostUpdate": "資産-ホストの更新",
|
||||||
|
@ -641,7 +641,7 @@
|
|||||||
"HistoryDate": "날짜",
|
"HistoryDate": "날짜",
|
||||||
"HistoryPassword": "역사 비밀번호",
|
"HistoryPassword": "역사 비밀번호",
|
||||||
"HistoryRecord": "역사 기록",
|
"HistoryRecord": "역사 기록",
|
||||||
"Host": "자산",
|
"Host": "호스트",
|
||||||
"HostCreate": "자산 생성 - 호스트",
|
"HostCreate": "자산 생성 - 호스트",
|
||||||
"HostDeployment": "배포 장비 배포",
|
"HostDeployment": "배포 장비 배포",
|
||||||
"HostUpdate": "자산 업데이트 - 호스트",
|
"HostUpdate": "자산 업데이트 - 호스트",
|
||||||
|
@ -642,7 +642,7 @@
|
|||||||
"HistoryDate": " Data",
|
"HistoryDate": " Data",
|
||||||
"HistoryPassword": "Senhas anteriores",
|
"HistoryPassword": "Senhas anteriores",
|
||||||
"HistoryRecord": "Histórico",
|
"HistoryRecord": "Histórico",
|
||||||
"Host": "Ativos",
|
"Host": "Host",
|
||||||
"HostCreate": "Criar Ativo - Host",
|
"HostCreate": "Criar Ativo - Host",
|
||||||
"HostDeployment": "Deploy da máquina de produção",
|
"HostDeployment": "Deploy da máquina de produção",
|
||||||
"HostUpdate": "Atualização de ativos - host",
|
"HostUpdate": "Atualização de ativos - host",
|
||||||
|
@ -643,7 +643,7 @@
|
|||||||
"HistoryDate": "Дата",
|
"HistoryDate": "Дата",
|
||||||
"HistoryPassword": "История паролей",
|
"HistoryPassword": "История паролей",
|
||||||
"HistoryRecord": "История записей",
|
"HistoryRecord": "История записей",
|
||||||
"Host": "Хост",
|
"Host": "Хост.",
|
||||||
"HostCreate": "Создать актив - хост",
|
"HostCreate": "Создать актив - хост",
|
||||||
"HostDeployment": "Развертывание машины публикации",
|
"HostDeployment": "Развертывание машины публикации",
|
||||||
"HostUpdate": "Обновить актив - хост",
|
"HostUpdate": "Обновить актив - хост",
|
||||||
|
@ -641,7 +641,7 @@
|
|||||||
"HistoryDate": "日期",
|
"HistoryDate": "日期",
|
||||||
"HistoryPassword": "历史密码",
|
"HistoryPassword": "历史密码",
|
||||||
"HistoryRecord": "历史记录",
|
"HistoryRecord": "历史记录",
|
||||||
"Host": "资产",
|
"Host": "主机",
|
||||||
"HostCreate": "创建资产-主机",
|
"HostCreate": "创建资产-主机",
|
||||||
"HostDeployment": "发布机部署",
|
"HostDeployment": "发布机部署",
|
||||||
"HostUpdate": "更新资产-主机",
|
"HostUpdate": "更新资产-主机",
|
||||||
|
@ -646,7 +646,7 @@
|
|||||||
"HistoryDate": "日期",
|
"HistoryDate": "日期",
|
||||||
"HistoryPassword": "歷史密碼",
|
"HistoryPassword": "歷史密碼",
|
||||||
"HistoryRecord": "歷史紀錄",
|
"HistoryRecord": "歷史紀錄",
|
||||||
"Host": "資產",
|
"Host": "主機",
|
||||||
"HostCreate": "創建資產-主機",
|
"HostCreate": "創建資產-主機",
|
||||||
"HostDeployment": "發布機部署",
|
"HostDeployment": "發布機部署",
|
||||||
"HostUpdate": "更新資產-主機",
|
"HostUpdate": "更新資產-主機",
|
||||||
|
Loading…
Reference in New Issue
Block a user