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
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):

View File

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

View File

@ -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 ""

View File

@ -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",

View File

@ -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 = {

View File

@ -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

View File

@ -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):