fix: 修复 web gui 支持的数据库

pull/9760/head
Bai 2023-02-24 15:09:17 +08:00 committed by Jiangjie.Bai
parent dbb1ee3a75
commit a1dcef0ba0
1 changed files with 13 additions and 6 deletions

View File

@ -17,17 +17,17 @@ class WebMethod(TextChoices):
@classmethod
def get_methods(cls):
return {
methods = {
Protocol.ssh: [cls.web_cli, cls.web_sftp],
Protocol.telnet: [cls.web_cli],
Protocol.rdp: [cls.web_gui],
Protocol.vnc: [cls.web_gui],
Protocol.mysql: [cls.web_cli, cls.web_gui],
Protocol.mariadb: [cls.web_cli, cls.web_gui],
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.mysql: [cls.web_cli],
Protocol.mariadb: [cls.web_cli],
Protocol.oracle: [cls.web_cli],
Protocol.postgresql: [cls.web_cli],
Protocol.sqlserver: [cls.web_cli],
Protocol.redis: [cls.web_cli],
Protocol.mongodb: [cls.web_cli],
Protocol.clickhouse: [cls.web_cli],
@ -35,6 +35,13 @@ class WebMethod(TextChoices):
Protocol.k8s: [cls.web_cli],
Protocol.http: []
}
if not settings.XPACK_ENABLED:
return methods
web_gui_dbs = [Protocol.mysql, Protocol.mariadb, Protocol.oracle, Protocol.postgresql]
for db in web_gui_dbs:
methods[db].append(cls.web_gui)
return methods
class NativeClient(TextChoices):