feat: multi-type server support — SQL, Redis, Grafana, Prometheus, Telnet, WinRM, RDP/VNC
Full implementation of multi-type server management across GUI and CLI: New clients: SQLClient (MariaDB/MSSQL/PostgreSQL), RedisClient, GrafanaClient, PrometheusClient, TelnetSession, WinRMClient, RemoteDesktopLauncher. New GUI tabs: QueryTab (SQL editor + Treeview), RedisTab (console + history), GrafanaTab (dashboards + alerts), PrometheusTab (PromQL + targets), PowershellTab (PS/CMD), LaunchTab (RDP/VNC external client). Infrastructure: TAB_REGISTRY for conditional tabs per server type, adaptive server_dialog fields, colored type badges in sidebar, status checker for all types (SSH/TCP/SQL/Redis/HTTP), 100+ i18n keys. CLI: ssh.py extended with --sql, --redis, --grafana-*, --prom-*, --ps, --cmd. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Connection factory — stubs for non-SSH connection types.
|
||||
SSH is fully implemented via SSHClientWrapper.
|
||||
Other types are placeholders for future implementation.
|
||||
Connection factory — creates connection wrappers based on server type.
|
||||
Uses lazy imports so missing optional dependencies don't crash the app.
|
||||
"""
|
||||
|
||||
from core.ssh_client import SSHClientWrapper
|
||||
@@ -14,12 +13,32 @@ def create_connection(server: dict, key_path: str = ""):
|
||||
if server_type == "ssh":
|
||||
return SSHClientWrapper(server, key_path)
|
||||
|
||||
# Stubs for future types
|
||||
if server_type == "rdp":
|
||||
raise NotImplementedError("RDP connections — use mstsc.exe or rdesktop")
|
||||
if server_type == "telnet":
|
||||
raise NotImplementedError("Telnet connections — planned")
|
||||
from core.telnet_client import TelnetSession
|
||||
return TelnetSession(server)
|
||||
|
||||
if server_type in ("mariadb", "mssql", "postgresql"):
|
||||
raise NotImplementedError(f"{server_type.upper()} connections — planned")
|
||||
from core.sql_client import SQLClient
|
||||
return SQLClient(server)
|
||||
|
||||
if server_type == "redis":
|
||||
from core.redis_client import RedisClient
|
||||
return RedisClient(server)
|
||||
|
||||
if server_type == "grafana":
|
||||
from core.grafana_client import GrafanaClient
|
||||
return GrafanaClient(server)
|
||||
|
||||
if server_type == "prometheus":
|
||||
from core.prometheus_client import PrometheusClient
|
||||
return PrometheusClient(server)
|
||||
|
||||
if server_type == "winrm":
|
||||
from core.winrm_client import WinRMClient
|
||||
return WinRMClient(server)
|
||||
|
||||
if server_type in ("rdp", "vnc"):
|
||||
from core.remote_desktop import RemoteDesktopLauncher
|
||||
return RemoteDesktopLauncher()
|
||||
|
||||
raise ValueError(f"Unknown server type: {server_type}")
|
||||
|
||||
Reference in New Issue
Block a user