mirror of https://github.com/jumpserver/jumpserver
parent
7ba7d178e5
commit
47cd79ea5a
|
@ -58,36 +58,43 @@ class Protocol(ChoicesMixin, models.TextChoices):
|
|||
return {
|
||||
cls.mysql: {
|
||||
'port': 3306,
|
||||
'setting': {},
|
||||
'required': True,
|
||||
'secret_types': ['password'],
|
||||
'setting': {
|
||||
}
|
||||
},
|
||||
cls.mariadb: {
|
||||
'port': 3306,
|
||||
'required': True,
|
||||
'secret_types': ['password'],
|
||||
},
|
||||
cls.postgresql: {
|
||||
'port': 5432,
|
||||
'required': True,
|
||||
'secret_types': ['password'],
|
||||
},
|
||||
cls.oracle: {
|
||||
'port': 1521,
|
||||
'required': True,
|
||||
'secret_types': ['password'],
|
||||
},
|
||||
cls.sqlserver: {
|
||||
'port': 1433,
|
||||
'required': True,
|
||||
'secret_types': ['password'],
|
||||
},
|
||||
cls.clickhouse: {
|
||||
'port': 9000,
|
||||
'required': True,
|
||||
'secret_types': ['password'],
|
||||
},
|
||||
cls.mongodb: {
|
||||
'port': 27017,
|
||||
'required': True,
|
||||
'secret_types': ['password'],
|
||||
},
|
||||
cls.redis: {
|
||||
'port': 6379,
|
||||
'required': True,
|
||||
'secret_types': ['password'],
|
||||
},
|
||||
}
|
||||
|
@ -97,6 +104,7 @@ class Protocol(ChoicesMixin, models.TextChoices):
|
|||
return {
|
||||
cls.k8s: {
|
||||
'port': 443,
|
||||
'required': True,
|
||||
'secret_types': ['token'],
|
||||
},
|
||||
cls.http: {
|
||||
|
|
|
@ -302,8 +302,8 @@ class AllTypes(ChoicesMixin):
|
|||
protocols_data = [p for p in protocols_data if p['name'] in _protocols]
|
||||
for p in protocols_data:
|
||||
setting = _protocols_setting.get(p['name'], {})
|
||||
p['required'] = setting.pop('required', False)
|
||||
p['default'] = setting.pop('default', False)
|
||||
p['required'] = p.pop('required', False)
|
||||
p['default'] = p.pop('default', False)
|
||||
p['setting'] = {**setting, **p.get('setting', {})}
|
||||
|
||||
platform_data = {
|
||||
|
|
Loading…
Reference in New Issue