Merge pull request #9162 from jumpserver/pr@dev@feat_clickhouse

feat: 增加clickhouse
pull/9164/head
老广 2022-12-06 17:25:24 +08:00 committed by GitHub
commit b89720017b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -8,6 +8,7 @@ class DatabaseTypes(BaseType):
POSTGRESQL = 'postgresql', 'PostgreSQL'
ORACLE = 'oracle', 'Oracle'
SQLSERVER = 'sqlserver', 'SQLServer'
CLICKHOUSE = 'clickhouse', 'ClickHouse'
MONGODB = 'mongodb', 'MongoDB'
REDIS = 'redis', 'Redis'
@ -54,6 +55,9 @@ class DatabaseTypes(BaseType):
cls.POSTGRESQL: [{'name': 'PostgreSQL'}],
cls.ORACLE: [{'name': 'Oracle'}],
cls.SQLSERVER: [{'name': 'SQLServer'}],
cls.CLICKHOUSE: [
{'name': 'ClickHouse', 'automation': {'ansible_enabled': False}}
],
cls.MONGODB: [{'name': 'MongoDB'}],
cls.REDIS: [{'name': 'Redis'}],
}

View File

@ -15,6 +15,7 @@ class Protocol(ChoicesMixin, models.TextChoices):
oracle = 'oracle', 'Oracle'
postgresql = 'postgresql', 'PostgreSQL'
sqlserver = 'sqlserver', 'SQLServer'
clickhouse = 'clickhouse', 'ClickHouse'
redis = 'redis', 'Redis'
mongodb = 'mongodb', 'MongoDB'
@ -76,6 +77,10 @@ class Protocol(ChoicesMixin, models.TextChoices):
'port': 1433,
'secret_types': ['password'],
},
cls.clickhouse: {
'port': 9000,
'secret_types': ['password'],
},
cls.mongodb: {
'port': 27017,
'secret_types': ['password'],

View File

@ -62,6 +62,7 @@ class WebMethod(TextChoices):
Protocol.oracle: [cls.web_cli, cls.web_gui],
Protocol.postgresql: [cls.web_cli, cls.web_gui],
Protocol.sqlserver: [cls.web_cli, cls.web_gui],
Protocol.clickhouse: [cls.web_cli],
Protocol.redis: [cls.web_cli],
Protocol.mongodb: [cls.web_cli],
@ -192,8 +193,8 @@ class TerminalType(TextChoices):
Protocol.ssh, Protocol.telnet,
Protocol.mysql, Protocol.postgresql,
Protocol.oracle, Protocol.sqlserver,
Protocol.mariadb, Protocol.redis,
Protocol.mongodb, Protocol.k8s,
Protocol.mariadb, Protocol.clickhouse,
Protocol.redis, Protocol.mongodb, Protocol.k8s,
],
'match': 'm2m'
},