Browse Source

perf: 修改组件支持

pull/10943/head
ibuler 1 year ago
parent
commit
4caa704abe
  1. 5
      apps/assets/const/protocol.py
  2. 2
      apps/assets/migrations/0120_auto_20230630_1613.py
  3. 4
      apps/locale/zh/LC_MESSAGES/django.po
  4. 6
      apps/terminal/connect_methods.py

5
apps/assets/const/protocol.py

@ -181,6 +181,11 @@ class Protocol(ChoicesMixin, models.TextChoices):
'type': 'str', 'type': 'str',
'default': 'type=submit', 'default': 'type=submit',
'label': _('Submit selector') 'label': _('Submit selector')
},
'script': {
'type': 'text',
'default': '',
'label': _('Script'),
} }
} }
}, },

2
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', domain_enabled=False, su_enabled=False, comment='ChatGPT',
created_by='System', updated_by='System', 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) automation_cls.objects.create(ansible_enabled=False, platform=platform)

4
apps/locale/zh/LC_MESSAGES/django.po

@ -1399,7 +1399,7 @@ msgstr "忽略证书校验"
#: assets/models/asset/gpt.py:8 #: assets/models/asset/gpt.py:8
msgid "Proxy" msgid "Proxy"
msgstr "" msgstr "代理"
#: assets/models/asset/web.py:9 assets/serializers/asset/info/spec.py:16 #: assets/models/asset/web.py:9 assets/serializers/asset/info/spec.py:16
msgid "Autofill" msgid "Autofill"
@ -1727,7 +1727,7 @@ msgstr ""
#: assets/serializers/asset/gpt.py:23 #: assets/serializers/asset/gpt.py:23
msgid "HTTP proxy" msgid "HTTP proxy"
msgstr "HTTP 代理" msgstr "HTTP(s) 代理"
#: assets/serializers/asset/info/gathered.py:6 #: assets/serializers/asset/info/gathered.py:6
msgid "Vendor" msgid "Vendor"

6
apps/terminal/connect_methods.py

@ -214,6 +214,12 @@ class ConnectMethodUtil:
'support': [Protocol.rdp], 'support': [Protocol.rdp],
'match': 'map' 'match': 'map'
}, },
TerminalType.kael: {
'web_methods': [WebMethod.web_gui],
'listen': [Protocol.http],
'support': [Protocol.chatgpt],
'match': 'm2m'
}
} }
return protocols return protocols

Loading…
Cancel
Save