mirror of
https://github.com/YuzuZensai/Termix.git
synced 2026-09-13 18:58:52 +00:00
* Feature request network graph
* Fixing PR442:
- Fixed:
- UI design elemets
- UI and button colors
- JSON export
- recent activity is default again
- Removed:
- Online/Offline UI labels
- left-click menu on hosts
- Added:
- small pulsing dot inside the hosts to indicate online status like in the left bar
* fix: electron build errors and skip macos job
* fix: testflight submit failure
* fix: made submit job match build type
* fix: resolve Vite build warnings for mixed static/dynamic imports (#473)
* Update Crowdin configuration file
* Update Crowdin configuration file
* fix: resolve Vite build warnings for mixed static/dynamic imports
- Convert all dynamic imports of main-axios.ts to static imports (10 files)
- Convert all dynamic imports of sonner to static imports (4 files)
- Add manual chunking configuration to vite.config.ts for better bundle splitting
- react-vendor: React and React DOM
- ui-vendor: Radix UI, lucide-react, clsx, tailwind-merge
- monaco: Monaco Editor
- codemirror: CodeMirror and related packages
- Increase chunkSizeWarningLimit to 1000kB
This resolves Vite warnings about mixed import strategies preventing
proper code-splitting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
* fix: file manager incorrectly decoding/encoding when editing files (made base64/utf8 dependent)
* fix: build error on docker
* Handle enter button (#481)
* Update Crowdin configuration file
* Update Crowdin configuration file
* Update Linux Portable section with AUR link (#474)
* fix: file manager incorrectly decoding/encoding when editing files (#476)
* fix: electron build errors and skip macos job
* fix: testflight submit failure
* fix: made submit job match build type
* fix: resolve Vite build warnings for mixed static/dynamic imports (#473)
* Update Crowdin configuration file
* Update Crowdin configuration file
* fix: resolve Vite build warnings for mixed static/dynamic imports
- Convert all dynamic imports of main-axios.ts to static imports (10 files)
- Convert all dynamic imports of sonner to static imports (4 files)
- Add manual chunking configuration to vite.config.ts for better bundle splitting
- react-vendor: React and React DOM
- ui-vendor: Radix UI, lucide-react, clsx, tailwind-merge
- monaco: Monaco Editor
- codemirror: CodeMirror and related packages
- Increase chunkSizeWarningLimit to 1000kB
This resolves Vite warnings about mixed import strategies preventing
proper code-splitting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
* fix: file manager incorrectly decoding/encoding when editing files (made base64/utf8 dependent)
---------
Co-authored-by: Jefferson Nunn <89030989+jeffersonwarrior@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
* fix: build error on docker (#477)
* fix: electron build errors and skip macos job
* fix: testflight submit failure
* fix: made submit job match build type
* fix: resolve Vite build warnings for mixed static/dynamic imports (#473)
* Update Crowdin configuration file
* Update Crowdin configuration file
* fix: resolve Vite build warnings for mixed static/dynamic imports
- Convert all dynamic imports of main-axios.ts to static imports (10 files)
- Convert all dynamic imports of sonner to static imports (4 files)
- Add manual chunking configuration to vite.config.ts for better bundle splitting
- react-vendor: React and React DOM
- ui-vendor: Radix UI, lucide-react, clsx, tailwind-merge
- monaco: Monaco Editor
- codemirror: CodeMirror and related packages
- Increase chunkSizeWarningLimit to 1000kB
This resolves Vite warnings about mixed import strategies preventing
proper code-splitting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
* fix: file manager incorrectly decoding/encoding when editing files (made base64/utf8 dependent)
* fix: build error on docker
---------
Co-authored-by: Jefferson Nunn <89030989+jeffersonwarrior@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
* Increase max old space size for npm builds
* Increase Node.js memory limit in Dockerfile
* Remove NODE_OPTIONS from build commands in Dockerfile
* Change runner to blacksmith-4vcpu-ubuntu-2404
* fix: build error on docker
* Add handle on enter button;
---------
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
Co-authored-by: Gaylord Julien <g.j@mailbox.org>
Co-authored-by: Jefferson Nunn <89030989+jeffersonwarrior@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: LukeGus <bugattiguy527@gmail.com>
* fix: remove top tech
* fix: update readme
* fix: prevent long container names from overflowing card (#496)
Added min-w-0 to CardTitle to allow text truncation in flexbox.
Without this, flex items have min-width: auto which prevents
the truncate class from working properly.
Fixes #411
* fix: use SFTP readdir for file listing to support non-Linux systems (#495)
The file manager now uses SFTP readdir as the primary method for
listing files, with ls -la as a fallback. This enables compatibility
with MikroTik RouterOS and other non-Linux systems that don't have
standard shell commands.
Fixes #317
* fix: restore SSH connection timeout to 120s for 2FA authentication (#494)
The timeout was reduced from 120s to 30s in v1.10, causing 2FA login
failures. Users with keyboard-interactive authentication (TOTP/2FA)
need sufficient time to enter their verification codes before the
SSH connection times out.
Fixes #404
* feat: add Docker container healthcheck (#493)
* fix: owner should not be marked as shared when host is shared to their role (#492)
* fix: use correct MIME types for image preview (#491)
* fix: prevent session reset when updating host properties (#490)
* fix: add shell creation timeout and improve error handling (#489)
* fix: set default lineHeight to 1.0 for TUI apps compatibility (#488)
* fix: delete all related data when removing user (#487)
* fix: nginx permission denied on restricted kernels (#486)
* fix: skip existing hosts and credentials during JSON import (#485)
Added duplicate detection for SSH hosts (by ip+port+username) and
credentials (by name) during import. Existing items are now skipped
by default, or updated if replaceExisting option is enabled.
This matches the existing behavior of importDismissedAlerts.
Fixes #389
* feat: add firewall status widget for server stats (#484)
* Feature: PWA (#479)
* feat: add PWA support with offline capabilities
- Add web app manifest with icons and theme configuration
- Add service worker with cache-first strategy for static assets
- Add useServiceWorker hook for SW registration
- Add PWA meta tags and Apple-specific tags to index.html
- Update vite.config.ts for optimal asset caching
* Update package-lock.json
* New Crowdin updates (#472)
* New translations en.json (Romanian)
* New translations en.json (French)
* New translations en.json (Spanish)
* New translations en.json (Afrikaans)
* New translations en.json (Arabic)
* New translations en.json (Catalan)
* New translations en.json (Czech)
* New translations en.json (Danish)
* New translations en.json (German)
* New translations en.json (Greek)
* New translations en.json (Finnish)
* New translations en.json (Hebrew)
* New translations en.json (Hungarian)
* New translations en.json (Italian)
* New translations en.json (Japanese)
* New translations en.json (Korean)
* New translations en.json (Dutch)
* New translations en.json (Norwegian)
* New translations en.json (Polish)
* New translations en.json (Portuguese)
* New translations en.json (Russian)
* New translations en.json (Serbian (Cyrillic))
* New translations en.json (Swedish)
* New translations en.json (Turkish)
* New translations en.json (Ukrainian)
* New translations en.json (Chinese Simplified)
* New translations en.json (English)
* New translations en.json (Vietnamese)
* New translations en.json (German)
* feat: add listening ports widget for server stats (#483)
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
* feat: fix network stats merge and add openapi jsdocs comments
* feat: add workflow/config to auto generate openapi json
* feat: remove locales
* feat: support URL routes to open terminal directly (#156) (#503)
* fix: resolve merge conflict artifacts in dev-1.10.1
- Fix missing closing tags in AppView.tsx NetworkGraphView
- Fix incomplete catch blocks in server-stats.ts and db/index.ts
- Fix missing closing brace in en.json ports section
- Fix HostManagerApp.tsx import path
- Fix stats-widgets.ts type definition
- Fix schema.ts networkTopology table definition
- Add type annotations in user-data-import.ts
* feat: support URL routes to open terminal directly (#156)
- Add /terminal/{hostNameOrId} route for new format
- Keep /hosts/{id}/terminal for backward compatibility
- Smart detection: numeric IDs for ID lookup, otherwise name lookup
- Clean URL after opening to prevent duplicate on refresh
- Show toast error when host not found
---------
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
* feat: add Ctrl+Alt key remapping for browser-blocked shortcuts (#501)
Browsers intercept Ctrl+W/T/N/Q, making them unusable in terminal.
This adds Ctrl+Alt+<key> as an alternative that sends Ctrl+<key>.
- Ctrl+Alt+W → Ctrl+W (nano search, delete word)
- Ctrl+Alt+T → Ctrl+T (transpose chars)
- Ctrl+Alt+N → Ctrl+N (next line)
- Ctrl+Alt+Q → Ctrl+Q (XON flow control)
Fixes Termix-SSH/Support#407
* feat: remove locales
* New Crowdin updates (#504)
* New translations en.json (Romanian)
* New translations en.json (French)
* New translations en.json (Spanish)
* New translations en.json (Afrikaans)
* New translations en.json (Arabic)
* New translations en.json (Catalan)
* New translations en.json (Czech)
* New translations en.json (Danish)
* New translations en.json (German)
* New translations en.json (Greek)
* New translations en.json (Finnish)
* New translations en.json (Hebrew)
* New translations en.json (Hungarian)
* New translations en.json (Italian)
* New translations en.json (Japanese)
* New translations en.json (Korean)
* New translations en.json (Dutch)
* New translations en.json (Norwegian)
* New translations en.json (Polish)
* New translations en.json (Portuguese)
* New translations en.json (Russian)
* New translations en.json (Serbian (Cyrillic))
* New translations en.json (Swedish)
* New translations en.json (Turkish)
* New translations en.json (Ukrainian)
* New translations en.json (Chinese Simplified)
* New translations en.json (English)
* New translations en.json (Vietnamese)
* New translations en.json (German)
* New translations en.json (Norwegian)
* New translations en.json (Romanian)
* New translations en.json (French)
* New translations en.json (Spanish)
* New translations en.json (Arabic)
* New translations en.json (Czech)
* New translations en.json (Danish)
* New translations en.json (Greek)
* New translations en.json (Finnish)
* New translations en.json (Italian)
* New translations en.json (Japanese)
* New translations en.json (Dutch)
* New translations en.json (Norwegian)
* New translations en.json (Polish)
* New translations en.json (Portuguese)
* New translations en.json (Russian)
* New translations en.json (Swedish)
* New translations en.json (Ukrainian)
* New translations en.json (Chinese Simplified)
* New translations en.json (Chinese Traditional)
* New translations en.json (Finnish)
* New translations en.json (Chinese Simplified)
* New translations en.json (Chinese Traditional)
* feat: add option to disable update checker (#502)
* feat: add option to disable update checker
Add a new setting in User Profile > Settings to disable automatic
update checking on startup and dashboard.
- Adds 'Disable Update Check' toggle in profile settings
- Skips GitHub API calls when disabled (reduces network requests)
- Works for both web app and Electron client
Fixes Termix-SSH/Support#410
* feat: remove locales
---------
Co-authored-by: LukeGus <bugattiguy527@gmail.com>
* New Crowdin updates (#505)
* New translations en.json (Romanian)
* New translations en.json (French)
* New translations en.json (Spanish)
* New translations en.json (Afrikaans)
* New translations en.json (Arabic)
* New translations en.json (Catalan)
* New translations en.json (Czech)
* New translations en.json (Danish)
* New translations en.json (German)
* New translations en.json (Greek)
* New translations en.json (Finnish)
* New translations en.json (Hebrew)
* New translations en.json (Hungarian)
* New translations en.json (Italian)
* New translations en.json (Japanese)
* New translations en.json (Korean)
* New translations en.json (Dutch)
* New translations en.json (Norwegian)
* New translations en.json (Polish)
* New translations en.json (Portuguese)
* New translations en.json (Russian)
* New translations en.json (Serbian (Cyrillic))
* New translations en.json (Swedish)
* New translations en.json (Turkish)
* New translations en.json (Ukrainian)
* New translations en.json (Chinese Simplified)
* New translations en.json (English)
* New translations en.json (Vietnamese)
* New translations en.json (German)
* New translations en.json (Norwegian)
* New translations en.json (Romanian)
* New translations en.json (French)
* New translations en.json (Spanish)
* New translations en.json (Arabic)
* New translations en.json (Czech)
* New translations en.json (Danish)
* New translations en.json (Greek)
* New translations en.json (Finnish)
* New translations en.json (Italian)
* New translations en.json (Japanese)
* New translations en.json (Dutch)
* New translations en.json (Norwegian)
* New translations en.json (Polish)
* New translations en.json (Portuguese)
* New translations en.json (Russian)
* New translations en.json (Swedish)
* New translations en.json (Ukrainian)
* New translations en.json (Chinese Simplified)
* New translations en.json (Chinese Traditional)
* New translations en.json (Finnish)
* New translations en.json (Chinese Simplified)
* New translations en.json (Chinese Traditional)
* New translations en.json (Chinese Simplified)
* New translations en.json (Chinese Traditional)
* New translations en.json (Bulgarian)
* New translations en.json (Indonesian)
* New translations en.json (Hindi)
* feat: add crowdin i18n
* feat: remove locales
* New Crowdin updates (#506)
* New translations en.json (Romanian)
* New translations en.json (French)
* New translations en.json (Spanish)
* New translations en.json (Afrikaans)
* New translations en.json (Arabic)
* New translations en.json (Catalan)
* New translations en.json (Czech)
* New translations en.json (Danish)
* New translations en.json (German)
* New translations en.json (Greek)
* New translations en.json (Finnish)
* New translations en.json (Hebrew)
* New translations en.json (Hungarian)
* New translations en.json (Italian)
* New translations en.json (Japanese)
* New translations en.json (Korean)
* New translations en.json (Dutch)
* New translations en.json (Norwegian)
* New translations en.json (Polish)
* New translations en.json (Portuguese)
* New translations en.json (Russian)
* New translations en.json (Serbian (Cyrillic))
* New translations en.json (Swedish)
* New translations en.json (Turkish)
* New translations en.json (Ukrainian)
* New translations en.json (Chinese Simplified)
* New translations en.json (English)
* New translations en.json (Vietnamese)
* New translations en.json (German)
* New translations en.json (Norwegian)
* New translations en.json (Romanian)
* New translations en.json (French)
* New translations en.json (Spanish)
* New translations en.json (Arabic)
* New translations en.json (Czech)
* New translations en.json (Danish)
* New translations en.json (Greek)
* New translations en.json (Finnish)
* New translations en.json (Italian)
* New translations en.json (Japanese)
* New translations en.json (Dutch)
* New translations en.json (Norwegian)
* New translations en.json (Polish)
* New translations en.json (Portuguese)
* New translations en.json (Russian)
* New translations en.json (Swedish)
* New translations en.json (Ukrainian)
* New translations en.json (Chinese Simplified)
* New translations en.json (Chinese Traditional)
* New translations en.json (Finnish)
* New translations en.json (Chinese Simplified)
* New translations en.json (Chinese Traditional)
* New translations en.json (Chinese Simplified)
* New translations en.json (Chinese Traditional)
* New translations en.json (Bulgarian)
* New translations en.json (Indonesian)
* New translations en.json (Hindi)
* New translations en.json (Romanian)
* New translations en.json (French)
* New translations en.json (Spanish)
* New translations en.json (Afrikaans)
* New translations en.json (Arabic)
* New translations en.json (Catalan)
* New translations en.json (Czech)
* New translations en.json (German)
* New translations en.json (Greek)
* New translations en.json (Finnish)
* New translations en.json (Hebrew)
* New translations en.json (Hungarian)
* New translations en.json (Italian)
* New translations en.json (Japanese)
* New translations en.json (Korean)
* New translations en.json (Dutch)
* New translations en.json (Polish)
* New translations en.json (Portuguese)
* New translations en.json (Russian)
* New translations en.json (Serbian (Cyrillic))
* New translations en.json (Turkish)
* New translations en.json (Ukrainian)
* New translations en.json (Chinese Simplified)
* New translations en.json (Chinese Traditional)
* New translations en.json (Vietnamese)
* New translations en.json (Portuguese, Brazilian)
* New translations en.json (Bulgarian)
* New translations en.json (Indonesian)
* New translations en.json (Hindi)
* New translations en.json (Bengali)
* New translations en.json (Thai)
* feat: update readme
* feat: update readme
* feat: update credential editor to use submitting system and add health monitor
* feat: added toggle for command pallete
* feat: added close button on tab dropdown
* feat: added sidebar management and improved some host manager UI/UX
* feat: re-added missing users.ts route from merge
* feat: add toggle for password reset feature in admin settings (#508)
* feat: add sudo support for file manager operations (#509)
* fix: add sudo support for listFiles and improve permission error handling (#512)
* feat: add sudo support for file manager operations
* fix: add sudo support for listFiles and improve permission error handling
---------
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
* feat: fix sudo password dialog ui, add totp/pass reset limiting, and refreshed users screen when auth is outdated
* feat: add copy password button and fixed new line carriage issues and backend crash for auth key
* feat: added quick connection system (ad-hoc)
* Enter Key for Quick Login (#513)
* feat: added -r and -l support for tunnels
* feat: begin dashboard overhaul by splitting into cards and adding customization
* feat: improved full screen apps, overhauled dashboard, updated server stats ui, etc.
* feat: add auth.tsx suppot for fullscreen
* feat: greatly improve network graph ui/ux and migrated to use translations and theme system
* feat: update to use blacksmith
* feat: improve ui for customized tabs and hide add/edit host/credential when submiting
* feat: add warpgate support with a dialog (terminal only)
* feat: expand warpgate to docker/file manager
* fix: docker not working wtih warpgate and none auth failing for terminal
* fix: prevent owner permission loss when sharing host to own role (#514)
* Update Crowdin configuration file
* Update Crowdin configuration file
* Update Linux Portable section with AUR link (#474)
* fix: file manager incorrectly decoding/encoding when editing files (#476)
* fix: electron build errors and skip macos job
* fix: testflight submit failure
* fix: made submit job match build type
* fix: resolve Vite build warnings for mixed static/dynamic imports (#473)
* Update Crowdin configuration file
* Update Crowdin configuration file
* fix: resolve Vite build warnings for mixed static/dynamic imports
- Convert all dynamic imports of main-axios.ts to static imports (10 files)
- Convert all dynamic imports of sonner to static imports (4 files)
- Add manual chunking configuration to vite.config.ts for better bundle splitting
- react-vendor: React and React DOM
- ui-vendor: Radix UI, lucide-react, clsx, tailwind-merge
- monaco: Monaco Editor
- codemirror: CodeMirror and related packages
- Increase chunkSizeWarningLimit to 1000kB
This resolves Vite warnings about mixed import strategies preventing
proper code-splitting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
* fix: file manager incorrectly decoding/encoding when editing files (made base64/utf8 dependent)
---------
Co-authored-by: Jefferson Nunn <89030989+jeffersonwarrior@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
* fix: build error on docker (#477)
* fix: electron build errors and skip macos job
* fix: testflight submit failure
* fix: made submit job match build type
* fix: resolve Vite build warnings for mixed static/dynamic imports (#473)
* Update Crowdin configuration file
* Update Crowdin configuration file
* fix: resolve Vite build warnings for mixed static/dynamic imports
- Convert all dynamic imports of main-axios.ts to static imports (10 files)
- Convert all dynamic imports of sonner to static imports (4 files)
- Add manual chunking configuration to vite.config.ts for better bundle splitting
- react-vendor: React and React DOM
- ui-vendor: Radix UI, lucide-react, clsx, tailwind-merge
- monaco: Monaco Editor
- codemirror: CodeMirror and related packages
- Increase chunkSizeWarningLimit to 1000kB
This resolves Vite warnings about mixed import strategies preventing
proper code-splitting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
* fix: file manager incorrectly decoding/encoding when editing files (made base64/utf8 dependent)
* fix: build error on docker
---------
Co-authored-by: Jefferson Nunn <89030989+jeffersonwarrior@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
* Increase max old space size for npm builds
* Increase Node.js memory limit in Dockerfile
* Remove NODE_OPTIONS from build commands in Dockerfile
* Change runner to blacksmith-4vcpu-ubuntu-2404
* fix: build error on docker
* fix: prevent owner permission loss when sharing host to own role
Fixes #391
---------
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
Co-authored-by: Gaylord Julien <g.j@mailbox.org>
Co-authored-by: Jefferson Nunn <89030989+jeffersonwarrior@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: LukeGus <bugattiguy527@gmail.com>
* fix: SSH key passphrase not passed for Docker and Tunnel (#521)
* perf: optimize Host Manager for large host lists
- Add ServerStatusContext for shared status polling (reduces API calls from N to 1)
- Move TooltipProvider to component root (eliminates N context instances)
- Add pagination with "Show More" button (limits initial DOM nodes per folder)
Fixes performance issues when managing ~1000 hosts with status monitoring enabled.
* fix: SSH key passphrase not passed to ssh2 for Docker and Tunnel
Database field is `key_password` but code used `keyPassword`.
Added fallback to check both field names.
Affected:
- docker.ts: Docker SSH connections with encrypted keys
- tunnel.ts: Tunnel connections with encrypted keys
---------
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
* perf: optimize Host Manager for large host lists (#520)
- Add ServerStatusContext for shared status polling (reduces API calls from N to 1)
- Move TooltipProvider to component root (eliminates N context instances)
- Add pagination with "Show More" button (limits initial DOM nodes per folder)
Fixes performance issues when managing ~1000 hosts with status monitoring enabled.
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
* fix: add missing mimeTypes definition for image preview (#518)
Fixes Termix-SSH/Support#408
* fix: prevent session reset when updating host properties (#517)
Move WebSocket cleanup logic to a separate unmount-only effect to
prevent SSH sessions from being closed when host properties are updated.
Closes Termix-SSH/Support#401
* fix: backend type error
* feat: make terminal connections more resilient, added connection log, and fixed https/proxy reconnection loop (issue #385)
* feat: improved conneciton log ui/logic
* feat: improved conneciton log ui/logic
* feat: expanded connection log to work across all components (readying for release)
* feat: update readme
* feat: update readme
* fix: build error
* fix: build error
* fix: changed ver
* chore: clean up
* chore: continue clean up
* fix: remove attempts remaining and fix electron errors and some connection log ui inconsistencies
* fix: added missing nginx routes and fixed sudo password copy with sudo password autofil field
* fix: update readme and run cleaner
* fix: update readme
* fix: update readme
* fix: update readme
* feat: update chinese readme
---------
Co-authored-by: Steven Josefs <s.josefs@gmx.de>
Co-authored-by: Jefferson Nunn <89030989+jeffersonwarrior@users.noreply.github.com>
Co-authored-by: Termix CI <ci@termix.dev>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Nunzio Marfè <nunzio.marfe@protonmail.com>
Co-authored-by: Gaylord Julien <g.j@mailbox.org>
Co-authored-by: ZacharyZcR <zacharyzcr1984@gmail.com>
Co-authored-by: Aditya Tawade <36890395+aditya-tawade@users.noreply.github.com>
763 lines
23 KiB
TypeScript
763 lines
23 KiB
TypeScript
import React from "react";
|
|
import { useSidebar } from "@/components/ui/sidebar.tsx";
|
|
import { Separator } from "@/components/ui/separator.tsx";
|
|
import {
|
|
Tabs,
|
|
TabsContent,
|
|
TabsList,
|
|
TabsTrigger,
|
|
} from "@/components/ui/tabs.tsx";
|
|
import { useTranslation } from "react-i18next";
|
|
import { toast } from "sonner";
|
|
import type { SSHHost, DockerContainer, DockerValidation } from "@/types";
|
|
import {
|
|
connectDockerSession,
|
|
disconnectDockerSession,
|
|
listDockerContainers,
|
|
validateDockerAvailability,
|
|
keepaliveDockerSession,
|
|
verifyDockerTOTP,
|
|
verifyDockerWarpgate,
|
|
logActivity,
|
|
getSSHHosts,
|
|
} from "@/ui/main-axios.ts";
|
|
import { SimpleLoader } from "@/ui/desktop/navigation/animations/SimpleLoader.tsx";
|
|
import { ContainerList } from "./components/ContainerList.tsx";
|
|
import { ContainerDetail } from "./components/ContainerDetail.tsx";
|
|
import { TOTPDialog } from "@/ui/desktop/navigation/dialogs/TOTPDialog.tsx";
|
|
import { SSHAuthDialog } from "@/ui/desktop/navigation/dialogs/SSHAuthDialog.tsx";
|
|
import { WarpgateDialog } from "@/ui/desktop/navigation/dialogs/WarpgateDialog.tsx";
|
|
import { useTabs } from "@/ui/desktop/navigation/tabs/TabContext.tsx";
|
|
import {
|
|
ConnectionLogProvider,
|
|
useConnectionLog,
|
|
} from "@/ui/desktop/navigation/connection-log/ConnectionLogContext.tsx";
|
|
import { ConnectionLog } from "@/ui/desktop/navigation/connection-log/ConnectionLog.tsx";
|
|
|
|
interface DockerManagerProps {
|
|
hostConfig?: SSHHost;
|
|
title?: string;
|
|
isVisible?: boolean;
|
|
isTopbarOpen?: boolean;
|
|
embedded?: boolean;
|
|
onClose?: () => void;
|
|
}
|
|
|
|
interface TabData {
|
|
id: number;
|
|
type: string;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
function DockerManagerInner({
|
|
hostConfig,
|
|
title,
|
|
isVisible = true,
|
|
isTopbarOpen = true,
|
|
embedded = false,
|
|
onClose,
|
|
}: DockerManagerProps): React.ReactElement {
|
|
const { t } = useTranslation();
|
|
const { state: sidebarState } = useSidebar();
|
|
const {
|
|
addLog,
|
|
setLogs,
|
|
clearLogs,
|
|
isExpanded: isConnectionLogExpanded,
|
|
} = useConnectionLog();
|
|
const { currentTab, removeTab } = useTabs() as {
|
|
currentTab: number | null;
|
|
removeTab: (tabId: number) => void;
|
|
};
|
|
const [currentHostConfig, setCurrentHostConfig] = React.useState(hostConfig);
|
|
const [sessionId, setSessionId] = React.useState<string | null>(null);
|
|
const [containers, setContainers] = React.useState<DockerContainer[]>([]);
|
|
const [selectedContainer, setSelectedContainer] = React.useState<
|
|
string | null
|
|
>(null);
|
|
const [isConnecting, setIsConnecting] = React.useState(false);
|
|
const [activeTab, setActiveTab] = React.useState("containers");
|
|
const [dockerValidation, setDockerValidation] =
|
|
React.useState<DockerValidation | null>(null);
|
|
const [isValidating, setIsValidating] = React.useState(false);
|
|
const [viewMode, setViewMode] = React.useState<"list" | "detail">("list");
|
|
const [isLoadingContainers, setIsLoadingContainers] = React.useState(false);
|
|
const [totpRequired, setTotpRequired] = React.useState(false);
|
|
const [totpSessionId, setTotpSessionId] = React.useState<string | null>(null);
|
|
const [totpPrompt, setTotpPrompt] = React.useState<string>("");
|
|
const [warpgateRequired, setWarpgateRequired] = React.useState(false);
|
|
const [warpgateSessionId, setWarpgateSessionId] = React.useState<
|
|
string | null
|
|
>(null);
|
|
const [warpgateUrl, setWarpgateUrl] = React.useState<string>("");
|
|
const [warpgateSecurityKey, setWarpgateSecurityKey] =
|
|
React.useState<string>("");
|
|
const [showAuthDialog, setShowAuthDialog] = React.useState(false);
|
|
const [authReason, setAuthReason] = React.useState<
|
|
"no_keyboard" | "auth_failed" | "timeout"
|
|
>("no_keyboard");
|
|
const [hasConnectionError, setHasConnectionError] = React.useState(false);
|
|
|
|
const activityLoggedRef = React.useRef(false);
|
|
const activityLoggingRef = React.useRef(false);
|
|
|
|
const logDockerActivity = async () => {
|
|
if (
|
|
!currentHostConfig?.id ||
|
|
activityLoggedRef.current ||
|
|
activityLoggingRef.current
|
|
) {
|
|
return;
|
|
}
|
|
|
|
activityLoggingRef.current = true;
|
|
activityLoggedRef.current = true;
|
|
|
|
try {
|
|
const hostName =
|
|
currentHostConfig.name ||
|
|
`${currentHostConfig.username}@${currentHostConfig.ip}`;
|
|
await logActivity("docker", currentHostConfig.id, hostName);
|
|
} catch (err) {
|
|
console.warn("Failed to log docker activity:", err);
|
|
activityLoggedRef.current = false;
|
|
} finally {
|
|
activityLoggingRef.current = false;
|
|
}
|
|
};
|
|
|
|
React.useEffect(() => {
|
|
if (hostConfig?.id !== currentHostConfig?.id) {
|
|
setCurrentHostConfig(hostConfig);
|
|
setContainers([]);
|
|
setSelectedContainer(null);
|
|
setSessionId(null);
|
|
setDockerValidation(null);
|
|
setViewMode("list");
|
|
}
|
|
}, [hostConfig?.id]);
|
|
|
|
React.useEffect(() => {
|
|
const fetchLatestHostConfig = async () => {
|
|
if (hostConfig?.id) {
|
|
try {
|
|
const hosts = await getSSHHosts();
|
|
const updatedHost = hosts.find((h) => h.id === hostConfig.id);
|
|
if (updatedHost) {
|
|
setCurrentHostConfig(updatedHost);
|
|
}
|
|
} catch {
|
|
// Silently handle error
|
|
}
|
|
}
|
|
};
|
|
|
|
fetchLatestHostConfig();
|
|
|
|
const handleHostsChanged = async () => {
|
|
if (hostConfig?.id) {
|
|
try {
|
|
const hosts = await getSSHHosts();
|
|
const updatedHost = hosts.find((h) => h.id === hostConfig.id);
|
|
if (updatedHost) {
|
|
setCurrentHostConfig(updatedHost);
|
|
}
|
|
} catch {
|
|
// Silently handle error
|
|
}
|
|
}
|
|
};
|
|
|
|
window.addEventListener("ssh-hosts:changed", handleHostsChanged);
|
|
return () =>
|
|
window.removeEventListener("ssh-hosts:changed", handleHostsChanged);
|
|
}, [hostConfig?.id]);
|
|
|
|
const initializingRef = React.useRef(false);
|
|
|
|
React.useEffect(() => {
|
|
const initSession = async () => {
|
|
if (!currentHostConfig?.id || !currentHostConfig.enableDocker) {
|
|
return;
|
|
}
|
|
|
|
if (initializingRef.current) return;
|
|
initializingRef.current = true;
|
|
|
|
if (sessionId) {
|
|
initializingRef.current = false;
|
|
return;
|
|
}
|
|
|
|
setIsConnecting(true);
|
|
setHasConnectionError(false);
|
|
clearLogs();
|
|
const sid = `docker-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
|
|
try {
|
|
const result = await connectDockerSession(sid, currentHostConfig.id, {
|
|
useSocks5: currentHostConfig.useSocks5,
|
|
socks5Host: currentHostConfig.socks5Host,
|
|
socks5Port: currentHostConfig.socks5Port,
|
|
socks5Username: currentHostConfig.socks5Username,
|
|
socks5Password: currentHostConfig.socks5Password,
|
|
socks5ProxyChain: currentHostConfig.socks5ProxyChain,
|
|
});
|
|
|
|
if (result?.requires_warpgate) {
|
|
setWarpgateRequired(true);
|
|
setWarpgateSessionId(sid);
|
|
setWarpgateUrl(result.url || "");
|
|
setWarpgateSecurityKey(result.securityKey || "");
|
|
setIsConnecting(false);
|
|
return;
|
|
}
|
|
|
|
if (result?.requires_totp) {
|
|
setTotpRequired(true);
|
|
setTotpSessionId(sid);
|
|
setTotpPrompt(result.prompt || t("docker.verificationCodePrompt"));
|
|
setIsConnecting(false);
|
|
return;
|
|
}
|
|
|
|
if (result?.status === "auth_required") {
|
|
setShowAuthDialog(true);
|
|
setAuthReason(
|
|
result.reason === "no_keyboard" ? "no_keyboard" : "auth_failed",
|
|
);
|
|
setIsConnecting(false);
|
|
return;
|
|
}
|
|
|
|
setSessionId(sid);
|
|
|
|
setIsValidating(true);
|
|
const validation = await validateDockerAvailability(sid);
|
|
setDockerValidation(validation);
|
|
setIsValidating(false);
|
|
|
|
if (!validation.available) {
|
|
setHasConnectionError(true);
|
|
addLog({
|
|
type: "error",
|
|
stage: "validation",
|
|
message: validation.error || t("docker.error"),
|
|
details: validation.code
|
|
? `Error code: ${validation.code}`
|
|
: undefined,
|
|
});
|
|
} else {
|
|
logDockerActivity();
|
|
setTimeout(() => clearLogs(), 1000);
|
|
}
|
|
} catch (error: any) {
|
|
setIsConnecting(false);
|
|
setIsValidating(false);
|
|
setHasConnectionError(true);
|
|
|
|
if (error?.connectionLogs) {
|
|
setLogs(error.connectionLogs);
|
|
} else {
|
|
addLog({
|
|
type: "error",
|
|
stage: "connection",
|
|
message: error?.message || t("docker.connectionFailed"),
|
|
});
|
|
}
|
|
} finally {
|
|
setIsConnecting(false);
|
|
}
|
|
};
|
|
|
|
initSession();
|
|
|
|
return () => {
|
|
initializingRef.current = false;
|
|
if (sessionId) {
|
|
disconnectDockerSession(sessionId).catch(() => {
|
|
// Silently handle disconnect errors
|
|
});
|
|
}
|
|
};
|
|
}, [currentHostConfig?.id, currentHostConfig?.enableDocker]);
|
|
|
|
React.useEffect(() => {
|
|
if (!sessionId || !isVisible) return;
|
|
|
|
const keepalive = setInterval(
|
|
() => {
|
|
keepaliveDockerSession(sessionId).catch(() => {
|
|
// Silently handle keepalive errors
|
|
});
|
|
},
|
|
10 * 60 * 1000,
|
|
);
|
|
|
|
return () => clearInterval(keepalive);
|
|
}, [sessionId, isVisible]);
|
|
|
|
const refreshContainers = React.useCallback(async () => {
|
|
if (!sessionId) return;
|
|
try {
|
|
const data = await listDockerContainers(sessionId, true);
|
|
setContainers(data);
|
|
} catch (error) {
|
|
// Silently handle polling errors
|
|
}
|
|
}, [sessionId]);
|
|
|
|
React.useEffect(() => {
|
|
if (!sessionId || !isVisible || !dockerValidation?.available) return;
|
|
|
|
let cancelled = false;
|
|
|
|
const pollContainers = async () => {
|
|
try {
|
|
setIsLoadingContainers(true);
|
|
const data = await listDockerContainers(sessionId, true);
|
|
if (!cancelled) {
|
|
setContainers(data);
|
|
}
|
|
} catch (error) {
|
|
// Silently handle polling errors
|
|
} finally {
|
|
if (!cancelled) {
|
|
setIsLoadingContainers(false);
|
|
}
|
|
}
|
|
};
|
|
|
|
pollContainers();
|
|
const interval = setInterval(pollContainers, 5000);
|
|
|
|
return () => {
|
|
cancelled = true;
|
|
clearInterval(interval);
|
|
};
|
|
}, [sessionId, isVisible, dockerValidation?.available]);
|
|
|
|
const handleBack = React.useCallback(() => {
|
|
setViewMode("list");
|
|
setSelectedContainer(null);
|
|
}, []);
|
|
|
|
const handleTotpSubmit = async (code: string) => {
|
|
if (!totpSessionId || !code) return;
|
|
|
|
try {
|
|
setIsConnecting(true);
|
|
const result = await verifyDockerTOTP(totpSessionId, code);
|
|
|
|
if (result?.status === "success") {
|
|
setTotpRequired(false);
|
|
setTotpPrompt("");
|
|
setSessionId(totpSessionId);
|
|
setTotpSessionId(null);
|
|
|
|
setIsValidating(true);
|
|
const validation = await validateDockerAvailability(totpSessionId);
|
|
setDockerValidation(validation);
|
|
setIsValidating(false);
|
|
|
|
if (!validation.available) {
|
|
setHasConnectionError(true);
|
|
addLog({
|
|
type: "error",
|
|
stage: "validation",
|
|
message: validation.error || t("docker.error"),
|
|
details: validation.code
|
|
? `Error code: ${validation.code}`
|
|
: undefined,
|
|
});
|
|
} else {
|
|
logDockerActivity();
|
|
}
|
|
}
|
|
} catch (error) {
|
|
console.error("TOTP verification failed:", error);
|
|
setHasConnectionError(true);
|
|
addLog({
|
|
type: "error",
|
|
stage: "auth",
|
|
message: t("docker.totpVerificationFailed"),
|
|
});
|
|
} finally {
|
|
setIsConnecting(false);
|
|
}
|
|
};
|
|
|
|
const handleTotpCancel = () => {
|
|
setTotpRequired(false);
|
|
setTotpSessionId(null);
|
|
setTotpPrompt("");
|
|
setIsConnecting(false);
|
|
if (currentTab !== null) {
|
|
removeTab(currentTab);
|
|
}
|
|
};
|
|
|
|
const handleWarpgateContinue = async () => {
|
|
if (!warpgateSessionId) return;
|
|
|
|
try {
|
|
setIsConnecting(true);
|
|
const result = await verifyDockerWarpgate(warpgateSessionId);
|
|
|
|
if (result?.status === "success") {
|
|
setWarpgateRequired(false);
|
|
setWarpgateUrl("");
|
|
setWarpgateSecurityKey("");
|
|
setSessionId(warpgateSessionId);
|
|
setWarpgateSessionId(null);
|
|
|
|
setIsValidating(true);
|
|
const validation = await validateDockerAvailability(warpgateSessionId);
|
|
setDockerValidation(validation);
|
|
setIsValidating(false);
|
|
|
|
if (!validation.available) {
|
|
setHasConnectionError(true);
|
|
addLog({
|
|
type: "error",
|
|
stage: "validation",
|
|
message: validation.error || t("docker.error"),
|
|
details: validation.code
|
|
? `Error code: ${validation.code}`
|
|
: undefined,
|
|
});
|
|
} else {
|
|
logDockerActivity();
|
|
}
|
|
}
|
|
} catch (error) {
|
|
console.error("Warpgate verification failed:", error);
|
|
setHasConnectionError(true);
|
|
addLog({
|
|
type: "error",
|
|
stage: "auth",
|
|
message: t("docker.warpgateVerificationFailed"),
|
|
});
|
|
} finally {
|
|
setIsConnecting(false);
|
|
}
|
|
};
|
|
|
|
const handleWarpgateCancel = () => {
|
|
setWarpgateRequired(false);
|
|
setWarpgateSessionId(null);
|
|
setWarpgateUrl("");
|
|
setWarpgateSecurityKey("");
|
|
setIsConnecting(false);
|
|
if (currentTab !== null) {
|
|
removeTab(currentTab);
|
|
}
|
|
};
|
|
|
|
const handleWarpgateOpenUrl = () => {
|
|
if (warpgateUrl) {
|
|
window.open(warpgateUrl, "_blank", "noopener,noreferrer");
|
|
}
|
|
};
|
|
|
|
const handleAuthSubmit = async (credentials: {
|
|
password?: string;
|
|
sshKey?: string;
|
|
keyPassword?: string;
|
|
}) => {
|
|
if (!currentHostConfig?.id) return;
|
|
|
|
setShowAuthDialog(false);
|
|
setIsConnecting(true);
|
|
|
|
const sid = `docker-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
|
|
try {
|
|
const result = await connectDockerSession(sid, currentHostConfig.id, {
|
|
userProvidedPassword: credentials.password,
|
|
userProvidedSshKey: credentials.sshKey,
|
|
userProvidedKeyPassword: credentials.keyPassword,
|
|
useSocks5: currentHostConfig.useSocks5,
|
|
socks5Host: currentHostConfig.socks5Host,
|
|
socks5Port: currentHostConfig.socks5Port,
|
|
socks5Username: currentHostConfig.socks5Username,
|
|
socks5Password: currentHostConfig.socks5Password,
|
|
socks5ProxyChain: currentHostConfig.socks5ProxyChain,
|
|
});
|
|
|
|
if (result?.requires_warpgate) {
|
|
setWarpgateRequired(true);
|
|
setWarpgateSessionId(sid);
|
|
setWarpgateUrl(result.url || "");
|
|
setWarpgateSecurityKey(result.securityKey || "N/A");
|
|
setIsConnecting(false);
|
|
return;
|
|
}
|
|
|
|
if (result?.requires_totp) {
|
|
setTotpRequired(true);
|
|
setTotpSessionId(sid);
|
|
setTotpPrompt(result.prompt || t("docker.verificationCodePrompt"));
|
|
setIsConnecting(false);
|
|
return;
|
|
}
|
|
|
|
if (result?.status === "auth_required") {
|
|
setShowAuthDialog(true);
|
|
setAuthReason("auth_failed");
|
|
setIsConnecting(false);
|
|
return;
|
|
}
|
|
|
|
setSessionId(sid);
|
|
|
|
setIsValidating(true);
|
|
const validation = await validateDockerAvailability(sid);
|
|
setDockerValidation(validation);
|
|
setIsValidating(false);
|
|
|
|
if (!validation.available) {
|
|
setHasConnectionError(true);
|
|
} else {
|
|
logDockerActivity();
|
|
}
|
|
} catch (error) {
|
|
setIsConnecting(false);
|
|
setIsValidating(false);
|
|
setHasConnectionError(true);
|
|
addLog({
|
|
type: "error",
|
|
stage: "connection",
|
|
message: error?.message || t("docker.connectionFailed"),
|
|
});
|
|
} finally {
|
|
setIsConnecting(false);
|
|
}
|
|
};
|
|
|
|
const handleAuthCancel = () => {
|
|
setShowAuthDialog(false);
|
|
setIsConnecting(false);
|
|
onClose?.();
|
|
};
|
|
|
|
const topMarginPx = isTopbarOpen ? 74 : 16;
|
|
const leftMarginPx = sidebarState === "collapsed" ? 16 : 8;
|
|
const bottomMarginPx = 8;
|
|
|
|
const wrapperStyle: React.CSSProperties = embedded
|
|
? { opacity: isVisible ? 1 : 0, height: "100%", width: "100%" }
|
|
: {
|
|
opacity: isVisible ? 1 : 0,
|
|
marginLeft: leftMarginPx,
|
|
marginRight: 17,
|
|
marginTop: topMarginPx,
|
|
marginBottom: bottomMarginPx,
|
|
height: `calc(100vh - ${topMarginPx + bottomMarginPx}px)`,
|
|
};
|
|
|
|
const containerClass = embedded
|
|
? "h-full w-full text-foreground overflow-hidden bg-transparent"
|
|
: "bg-canvas text-foreground rounded-lg border-2 border-edge overflow-hidden";
|
|
|
|
if (!currentHostConfig?.enableDocker) {
|
|
return (
|
|
<div style={wrapperStyle} className={`${containerClass} relative`}>
|
|
<div className="h-full w-full flex flex-col">
|
|
<div className="flex flex-col sm:flex-row sm:items-center justify-between px-4 pt-3 pb-3 gap-3">
|
|
<div className="flex items-center gap-4 min-w-0">
|
|
<div className="min-w-0">
|
|
<h1 className="font-bold text-lg truncate">
|
|
{currentHostConfig?.folder} / {title}
|
|
</h1>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<Separator className="p-0.25 w-full" />
|
|
|
|
<div className="flex-1 overflow-hidden min-h-0 p-4">
|
|
<Alert variant="destructive">
|
|
<AlertCircle className="h-4 w-4" />
|
|
<AlertDescription>{t("docker.notEnabled")}</AlertDescription>
|
|
</Alert>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
if (isConnecting || isValidating) {
|
|
return (
|
|
<div style={wrapperStyle} className={`${containerClass} relative`}>
|
|
<div className="h-full w-full flex flex-col">
|
|
<div className="flex-1 overflow-hidden min-h-0 relative">
|
|
<SimpleLoader
|
|
visible={true && !isConnectionLogExpanded}
|
|
message={
|
|
isValidating ? t("docker.validating") : t("docker.connecting")
|
|
}
|
|
/>
|
|
</div>
|
|
</div>
|
|
<ConnectionLog
|
|
isConnecting={isConnecting}
|
|
isConnected={!!sessionId && !!dockerValidation?.available}
|
|
hasConnectionError={hasConnectionError}
|
|
position={hasConnectionError ? "top" : "bottom"}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
if (dockerValidation && !dockerValidation.available) {
|
|
return (
|
|
<div style={wrapperStyle} className={`${containerClass} relative`}>
|
|
<ConnectionLog
|
|
isConnecting={isConnecting}
|
|
isConnected={!!sessionId && !!dockerValidation?.available}
|
|
hasConnectionError={
|
|
hasConnectionError ||
|
|
(!!dockerValidation && !dockerValidation.available)
|
|
}
|
|
position={
|
|
hasConnectionError ||
|
|
(!!dockerValidation && !dockerValidation.available)
|
|
? "top"
|
|
: "bottom"
|
|
}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div style={wrapperStyle} className={`${containerClass} relative`}>
|
|
<div
|
|
className="h-full w-full flex flex-col"
|
|
style={{
|
|
visibility:
|
|
(hasConnectionError ||
|
|
(!!dockerValidation && !dockerValidation.available)) &&
|
|
isConnectionLogExpanded
|
|
? "hidden"
|
|
: "visible",
|
|
}}
|
|
>
|
|
<div className="flex flex-col sm:flex-row sm:items-center justify-between px-4 pt-3 pb-3 gap-3">
|
|
<div className="flex items-center gap-4 min-w-0">
|
|
<div className="min-w-0">
|
|
<h1 className="font-bold text-lg truncate">
|
|
{currentHostConfig?.folder} / {title}
|
|
</h1>
|
|
{dockerValidation?.version && (
|
|
<p className="text-xs text-muted-foreground">
|
|
{t("docker.version", { version: dockerValidation.version })}
|
|
</p>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<Separator className="p-0.25 w-full" />
|
|
|
|
<div className="flex-1 overflow-hidden min-h-0 relative">
|
|
{viewMode === "list" ? (
|
|
<div className="h-full px-4 py-4">
|
|
{sessionId ? (
|
|
isLoadingContainers && containers.length === 0 ? (
|
|
<SimpleLoader
|
|
visible={true}
|
|
message={t("docker.loadingContainers")}
|
|
/>
|
|
) : (
|
|
<ContainerList
|
|
containers={containers}
|
|
sessionId={sessionId}
|
|
onSelectContainer={(id) => {
|
|
setSelectedContainer(id);
|
|
setViewMode("detail");
|
|
}}
|
|
selectedContainerId={selectedContainer}
|
|
onRefresh={refreshContainers}
|
|
/>
|
|
)
|
|
) : (
|
|
<div className="text-center py-8">
|
|
<p className="text-muted-foreground">No session available</p>
|
|
</div>
|
|
)}
|
|
</div>
|
|
) : sessionId && selectedContainer && currentHostConfig ? (
|
|
<ContainerDetail
|
|
sessionId={sessionId}
|
|
containerId={selectedContainer}
|
|
containers={containers}
|
|
hostConfig={currentHostConfig}
|
|
onBack={handleBack}
|
|
/>
|
|
) : (
|
|
<div className="text-center py-8">
|
|
<p className="text-muted-foreground">
|
|
Select a container to view details
|
|
</p>
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
<TOTPDialog
|
|
isOpen={totpRequired}
|
|
prompt={totpPrompt}
|
|
onSubmit={handleTotpSubmit}
|
|
onCancel={handleTotpCancel}
|
|
/>
|
|
<WarpgateDialog
|
|
isOpen={warpgateRequired}
|
|
url={warpgateUrl}
|
|
securityKey={warpgateSecurityKey}
|
|
onContinue={handleWarpgateContinue}
|
|
onCancel={handleWarpgateCancel}
|
|
onOpenUrl={handleWarpgateOpenUrl}
|
|
/>
|
|
{currentHostConfig && (
|
|
<SSHAuthDialog
|
|
isOpen={showAuthDialog}
|
|
reason={authReason}
|
|
onSubmit={handleAuthSubmit}
|
|
onCancel={handleAuthCancel}
|
|
hostInfo={{
|
|
ip: currentHostConfig.ip,
|
|
port: currentHostConfig.port,
|
|
username: currentHostConfig.username,
|
|
name: currentHostConfig.name,
|
|
}}
|
|
/>
|
|
)}
|
|
<SimpleLoader
|
|
visible={isConnecting && !isConnectionLogExpanded}
|
|
message={t("docker.connecting")}
|
|
/>
|
|
<ConnectionLog
|
|
isConnecting={isConnecting}
|
|
isConnected={!!sessionId && !!dockerValidation?.available}
|
|
hasConnectionError={
|
|
hasConnectionError ||
|
|
(!!dockerValidation && !dockerValidation.available)
|
|
}
|
|
position={
|
|
hasConnectionError ||
|
|
(!!dockerValidation && !dockerValidation.available)
|
|
? "top"
|
|
: "bottom"
|
|
}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export function DockerManager(props: DockerManagerProps): React.ReactElement {
|
|
return (
|
|
<ConnectionLogProvider>
|
|
<DockerManagerInner {...props} />
|
|
</ConnectionLogProvider>
|
|
);
|
|
}
|