mirror of https://github.com/jumpserver/jumpserver
Merge pull request #10931 from jumpserver/pr@dev@perf_change_platform
perf: 修改 Platform 约束pull/10942/head
commit
100b1553b6
|
@ -69,10 +69,15 @@ class BaseType(TextChoices):
|
|||
choices = protocol.get('choices', [])
|
||||
if choices == '__self__':
|
||||
choices = [tp]
|
||||
protocols = [
|
||||
{'name': name, **settings.get(name, {})}
|
||||
for name in choices
|
||||
]
|
||||
|
||||
protocols = []
|
||||
for name in choices:
|
||||
protocol = {'name': name, **settings.get(name, {})}
|
||||
setting = protocol.pop('setting', {})
|
||||
setting_values = {k: v.get('default', None) for k, v in setting.items()}
|
||||
protocol['setting'] = setting_values
|
||||
protocols.append(protocol)
|
||||
|
||||
if protocols:
|
||||
protocols[0]['default'] = True
|
||||
return protocols
|
||||
|
|
Loading…
Reference in New Issue