From 4caa704abe34cb9284c7ab938ce53db9bb116f01 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 11 Jul 2023 17:04:43 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/const/protocol.py | 5 +++++ apps/assets/migrations/0120_auto_20230630_1613.py | 2 +- apps/locale/zh/LC_MESSAGES/django.po | 4 ++-- apps/terminal/connect_methods.py | 6 ++++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/assets/const/protocol.py b/apps/assets/const/protocol.py index 1eff23a49..b2bf254e6 100644 --- a/apps/assets/const/protocol.py +++ b/apps/assets/const/protocol.py @@ -181,6 +181,11 @@ class Protocol(ChoicesMixin, models.TextChoices): 'type': 'str', 'default': 'type=submit', 'label': _('Submit selector') + }, + 'script': { + 'type': 'text', + 'default': '', + 'label': _('Script'), } } }, diff --git a/apps/assets/migrations/0120_auto_20230630_1613.py b/apps/assets/migrations/0120_auto_20230630_1613.py index aa884a217..a5205804b 100644 --- a/apps/assets/migrations/0120_auto_20230630_1613.py +++ b/apps/assets/migrations/0120_auto_20230630_1613.py @@ -12,7 +12,7 @@ def add_chatgpt_platform(apps, schema_editor): domain_enabled=False, su_enabled=False, comment='ChatGPT', created_by='System', updated_by='System', ) - platform.protocols.create(name='chatgpt', port=443, primary=True) + 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) diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index b74c0fc53..f6b13ebb4 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -1399,7 +1399,7 @@ msgstr "忽略证书校验" #: assets/models/asset/gpt.py:8 msgid "Proxy" -msgstr "" +msgstr "代理" #: assets/models/asset/web.py:9 assets/serializers/asset/info/spec.py:16 msgid "Autofill" @@ -1727,7 +1727,7 @@ msgstr "" #: assets/serializers/asset/gpt.py:23 msgid "HTTP proxy" -msgstr "HTTP 代理" +msgstr "HTTP(s) 代理" #: assets/serializers/asset/info/gathered.py:6 msgid "Vendor" diff --git a/apps/terminal/connect_methods.py b/apps/terminal/connect_methods.py index a4901b93c..4a85c2d01 100644 --- a/apps/terminal/connect_methods.py +++ b/apps/terminal/connect_methods.py @@ -214,6 +214,12 @@ class ConnectMethodUtil: 'support': [Protocol.rdp], 'match': 'map' }, + TerminalType.kael: { + 'web_methods': [WebMethod.web_gui], + 'listen': [Protocol.http], + 'support': [Protocol.chatgpt], + 'match': 'm2m' + } } return protocols