perf: databases protocol required (#9354)

Co-authored-by: feng <1304903146@qq.com>
pull/9355/head
fit2bot 2 years ago committed by GitHub
parent 7ba7d178e5
commit 47cd79ea5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save