perf: 添加配置支持 Lite

pull/12764/head
ibuler 2024-03-04 19:18:26 +08:00
parent 348f67f4a4
commit e57512f4fe
7 changed files with 23 additions and 15 deletions

View File

@ -165,15 +165,19 @@ class AllTypes(ChoicesMixin):
@classmethod @classmethod
def category_types(cls): def category_types(cls):
return ( types = [
(Category.HOST, HostTypes), (Category.HOST, HostTypes),
(Category.DEVICE, DeviceTypes), (Category.DEVICE, DeviceTypes),
(Category.DATABASE, DatabaseTypes), (Category.DATABASE, DatabaseTypes),
# (Category.CLOUD, CloudTypes), ]
# (Category.WEB, WebTypes), if not settings.LITE:
# (Category.GPT, GPTTypes), types.extend([
# (Category.CUSTOM, CustomTypes), (Category.CLOUD, CloudTypes),
) (Category.WEB, WebTypes),
(Category.GPT, GPTTypes),
(Category.CUSTOM, CustomTypes),
])
return types
@classmethod @classmethod
def get_types(cls, exclude_custom=False): def get_types(cls, exclude_custom=False):

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:354a97baa671b72139dd50723e3a460f4d8e6def32c053722bcd2f4e21063c1a oid sha256:37361f83f7fa134e220bc7f0f4cc235d77bf0970a4e5f44a4692542127a433d2
size 2464 size 2463

View File

@ -930,7 +930,7 @@ msgstr ""
#: tickets/models/ticket/general.py:297 users/models/user.py:836 #: tickets/models/ticket/general.py:297 users/models/user.py:836
#: xpack/plugins/cloud/models.py:39 xpack/plugins/cloud/models.py:110 #: xpack/plugins/cloud/models.py:39 xpack/plugins/cloud/models.py:110
msgid "Comment" msgid "Comment"
msgstr "Comment" msgstr "Description"
#: accounts/serializers/account/virtual.py:24 #: accounts/serializers/account/virtual.py:24
msgid "" msgid ""

View File

@ -6,7 +6,7 @@
"AccessKey": "Access Key", "AccessKey": "Access Key",
"Account": "Account", "Account": "Account",
"AccountBackup": "Account Backup", "AccountBackup": "Account Backup",
"AccountChangeSecret": "Account Change Secret", "AccountChangeSecret": "Change Secret",
"AccountGatherList": "Gather Tasks", "AccountGatherList": "Gather Tasks",
"AccountGatherTaskList": "Account Gather", "AccountGatherTaskList": "Account Gather",
"AccountBackupCreate": "Create Account Backup", "AccountBackupCreate": "Create Account Backup",
@ -129,7 +129,7 @@
"AssetPermissionRules": "Authorization Rules", "AssetPermissionRules": "Authorization Rules",
"AssetPermissionUpdate": "Update the Asset 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", "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", "Assets": "Assets",
"AssetsAmount": "Asset amount", "AssetsAmount": "Asset amount",
"AssetsTotal": "Asset Total", "AssetsTotal": "Asset Total",
@ -233,7 +233,7 @@
"CloudAccountList": "Cloud Accounts", "CloudAccountList": "Cloud Accounts",
"CloudCreate": "Create a Asset - Cloud", "CloudCreate": "Create a Asset - Cloud",
"CloudSource": "Sync Source", "CloudSource": "Sync Source",
"CloudSync": "Cloud Sync", "CloudSync": "Cloud Provider",
"CloudUpdate": "Update the Asset - Cloud", "CloudUpdate": "Update the Asset - Cloud",
"Cluster": "Cluster", "Cluster": "Cluster",
"CollectionSucceed": "Collection successful", "CollectionSucceed": "Collection successful",
@ -373,7 +373,7 @@
"Domain": "Domain", "Domain": "Domain",
"DomainCreate": "Create a Domain", "DomainCreate": "Create a Domain",
"DomainEnabled": "Enable 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", "DomainList": "Domains",
"DomainUpdate": "Update the Domain", "DomainUpdate": "Update the Domain",
"Download": "Download", "Download": "Download",
@ -1117,7 +1117,7 @@
"TwoAssignee": "Subscribe to Authorization ID", "TwoAssignee": "Subscribe to Authorization ID",
"TwoAssigneeType": "Secondary Recipient Type", "TwoAssigneeType": "Secondary Recipient Type",
"Type": "Type", "Type": "Type",
"TypeTree": "Type Tree", "TypeTree": "Type tree",
"Types": "Type", "Types": "Type",
"UCloud": "UCloud UHost", "UCloud": "UCloud UHost",
"UnSyncCount": "Not Synced", "UnSyncCount": "Not Synced",

View File

@ -607,7 +607,8 @@ class Config(dict):
'FILE_UPLOAD_SIZE_LIMIT_MB': 200, 'FILE_UPLOAD_SIZE_LIMIT_MB': 200,
'TICKET_APPLY_ASSET_SCOPE': 'all' 'TICKET_APPLY_ASSET_SCOPE': 'all',
'LITE': False
} }
old_config_map = { old_config_map = {

View File

@ -229,3 +229,5 @@ VIRTUAL_APP_ENABLED = CONFIG.VIRTUAL_APP_ENABLED
FILE_UPLOAD_SIZE_LIMIT_MB = CONFIG.FILE_UPLOAD_SIZE_LIMIT_MB FILE_UPLOAD_SIZE_LIMIT_MB = CONFIG.FILE_UPLOAD_SIZE_LIMIT_MB
TICKET_APPLY_ASSET_SCOPE = CONFIG.TICKET_APPLY_ASSET_SCOPE TICKET_APPLY_ASSET_SCOPE = CONFIG.TICKET_APPLY_ASSET_SCOPE
LITE = CONFIG.LITE

View File

@ -58,6 +58,7 @@ class PrivateSettingSerializer(PublicSettingSerializer):
CHAT_AI_ENABLED = serializers.BooleanField() CHAT_AI_ENABLED = serializers.BooleanField()
GPT_MODEL = serializers.CharField() GPT_MODEL = serializers.CharField()
FILE_UPLOAD_SIZE_LIMIT_MB = serializers.IntegerField() FILE_UPLOAD_SIZE_LIMIT_MB = serializers.IntegerField()
LITE = serializers.BooleanField()
class ServerInfoSerializer(serializers.Serializer): class ServerInfoSerializer(serializers.Serializer):