Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

feat(nav): fold Remote Access into Servers tabs + redesign page

Juan Denis31ee5fee6acc
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 7021e523..ed4f3b88 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -289,7 +289,6 @@ function AppRoutes() {
<Route path="ssl" element={<SSLCertificates />} />
<Route path="dynamic-dns" element={<DynamicDns />} />
</Route>
- <Route path="remote-access" element={<RemoteAccess />} />
<Route path="databases" element={<Databases />} />
<Route path="databases/:tab" element={<Databases />} />
<Route path="docker" element={<Docker />} />
@@ -299,6 +298,7 @@ function AppRoutes() {
<Route path="fleet" element={<AgentFleet />} />
<Route path="fleet-monitor" element={<FleetMonitor />} />
<Route path="cloud" element={<CloudProvision />} />
+ <Route path="remote-access" element={<RemoteAccess />} />
<Route path="server-templates" element={<ServerTemplates />} />
</Route>
<Route path="servers/:id" element={<ServerDetail />} />
diff --git a/frontend/src/components/servers/serverTabs.jsx b/frontend/src/components/servers/serverTabs.jsx
index 1cd63f73..3ce7f764 100644
--- a/frontend/src/components/servers/serverTabs.jsx
+++ b/frontend/src/components/servers/serverTabs.jsx
@@ -1,13 +1,15 @@
-import { Server, Users, Activity, Cloud, FileCog } from 'lucide-react';
+import { Server, Users, Activity, Cloud, FileCog, Network } from 'lucide-react';
// Shared sub-nav for the Servers page group (Servers / Agent Fleet / Fleet
-// Monitor / Cloud Servers / Config Templates). Rendered in each page's
-// <PageTopbar tabs={SERVER_TABS}> — the demo's top-bar layout replaces the old
-// sidebar sub-menu (see docs/REDESIGN_MAP.md §6 decision 3).
+// Monitor / Cloud Servers / Remote Access / Config Templates). Rendered in each
+// page's <PageTopbar tabs={SERVER_TABS}> — the demo's top-bar layout replaces
+// the old sidebar sub-menu (see docs/REDESIGN_MAP.md §6 decision 3). Remote
+// Access lives here because it's fundamentally agent-to-agent WireGuard pairing.
export const SERVER_TABS = [
{ to: '/servers', label: 'Servers', end: true, icon: <Server size={15} /> },
{ to: '/fleet', label: 'Agent Fleet', icon: <Users size={15} /> },
{ to: '/fleet-monitor', label: 'Fleet Monitor', icon: <Activity size={15} /> },
{ to: '/cloud', label: 'Cloud Servers', icon: <Cloud size={15} /> },
+ { to: '/remote-access', label: 'Remote Access', icon: <Network size={15} /> },
{ to: '/server-templates', label: 'Config Templates', icon: <FileCog size={15} /> },
];
diff --git a/frontend/src/components/sidebarItems.js b/frontend/src/components/sidebarItems.js
index 15241512..bc6838a6 100644
--- a/frontend/src/components/sidebarItems.js
+++ b/frontend/src/components/sidebarItems.js
@@ -59,13 +59,6 @@ export const SIDEBAR_ITEMS = [
category: 'infrastructure',
icon: '<circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>'
},
- {
- id: 'remote-access',
- label: 'Remote Access',
- route: '/remote-access',
- category: 'infrastructure',
- icon: '<rect x="16" y="16" width="6" height="6" rx="1"/><rect x="2" y="16" width="6" height="6" rx="1"/><rect x="9" y="2" width="6" height="6" rx="1"/><path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"/><path d="M12 12V8"/>'
- },
{
// Redesign: Services uses the top-bar layout (REDESIGN_MAP §6 decision 3).
// New Service / Templates / Deploy Activity now live in the page's top
diff --git a/frontend/src/pages/RemoteAccess.jsx b/frontend/src/pages/RemoteAccess.jsx
index e13abd89..84a9bee7 100644
--- a/frontend/src/pages/RemoteAccess.jsx
+++ b/frontend/src/pages/RemoteAccess.jsx
@@ -1,15 +1,19 @@
import { useState, useEffect, useCallback } from 'react';
-import { Network, Plus, Trash2, Globe, Lock, ShieldCheck, ExternalLink } from 'lucide-react';
+import {
+ Network, Plus, Trash2, Globe, Lock, ShieldCheck, ExternalLink,
+ ArrowRight, HardDrive, Cloud, AlertTriangle,
+} from 'lucide-react';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
+import EmptyState from '../components/EmptyState';
import Spinner from '../components/Spinner';
import Modal from '../components/Modal';
+import { Pill } from '@/components/ds';
+import { useTopbarActions } from '@/hooks/useTopbarActions';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Switch } from '@/components/ui/switch';
-import { Badge } from '@/components/ui/badge';
-import { Card, CardContent } from '@/components/ui/card';
import {
Select,
SelectTrigger,
@@ -18,23 +22,16 @@ import {
SelectValue,
} from '@/components/ui/select';
-const STATUS_STYLES = {
- up: 'text-green-600 border-green-500/40',
- pending: 'text-yellow-600 border-yellow-500/40',
- degraded: 'text-yellow-600 border-yellow-500/40',
- published: 'text-green-600 border-green-500/40',
- down: 'text-red-600 border-red-500/40',
- error: 'text-red-600 border-red-500/40',
+// Tunnel / service status → status-pill tone.
+const PILL_KIND = {
+ up: 'green',
+ published: 'green',
+ pending: 'amber',
+ degraded: 'amber',
+ down: 'red',
+ error: 'red',
};
-
-function StatusBadge({ status }) {
- const cls = STATUS_STYLES[status] || 'text-muted-foreground border-border';
- return (
- <Badge variant="outline" className={cls}>
- {status || 'unknown'}
- </Badge>
- );
-}
+const pillKind = (status) => PILL_KIND[status] || 'gray';
const EMPTY_FORM = {
privateServerId: '',
@@ -176,71 +173,76 @@ const RemoteAccess = () => {
}
};
+ // Header action lives in the shared Servers top bar (this page is a tab in
+ // the Servers group), so the page renders no header of its own.
+ useTopbarActions(
+ () => (
+ <Button size="sm" onClick={() => openWizard(null)} disabled={loading}>
+ <Plus size={15} /> Expose a Local Service
+ </Button>
+ ),
+ [loading]
+ );
+
return (
- <div className="p-6 max-w-6xl mx-auto">
- <div className="flex items-start justify-between gap-4 mb-6">
- <div>
- <h1 className="text-2xl font-semibold flex items-center gap-2">
- <Network className="w-6 h-6 text-primary" />
- Remote Access
- </h1>
- <p className="text-muted-foreground mt-1 max-w-2xl">
- Expose a service running on a private machine (behind NAT, no port-forwarding) to a public
- hostname over a WireGuard tunnel between two of your agents.
- </p>
- </div>
- <Button onClick={() => openWizard(null)} disabled={loading}>
- <Plus className="w-4 h-4 mr-1" />
- Expose a Local Service
- </Button>
- </div>
+ <div className="sk-tabgroup__inner ra-page">
+ <p className="ra-intro">
+ Expose a service running on a private machine (behind NAT, no port-forwarding) to a
+ public hostname over a WireGuard tunnel between two of your agents.
+ </p>
{loading ? (
- <div className="flex justify-center py-16">
+ <div className="ra-loading">
<Spinner />
</div>
) : tunnels.length === 0 ? (
- <Card>
- <CardContent className="py-16 flex flex-col items-center text-center gap-3">
- <Network className="w-10 h-10 text-muted-foreground" />
- <h2 className="text-lg font-medium">No tunnels yet</h2>
- <p className="text-muted-foreground max-w-md">
- Pick a public-IP edge server and a private host, and ServerKit will pair them over
- WireGuard and publish your service — no router changes needed.
- </p>
- <Button onClick={() => openWizard(null)} className="mt-2">
- <Plus className="w-4 h-4 mr-1" />
- Expose a Local Service
+ <EmptyState
+ icon={Network}
+ title="No tunnels yet"
+ description="Pick a public-IP edge server and a private host, and ServerKit will pair them over WireGuard and publish your service — no router changes needed."
+ action={
+ <Button onClick={() => openWizard(null)}>
+ <Plus size={16} /> Expose a Local Service
</Button>
- </CardContent>
- </Card>
+ }
+ />
) : (
- <div className="space-y-4">
- {tunnels.map((t) => (
- <Card key={t.id}>
- <CardContent className="p-5">
- <div className="flex items-start justify-between gap-4">
- <div>
- <div className="flex items-center gap-2 flex-wrap">
- <span className="font-medium">{t.private_server_name || t.private_server_id}</span>
- <span className="text-muted-foreground">→</span>
- <span className="font-medium">{t.edge_server_name || t.edge_server_id}</span>
- <StatusBadge status={t.status} />
+ <div className="ra-list">
+ {tunnels.map((t) => {
+ const svcs = services[t.id] || [];
+ return (
+ <section key={t.id} className="ra-tunnel">
+ <div className="ra-tunnel__head">
+ <div className="ra-tunnel__info">
+ <div className="ra-tunnel__route">
+ <span className="ra-node">
+ <span className="ra-node__ico"><HardDrive size={14} /></span>
+ {t.private_server_name || t.private_server_id}
+ </span>
+ <ArrowRight className="ra-arrow" size={16} />
+ <span className="ra-node">
+ <span className="ra-node__ico"><Cloud size={14} /></span>
+ {t.edge_server_name || t.edge_server_id}
+ </span>
+ <Pill kind={pillKind(t.status)}>{t.status || 'unknown'}</Pill>
</div>
- <div className="text-sm text-muted-foreground mt-1">
- {t.subnet} · {t.interface_name} · UDP {t.listen_port}
- {t.last_handshake_at ? ` · handshake ${new Date(t.last_handshake_at).toLocaleString()}` : ' · no handshake yet'}
+ <div className="ra-tunnel__meta">
+ <span>{t.subnet}</span>
+ <span className="ra-dot">·</span>
+ <span>{t.interface_name}</span>
+ <span className="ra-dot">·</span>
+ <span>UDP {t.listen_port}</span>
+ <span className="ra-dot">·</span>
+ <span>
+ {t.last_handshake_at
+ ? `handshake ${new Date(t.last_handshake_at).toLocaleString()}`
+ : 'no handshake yet'}
+ </span>
</div>
- {!t.last_handshake_at && t.status !== 'up' && (
- <p className="text-xs text-yellow-600 mt-1">
- No handshake yet — if this persists, the private host&apos;s outbound UDP to the edge may be blocked (a relay is needed).
- </p>
- )}
</div>
- <div className="flex items-center gap-2 shrink-0">
+ <div className="ra-tunnel__actions">
<Button variant="outline" size="sm" onClick={() => openWizard(t)}>
- <Plus className="w-4 h-4 mr-1" />
- Expose service
+ <Plus size={15} /> Expose service
</Button>
<Button
variant="ghost"
@@ -249,54 +251,76 @@ const RemoteAccess = () => {
onClick={() => setTeardown(t)}
title="Tear down tunnel"
>
- <Trash2 className="w-4 h-4" />
+ <Trash2 size={15} />
</Button>
</div>
</div>
- <div className="mt-4 border-t border-border pt-3">
- {(services[t.id] || []).length === 0 ? (
- <p className="text-sm text-muted-foreground">No services exposed on this tunnel.</p>
+ {!t.last_handshake_at && t.status !== 'up' && (
+ <div className="ra-tunnel__warn">
+ <AlertTriangle size={14} />
+ <span>
+ No handshake yet — if this persists, the private host&apos;s outbound UDP
+ to the edge may be blocked (a relay is needed).
+ </span>
+ </div>
+ )}
+
+ <div className="ra-svcs">
+ {svcs.length === 0 ? (
+ <p className="ra-svcs__empty">No services exposed on this tunnel yet.</p>
) : (
- <ul className="space-y-2">
- {(services[t.id] || []).map((svc) => (
- <li key={svc.id} className="flex items-center justify-between gap-3">
- <div className="flex items-center gap-2 min-w-0">
- <Globe className="w-4 h-4 text-muted-foreground shrink-0" />
- {svc.url ? (
- <a
- href={svc.url}
- target="_blank"
- rel="noreferrer"
- className="text-primary hover:underline truncate inline-flex items-center gap-1"
- >
- {svc.hostname}
- <ExternalLink className="w-3 h-3" />
- </a>
- ) : (
- <span className="truncate">{svc.hostname}</span>
+ svcs.map((svc) => (
+ <div key={svc.id} className="ra-svc">
+ <div className="ra-svc__main">
+ <Globe className="ra-svc__ico" size={15} />
+ {svc.url ? (
+ <a
+ className="ra-svc__host"
+ href={svc.url}
+ target="_blank"
+ rel="noreferrer"
+ >
+ {svc.hostname}
+ <ExternalLink size={12} />
+ </a>
+ ) : (
+ <span className="ra-svc__host">{svc.hostname}</span>
+ )}
+ <span className="ra-svc__port">→ :{svc.port}</span>
+ <span className="ra-svc__flags">
+ {svc.require_auth && (
+ <Lock size={13} aria-label="Basic auth" />
+ )}
+ {svc.ssl_enabled && (
+ <ShieldCheck
+ size={13}
+ className="ra-flag--ssl"
+ aria-label="HTTPS"
+ />
)}
- <span className="text-muted-foreground text-sm">→ :{svc.port}</span>
- {svc.require_auth && <Lock className="w-3 h-3 text-muted-foreground" title="Basic auth" />}
- {svc.ssl_enabled && <ShieldCheck className="w-3 h-3 text-green-600" title="HTTPS" />}
- <StatusBadge status={svc.status} />
- </div>
+ </span>
+ </div>
+ <div className="ra-svc__right">
+ <Pill kind={pillKind(svc.status)}>
+ {svc.status || 'unknown'}
+ </Pill>
<Button
variant="ghost"
size="sm"
- className="text-red-600 shrink-0"
+ className="text-red-600"
onClick={() => unpublish(t.id, svc)}
>
Remove
</Button>
- </li>
- ))}
- </ul>
+ </div>
+ </div>
+ ))
)}
</div>
- </CardContent>
- </Card>
- ))}
+ </section>
+ );
+ })}
</div>
)}
diff --git a/frontend/src/styles/main.scss b/frontend/src/styles/main.scss
index 46d45e05..d07e5c42 100644
--- a/frontend/src/styles/main.scss
+++ b/frontend/src/styles/main.scss
@@ -105,6 +105,7 @@
@import 'pages/_server-templates';
@import 'pages/_server-packages';
@import 'pages/_server-services';
+@import 'pages/_remote-access';
@import 'pages/_workspaces';
@import 'pages/_dns-zones';
@import 'pages/_status-pages';
diff --git a/frontend/src/styles/pages/_remote-access.scss b/frontend/src/styles/pages/_remote-access.scss
new file mode 100644
index 00000000..d1e2b9e1
--- /dev/null
+++ b/frontend/src/styles/pages/_remote-access.scss
@@ -0,0 +1,217 @@
+// ============================================
+// REMOTE ACCESS (/remote-access — a tab in the Servers group)
+// ============================================
+// WireGuard tunnels between two agents + the services published over them.
+// Page-local `.ra-*` classes built on the infra-console tokens (sk-* siblings).
+// Deliberately NOT the shadcn <Card>: its unlayered `.ui-card-content` zeroes
+// top padding and can't be reliably overridden by Tailwind utilities, which sit
+// in a lower-priority @layer — that's what made the old page look unpadded.
+
+.ra-page {
+ display: flex;
+ flex-direction: column;
+ gap: $space-5;
+}
+
+.ra-intro {
+ margin: -2px 0 0;
+ max-width: 72ch;
+ font-size: 13.5px;
+ line-height: 1.55;
+ color: var(--text-dim);
+}
+
+.ra-loading {
+ display: flex;
+ justify-content: center;
+ padding: $space-10 0;
+}
+
+.ra-list {
+ display: flex;
+ flex-direction: column;
+ gap: $space-4;
+}
+
+// ---- Tunnel card --------------------------------------------------
+.ra-tunnel {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius-lg);
+ overflow: hidden;
+ transition: border-color 0.15s;
+
+ &:hover { border-color: var(--border-strong); }
+}
+
+.ra-tunnel__head {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: $space-4;
+ padding: $space-4 $space-5;
+}
+
+.ra-tunnel__info { min-width: 0; }
+
+.ra-tunnel__route {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ gap: 9px;
+ font-size: 14.5px;
+ font-weight: 600;
+ color: var(--text);
+
+ .ra-node {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ min-width: 0;
+ }
+
+ .ra-node__ico {
+ width: 27px;
+ height: 27px;
+ border-radius: 8px;
+ display: grid;
+ place-items: center;
+ flex-shrink: 0;
+ background: var(--surface-2);
+ color: var(--text-dim);
+ }
+
+ .ra-arrow {
+ color: var(--text-faint);
+ flex-shrink: 0;
+ }
+}
+
+.ra-tunnel__meta {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ gap: 7px;
+ margin-top: 9px;
+ font-family: var(--mono);
+ font-size: 11.5px;
+ color: var(--text-faint);
+
+ .ra-dot { opacity: 0.55; }
+}
+
+.ra-tunnel__actions {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ flex-shrink: 0;
+}
+
+.ra-tunnel__warn {
+ display: flex;
+ align-items: flex-start;
+ gap: 8px;
+ margin: 0 $space-5 $space-4;
+ padding: 9px 12px;
+ border-radius: 9px;
+ background: var(--amber-bg);
+ color: var(--amber);
+ font-size: 12px;
+ line-height: 1.45;
+
+ svg { flex-shrink: 0; margin-top: 1px; }
+}
+
+// ---- Published services -------------------------------------------
+.ra-svcs {
+ border-top: 1px solid var(--border-soft);
+}
+
+.ra-svcs__empty {
+ padding: 14px $space-5;
+ font-size: 12.5px;
+ color: var(--text-faint);
+}
+
+.ra-svc {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: $space-4;
+ padding: 12px $space-5;
+ transition: background 0.12s;
+
+ & + .ra-svc { border-top: 1px solid var(--border-soft); }
+ &:hover { background: var(--surface-2); }
+}
+
+.ra-svc__main {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ min-width: 0;
+}
+
+.ra-svc__ico {
+ color: var(--text-faint);
+ flex-shrink: 0;
+}
+
+.ra-svc__host {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ min-width: 0;
+ font-size: 13.5px;
+ font-weight: 550;
+ color: var(--text);
+ text-decoration: none;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ svg { color: var(--text-faint); flex-shrink: 0; }
+
+ // Only linkable (published) hosts get the hover affordance.
+ &:where(a):hover {
+ color: var(--accent-bright);
+ text-decoration: underline;
+ svg { color: var(--accent-bright); }
+ }
+}
+
+.ra-svc__port {
+ font-family: var(--mono);
+ font-size: 12px;
+ color: var(--text-faint);
+ flex-shrink: 0;
+}
+
+.ra-svc__flags {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ flex-shrink: 0;
+ color: var(--text-faint);
+
+ .ra-flag--ssl { color: var(--green); }
+}
+
+.ra-svc__right {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-3;
+ flex-shrink: 0;
+}
+
+@media (max-width: $breakpoint-md) {
+ .ra-tunnel__head { flex-direction: column; gap: $space-3; }
+ .ra-tunnel__actions { width: 100%; }
+
+ .ra-svc {
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 10px;
+ }
+ .ra-svc__right { width: 100%; justify-content: space-between; }
+}