diff --git a/frontend/src/components/ProxmoxPanel.jsx b/frontend/src/components/ProxmoxPanel.jsx
index b4d64a1..f19a55f 100644
--- a/frontend/src/components/ProxmoxPanel.jsx
+++ b/frontend/src/components/ProxmoxPanel.jsx
@@ -6,7 +6,7 @@ import TerminalModal from './TerminalModal'
import {
X, Cpu, MemoryStick, HardDrive, Clock, Network, Server, Monitor,
Container, Database, FolderTree, Settings, Download, Trash2, Copy, Check,
- MonitorSmartphone, Terminal, Cable, ExternalLink,
+ MonitorSmartphone, Terminal, Cable, ExternalLink, Plus, Unplug,
} from 'lucide-react'
const buildTabs = (hasPBS) => [
@@ -679,8 +679,8 @@ function TunnelTab({ agentId, agent, webguiPort = 8006 }) {
const [customHost, setCustomHost] = useState('127.0.0.1')
const [customPort, setCustomPort] = useState('')
const [error, setError] = useState('')
+ const [sshCopied, setSshCopied] = useState(null)
const [terminalOpen, setTerminalOpen] = useState(false)
- const [copiedCmd, setCopiedCmd] = useState(false)
const backendHost = useSettingsStore.getState().getBackendHost()
@@ -709,9 +709,16 @@ function TunnelTab({ agentId, agent, webguiPort = 8006 }) {
const resp = await api.openTunnel(agentId, targetHost, targetPort)
const data = resp?.data || resp
loadTunnels()
- if (targetPort === webguiPort && data?.proxy_port) {
+ if (data?.proxy_port) {
setTimeout(() => {
- window.open(`https://${backendHost}:${data.proxy_port}`, '_blank')
+ if (targetPort === webguiPort) {
+ window.open(`https://${backendHost}:${data.proxy_port}`, '_blank')
+ } else if (targetPort === 22) {
+ const cmd = `ssh root@${backendHost} -p ${data.proxy_port}`
+ navigator.clipboard.writeText(cmd).catch(() => {})
+ setSshCopied(data.proxy_port)
+ setTimeout(() => setSshCopied(null), 4000)
+ }
}, 1000)
}
return data
@@ -739,23 +746,13 @@ function TunnelTab({ agentId, agent, webguiPort = 8006 }) {
setCustomPort('')
}
- const sshTunnel = tunnels.find(t => t.target_port === 22)
- const sshCmd = sshTunnel ? `ssh root@${backendHost} -p ${sshTunnel.proxy_port}` : null
-
- const copySSHCmd = () => {
- if (sshCmd) {
- navigator.clipboard.writeText(sshCmd)
- setCopiedCmd(true)
- setTimeout(() => setCopiedCmd(false), 2000)
- }
- }
-
return (
{terminalOpen && (
setTerminalOpen(false)} />
)}
+ {/* Schnellzugriff */}
Schnellzugriff:
- {/* SSH-Copy-Karte wenn SSH-Tunnel aktiv */}
- {sshTunnel && (
-
-
-
{sshCmd}
-