feat(dashboard): clarify server navigation and refresh gallery
Build and publish Docker image / build-and-publish (push) Successful in 40s

This commit is contained in:
wfalkowski committed 2026-10-23 20:50:13 +00:00
1 parent ad5bf1d015
commit 3523a2e141
8 files changed
+88 -48

No files matched your search

+3 -3
View File
@@ -1,15 +1,15 @@
# Public assets # Public assets
Recovered from https://www.anchorhost.eu/ on 2026-06-09. Existing assets were recovered from https://www.anchorhost.eu/ on 2026-06-09. The hero gallery replacements below are downloaded from Unsplash and used under its free commercial-use license.
| File | Size | Source | | File | Size | Source |
|------|------|--------| |------|------|--------|
| `transparent_anchorhost.png` | 82 KB | `/assets/transparent_anchorhost.png` | | `transparent_anchorhost.png` | 82 KB | `/assets/transparent_anchorhost.png` |
| `hero-bg.jpg` | 41 KB | `/assets/hero-bg.jpg` | | `hero-bg.jpg` | 41 KB | `/assets/hero-bg.jpg` |
| `pricing-bg.jpg` | Hero gallery: [Ethernet cables connected to a network device](https://unsplash.com/photos/ethernet-cables-connected-to-the-back-of-a-network-device-y4GHs9GEFdM) by Manuel Luikenga (Unsplash License) | | `data-center.jpg` | Hero gallery: [A rack of servers in a server room](https://unsplash.com/photos/a-rack-of-servers-in-a-server-room-2JJ3wBHu4_0) by Kevin Ache, used under the Unsplash License |
| `fiber-network.jpg` | Hero gallery: [Yellow and green electric wires for optical networks](https://unsplash.com/photos/yellow-and-green-electric-wires-ohBcGYJ8brQ) by Kirill Sh, used under the Unsplash License |
| `code.jpg` | 6.6 MB | `/assets/code.jpg` | | `code.jpg` | 6.6 MB | `/assets/code.jpg` |
| `dark-bg.png` | 1.8 MB | `/assets/dark-bg.png` | | `dark-bg.png` | 1.8 MB | `/assets/dark-bg.png` |
| `server-2.jpg` | Hero gallery: [Two server racks filled with electronic components and wires](https://unsplash.com/photos/two-server-racks-filled-with-electronic-components-and-wires-k27hkqXuveo) by Eric Stoynov (Unsplash License) |
Root-level icons (in `public/`): Root-level icons (in `public/`):
Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

+56 -33
View File
@@ -628,30 +628,14 @@ const FileManager = forwardRef(({ serverId, serverImage, sendMessage, isActive,
const filePath = getFullPath(file.name); const filePath = getFullPath(file.name);
const CHUNK_SIZE = 512 * 1024; // 512KB chunks (reduced to prevent WebSocket frame size issues) const CHUNK_SIZE = 512 * 1024; // 512KB chunks (reduced to prevent WebSocket frame size issues)
const fileSize = file.size; const fileSize = file.size;
const totalChunks = Math.ceil(fileSize / CHUNK_SIZE); const totalChunks = Math.max(1, Math.ceil(fileSize / CHUNK_SIZE));
// Always use chunked upload for better progress tracking and binary file support // Always use chunked upload for better progress tracking and binary file support
const chunks = []; const chunks = [];
let chunkIndex = 0; let chunkIndex = 0;
const reader = new FileReader(); const reader = new FileReader();
reader.onload = (e) => { const queueUpload = () => {
const chunk = e.target.result;
// Convert ArrayBuffer to base64 (works for all file types)
const uint8Array = new Uint8Array(chunk);
const binaryString = Array.from(uint8Array, byte => String.fromCharCode(byte)).join('');
const base64Chunk = btoa(binaryString);
chunks.push(base64Chunk);
chunkIndex++;
if (chunkIndex < totalChunks) {
// Read next chunk
const start = chunkIndex * CHUNK_SIZE;
const end = Math.min(start + CHUNK_SIZE, fileSize);
reader.readAsArrayBuffer(file.slice(start, end));
} else {
// All chunks read, start upload
activeUploadsRef.current[filePath] = { activeUploadsRef.current[filePath] = {
chunks, chunks,
currentChunkIndex: 0, currentChunkIndex: 0,
@@ -671,26 +655,44 @@ const FileManager = forwardRef(({ serverId, serverImage, sendMessage, isActive,
} }
})); }));
// Initiate chunked upload only if connection is ready
if (connectionStatus === 'connected') { if (connectionStatus === 'connected') {
sendMessage({ sendMessage({
type: 'start_chunked_upload', type: 'start_chunked_upload',
serverId: serverId, serverId,
filePath: filePath, filePath,
fileName: file.name, fileName: file.name,
totalSize: fileSize, totalSize: fileSize,
totalChunks: totalChunks, totalChunks,
chunkSize: CHUNK_SIZE chunkSize: CHUNK_SIZE
}); });
} else { } else {
console.warn('Cannot start upload - WebSocket not connected. Status:', connectionStatus);
// Remove from active uploads if connection not ready
delete activeUploadsRef.current[filePath]; delete activeUploadsRef.current[filePath];
const errorProgress = { ...uploadProgress }; setUploadProgress(prev => {
delete errorProgress[filePath]; const next = { ...prev };
setUploadProgress(errorProgress); delete next[filePath];
return next;
});
showAlert('Upload Blocked', 'WebSocket connection not available. Please wait for connection to be restored.', 'warning'); showAlert('Upload Blocked', 'WebSocket connection not available. Please wait for connection to be restored.', 'warning');
} }
};
reader.onload = (e) => {
const chunk = e.target.result;
// Convert ArrayBuffer to base64 (works for all file types)
const uint8Array = new Uint8Array(chunk);
const binaryString = Array.from(uint8Array, byte => String.fromCharCode(byte)).join('');
const base64Chunk = btoa(binaryString);
chunks.push(base64Chunk);
chunkIndex++;
if (chunkIndex < totalChunks) {
// Read next chunk
const start = chunkIndex * CHUNK_SIZE;
const end = Math.min(start + CHUNK_SIZE, fileSize);
reader.readAsArrayBuffer(file.slice(start, end));
} else {
queueUpload();
} }
}; };
@@ -704,8 +706,13 @@ const FileManager = forwardRef(({ serverId, serverImage, sendMessage, isActive,
activeUploadsRef.current = errorActiveUploads; activeUploadsRef.current = errorActiveUploads;
}; };
// Start reading first chunk // Empty files still use one empty chunk so the upload protocol can create them.
if (fileSize === 0) {
chunks.push('');
queueUpload();
} else {
reader.readAsArrayBuffer(file.slice(0, Math.min(CHUNK_SIZE, fileSize))); reader.readAsArrayBuffer(file.slice(0, Math.min(CHUNK_SIZE, fileSize)));
}
}); });
// Reset file input // Reset file input
@@ -770,6 +777,9 @@ const FileManager = forwardRef(({ serverId, serverImage, sendMessage, isActive,
</div> </div>
<div> <div>
<h3 className="font-semibold text-lg" style={{ color: colors.brightWhite }}>File Manager & SFTP</h3> <h3 className="font-semibold text-lg" style={{ color: colors.brightWhite }}>File Manager & SFTP</h3>
<p className="text-xs" role="status" style={{ color: connectionStatus === 'connected' ? colors.brightGreen : colors.yellow }}>
{connectionStatus === 'connected' ? 'Server connected' : 'Reconnect to manage files'}
</p>
{!initialized && ( {!initialized && (
<div className="flex items-center space-x-2 text-sm" style={{ color: colors.yellow }}> <div className="flex items-center space-x-2 text-sm" style={{ color: colors.yellow }}>
<RefreshCw className="w-3 h-3 animate-spin" /> <RefreshCw className="w-3 h-3 animate-spin" />
@@ -780,11 +790,14 @@ const FileManager = forwardRef(({ serverId, serverImage, sendMessage, isActive,
</div> </div>
<div className="flex items-center space-x-3"> <div className="flex items-center space-x-3">
<button <button
type="button"
onClick={() => { onClick={() => {
setInitialized(false); setInitialized(false);
detectWorkingDirectory(); detectWorkingDirectory();
}} }}
className="p-3 rounded-xl transition-all duration-200 hover:scale-105 border" disabled={connectionStatus !== 'connected'}
aria-label="Refresh file list and detect path"
className="p-3 rounded-xl transition-all duration-200 hover:scale-105 border disabled:cursor-not-allowed disabled:opacity-40"
style={{ style={{
backgroundColor: colors.brightBlack, backgroundColor: colors.brightBlack,
color: colors.foreground, color: colors.foreground,
@@ -802,8 +815,10 @@ const FileManager = forwardRef(({ serverId, serverImage, sendMessage, isActive,
<div className="flex items-center justify-between mb-4"> <div className="flex items-center justify-between mb-4">
<div className="flex items-center space-x-3 text-sm"> <div className="flex items-center space-x-3 text-sm">
<button <button
type="button"
onClick={goToParent} onClick={goToParent}
disabled={currentPath === '/' || currentPath === getBasePath()} disabled={currentPath === '/' || currentPath === getBasePath()}
aria-label="Go to parent folder"
className="p-2 rounded-xl transition-all duration-200 hover:scale-105 disabled:opacity-50 border" className="p-2 rounded-xl transition-all duration-200 hover:scale-105 disabled:opacity-50 border"
style={{ style={{
backgroundColor: colors.brightBlack, backgroundColor: colors.brightBlack,
@@ -863,6 +878,8 @@ const FileManager = forwardRef(({ serverId, serverImage, sendMessage, isActive,
</div> </div>
<button <button
type="button"
disabled={connectionStatus !== 'connected'}
onClick={() => { onClick={() => {
const zipName = currentPath === getBasePath() ? 'archive.zip' : `${currentPath.split('/').filter(Boolean).pop()}.zip`; const zipName = currentPath === getBasePath() ? 'archive.zip' : `${currentPath.split('/').filter(Boolean).pop()}.zip`;
const zipPath = getFullPath(zipName); const zipPath = getFullPath(zipName);
@@ -873,7 +890,7 @@ const FileManager = forwardRef(({ serverId, serverImage, sendMessage, isActive,
zipPath: zipPath zipPath: zipPath
}); });
}} }}
className="flex items-center space-x-2 px-3 py-2 rounded-xl text-sm transition-all duration-200 hover:scale-105 border" className="flex items-center space-x-2 px-3 py-2 rounded-xl text-sm transition-all duration-200 hover:scale-105 border disabled:cursor-not-allowed disabled:opacity-40"
style={{ style={{
backgroundColor: `${colors.green}20`, backgroundColor: `${colors.green}20`,
borderColor: colors.green, borderColor: colors.green,
@@ -891,8 +908,10 @@ const FileManager = forwardRef(({ serverId, serverImage, sendMessage, isActive,
{selectedFiles.size === 0 && ( {selectedFiles.size === 0 && (
<> <>
<button <button
type="button"
disabled={connectionStatus !== 'connected'}
onClick={() => setCreateFolderModalOpen(true)} onClick={() => setCreateFolderModalOpen(true)}
className="flex items-center space-x-2 px-3 py-2 rounded-xl text-sm transition-all duration-200 hover:scale-105 border" className="flex items-center space-x-2 px-3 py-2 rounded-xl text-sm transition-all duration-200 hover:scale-105 border disabled:cursor-not-allowed disabled:opacity-40"
style={{ style={{
backgroundColor: `${colors.green}20`, backgroundColor: `${colors.green}20`,
borderColor: colors.green, borderColor: colors.green,
@@ -904,8 +923,10 @@ const FileManager = forwardRef(({ serverId, serverImage, sendMessage, isActive,
</button> </button>
<button <button
type="button"
disabled={connectionStatus !== 'connected'}
onClick={() => setUploadModalOpen(true)} onClick={() => setUploadModalOpen(true)}
className="flex items-center space-x-2 px-3 py-2 rounded-xl text-sm transition-all duration-200 hover:scale-105 border" className="flex items-center space-x-2 px-3 py-2 rounded-xl text-sm transition-all duration-200 hover:scale-105 border disabled:cursor-not-allowed disabled:opacity-40"
style={{ style={{
backgroundColor: `${colors.blue}20`, backgroundColor: `${colors.blue}20`,
borderColor: colors.blue, borderColor: colors.blue,
@@ -972,8 +993,10 @@ const FileManager = forwardRef(({ serverId, serverImage, sendMessage, isActive,
{clipboard && ( {clipboard && (
<button <button
type="button"
disabled={connectionStatus !== 'connected'}
onClick={pasteFiles} onClick={pasteFiles}
className="flex items-center space-x-2 px-3 py-2 rounded-xl text-sm transition-all duration-200 hover:scale-105 border animate-pulse" className="flex items-center space-x-2 px-3 py-2 rounded-xl text-sm transition-all duration-200 hover:scale-105 border disabled:cursor-not-allowed disabled:opacity-40"
style={{ backgroundColor: `${colors.green}20`, borderColor: colors.green, color: colors.brightGreen }} style={{ backgroundColor: `${colors.green}20`, borderColor: colors.green, color: colors.brightGreen }}
> >
<Upload className="w-4 h-4 rotate-180" /> <Upload className="w-4 h-4 rotate-180" />
+5
View File
@@ -48,6 +48,11 @@
height: auto; height: auto;
} }
svg.lucide {
flex: 0 0 auto;
aspect-ratio: 1 / 1;
}
input, input,
textarea, textarea,
select { select {
+17 -5
View File
@@ -7,7 +7,7 @@ import {
Server, Terminal, User, Settings, Plus, Trash2, Play, Square, RefreshCw, Server, Terminal, User, Settings, Plus, Trash2, Play, Square, RefreshCw,
Cpu, HardDrive, MemoryStick, Copy, Maximize2, Minimize2, AlertCircle, Cpu, HardDrive, MemoryStick, Copy, Maximize2, Minimize2, AlertCircle,
ShoppingCart, Coins, Globe, Database, Activity, Menu, LogOut, Wifi, WifiOff, ShoppingCart, Coins, Globe, Database, Activity, Menu, LogOut, Wifi, WifiOff,
Home, BookOpen, Home, BookOpen, FileText,
BarChart3, HardDriveIcon, NetworkIcon, Clock, Info, BarChart3, HardDriveIcon, NetworkIcon, Clock, Info,
CheckCircle, Gamepad2, CheckCircle, Gamepad2,
Folder, Edit, Folder, Edit,
@@ -2933,12 +2933,12 @@ const handleWebSocketMessage = useCallback((data) => {
</div> </div>
<div className="border-b border-dash-border bg-black/5 shrink-0"> <div className="border-b border-dash-border bg-black/5 shrink-0">
<div className="flex space-x-1 px-6 overflow-x-auto custom-scrollbar"> <div role="tablist" aria-label="Server sections" className="flex space-x-1 px-6 overflow-x-auto custom-scrollbar">
{[ {[
{ id: 'overview', label: 'Overview', icon: Info }, { id: 'overview', label: 'Overview', icon: Info },
...(selectedServer.type === 'game' ...(selectedServer.type === 'game'
? [ ? [
{ id: 'game-console', label: 'Game Console', icon: Gamepad2 }, { id: 'game-console', label: 'Console', icon: Gamepad2 },
...(selectedServer.image && selectedServer.image.toLowerCase().includes('minecraft') ...(selectedServer.image && selectedServer.image.toLowerCase().includes('minecraft')
? [ ? [
{ id: 'plugin-store', label: 'Plugin Store', icon: Package }, { id: 'plugin-store', label: 'Plugin Store', icon: Package },
@@ -2948,8 +2948,10 @@ const handleWebSocketMessage = useCallback((data) => {
] ]
: []), : []),
...(selectedServer.type !== 'database' && selectedServer.type !== 'vps' ...(selectedServer.type !== 'database' && selectedServer.type !== 'vps'
? [{ id: 'files', label: 'Files & SFTP', icon: Folder }] ? [{ id: 'files', label: 'Files', icon: Folder }]
: []), : []),
{ id: 'terminal', label: 'Terminal', icon: Terminal },
{ id: 'logs', label: 'Logs', icon: FileText },
{ id: 'network', label: 'Network', icon: NetworkIcon }, { id: 'network', label: 'Network', icon: NetworkIcon },
{ id: 'backups', label: 'Backups', icon: Database }, { id: 'backups', label: 'Backups', icon: Database },
].map((tab) => { ].map((tab) => {
@@ -2958,6 +2960,10 @@ const handleWebSocketMessage = useCallback((data) => {
return ( return (
<button <button
key={tab.id} key={tab.id}
type="button"
role="tab"
aria-selected={active}
id={`server-tab-${tab.id}`}
onClick={() => { onClick={() => {
setActiveServerDetailTab(tab.id); setActiveServerDetailTab(tab.id);
if (tab.id !== 'network') setShowPortMappingGuide(false); if (tab.id !== 'network') setShowPortMappingGuide(false);
@@ -2976,7 +2982,13 @@ const handleWebSocketMessage = useCallback((data) => {
</div> </div>
</div> </div>
<div className="flex-1 min-h-0 overflow-y-auto custom-scrollbar"> <div
role="tabpanel"
id="server-detail-panel"
aria-labelledby={`server-tab-${activeServerDetailTab}`}
tabIndex={0}
className="flex-1 min-h-0 overflow-y-auto custom-scrollbar"
>
<div className={dashLayout.bodyPadding}> <div className={dashLayout.bodyPadding}>
{activeServerDetailTab === 'overview' && ( {activeServerDetailTab === 'overview' && (
<div className="max-w-7xl mx-auto space-y-8"> <div className="max-w-7xl mx-auto space-y-8">
+1 -1
View File
@@ -1048,7 +1048,7 @@ Restart Apache: \`sudo systemctl restart apache2\`. Visit your IP in the browser
return ( return (
<div className="flex h-screen overflow-hidden bg-dash-surface font-sans selection:bg-primary/30 text-dash-textMuted antialiased"> <div className="flex h-screen overflow-hidden bg-dash-surface font-sans selection:bg-primary/30 text-dash-textMuted antialiased">
{/* Sidebar */} {/* Sidebar */}
<aside className={`fixed inset-y-0 left-0 z-50 w-72 transform transition-transform duration-300 ease-in-out md:relative md:translate-x-0 border-r border-dash-border bg-dash-surfaceElevated/50 backdrop-blur-md pt-[env(safe-area-inset-top,0px)] ${isMobileMenuOpen ? 'translate-x-0' : '-translate-x-full'}`}> <aside className={`fixed inset-y-0 left-0 z-50 w-72 transform transition-transform duration-300 ease-in-out md:relative md:translate-x-0 border-r border-dash-border bg-dash-surfaceElevated pt-[env(safe-area-inset-top,0px)] ${isMobileMenuOpen ? 'translate-x-0' : '-translate-x-full'}`}>
<div className="flex flex-col h-full"> <div className="flex flex-col h-full">
<div className="p-6 border-b border-dash-border bg-black/10"> <div className="p-6 border-b border-dash-border bg-black/10">
<Link to="/" className="flex items-center space-x-3 group"> <Link to="/" className="flex items-center space-x-3 group">
+6 -6
View File
@@ -44,14 +44,14 @@ const heroGallery = [
title: 'Your work, online', title: 'Your work, online',
}, },
{ {
src: '/assets/server-2.jpg', src: '/assets/data-center.jpg',
alt: 'Network hardware and cabling inside a blue server rack', alt: 'Rows of server and network equipment in a data center',
title: 'Servers and network hardware', title: 'Infrastructure that stays online',
}, },
{ {
src: '/assets/pricing-bg.jpg', src: '/assets/fiber-network.jpg',
alt: 'Ethernet cables connected to a network switch', alt: 'Fiber optic cables connected to telecommunications equipment',
title: 'Connections, made visible', title: 'A network built on fiber',
}, },
]; ];