From e57512f4fe0a02ac5fa73e864e319bb99a3f9287 Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 4 Mar 2024 19:18:26 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=B7=BB=E5=8A=A0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20Lite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/const/types.py | 16 ++++++++++------ apps/i18n/core/en/LC_MESSAGES/django.mo | 4 ++-- apps/i18n/core/en/LC_MESSAGES/django.po | 2 +- apps/i18n/lina/en.json | 10 +++++----- apps/jumpserver/conf.py | 3 ++- apps/jumpserver/settings/custom.py | 2 ++ apps/settings/serializers/public.py | 1 + 7 files changed, 23 insertions(+), 15 deletions(-) diff --git a/apps/assets/const/types.py b/apps/assets/const/types.py index 6f03839d5..81c5f190f 100644 --- a/apps/assets/const/types.py +++ b/apps/assets/const/types.py @@ -165,15 +165,19 @@ class AllTypes(ChoicesMixin): @classmethod def category_types(cls): - return ( + types = [ (Category.HOST, HostTypes), (Category.DEVICE, DeviceTypes), (Category.DATABASE, DatabaseTypes), - # (Category.CLOUD, CloudTypes), - # (Category.WEB, WebTypes), - # (Category.GPT, GPTTypes), - # (Category.CUSTOM, CustomTypes), - ) + ] + if not settings.LITE: + types.extend([ + (Category.CLOUD, CloudTypes), + (Category.WEB, WebTypes), + (Category.GPT, GPTTypes), + (Category.CUSTOM, CustomTypes), + ]) + return types @classmethod def get_types(cls, exclude_custom=False): diff --git a/apps/i18n/core/en/LC_MESSAGES/django.mo b/apps/i18n/core/en/LC_MESSAGES/django.mo index 120248679..8c4e1af5b 100644 --- a/apps/i18n/core/en/LC_MESSAGES/django.mo +++ b/apps/i18n/core/en/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:354a97baa671b72139dd50723e3a460f4d8e6def32c053722bcd2f4e21063c1a -size 2464 +oid sha256:37361f83f7fa134e220bc7f0f4cc235d77bf0970a4e5f44a4692542127a433d2 +size 2463 diff --git a/apps/i18n/core/en/LC_MESSAGES/django.po b/apps/i18n/core/en/LC_MESSAGES/django.po index 052658858..3fd20902b 100644 --- a/apps/i18n/core/en/LC_MESSAGES/django.po +++ b/apps/i18n/core/en/LC_MESSAGES/django.po @@ -930,7 +930,7 @@ msgstr "" #: tickets/models/ticket/general.py:297 users/models/user.py:836 #: xpack/plugins/cloud/models.py:39 xpack/plugins/cloud/models.py:110 msgid "Comment" -msgstr "Comment" +msgstr "Description" #: accounts/serializers/account/virtual.py:24 msgid "" diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index 4d2d5dac6..8d5424925 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -6,7 +6,7 @@ "AccessKey": "Access Key", "Account": "Account", "AccountBackup": "Account Backup", - "AccountChangeSecret": "Account Change Secret", + "AccountChangeSecret": "Change Secret", "AccountGatherList": "Gather Tasks", "AccountGatherTaskList": "Account Gather", "AccountBackupCreate": "Create Account Backup", @@ -129,7 +129,7 @@ "AssetPermissionRules": "Authorization Rules", "AssetPermissionUpdate": "Update the Asset Authorization Rules", "AssetProtocolHelpText": "The protocols supported by the assets are restricted by the platform, click the settings button to view the protocol settings. If updates are required, please update the platform", - "AssetTree": "Asset Tree", + "AssetTree": "Asset tree", "Assets": "Assets", "AssetsAmount": "Asset amount", "AssetsTotal": "Asset Total", @@ -233,7 +233,7 @@ "CloudAccountList": "Cloud Accounts", "CloudCreate": "Create a Asset - Cloud", "CloudSource": "Sync Source", - "CloudSync": "Cloud Sync", + "CloudSync": "Cloud Provider", "CloudUpdate": "Update the Asset - Cloud", "Cluster": "Cluster", "CollectionSucceed": "Collection successful", @@ -373,7 +373,7 @@ "Domain": "Domain", "DomainCreate": "Create a Domain", "DomainEnabled": "Enable Domain", - "DomainHelpMessage": "Domain function is designed to solve the problem that some environments (such as: hybrid cloud) cannot be directly connected, and a new function is added. The principle is to log in through the gateway server. JMS => Domain Gateway => Target Assets.", + "DomainHelpMessage": "Domain function is designed to solve the problem that some environments (such as: hybrid cloud) cannot be directly connected, and a new function is added. The principle is to log in through the gateway server. Server -> Domain Gateway -> Target Assets.", "DomainList": "Domains", "DomainUpdate": "Update the Domain", "Download": "Download", @@ -1117,7 +1117,7 @@ "TwoAssignee": "Subscribe to Authorization ID", "TwoAssigneeType": "Secondary Recipient Type", "Type": "Type", - "TypeTree": "Type Tree", + "TypeTree": "Type tree", "Types": "Type", "UCloud": "UCloud UHost", "UnSyncCount": "Not Synced", diff --git a/apps/jumpserver/conf.py b/apps/jumpserver/conf.py index 9f869ace6..031083ff0 100644 --- a/apps/jumpserver/conf.py +++ b/apps/jumpserver/conf.py @@ -607,7 +607,8 @@ class Config(dict): 'FILE_UPLOAD_SIZE_LIMIT_MB': 200, - 'TICKET_APPLY_ASSET_SCOPE': 'all' + 'TICKET_APPLY_ASSET_SCOPE': 'all', + 'LITE': False } old_config_map = { diff --git a/apps/jumpserver/settings/custom.py b/apps/jumpserver/settings/custom.py index ed5cc61a9..856d9aa1b 100644 --- a/apps/jumpserver/settings/custom.py +++ b/apps/jumpserver/settings/custom.py @@ -229,3 +229,5 @@ VIRTUAL_APP_ENABLED = CONFIG.VIRTUAL_APP_ENABLED FILE_UPLOAD_SIZE_LIMIT_MB = CONFIG.FILE_UPLOAD_SIZE_LIMIT_MB TICKET_APPLY_ASSET_SCOPE = CONFIG.TICKET_APPLY_ASSET_SCOPE + +LITE = CONFIG.LITE diff --git a/apps/settings/serializers/public.py b/apps/settings/serializers/public.py index 278764c65..054733667 100644 --- a/apps/settings/serializers/public.py +++ b/apps/settings/serializers/public.py @@ -58,6 +58,7 @@ class PrivateSettingSerializer(PublicSettingSerializer): CHAT_AI_ENABLED = serializers.BooleanField() GPT_MODEL = serializers.CharField() FILE_UPLOAD_SIZE_LIMIT_MB = serializers.IntegerField() + LITE = serializers.BooleanField() class ServerInfoSerializer(serializers.Serializer):