Initial commit: ServerManager GUI application
CustomTkinter desktop app for managing remote servers. Features: SSH terminal, SFTP file transfer, key management, background status monitoring, server CRUD with dark theme. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
25
core/connection_factory.py
Normal file
25
core/connection_factory.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
Connection factory — stubs for non-SSH connection types.
|
||||
SSH is fully implemented via SSHClientWrapper.
|
||||
Other types are placeholders for future implementation.
|
||||
"""
|
||||
|
||||
from core.ssh_client import SSHClientWrapper
|
||||
|
||||
|
||||
def create_connection(server: dict, key_path: str = ""):
|
||||
"""Create a connection wrapper based on server type."""
|
||||
server_type = server.get("type", "ssh")
|
||||
|
||||
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")
|
||||
if server_type in ("mariadb", "mssql", "postgresql"):
|
||||
raise NotImplementedError(f"{server_type.upper()} connections — planned")
|
||||
|
||||
raise ValueError(f"Unknown server type: {server_type}")
|
||||
Reference in New Issue
Block a user