From c22f88ae42f65a00129e7ced00584f2b525295da Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 27 Mar 2024 17:50:44 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/serializers/asset/common.py | 2 +- apps/assets/serializers/domain.py | 2 +- apps/assets/serializers/platform.py | 32 +++++++++++++++---------- apps/i18n/lina/en.json | 7 +++--- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/apps/assets/serializers/asset/common.py b/apps/assets/serializers/asset/common.py index 150b69b38..2e2025dcf 100644 --- a/apps/assets/serializers/asset/common.py +++ b/apps/assets/serializers/asset/common.py @@ -125,7 +125,7 @@ class AssetSerializer(BulkOrgResourceModelSerializer, ResourceLabelsMixin, Writa category = LabeledChoiceField(choices=Category.choices, read_only=True, label=_('Category')) type = LabeledChoiceField(choices=AllTypes.choices(), read_only=True, label=_('Type')) protocols = AssetProtocolsSerializer(many=True, required=False, label=_('Protocols'), default=()) - accounts = AssetAccountSerializer(many=True, required=False, allow_null=True, write_only=True, label=_('Account')) + accounts = AssetAccountSerializer(many=True, required=False, allow_null=True, write_only=True, label=_('Accounts')) nodes_display = serializers.ListField(read_only=False, required=False, label=_("Node path")) _accounts = None diff --git a/apps/assets/serializers/domain.py b/apps/assets/serializers/domain.py index 3fa0c6c02..ccb278145 100644 --- a/apps/assets/serializers/domain.py +++ b/apps/assets/serializers/domain.py @@ -15,7 +15,7 @@ __all__ = ['DomainSerializer', 'DomainWithGatewaySerializer', 'DomainListSeriali class DomainSerializer(ResourceLabelsMixin, BulkOrgResourceModelSerializer): gateways = ObjectRelatedField( - many=True, required=False, label=_('Gateway'), read_only=True, + many=True, required=False, label=_('Gateways'), read_only=True, ) assets_amount = serializers.IntegerField(label=_('Assets amount'), read_only=True) diff --git a/apps/assets/serializers/platform.py b/apps/assets/serializers/platform.py index 969ee3c9e..7f50513e2 100644 --- a/apps/assets/serializers/platform.py +++ b/apps/assets/serializers/platform.py @@ -30,30 +30,36 @@ class PlatformAutomationSerializer(serializers.ModelSerializer): ] extra_kwargs = { # 启用资产探测 - "ping_enabled": {"label": _("Ping enabled"), "help_text": _("Enable asset detection")}, - "ping_method": {"label": _("Ping method")}, - "gather_facts_enabled": { - "label": _("Gather facts enabled"), - "help_text": _("Enable asset facts collection") + "ping_enabled": {"label": _("Ping enabled"), }, + "ping_method": {"label": _("Ping method"), "help_text": _("Enable asset detection")}, + "gather_facts_enabled": {"label": _("Gather facts enabled"), }, + "gather_facts_method": { + "label": _("Gather facts method"), + "help_text": _("Enable asset information collection") }, - "gather_facts_method": {"label": _("Gather facts method")}, - "verify_account_enabled": { - "label": _("Verify account enabled"), + "verify_account_method": { + "label": _("Verify account method"), "help_text": _("Enable account verification") }, - "verify_account_method": {"label": _("Verify account method")}, "change_secret_enabled": { "label": _("Change secret enabled"), + }, + "change_secret_method": { + "label": _("Change secret method"), "help_text": _("Enable account secret auto change") }, - "change_secret_method": {"label": _("Change secret method")}, - "push_account_enabled": {"label": _("Push account enabled"), "help_text": _("Enable account auto push")}, - "push_account_method": {"label": _("Push account method")}, + "push_account_enabled": {"label": _("Push account enabled"), }, + "push_account_method": { + "label": _("Push account method"), + "help_text": _("Enable account auto push") + }, "gather_accounts_enabled": { "label": _("Gather accounts enabled"), + }, + "gather_accounts_method": { + "label": _("Gather accounts method"), "help_text": _("Enable account collection") }, - "gather_accounts_method": {"label": _("Gather accounts method")}, } diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index a9a9563d1..a60766b8a 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -1040,12 +1040,13 @@ "StrategyHelpTips": "Identify the unique attributes of assets (such as platforms) based on priority of strategies; when an asset's attribute (like nodes) can be configured to multiple, all Actions of the strategies will be executed.", "StrategyList": "Policy List", "StrategyUpdate": "Update the Policy", - "SuEnabled": "Enable SU", - "SuFrom": "SU From", + "SuEnabled": "Enable switch", + "SuFrom": "Switch From", "Submit": "Submit", "Success": "Success", "SuccessAsset": "Successful Assets", "SuccessfulOperation": "Action successful", + "AddInDetailText": "After successful creation or update, add to the details", "Summary(success/total)": " Overview( Successful/Total )", "Sunday": "Sunday", "SuperAdmin": "Super Administrator", @@ -1197,7 +1198,7 @@ "UserProfile": "Profile", "UserSession": "Asset Sessions", "UserSetting": "Preference", - "UserSwitchFrom": "SU from", + "UserSwitchFrom": "Switch from", "UserUpdate": "Update the User", "Username": "Username", "UsernamePlaceholder": "Please Enter Username",