mirror of https://github.com/jumpserver/jumpserver
perf: 设置 winrm 用户端不可以连接
parent
b2327c0c5a
commit
88afabdd1d
|
@ -94,10 +94,17 @@ class PlatformProtocolSerializer(serializers.ModelSerializer):
|
|||
setting_fields = protocol_settings.get(protocol, {}).get('setting')
|
||||
if not setting_fields:
|
||||
return default_field
|
||||
|
||||
setting_fields = [{'name': k, **v} for k, v in setting_fields.items()]
|
||||
name = '{}ProtocolSettingSerializer'.format(protocol.capitalize())
|
||||
return create_serializer_class(name, setting_fields)()
|
||||
|
||||
def validate(self, cleaned_data):
|
||||
name = cleaned_data.get('name')
|
||||
if name in ['winrm']:
|
||||
cleaned_data['public'] = False
|
||||
return cleaned_data
|
||||
|
||||
def to_file_representation(self, data):
|
||||
return '{name}/{port}'.format(**data)
|
||||
|
||||
|
|
Loading…
Reference in New Issue