mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-16 03:50:52 +00:00
14ed19d2ed7cd1ecc201c9c910b112e97cc098ff
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ebc1ac7598 |
Add container runtime switcher and Kubernetes pods in the Docker panel (#3791)
* feat(system-manager): add container runtime switcher and kubectl pods Keep the existing Docker tab and select docker, podman, nerdctl, or Kubernetes from runtimes detected on the host. Kubernetes replaces the switcher with context and namespace selectors in the same panel. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): address container runtime review findings Move the runtime adapter into the domain layer, keep a context namespace when namespace listing is forbidden, and emit PowerShell or cmd startup commands for Kubernetes shell, logs, and describe. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): cover Windows container popups and stale namespaces Run container shell and logs through the host shell's inspect wrapper on PowerShell and cmd, and reset the namespace when a remembered Kubernetes context is no longer present. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): parse kubectl JSON after banners and scope inspect cache Skip bracketed banners before kubectl JSON, and include the container runtime in image and container inspect cache keys. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): parse Podman image lists emitted as JSON arrays Podman applies {{json .}} to the whole image slice. Accept that array, including Names and byte sizes, and keep Docker's JSON lines. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): parse Podman stats arrays Accept Podman's stats JSON array and its id/cpu_percent fields, and keep Docker's one-stat-per-line output. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): list every Podman image tag Expand each name in a Podman image's Names array into its own row so extra tags stay visible and searchable. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): quote kubectl list and delete for the session shell Namespace, pod, and delete commands follow PowerShell or cmd quoting when the session shell is not POSIX, so apostrophes in a context name survive local PowerShell. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): drop renamed runtime launch commands from shell history Container popups now probe with _nc_rt_err and also cover podman, nerdctl, and kubectl. History sanitizers still required _nc_docker_err, so those launches stayed in persisted history. Confirm-dialog resets also follow the selected runtime. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): sum Podman interface stats and quote kubectl for the executor Podman {{json .}} stats keep per-interface counters on Network, so the details panel now sums RxBytes and TxBytes. Background kubectl runs in powershell.exe on local Windows even when the terminal is cmd, so those commands are quoted for that executor instead of the interactive shell. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): remove a selected image tag instead of the shared id Podman rows that share one image id were all deleted with rmi <id>, which either fails while other tags remain or drops every name. Tagged rows now run rmi repository:tag; dangling images still use the id. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): reject cmd kubectl arguments that contain percent signs Interactive cmd.exe expands %VAR% inside double quotes, so a context such as prod-%USERNAME% would be rewritten before kubectl sees it. Cmd popups now refuse that argument. PowerShell quoting still preserves the percent. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * refactor(system-manager): move runtime selection into an application hook Persisted source, context, and namespace state plus the kubectl discovery effects now live in useContainerRuntimeSelection. DockerManagerTab only renders the switcher and panels. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): offer kubectl shell only for running containers Succeeded and failed pods have no running container, and a completed init container cannot accept exec. Shell targets now come from container statuses that are running; logs still include init containers. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): keep Windows popup commands out of shell history PowerShell and cmd container popups inspect then run, and kubectl popups are typed directly. History filtering only matched the POSIX sh -c wrapper, so those launches were stored as user commands. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): mark Windows popups instead of matching kubectl syntax Filtering kubectl --context logs and describe also dropped commands the user typed. Windows popups now carry __NC_POPUP__, and ordinary kubectl lines stay in history. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): reject cmd arguments that contain delayed-expansion marks cmd.exe with /V:ON expands !VAR! inside double quotes. Contexts such as prod!USER! are refused for cmd popups, same as percent signs. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): hide raw nerdctl and unreachable cluster errors Only offer nerdctl after a short info probe succeeds, or when the failure is a socket permission error that sudo can still recover. Map dead containerd and unreachable kube API errors to short localized messages and keep the CLI text in the log. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): show terminating pods and ephemeral containers A deletion timestamp is Terminating even while the phase is still Running. Ephemeral containers are included in the logs list, and a running one is a shell target. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): keep the runtime select on Kubernetes and avoid covering it Kubernetes uses the same compact source menu as Docker, with context and namespace beside it. Shell popups open in the free part of the window so they no longer sit on top of the pod badges. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): restore the saved engine when Kubernetes disappears A host that was on Podman before Kubernetes keeps Podman if kubectl is gone, instead of falling back to Docker and overwriting that choice. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): avoid the visible system panel when others are parked A hidden parking-host panel can be the first system-manager match and has a zero-size rect. Scan every match and pass the first panel that actually has size so the shell popup still sits beside the open panel. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): keep a runtime choice across probe gaps and show podman ports A failed nerdctl or kubectl probe was saved as the fallback engine, so the previous choice never returned. Reconciliation now restores the stored source when it is detected again, and automatic fallbacks are not written back. Podman ps port mappings and exposed ports are formatted into the same display string the container detail strip already shows. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): show a pod's Evicted reason Pod status.reason is the eviction signal, while the phase stays Failed and the container often reports Error. Use that reason after a container waiting state and before the generic phase so the badge stays Evicted. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): keep an avoided shell popup inside the work area When the source window sits partly off-screen, clamping a slot back onto the display could cover the system panel, and the fallback then used the raw slot origin. Place the popup in the on-screen part of the slot instead. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(system-manager): left-align the runtime selector row The Kubernetes context, namespace, and runtime selects sat on the right of the header, so they did not line up with the search field. Keep the same padding, let the context select fill the remaining width, and leave the runtime and namespace selects at their natural width. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> |
||
|
|
cc5ad3be16 |
perf: isolate Terminal hot props, cut memory/jank, and repay architecture debt (#2790)
* refactor: migrate architecture-debt hooks into application/state Move SFTP Wave A stores/hooks and related vault/AI/terminal/systemManager hooks out of components into application/state, update importers, and keep thin deprecated re-exports at the old paths. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * refactor(sftp): align local bookmarks store API with global bookmarks Export subscribe/get/set/rehydrate helpers from localSftpBookmarks to match the globalSftpBookmarks external-store pattern. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(electron): reduce baseline memory via spellcheck/GPU/prewarm guards Disable spellcheck on BrowserWindows and the default session, drop spare renderers, gate aggressive GPU switches behind NETCATTY_COMPAT_GPU, and make settings prewarm opt-in via NETCATTY_PREWARM_SETTINGS. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * Isolate notes and customAccent from TerminalLayer hot props Route vault notes through notesStore (shellHistoryStore pattern) and app accent through appearanceChromeStore so note edits and accent-drag ticks no longer rebuild TerminalLayer. Notes/AI slots and Terminal leaves subscribe locally; VaultView and open-note callbacks stay unchanged. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(ui): cut unnecessary AppView/VaultView/settings re-renders Stabilize TopTabs close handler, memo AppHostTreeLayer, exclude accent from settingsVersion, ignore connectionLogs off the logs section, share lastConnected host refs, and keep rename dialog drafts local so chrome domain stays stable. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * chore: package size, dead code, and consolidation cleanup Remove unused direct deps, exclude Vite-bundled renderer packages from electron-builder, delete high-confidence dead code/no-op transfer warm wiring, consolidate cloud provider IDs and KnownHost/SFTP helpers, and land UI/AGENTS quick wins (rAF text batching, notes draft debounce, streaming plain text, tempDirBridge, diagnostics adapter, External MCP setters). Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: stabilize rAF text batching and diagnostics tests Polyfill requestAnimationFrame for Node, flush pending text before steer buffering, bypass rAF while steer is in flight, and stub global localStorage for AI panel diagnostics adapter tests. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: correct import paths after application/state hook migrations Migrated vault/AI/system hooks still used components/-relative imports; point them at repo-root domain/components/types/lib instead. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: address Bugbot/Codex regressions from perf cleanup - Keep blank Enter from closing RenameDraftDialog; only reset rename state after a non-empty submit - Flush note drafts before vault mutations so pending title/body edits are not overwritten - Re-apply appearanceChromeStore accent on appearanceTheme in Terminal, and keep layer themes unaccented Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(notes): flush draft before markdown export paths Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: keep editor-close hotkey ref fresh during render Assign handleRequestCloseEditorTabRef in render instead of useEffect so Cmd/Ctrl+W never hits the App stub before the effect runs. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: keep accent in chrome themes without TerminalLayer thrash Restore accent in globalAppearance for chrome/injection consumers. Keep resolveFocusedAppearance identity stable across accent drag via accent ref, while Terminal leaf still re-applies appearanceChromeStore. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: keep compose chrome accent live and merge note renames Subscribe theme-panel focusedAppearance to appearanceChromeStore so compose-bar chrome updates during color-picker drag even when resolveFocusedAppearance identity stays stable. Tree renames now merge title into the post-flush note instead of replacing from a stale row. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: clear terminal accent when switching back to theme mode Re-resolve appearanceTheme by catalog id before applyCustomAccent so a stale baked custom cursor/selection cannot stick after accentMode returns to theme while TerminalLayer memo ignores accent props. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: register unsaved prompt singleton during render AppView close handlers call promptUnsavedChanges outside the old render-prop. Assign the singleton during render so Cmd/Ctrl+W and tab close never hit the pre-effect null window that auto-cancels. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: keep vault import hooks UI-free and flush notes on teardown Move ImportOptions into application/state and inject a notifier so useVaultImportHandlers no longer imports components. Notes drafts also flush on pagehide/beforeunload when Electron tears down without React unmount. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: move AI terminal session context builders into domain buildAITerminalSessionInfo and AIPanelContext now live under domain/ so application hooks no longer import TerminalLayerSupport and create a UI → application → UI cycle. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: drop duplicate AIPanelContext type from TerminalLayerSupport The type is re-exported from domain; the local definition conflicted. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: keep migrated state hooks free of UI-layer imports Move aiChatStreamingSupport into infrastructure/ai and poll list helpers into domain/systemManager so useAIChatStreaming / useSystemManager no longer import from components. Leave thin re-exports at the old paths. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: move remaining migrated-hook deps out of components Host-key verification types/helpers now live in domain/, and SFTP column layout types live in application/state/sftp/columnLayout. Application hooks no longer import those definitions from the UI layer. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: clear lint blockers and flush notes when panels hide Move AI panel diagnostics persistence into application/state so components stop importing localStorageAdapter. Flush note drafts when retained NotesManager mounts become inactive, and silence related lint warnings in theme/host-key helpers. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(notes): publish notesStore sync on vault note updates updateNotes/updateNoteGroups now publishNotesSnapshot immediately so AI/notes consumers do not briefly read a stale catalog after a hide flush. Flush inactive drafts in useLayoutEffect before paint. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> |