diff --git a/apps/assets/migrations/0003_auto_20180109_2331.py b/apps/assets/migrations/0003_auto_20180109_2331.py index e23610dd2..7034825b4 100644 --- a/apps/assets/migrations/0003_auto_20180109_2331.py +++ b/apps/assets/migrations/0003_auto_20180109_2331.py @@ -2,9 +2,10 @@ import json from functools import reduce + +from django.db import migrations from django.db.models import F -from django.conf import settings -from django.db import migrations, models + from assets.const import AllTypes platforms_data_json = '''[ @@ -664,7 +665,8 @@ platforms_data_json = '''[ "internal": true, "charset": "utf-8", "domain_enabled": true, - "su_enabled": false, + "su_enabled": true, + "su_method: "enable“, "name": "Cisco", "automation": { "ansible_enabled": false, @@ -705,7 +707,8 @@ platforms_data_json = '''[ "internal": true, "charset": "utf-8", "domain_enabled": true, - "su_enabled": false, + "su_enabled": true, + "su_method: "super“, "name": "Huawei", "automation": { "ansible_enabled": false, @@ -746,7 +749,8 @@ platforms_data_json = '''[ "internal": true, "charset": "utf-8", "domain_enabled": true, - "su_enabled": false, + "su_enabled": true, + "su_method: "super_level“, "name": "H3C", "automation": { "ansible_enabled": false, @@ -1093,6 +1097,28 @@ platforms_data_json = '''[ } ] }, + { + "name": "DB2", + "category": "database", + "internal": true, + "type": "db2", + "domain_enabled": true, + "su_enabled": false, + "su_method": null, + "comment": "DB2", + "created_by": "System", + "updated_by": "System", + "protocols": [ + { + "name": "db2", + "port": 50000, + "primary": true, + "required": false, + "default": false, + "setting": {} + } + ] + }, { "category": "web", "type": "website", @@ -1184,6 +1210,29 @@ platforms_data_json = '''[ "setting": {} } ] + }, + { + "name": "ChatGPT", + "internal": true, + "category": "gpt", + "type": "chatgpt", + "domain_enabled": false, + "su_enabled": false, + "comment": "ChatGPT", + "created_by": "System", + "updated_by": "System", + "protocols": [ + { + "name": "chatgpt", + "port": 443, + "primary": true, + "required": false, + "default": false, + "setting": { + "api_mode": "gpt-3.5-turbo" + } + } + ] } ]''' @@ -1199,36 +1248,6 @@ def create_internal_platforms(apps, *args): AllTypes.create_or_update_by_platform_data(platform_data, platform_cls=platform_cls, automation_cls=automation_cls) -def add_chatgpt_platform(apps, schema_editor): - platform_cls = apps.get_model('assets', 'Platform') - automation_cls = apps.get_model('assets', 'PlatformAutomation') - platform = platform_cls.objects.create( - name='ChatGPT', internal=True, category='gpt', type='chatgpt', - domain_enabled=False, su_enabled=False, comment='ChatGPT', - created_by='System', updated_by='System', - ) - platform.protocols.create(name='chatgpt', port=443, primary=True, setting={'api_mode': 'gpt-3.5-turbo'}) - automation_cls.objects.create(ansible_enabled=False, platform=platform) - - -def add_db2_platform(apps, schema_editor): - platform_cls = apps.get_model('assets', 'Platform') - automation_cls = apps.get_model('assets', 'PlatformAutomation') - platform, _ = platform_cls.objects.update_or_create( - name='DB2', defaults={ - 'name': 'DB2', 'category': 'database', - 'internal': True, 'type': 'db2', - 'domain_enabled': True, 'su_enabled': False, - 'su_method': None, 'comment': 'DB2', 'created_by': 'System', - 'updated_by': 'System', 'custom_fields': [] - } - ) - platform.protocols.update_or_create(name='db2', defaults={ - 'name': 'db2', 'port': 50000, 'primary': True, 'setting': {} - }) - automation_cls.objects.update_or_create(platform=platform, defaults={'ansible_enabled': False}) - - def migrate_automation_ansible_remove_account(apps, *args): automation_model = apps.get_model('assets', 'PlatformAutomation') automation_map = { @@ -1262,8 +1281,6 @@ class Migration(migrations.Migration): operations = [ migrations.RunPython(create_internal_platforms), - migrations.RunPython(add_chatgpt_platform), - migrations.RunPython(add_db2_platform), migrations.RunPython(migrate_automation_ansible_remove_account), ] diff --git a/apps/i18n/core/zh/LC_MESSAGES/django.po b/apps/i18n/core/zh/LC_MESSAGES/django.po index 1753a1bfe..1bbbcfbeb 100644 --- a/apps/i18n/core/zh/LC_MESSAGES/django.po +++ b/apps/i18n/core/zh/LC_MESSAGES/django.po @@ -2274,7 +2274,7 @@ msgstr "端口来自地址" msgid "" "This protocol is primary, and it must be set when adding assets. " "Additionally, there can only be one primary protocol." -msgstr "该协议是主要的,添加资产时必须设置。并且只能有一个主要协议" +msgstr "该协议是主要的,添加资产时必须设置,并且只能有一个主要协议" #: assets/serializers/platform.py:92 msgid "This protocol is required, and it must be set when adding assets." diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index 3db746f4d..9c9266fa3 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -701,7 +701,7 @@ "Month": "Month", "More": "More", "MoreActions": "Actions", - "MoveAssetToNode": "Move assets to nodes", + "MoveAssetToNode": "Move assets to node", "MsgSubscribe": "Subscription", "MyAssets": "My assets", "MyTickets": "Submitted", @@ -896,11 +896,11 @@ "RelevantSystemUser": "System user", "RemoteAddr": "Remote address", "Remove": "Remove", - "RemoveAssetFromNode": "Remove asset from node", + "RemoveAssetFromNode": "Remove assets from node", "RemoveSelected": "Remove selected", "RemoveSuccessMsg": "Successfully removed", "Rename": "Rename", - "RenameNode": "Rename nodes", + "RenameNode": "Rename node", "ReplaceNodeAssetsAdminUserWithThis": "Replace asset admin", "Replay": "Playback", "ReplaySession": "Session replay", @@ -1167,7 +1167,7 @@ "TestGatewayHelpMessage": "If nat port mapping is used, please set it to the real port listened to by ssh", "TestGatewayTestConnection": "Test connect to gateway", "TestLdapLoginTitle": "Test ldap user login", - "TestNodeAssetConnectivity": "Test connectivity of asset nodes", + "TestNodeAssetConnectivity": "Test assets connectivity of node", "TestPortErrorMsg": "Port error, please re-enter", "TestSuccessMsg": "Test succeeded", "Thursday": "Thu", diff --git a/apps/i18n/lina/zh.json b/apps/i18n/lina/zh.json index 7197f0333..60083f8f7 100644 --- a/apps/i18n/lina/zh.json +++ b/apps/i18n/lina/zh.json @@ -36,7 +36,7 @@ "AccountGatherTaskList": "账号收集任务", "AccountGatherTaskCreate": "创建账号收集任务", "AccountGatherTaskUpdate": "更新账号收集任务", - "AccountList": "云账号", + "AccountList": "账号", "ChangeCredentials": "改密", "CrontabHelpText": "如果同时设置了 interval 和 crontab,则优先考虑 crontab", "LoginConfirmUser": "确认方式", diff --git a/apps/users/notifications.py b/apps/users/notifications.py index d872483f0..607a4634c 100644 --- a/apps/users/notifications.py +++ b/apps/users/notifications.py @@ -191,7 +191,7 @@ class UserExpirationReminderMsg(UserMessage): class ResetSSHKeyMsg(UserMessage): def get_html_msg(self) -> dict: subject = _('Reset SSH Key') - update_url = urljoin(settings.SITE_URL, '/ui/#/profile/setting/?activeTab=SSHUpdate') + update_url = urljoin(settings.SITE_URL, '/ui/#/profile/password-and-ssh-key/?tab=SSHKey') context = { 'name': self.user.name, 'url': update_url,