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(ui): restyle the FTP Server body to the new look

Juan Denis6687c429fa63
diff --git a/frontend/src/pages/FTPServer.jsx b/frontend/src/pages/FTPServer.jsx
index 6915e568..ee9d10e4 100644
--- a/frontend/src/pages/FTPServer.jsx
+++ b/frontend/src/pages/FTPServer.jsx
@@ -1,14 +1,16 @@
import { useState, useEffect } from 'react';
-import { FolderUp, UserPlus, Network } from 'lucide-react';
+import {
+ FolderUp, UserPlus, Network, Activity, Server, Users as UsersIcon,
+ Cable, KeyRound, Ban, Check, Trash2, RefreshCw, X,
+} from 'lucide-react';
import useTabParam from '../hooks/useTabParam';
import { api } from '../services/api';
-import { PageTopbar } from '@/components/ds';
+import { PageTopbar, MetricCard, Pill } from '@/components/ds';
import { FILE_TABS } from '../components/files/fileTabs';
import { useToast } from '../contexts/ToastContext';
import Spinner from '../components/Spinner';
import EmptyState from '../components/EmptyState';
import ConfirmDialog from '../components/ConfirmDialog';
-import { StatStrip, Stat } from '../components/StatCard';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
@@ -240,6 +242,10 @@ function FTPServer() {
const isInstalled = status?.any_installed;
const isRunning = status?.any_running;
const activeServer = status?.active_server;
+ const disabledUsers = users.filter((user) => !user.is_active).length;
+ const ftpPort = config?.settings
+ ? (config.settings.listen_port || config.settings.port || 21)
+ : null;
return (
<div className="page-container ftp-server">
@@ -303,16 +309,40 @@ function FTPServer() {
/>
) : (
<>
- <StatStrip ariaLabel="FTP server status">
- <Stat
- label="Server Status"
+ <div className="ftp-kpis" role="group" aria-label="FTP server status">
+ <MetricCard
+ tone={isRunning ? 'green' : 'amber'}
+ icon={<Activity size={16} />}
value={isRunning ? 'Running' : 'Stopped'}
- state={isRunning ? 'success' : 'warning'}
+ label="Server status"
/>
- <Stat label="Active Server" value={activeServer || 'None'} />
- <Stat label="FTP Users" value={users.length} />
- <Stat label="Active Connections" value={connections.length} />
- </StatStrip>
+ <MetricCard
+ tone="accent"
+ icon={<Server size={16} />}
+ value={activeServer || 'None'}
+ label="Active server"
+ >
+ {ftpPort != null && (
+ <div className="sk-kpi__sub"><span>port {ftpPort}</span></div>
+ )}
+ </MetricCard>
+ <MetricCard
+ tone="cyan"
+ icon={<UsersIcon size={16} />}
+ value={users.length}
+ label="FTP users"
+ >
+ {disabledUsers > 0 && (
+ <div className="sk-kpi__sub"><span>{disabledUsers} disabled</span></div>
+ )}
+ </MetricCard>
+ <MetricCard
+ tone="violet"
+ icon={<Cable size={16} />}
+ value={connections.length}
+ label="Active connections"
+ />
+ </div>
<Tabs value={activeTab} onValueChange={(val) => {
setActiveTab(val);
@@ -408,7 +438,7 @@ function FTPServer() {
/>
) : (
<div className="users-table">
- <table>
+ <table className="sk-dtable">
<thead>
<tr>
<th>Username</th>
@@ -427,17 +457,17 @@ function FTPServer() {
<Badge variant="info">FTP</Badge>
)}
</td>
- <td>
+ <td className="sk-cell-mono">
<code>{user.home}</code>
{!user.home_exists && (
<Badge variant="warning">Missing</Badge>
)}
</td>
- <td>{user.home_size_human}</td>
+ <td className="sk-cell-mono">{user.home_size_human}</td>
<td>
- <span className={`status-badge ${user.is_active ? 'active' : 'inactive'}`}>
+ <Pill kind={user.is_active ? 'green' : 'gray'}>
{user.is_active ? 'Active' : 'Disabled'}
- </span>
+ </Pill>
</td>
<td className="actions">
<Button
@@ -446,7 +476,7 @@ function FTPServer() {
onClick={() => openPasswordModal(user.username)}
title="Change Password"
>
- <span className="icon">key</span>
+ <KeyRound size={14} />
</Button>
<Button
variant={user.is_active ? 'secondary' : 'outline'}
@@ -454,7 +484,7 @@ function FTPServer() {
onClick={() => handleToggleUser(user.username, user.is_active)}
title={user.is_active ? 'Disable' : 'Enable'}
>
- <span className="icon">{user.is_active ? 'block' : 'check'}</span>
+ {user.is_active ? <Ban size={14} /> : <Check size={14} />}
</Button>
<Button
variant="destructive"
@@ -462,7 +492,7 @@ function FTPServer() {
onClick={() => handleDeleteUser(user.username)}
title="Delete"
>
- <span className="icon">delete</span>
+ <Trash2 size={14} />
</Button>
</td>
</tr>
@@ -479,7 +509,7 @@ function FTPServer() {
<div className="section-header">
<h3>Active Connections</h3>
<Button variant="outline" onClick={loadConnections}>
- <span className="icon">refresh</span>
+ <RefreshCw size={14} />
Refresh
</Button>
</div>
@@ -487,7 +517,7 @@ function FTPServer() {
<EmptyState icon={Network} title="No active connections" />
) : (
<div className="connections-table">
- <table>
+ <table className="sk-dtable">
<thead>
<tr>
<th>Local Address</th>
@@ -499,19 +529,19 @@ function FTPServer() {
<tbody>
{connections.map((conn, index) => (
<tr key={index}>
- <td><code>{conn.local}</code></td>
- <td><code>{conn.remote}</code></td>
+ <td className="sk-cell-mono"><code>{conn.local}</code></td>
+ <td className="sk-cell-mono"><code>{conn.remote}</code></td>
<td>
- <span className="status-badge active">{conn.state}</span>
+ <Pill kind="green">{conn.state}</Pill>
</td>
- <td>
+ <td className="actions">
<Button
variant="destructive"
size="sm"
onClick={() => handleDisconnect(conn.pid)}
title="Disconnect"
>
- <span className="icon">close</span>
+ <X size={14} />
</Button>
</td>
</tr>
@@ -528,7 +558,7 @@ function FTPServer() {
<div className="section-header">
<h3>Server Logs</h3>
<Button variant="outline" onClick={loadLogs}>
- <span className="icon">refresh</span>
+ <RefreshCw size={14} />
Refresh
</Button>
</div>
@@ -548,7 +578,7 @@ function FTPServer() {
<div className="modal-header">
<h2>Install FTP Server</h2>
<button className="btn btn-icon" onClick={() => setShowInstallModal(false)}>
- <span className="icon">close</span>
+ <X size={16} />
</button>
</div>
<div className="modal-body">
@@ -598,7 +628,7 @@ function FTPServer() {
<div className="modal-header">
<h2>Create FTP User</h2>
<button className="btn btn-icon" onClick={() => setShowUserModal(false)}>
- <span className="icon">close</span>
+ <X size={16} />
</button>
</div>
<div className="modal-body">
@@ -652,7 +682,7 @@ function FTPServer() {
<div className="modal-header">
<h2>Change Password</h2>
<button className="btn btn-icon" onClick={() => setShowPasswordModal(false)}>
- <span className="icon">close</span>
+ <X size={16} />
</button>
</div>
<div className="modal-body">
diff --git a/frontend/src/styles/pages/_ftp-server.scss b/frontend/src/styles/pages/_ftp-server.scss
index 9e639e82..12818bae 100644
--- a/frontend/src/styles/pages/_ftp-server.scss
+++ b/frontend/src/styles/pages/_ftp-server.scss
@@ -1,168 +1,70 @@
-// FTP Server Page Styles
+// ============================================
+// FTP SERVER PAGE (redesign — Files group, see docs/REDESIGN_MAP.md #7):
+// MetricCard KPI strip + mono-uppercase eyebrow section headers + dense
+// .sk-dtable user/connection tables on flat surface cards.
+// ============================================
.ftp-server {
- .page-header {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- margin-bottom: 24px;
- flex-wrap: wrap;
- gap: 16px;
-
- .page-header-content {
- h1 {
- font-size: 24px;
- font-weight: 600;
- margin: 0 0 4px 0;
- }
-
- .page-description {
- color: $text-secondary;
- margin: 0;
- }
- }
- .page-header-actions {
- display: flex;
- gap: 8px;
- }
- }
+ // ─── KPI strip (replaces the old StatStrip) ─────────
+ .ftp-kpis {
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ gap: $space-4;
+ margin: $space-5 0 $space-4;
- .page-loading {
- display: flex;
- justify-content: center;
- align-items: center;
- min-height: 400px;
+ @media (max-width: $breakpoint-lg) { grid-template-columns: repeat(2, 1fr); }
+ @media (max-width: $breakpoint-sm) { grid-template-columns: 1fr; }
}
- .empty-state-large {
+ // ─── Mono eyebrow section headers (Users / Connections / Logs) ───
+ .section-header {
display: flex;
- flex-direction: column;
+ justify-content: space-between;
align-items: center;
- justify-content: center;
- padding: 80px 24px;
- background: var(--card-bg);
- border-radius: 12px;
- text-align: center;
-
- .icon {
- font-size: 64px;
- color: $text-tertiary;
- margin-bottom: 24px;
- }
-
- h2 {
- margin: 0 0 12px 0;
- font-size: 24px;
- font-weight: 600;
- }
-
- p {
- margin: 0 0 24px 0;
- color: $text-secondary;
- max-width: 400px;
- }
- }
-
-
- .tabs {
- display: flex;
- gap: 4px;
- margin-bottom: 24px;
- border-bottom: 1px solid $border-subtle;
-
- .tab {
- padding: 12px 20px;
- background: none;
- border: none;
- font-size: 14px;
- font-weight: 500;
- color: $text-secondary;
- cursor: pointer;
- position: relative;
- transition: color 0.2s;
-
- &:hover {
- color: $text-primary;
- }
-
- &.active {
- color: $accent-primary;
-
- &::after {
- content: '';
- position: absolute;
- bottom: -1px;
- left: 0;
- right: 0;
- height: 2px;
- background: $accent-primary;
- }
- }
- }
- }
-
- .tab-content {
- .section-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 16px;
+ gap: $space-3;
+ margin-bottom: $space-3;
- h3 {
- margin: 0;
- font-size: 16px;
- font-weight: 600;
- }
- }
-
- .empty-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 48px;
- background: var(--card-bg);
- border-radius: 8px;
- color: $text-tertiary;
-
- .icon {
- font-size: 48px;
- margin-bottom: 16px;
- }
-
- p {
- margin-bottom: 16px;
- }
+ h3 {
+ margin: 0;
+ font-family: var(--mono);
+ font-size: 10.5px;
+ font-weight: $font-weight-semibold;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--text-faint);
}
}
+ // ─── Overview: config + connection-info cards ───────
.overview-tab {
display: grid;
grid-template-columns: 1fr 1fr;
- gap: 24px;
+ gap: $space-4;
- @media (max-width: 900px) {
- grid-template-columns: 1fr;
- }
+ @media (max-width: 900px) { grid-template-columns: 1fr; }
.config-section,
.info-section {
- background: var(--card-bg);
- border-radius: 8px;
- padding: 20px;
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ padding: $space-4 $space-5;
h3 {
- margin: 0 0 16px 0;
- font-size: 16px;
- font-weight: 600;
+ margin: 0 0 $space-3;
+ font-family: var(--mono);
+ font-size: 10.5px;
+ font-weight: $font-weight-semibold;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--text-faint);
}
}
.config-grid,
.info-grid {
display: grid;
- gap: 12px;
}
.config-item,
@@ -170,171 +72,114 @@
display: flex;
justify-content: space-between;
align-items: center;
- padding: 8px 0;
- border-bottom: 1px solid $border-subtle;
+ gap: $space-4;
+ padding: 10px 0;
+ border-bottom: 1px solid var(--border-soft);
+ font-size: 13px;
- &:last-child {
- border-bottom: none;
- }
+ &:first-child { padding-top: 0; }
+ &:last-child { border-bottom: none; padding-bottom: 0; }
.config-label,
.info-label {
- font-size: 13px;
- color: $text-secondary;
+ color: var(--text-dim);
}
.config-value {
- font-size: 13px;
- font-weight: 500;
+ font-family: var(--mono);
+ font-size: 12.5px;
+ font-weight: $font-weight-medium;
+ color: var(--text);
- &.success {
- color: var(--success);
- }
-
- &.warning {
- color: var(--warning);
- }
+ &.success { color: var(--green); }
+ &.warning { color: var(--amber); }
}
code {
- font-family: var(--font-mono);
- font-size: 13px;
- background: $bg-hover;
- padding: 4px 8px;
- border-radius: 4px;
+ font-family: var(--mono);
+ font-size: 12px;
+ color: var(--text);
+ background: var(--surface-2);
+ border: 1px solid var(--border-soft);
+ padding: 2px 7px;
+ border-radius: $radius-md;
}
}
}
- .users-tab,
- .connections-tab {
- .users-table,
- .connections-table {
- background: var(--card-bg);
- border-radius: 8px;
- overflow: hidden;
-
- table {
- width: 100%;
- border-collapse: collapse;
-
- th,
- td {
- padding: 12px 16px;
- text-align: left;
- }
-
- th {
- background: $bg-hover;
- font-size: 12px;
- font-weight: 600;
- text-transform: uppercase;
- color: $text-tertiary;
- }
-
- td {
- border-bottom: 1px solid $border-subtle;
- font-size: 13px;
-
- &:last-child {
- border-bottom: none;
- }
-
- code {
- font-family: var(--font-mono);
- font-size: 12px;
- background: $bg-hover;
- padding: 2px 6px;
- border-radius: 4px;
- }
- }
-
- tr:last-child td {
- border-bottom: none;
- }
- }
+ // ─── Users + Connections (dense .sk-dtable on a card) ───
+ .users-table,
+ .connections-table {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ overflow-x: auto;
+ .sk-dtable {
.user-name {
- font-weight: 500;
- margin-right: 8px;
+ font-size: 13px;
+ font-weight: 550;
+ color: var(--text);
+ margin-right: $space-2;
}
- .badge {
- display: inline-block;
- padding: 2px 8px;
- font-size: 11px;
- font-weight: 500;
- border-radius: 4px;
-
- &.badge-info {
- background: rgba(var(--primary-rgb), 0.1);
- color: $accent-primary;
- }
-
- &.badge-warning {
- background: rgba(255, 193, 7, 0.1);
- color: $color-star;
- }
+ // Paths/addresses render flat mono, not chip-styled <code>
+ code {
+ font: inherit;
+ color: inherit;
+ background: none;
+ border: none;
+ padding: 0;
+ overflow-wrap: anywhere;
}
- .status-badge {
- display: inline-block;
- padding: 4px 10px;
- font-size: 12px;
- font-weight: 500;
- border-radius: 4px;
-
- &.active {
- background: rgba(34, 197, 94, 0.1);
- color: var(--success);
- }
-
- &.inactive {
- background: rgba(156, 163, 175, 0.1);
- color: $text-tertiary;
- }
- }
+ code + [data-slot='badge'] { margin-left: $space-2; }
.actions {
display: flex;
- gap: 4px;
+ align-items: center;
+ gap: $space-1;
}
}
}
- .logs-tab {
- .log-viewer {
- background: var(--card-bg);
- border-radius: 8px;
- padding: 16px;
- max-height: 500px;
- overflow: auto;
+ // ─── Logs ───────────────────────────────────────────
+ .logs-tab .log-viewer {
+ background: var(--bg-code);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ padding: $space-4;
+ max-height: 500px;
+ overflow: auto;
- pre {
- margin: 0;
- font-family: var(--font-mono);
- font-size: 12px;
- line-height: 1.6;
- white-space: pre-wrap;
- word-break: break-all;
- color: $text-secondary;
- }
+ pre {
+ margin: 0;
+ font-family: var(--mono);
+ font-size: 12px;
+ line-height: 1.6;
+ white-space: pre-wrap;
+ word-break: break-all;
+ color: var(--text-dim);
}
}
+ // ─── Install modal info box ─────────────────────────
.install-info {
- padding: 16px;
- background: $bg-hover;
- border-radius: 8px;
- margin-top: 16px;
+ padding: $space-4;
+ background: var(--surface-2);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ margin-top: $space-4;
p {
margin: 0;
- font-size: 14px;
+ font-size: 13px;
line-height: 1.6;
+ color: $text-secondary;
strong {
- color: $accent-primary;
+ color: var(--accent-bright);
+ font-weight: $font-weight-semibold;
}
}
}