mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-28 12:49:53 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4fc53763a |
No files matched your search
@@ -1,16 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "monday"
|
||||
time: "09:00"
|
||||
timezone: "Asia/Shanghai"
|
||||
open-pull-requests-limit: 5
|
||||
groups:
|
||||
github-actions:
|
||||
patterns:
|
||||
- "*"
|
||||
commit-message:
|
||||
prefix: "ci"
|
||||
@@ -1,72 +0,0 @@
|
||||
# This file is machine-generated by `gh actions-lock`.
|
||||
# Do not edit by hand; run `gh actions-lock` to update.
|
||||
# Docs: https://gh.io/actions-lockfile
|
||||
version: 'v0.0.3'
|
||||
workflows:
|
||||
'.github/workflows/build-et-binaries.yml':
|
||||
- 'actions/cache@v6.1.0'
|
||||
- 'actions/checkout@v7.0.1'
|
||||
- 'actions/download-artifact@v8.0.2'
|
||||
- 'actions/upload-artifact@v7.0.2'
|
||||
- 'ilammy/msvc-dev-cmd@v1.13.0'
|
||||
'.github/workflows/build.yml':
|
||||
- 'actions/cache@v6.1.0'
|
||||
- 'actions/checkout@v7.0.1'
|
||||
- 'actions/download-artifact@v8.0.2'
|
||||
- 'actions/setup-node@v7.1.0'
|
||||
- 'actions/upload-artifact@v7.0.2'
|
||||
- 'ilammy/msvc-dev-cmd@v1.13.0'
|
||||
- 'softprops/action-gh-release@v2.6.2'
|
||||
'.github/workflows/grokbot-issue-relay.yml': []
|
||||
'.github/workflows/issue-format.yml':
|
||||
- 'actions/checkout@v7.0.1'
|
||||
- 'actions/github-script@v9.0.0'
|
||||
'.github/workflows/spam-comments.yml':
|
||||
- 'actions/checkout@v7.0.1'
|
||||
- 'actions/github-script@v9.0.0'
|
||||
'.github/workflows/star-history.yml':
|
||||
- 'actions/checkout@v7.0.1'
|
||||
'.github/workflows/test.yml':
|
||||
- 'actions/checkout@v7.0.1'
|
||||
- 'actions/setup-node@v7.1.0'
|
||||
dependencies:
|
||||
'actions/cache@v6.1.0':
|
||||
ref: 'v6.1.0'
|
||||
commit: 'sha1-55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
|
||||
owner_id: 44036562
|
||||
repo_id: 215566462
|
||||
'actions/checkout@v7.0.1':
|
||||
ref: 'v7.0.1'
|
||||
commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
|
||||
owner_id: 44036562
|
||||
repo_id: 197814629
|
||||
'actions/download-artifact@v8.0.2':
|
||||
ref: 'v8.0.2'
|
||||
commit: 'sha1-9000827ccba6bdab643e8b6fd33ac0654aef8333'
|
||||
owner_id: 44036562
|
||||
repo_id: 192626254
|
||||
'actions/github-script@v9.0.0':
|
||||
ref: 'v9.0.0'
|
||||
commit: 'sha1-3a2844b7e9c422d3c10d287c895573f7108da1b3'
|
||||
owner_id: 44036562
|
||||
repo_id: 205262760
|
||||
'actions/setup-node@v7.1.0':
|
||||
ref: 'v7.1.0'
|
||||
commit: 'sha1-949feb2413d6458794dcd2491c4babbbce0c15c1'
|
||||
owner_id: 44036562
|
||||
repo_id: 189476904
|
||||
'actions/upload-artifact@v7.0.2':
|
||||
ref: 'v7.0.2'
|
||||
commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9'
|
||||
owner_id: 44036562
|
||||
repo_id: 192625955
|
||||
'ilammy/msvc-dev-cmd@v1.13.0':
|
||||
ref: 'v1.13.0'
|
||||
commit: 'sha1-0b201ec74fa43914dc39ae48a89fd1d8cb592756'
|
||||
owner_id: 1256587
|
||||
repo_id: 212181767
|
||||
'softprops/action-gh-release@v2.6.2':
|
||||
ref: 'v2.6.2'
|
||||
commit: 'sha1-3bb12739c298aeb8a4eeaf626c5b8d85266b0e65'
|
||||
owner_id: 2242
|
||||
repo_id: 204253808
|
||||
@@ -48,9 +48,6 @@ concurrency:
|
||||
group: build-et-binaries-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
ET_REF: ${{ inputs.et_ref || 'et-v6.2.10' }}
|
||||
|
||||
@@ -62,19 +59,17 @@ jobs:
|
||||
name: build-linux-x64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/checkout@v7
|
||||
- name: Restore cached PR build
|
||||
id: et-build-cache
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/cache@v6.1.0
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: out/
|
||||
key: et-pr-build-v1-${{ runner.os }}-${{ runner.arch }}-${{ env.ET_REF }}-${{ hashFiles('.github/workflows/build-et-binaries.yml', 'scripts/build-et/**') }}
|
||||
- name: Restore vcpkg download cache
|
||||
if: github.event_name != 'pull_request' || steps.et-build-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache@v6.1.0
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: .cache/vcpkg-downloads
|
||||
key: vcpkg-downloads-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/build-et/**') }}
|
||||
@@ -107,7 +102,7 @@ jobs:
|
||||
quay.io/pypa/manylinux2014_x86_64 \
|
||||
bash scripts/build-et/build-linux.sh
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v7.0.2
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: et-linux-x64
|
||||
path: out/
|
||||
@@ -117,19 +112,17 @@ jobs:
|
||||
name: build-linux-arm64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/checkout@v7
|
||||
- name: Restore cached PR build
|
||||
id: et-build-cache
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/cache@v6.1.0
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: out/
|
||||
key: et-pr-build-v1-${{ runner.os }}-${{ runner.arch }}-${{ env.ET_REF }}-${{ hashFiles('.github/workflows/build-et-binaries.yml', 'scripts/build-et/**') }}
|
||||
- name: Restore vcpkg download cache
|
||||
if: github.event_name != 'pull_request' || steps.et-build-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache@v6.1.0
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: .cache/vcpkg-downloads
|
||||
key: vcpkg-downloads-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/build-et/**') }}
|
||||
@@ -162,7 +155,7 @@ jobs:
|
||||
quay.io/pypa/manylinux2014_aarch64 \
|
||||
bash scripts/build-et/build-linux.sh
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v7.0.2
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: et-linux-arm64
|
||||
path: out/
|
||||
@@ -175,19 +168,17 @@ jobs:
|
||||
name: build-macos-universal
|
||||
runs-on: macos-15
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/checkout@v7
|
||||
- name: Restore cached PR build
|
||||
id: et-build-cache
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/cache@v6.1.0
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: out/
|
||||
key: et-pr-build-v1-${{ runner.os }}-${{ runner.arch }}-${{ env.ET_REF }}-${{ hashFiles('.github/workflows/build-et-binaries.yml', 'scripts/build-et/**') }}
|
||||
- name: Restore vcpkg download cache
|
||||
if: github.event_name != 'pull_request' || steps.et-build-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache@v6.1.0
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ${{ runner.temp }}/vcpkg-downloads
|
||||
key: vcpkg-downloads-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/build-et/**') }}
|
||||
@@ -205,7 +196,7 @@ jobs:
|
||||
MACOSX_DEPLOYMENT_TARGET: "11.0"
|
||||
run: bash scripts/build-et/build-macos.sh
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v7.0.2
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: et-darwin-universal
|
||||
path: out/
|
||||
@@ -218,19 +209,17 @@ jobs:
|
||||
name: build-windows-x64
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/checkout@v7
|
||||
- name: Restore cached PR build
|
||||
id: et-build-cache
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/cache@v6.1.0
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: out/
|
||||
key: et-pr-build-v1-${{ runner.os }}-${{ runner.arch }}-${{ env.ET_REF }}-${{ hashFiles('.github/workflows/build-et-binaries.yml', 'scripts/build-et/**') }}
|
||||
- name: Restore vcpkg download cache
|
||||
if: github.event_name != 'pull_request' || steps.et-build-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache@v6.1.0
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ${{ runner.temp }}\vcpkg-downloads
|
||||
key: vcpkg-downloads-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/build-et/**') }}
|
||||
@@ -247,7 +236,7 @@ jobs:
|
||||
run: choco install -y ninja
|
||||
- name: Set up MSVC developer command prompt
|
||||
if: github.event_name != 'pull_request' || steps.et-build-cache.outputs.cache-hit != 'true'
|
||||
uses: ilammy/msvc-dev-cmd@v1.13.0
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
- name: Build et (win32-x64)
|
||||
@@ -258,7 +247,7 @@ jobs:
|
||||
shell: pwsh
|
||||
run: pwsh -File scripts/build-et/build-windows.ps1
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v7.0.2
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: et-win32-x64
|
||||
path: out/
|
||||
@@ -283,11 +272,9 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/checkout@v7
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v8.0.2
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
path: artifacts
|
||||
- name: Stage release files
|
||||
|
||||
+92
-36
@@ -40,6 +40,10 @@ on:
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/build.yml"
|
||||
- "components/AppLockGate.tsx"
|
||||
- "components/TrayPanel.tsx"
|
||||
- "index.tsx"
|
||||
- "index.css"
|
||||
- "build/**"
|
||||
- "electron-builder.config.cjs"
|
||||
- "electron/**"
|
||||
@@ -77,7 +81,11 @@ on:
|
||||
- "scripts/rebuildPatchedNodePty.cjs"
|
||||
- "scripts/resolve-et-bin-release.cjs"
|
||||
- "scripts/resolve-mosh-bin-release.cjs"
|
||||
- "scripts/tray-panel-layout.live.test.cjs"
|
||||
- "scripts/serial-named-pipe.live.test.cjs"
|
||||
- "scripts/fixtures/serial/**"
|
||||
- "scripts/verify-linux-*.sh"
|
||||
- "scripts/xterm-macos-column-selection.live.test.cjs"
|
||||
- "skills/**"
|
||||
|
||||
# A newer run for the same main push or PR cancels older in-progress work.
|
||||
@@ -119,9 +127,7 @@ jobs:
|
||||
mosh_bin_release: ${{ steps.resolve.outputs.mosh_bin_release }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Resolve bundled mosh-client release
|
||||
id: resolve
|
||||
@@ -148,9 +154,7 @@ jobs:
|
||||
et_bin_release: ${{ steps.resolve.outputs.et_bin_release }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Resolve bundled et-client release
|
||||
id: resolve
|
||||
@@ -218,24 +222,22 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v7.1.0
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
|
||||
- name: Set up MSVC developer command prompt
|
||||
if: matrix.name == 'windows'
|
||||
uses: ilammy/msvc-dev-cmd@v1.13.0
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Restore Electron download cache
|
||||
uses: actions/cache@v6.1.0
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: |
|
||||
~/.cache/electron
|
||||
@@ -251,6 +253,36 @@ jobs:
|
||||
- name: Install deps
|
||||
run: npm ci
|
||||
|
||||
- name: Test Windows serial pipe through native Electron
|
||||
if: matrix.name == 'windows'
|
||||
run: npx electron scripts/serial-named-pipe.live.test.cjs
|
||||
|
||||
- name: Test macOS Option column selection
|
||||
if: matrix.name == 'macos'
|
||||
run: npm run test:xterm-macos-selection
|
||||
|
||||
- name: Compile ConPTY test helpers
|
||||
if: matrix.name == 'windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$compiler = "$env:WINDIR\Microsoft.NET\Framework64\v4.0.30319\csc.exe"
|
||||
if (-not (Test-Path $compiler)) { throw "csc.exe not found" }
|
||||
New-Item -ItemType Directory -Force -Path "$env:RUNNER_TEMP\netcatty-mosh-conpty" | Out-Null
|
||||
& $compiler /nologo /target:exe /out:"$env:RUNNER_TEMP\netcatty-mosh-conpty\ssh.exe" electron\bridges\fixtures\mosh-conpty-fake-ssh.cs
|
||||
if ($LASTEXITCODE -ne 0) { throw "failed to compile fake ssh" }
|
||||
& $compiler /nologo /target:exe /out:"$env:RUNNER_TEMP\netcatty-mosh-conpty\mosh-client.exe" electron\bridges\fixtures\mosh-conpty-fake-client.cs
|
||||
if ($LASTEXITCODE -ne 0) { throw "failed to compile fake mosh-client" }
|
||||
|
||||
- name: Test Mosh handshake through ConPTY
|
||||
if: matrix.name == 'windows'
|
||||
shell: pwsh
|
||||
env:
|
||||
NETCATTY_TEST_MOSH_SSH_EXE: ${{ runner.temp }}\netcatty-mosh-conpty\ssh.exe
|
||||
NETCATTY_TEST_MOSH_CLIENT_EXE: ${{ runner.temp }}\netcatty-mosh-conpty\mosh-client.exe
|
||||
run: |
|
||||
node --test electron/bridges/moshHandshake.test.cjs
|
||||
node electron/bridges/terminalBridge.moshConpty.integration.cjs
|
||||
|
||||
- name: Fetch bundled mosh-client
|
||||
if: env.BUNDLE_MOSH == 'true'
|
||||
shell: bash
|
||||
@@ -298,8 +330,20 @@ jobs:
|
||||
APPLE_TEAM_ID: ${{ matrix.name == 'macos' && secrets.APPLE_TEAM_ID || '' }}
|
||||
run: npm run ${{ matrix.pack_script }}
|
||||
|
||||
- name: Test packaged SSH cipher negotiation
|
||||
run: node scripts/test-packaged-ssh-ciphers.cjs
|
||||
|
||||
- name: Test tray panel layout
|
||||
run: npm run test:tray-panel-layout
|
||||
|
||||
- name: Test tray panel layout at 200% scale on Windows
|
||||
if: matrix.name == 'windows'
|
||||
env:
|
||||
NETCATTY_TRAY_LAYOUT_SCALE: "2"
|
||||
run: npm run test:tray-panel-layout
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v7.0.2
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: netcatty-${{ matrix.name }}
|
||||
path: |
|
||||
@@ -339,7 +383,7 @@ jobs:
|
||||
# The GitHub runner already retries container pulls three times. Use the
|
||||
# official Quay mirror to avoid the Docker Hub endpoint that repeatedly
|
||||
# timed out in package validation.
|
||||
image: quay.io/almalinuxorg/almalinux:8.10-20261114@sha256:e85b75cd6ce05cd1e7616d4b2590077e0acc395e7ee73a9f887b17d1591b6ef3
|
||||
image: quay.io/almalinuxorg/almalinux:8
|
||||
env:
|
||||
MOSH_BIN_RELEASE: ${{ needs.resolve-mosh.outputs.mosh_bin_release }}
|
||||
ET_BIN_RELEASE: ${{ needs.resolve-et.outputs.et_bin_release }}
|
||||
@@ -523,12 +567,10 @@ jobs:
|
||||
echo "npm_config_python=/usr/bin/python3.11" >> "${GITHUB_ENV}"
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Restore Electron download cache
|
||||
uses: actions/cache@v6.1.0
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: |
|
||||
~/.cache/electron
|
||||
@@ -592,6 +634,9 @@ jobs:
|
||||
done
|
||||
npm run pack:linux-x64
|
||||
|
||||
- name: Test packaged SSH cipher negotiation
|
||||
run: node scripts/test-packaged-ssh-ciphers.cjs
|
||||
|
||||
- name: Verify packaged node-pty Linux runtime
|
||||
run: bash scripts/ensure-node-pty-linux.sh verify x64
|
||||
|
||||
@@ -602,7 +647,7 @@ jobs:
|
||||
run: bash scripts/verify-linux-rpm-artifact.sh x86_64
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v7.0.2
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: netcatty-linux-x64
|
||||
path: |
|
||||
@@ -626,7 +671,7 @@ jobs:
|
||||
&& (needs.resolve-et.result == 'success' || needs.resolve-et.result == 'skipped')
|
||||
runs-on: ubuntu-24.04-arm
|
||||
container:
|
||||
image: debian:bullseye-20260824@sha256:6f519a81440354a85eb592c5f32109ab80605f6b892455983a6f618bf87fabe9
|
||||
image: debian:bullseye
|
||||
env:
|
||||
MOSH_BIN_RELEASE: ${{ needs.resolve-mosh.outputs.mosh_bin_release }}
|
||||
ET_BIN_RELEASE: ${{ needs.resolve-et.outputs.et_bin_release }}
|
||||
@@ -678,12 +723,10 @@ jobs:
|
||||
apt-get -o Acquire::Retries=4 install -y nodejs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Restore Electron download cache
|
||||
uses: actions/cache@v6.1.0
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: |
|
||||
~/.cache/electron
|
||||
@@ -728,6 +771,9 @@ jobs:
|
||||
ELECTRON_BUILDER_PUBLISH: "never"
|
||||
run: npm run pack:linux-arm64
|
||||
|
||||
- name: Test packaged SSH cipher negotiation
|
||||
run: node scripts/test-packaged-ssh-ciphers.cjs
|
||||
|
||||
- name: Verify packaged node-pty Linux runtime
|
||||
run: bash scripts/ensure-node-pty-linux.sh verify arm64
|
||||
|
||||
@@ -738,7 +784,7 @@ jobs:
|
||||
run: bash scripts/verify-linux-rpm-artifact.sh aarch64
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v7.0.2
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: netcatty-linux-arm64
|
||||
path: |
|
||||
@@ -765,9 +811,7 @@ jobs:
|
||||
actions: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Validate release tag
|
||||
shell: bash
|
||||
@@ -778,7 +822,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v8.0.2
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
path: artifacts
|
||||
merge-multiple: true
|
||||
@@ -820,6 +864,20 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify downloaded Linux amd64 deb artifact
|
||||
run: |
|
||||
deb_file="$(find artifacts -maxdepth 1 -type f -name '*-linux-amd64.deb' -print | sort | head -n 1)"
|
||||
test -n "${deb_file}"
|
||||
bash scripts/verify-linux-deb-artifact.sh amd64 "${deb_file}"
|
||||
|
||||
- name: Verify downloaded Linux arm64 deb artifact metadata
|
||||
env:
|
||||
VERIFY_LOAD: "0"
|
||||
run: |
|
||||
deb_file="$(find artifacts -maxdepth 1 -type f -name '*-linux-arm64.deb' -print | sort | head -n 1)"
|
||||
test -n "${deb_file}"
|
||||
bash scripts/verify-linux-deb-artifact.sh arm64 "${deb_file}"
|
||||
|
||||
- name: Generate Release Body
|
||||
run: node .github/scripts/generate-release-note.js
|
||||
env:
|
||||
@@ -828,7 +886,7 @@ jobs:
|
||||
GITHUB_SHA: ${{ github.sha }}
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2.6.2
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
body_path: release_notes.md
|
||||
prerelease: ${{ contains(github.ref_name, '-') }}
|
||||
@@ -860,13 +918,13 @@ jobs:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout default branch
|
||||
uses: actions/checkout@v7.0.1
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
ref: ${{ github.event.repository.default_branch }}
|
||||
token: ${{ secrets.RELEASE_TOKEN }}
|
||||
|
||||
- name: Download Linux artifacts
|
||||
uses: actions/download-artifact@v8.0.2
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
path: artifacts
|
||||
merge-multiple: true
|
||||
@@ -1022,12 +1080,10 @@ jobs:
|
||||
&& (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish_release))
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Download macOS artifacts
|
||||
uses: actions/download-artifact@v8.0.2
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: netcatty-macos
|
||||
path: artifacts/
|
||||
|
||||
@@ -17,15 +17,14 @@ jobs:
|
||||
!contains(github.event.issue.labels.*.name, 'format-exempt')
|
||||
steps:
|
||||
- name: Checkout format helpers
|
||||
uses: actions/checkout@v7.0.1
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: |
|
||||
scripts/issue-format.cjs
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Validate title and body
|
||||
uses: actions/github-script@v9.0.0
|
||||
uses: actions/github-script@v9
|
||||
with:
|
||||
script: |
|
||||
const format = require(`${process.env.GITHUB_WORKSPACE}/scripts/issue-format.cjs`);
|
||||
|
||||
@@ -14,12 +14,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout filter rules
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Hide suspected malware spam
|
||||
uses: actions/github-script@v9.0.0
|
||||
uses: actions/github-script@v9
|
||||
with:
|
||||
script: |
|
||||
const path = require('node:path');
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
# Same PAT used for releases — needs stargazers read (admin/collaborator)
|
||||
# plus contents/PR write so we can open an update PR against protected main.
|
||||
|
||||
+111
-3
@@ -20,16 +20,21 @@ jobs:
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v7.1.0
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
|
||||
- name: Install shell test dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y fish xvfb
|
||||
|
||||
- name: Install deps
|
||||
run: npm ci
|
||||
|
||||
@@ -53,5 +58,108 @@ jobs:
|
||||
- name: Test
|
||||
run: npm test
|
||||
|
||||
- name: Test SSH cipher negotiation in Electron's crypto runtime
|
||||
env:
|
||||
NETCATTY_SSH_TEST_RUNTIME: electron
|
||||
run: node --test electron/bridges/sshChaChaTransport.test.cjs
|
||||
|
||||
- name: Test browser first-link lifecycle
|
||||
run: xvfb-run -a ./node_modules/.bin/electron --no-sandbox electron/hostBrowser/hostBrowser.firstLink.live.test.cjs
|
||||
|
||||
- name: Test terminal background rendering
|
||||
run: xvfb-run -a ./node_modules/.bin/electron --no-sandbox --use-angle=swiftshader --enable-unsafe-swiftshader scripts/terminal-background-rendering.live.test.cjs
|
||||
|
||||
- name: Test terminal keyword highlight performance
|
||||
env:
|
||||
NETCATTY_TERMINAL_PERF_SHOW_WINDOW: "1"
|
||||
# GitHub-hosted runners do not configure Electron's SUID sandbox helper.
|
||||
run: xvfb-run -a ./node_modules/.bin/electron --no-sandbox scripts/xterm-keyword-highlight-performance.live.test.cjs
|
||||
|
||||
- name: Test terminal keyword highlight throughput
|
||||
env:
|
||||
NETCATTY_TERMINAL_PERF_MAIN_REF: ${{ github.event.pull_request.base.sha || 'HEAD^' }}
|
||||
NETCATTY_TERMINAL_PERF_ROUNDS: "3"
|
||||
NETCATTY_TERMINAL_PERF_SHOW_WINDOW: "1"
|
||||
run: xvfb-run -a ./node_modules/.bin/electron --no-sandbox scripts/xterm-keyword-highlight-throughput.live.test.cjs
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
windows-fido:
|
||||
name: windows-fido
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
|
||||
- name: Install deps
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: Exercise serial named pipe transport on Windows
|
||||
run: node --test electron/bridges/serialNamedPipe.test.cjs
|
||||
|
||||
- name: Apply production dependency patches
|
||||
run: npx patch-package --error-on-fail
|
||||
|
||||
- name: Install user-mode OpenSSH and software authenticator toolchain
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: MSYS
|
||||
update: true
|
||||
install: gcc openssl-devel openssh
|
||||
|
||||
- name: Build disposable software authenticator
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
gcc -shared -DHAVE_STDINT_H scripts/fixtures/fido/provider.c -lcrypto -o /usr/lib/netcatty-fido-test-provider.dll
|
||||
printf 'NETCATTY_WINDOWS_SSH_AGENT=%s\n' "$(cygpath -w /usr/bin/ssh-agent.exe)" >> "$GITHUB_ENV"
|
||||
printf 'NETCATTY_WINDOWS_SSH_KEYGEN=%s\n' "$(cygpath -w /usr/bin/ssh-keygen.exe)" >> "$GITHUB_ENV"
|
||||
cygpath -w /usr/bin >> "$GITHUB_PATH"
|
||||
ssh -V
|
||||
|
||||
- name: Exercise Windows pipes, PIN bridge, SK signatures and cancellation
|
||||
env:
|
||||
NETCATTY_FIDO_WINDOWS: "1"
|
||||
run: node --test scripts/fido-windows.live.test.cjs electron/bridges/fidoNativeAgent.test.cjs electron/bridges/fidoAskpass.winpath.test.cjs
|
||||
|
||||
windows-broadcast-ssh:
|
||||
name: windows-broadcast-ssh
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
|
||||
- name: Install deps
|
||||
run: npm ci
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Test SSH cipher negotiation in Windows Electron's crypto runtime
|
||||
env:
|
||||
NETCATTY_SSH_TEST_RUNTIME: electron
|
||||
run: node --test electron/bridges/sshChaChaTransport.test.cjs
|
||||
|
||||
- name: Exercise native PowerShell and CMD directory navigation in ConPTY
|
||||
env:
|
||||
NETCATTY_DIRECTORY_WINDOWS_LIVE: "1"
|
||||
run: |
|
||||
$env:NETCATTY_TEST_PWSH = (Get-Command pwsh -ErrorAction Stop).Source
|
||||
node --test --test-force-exit --import tsx infrastructure/services/terminalDirectory.windows.test.ts
|
||||
|
||||
- name: Exercise two SSH password prompts in the desktop app
|
||||
run: node scripts/terminal-broadcast-ssh.live.cjs
|
||||
@@ -75,8 +75,6 @@
|
||||
!packages/**
|
||||
!patches/
|
||||
!patches/**
|
||||
!plugins/
|
||||
!plugins/**
|
||||
!public/
|
||||
!public/**
|
||||
!resources/
|
||||
@@ -118,7 +116,6 @@ coverage
|
||||
!/build/installer.nsh
|
||||
/electron/native/**/build
|
||||
/electron/bridges/windowsHelloHelper/build/
|
||||
/electron/preload.bundle.cjs
|
||||
/release
|
||||
/out
|
||||
/public/monaco
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { MonitorHostKeyDialog } from './components/vault/MonitorHostKeyDialog';
|
||||
import { MonitorRuntimeHost } from './application/app/MonitorRuntimeHost';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
import { initializeFonts } from './application/state/fontStore';
|
||||
@@ -53,7 +55,9 @@ function App() {
|
||||
}, []);
|
||||
return (
|
||||
<AppLocalStateProvider>
|
||||
<MonitorRuntimeHost />
|
||||
<AppSideEffects />
|
||||
<MonitorHostKeyDialog />
|
||||
<AppShell />
|
||||
</AppLocalStateProvider>
|
||||
);
|
||||
|
||||
+23
-217
@@ -9,25 +9,6 @@ import { getAvailablePaneMagnificationController } from '../../domain/paneMagnif
|
||||
import { sanitizeHostIconFields } from '../../domain/hostIcon';
|
||||
import { resolveEffectiveTerminalProtocol } from '../../domain/terminalProtocol';
|
||||
import { isPluginHostProtocol } from '../../domain/pluginConnection';
|
||||
import {
|
||||
applyHostDefaultConnectProtocol,
|
||||
buildHostForProtocolOverride,
|
||||
isRemoteDesktopProtocol,
|
||||
resolveRemoteDesktopConnectionSpec,
|
||||
shouldPromptHostProtocolOnConnect,
|
||||
type RemoteDesktopProtocol,
|
||||
} from '../../domain/remoteDesktop';
|
||||
import { resolveTerminalChainHosts } from '../../domain/terminalHostResolution';
|
||||
import { selectConnectionLogForTerminalDataCapture } from '../../domain/connectionLog';
|
||||
import {
|
||||
buildSystemRemoteDesktopPayload,
|
||||
isRemoteDesktopGrabReleaseChord,
|
||||
isTargetInsideRemoteDesktopCapture,
|
||||
} from '../../components/remoteDesktop/remoteDesktopHelpers';
|
||||
import {
|
||||
getConnectionLogsActions,
|
||||
getConnectionLogsSnapshot,
|
||||
} from '../state/connectionLogsStore';
|
||||
import { getTerminalPassthroughActions } from '../state/useGlobalHotkeys';
|
||||
import { getSettingsChromeSnapshot } from '../state/settingsChromeStore';
|
||||
import { isHostTreeWorkTabSurface } from './workTabSurface';
|
||||
@@ -272,13 +253,6 @@ export function flushQueuedTrayPanelConnectHostsImpl(getCtx: AppContextGetter) {
|
||||
export function handleGlobalHotkeyKeyDownImpl(getCtx: AppContextGetter, e: KeyboardEvent) {
|
||||
const { HOTKEY_DEBUG, closeTabKeyStr, executeHotkeyAction, hotkeyScheme, keyBindings, matchesKeyBinding } = getCtx();
|
||||
{
|
||||
if (
|
||||
isTargetInsideRemoteDesktopCapture(e.target, e.composedPath?.bind(e))
|
||||
&& !isRemoteDesktopGrabReleaseChord(e)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const isMac = hotkeyScheme === 'mac';
|
||||
const target = e.target as HTMLElement;
|
||||
const isCloseTabHotkey = closeTabKeyStr ? matchesKeyBinding(e, closeTabKeyStr, isMac) : false;
|
||||
@@ -366,21 +340,13 @@ export function handleGlobalHotkeyKeyDownImpl(getCtx: AppContextGetter, e: Keybo
|
||||
});
|
||||
if (!hasOpenHostModal) {
|
||||
const inPluginSurface = Boolean(target?.closest?.('[data-plugin-remote-surface]'));
|
||||
const visibleFullBleedSurfaces = Array.from(
|
||||
const activeFullBleedSurface = inPluginSurface || Array.from(
|
||||
document.querySelectorAll<HTMLElement>('[data-plugin-chrome="full-bleed"] [data-plugin-remote-surface]'),
|
||||
).filter((el) => {
|
||||
).some((el) => {
|
||||
const r = el.getBoundingClientRect();
|
||||
return r.width > 0 && r.height > 0;
|
||||
});
|
||||
const active = document.activeElement;
|
||||
const focusInsideHostChrome = Boolean(
|
||||
active
|
||||
&& active !== document.body
|
||||
&& active !== document.documentElement
|
||||
&& !visibleFullBleedSurfaces.some((el) => el.contains(active))
|
||||
&& !active.closest?.('[data-plugin-view-slot]'),
|
||||
);
|
||||
if (inPluginSurface || (visibleFullBleedSurfaces.length > 0 && !focusInsideHostChrome)) {
|
||||
if (activeFullBleedSurface) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -910,40 +876,6 @@ export function collectBatchBusyProbeSessionIds(
|
||||
return sessionIdsToProbe;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stamp `endTime` on open RDP/VNC `ConnectionLog` entries when remote desktop
|
||||
* sessions close so they do not stay stuck at "Ongoing" in Connection Logs.
|
||||
*/
|
||||
export function stampRemoteDesktopSessionEndTimes(
|
||||
getCtx: AppContextGetter,
|
||||
closingSessionIds: readonly string[],
|
||||
): number {
|
||||
if (!closingSessionIds.length) return 0;
|
||||
const ctx = getCtx();
|
||||
const sessionsList: TerminalSession[] = Array.isArray(ctx.sessions) ? ctx.sessions : [];
|
||||
const logs = Array.isArray(ctx.connectionLogs)
|
||||
? ctx.connectionLogs
|
||||
: [...getConnectionLogsSnapshot().connectionLogs];
|
||||
const updateLog = ctx.updateConnectionLog ?? getConnectionLogsActions()?.updateConnectionLog;
|
||||
if (!updateLog || logs.length === 0) return 0;
|
||||
|
||||
let stamped = 0;
|
||||
const now = Date.now();
|
||||
for (const sessionId of new Set(closingSessionIds)) {
|
||||
const session = sessionsList.find((candidate) => candidate.id === sessionId);
|
||||
const matchingLog = selectConnectionLogForTerminalDataCapture(logs, {
|
||||
sessionId,
|
||||
hostname: session?.hostname,
|
||||
});
|
||||
if (!matchingLog || matchingLog.endTime) continue;
|
||||
const protocol = session?.protocol ?? matchingLog.protocol;
|
||||
if (!isRemoteDesktopProtocol(protocol)) continue;
|
||||
void Promise.resolve(updateLog(matchingLog.id, { endTime: now })).catch(() => {});
|
||||
stamped += 1;
|
||||
}
|
||||
return stamped;
|
||||
}
|
||||
|
||||
export async function closeTabsBatchImpl(getCtx: AppContextGetter, targetIds: string[]) {
|
||||
const {
|
||||
closeLogView, closeSessions, closeTabsInFlightRef, closeWorkspace,
|
||||
@@ -981,12 +913,6 @@ export async function closeTabsBatchImpl(getCtx: AppContextGetter, targetIds: st
|
||||
sessions.some((session) => session.workspaceId === id && keepTabIds.has(session.id))
|
||||
));
|
||||
const standaloneSessionIds = effectiveRegularIds.filter((id) => sessions.some((session) => session.id === id));
|
||||
const workspaceSessionIds = effectiveRegularIds.flatMap((id) => (
|
||||
workspaces.some((workspace) => workspace.id === id)
|
||||
? sessions.filter((session) => session.workspaceId === id).map((session) => session.id)
|
||||
: []
|
||||
));
|
||||
stampRemoteDesktopSessionEndTimes(getCtx, [...standaloneSessionIds, ...workspaceSessionIds]);
|
||||
if (standaloneSessionIds.length) closeSessions(standaloneSessionIds);
|
||||
for (const id of effectiveRegularIds) {
|
||||
if (workspaces.some((workspace) => workspace.id === id)) closeWorkspace(id);
|
||||
@@ -1080,19 +1006,13 @@ export function executeHotkeyActionImpl(getCtx: AppContextGetter, action: string
|
||||
switch (intent.kind) {
|
||||
case 'closeSingleTab': {
|
||||
const ok = await confirmIfBusyLocalTerminal([intent.sessionId]);
|
||||
if (ok) {
|
||||
stampRemoteDesktopSessionEndTimes(getCtx, [intent.sessionId]);
|
||||
closeSession(intent.sessionId);
|
||||
}
|
||||
if (ok) closeSession(intent.sessionId);
|
||||
return;
|
||||
}
|
||||
case 'closeWorkspace': {
|
||||
const ids = sessions.filter((s) => s.workspaceId === intent.workspaceId).map((s) => s.id);
|
||||
const ok = await confirmIfBusyLocalTerminal(ids);
|
||||
if (ok) {
|
||||
stampRemoteDesktopSessionEndTimes(getCtx, ids);
|
||||
closeWorkspace(intent.workspaceId);
|
||||
}
|
||||
if (ok) closeWorkspace(intent.workspaceId);
|
||||
return;
|
||||
}
|
||||
case 'noop':
|
||||
@@ -1128,7 +1048,6 @@ export function executeHotkeyActionImpl(getCtx: AppContextGetter, action: string
|
||||
if (focusedId) {
|
||||
const ok = await confirmIfBusyLocalTerminal([focusedId]);
|
||||
if (ok) {
|
||||
stampRemoteDesktopSessionEndTimes(getCtx, [focusedId]);
|
||||
// The pane shortcut closes the tab when only one pane remains.
|
||||
if (aliveIds.length === 1) closeWorkspace(workspace.id);
|
||||
else closeSession(focusedId);
|
||||
@@ -1137,10 +1056,7 @@ export function executeHotkeyActionImpl(getCtx: AppContextGetter, action: string
|
||||
} else if (session) {
|
||||
// Standalone session tab — close the session
|
||||
const ok = await confirmIfBusyLocalTerminal([session.id]);
|
||||
if (ok) {
|
||||
stampRemoteDesktopSessionEndTimes(getCtx, [session.id]);
|
||||
closeSession(session.id);
|
||||
}
|
||||
if (ok) closeSession(session.id);
|
||||
}
|
||||
} finally {
|
||||
closeTabInFlightRef.current = false;
|
||||
@@ -1444,11 +1360,7 @@ export function handleConnectToHostImpl(getCtx: AppContextGetter, host: Host, hi
|
||||
// Local-shell vault hosts carry no SSH credentials, so log the system
|
||||
// user like local terminals do (see handleCreateLocalTerminalImpl)
|
||||
// instead of 'root' or an inherited group SSH username.
|
||||
username: protocol === 'local'
|
||||
? username
|
||||
: isRemoteDesktopProtocol(protocol)
|
||||
? (effectiveHost.username || '')
|
||||
: (resolvedAuth.username || 'root'),
|
||||
username: protocol === 'local' ? username : (resolvedAuth.username || 'root'),
|
||||
protocol,
|
||||
...getLogHostVisualSnapshot(effectiveHost),
|
||||
startTime: Date.now(),
|
||||
@@ -1460,85 +1372,6 @@ export function handleConnectToHostImpl(getCtx: AppContextGetter, host: Host, hi
|
||||
}
|
||||
}
|
||||
|
||||
export function handleConnectRemoteDesktopImpl(
|
||||
getCtx: AppContextGetter,
|
||||
host: Host,
|
||||
protocol: RemoteDesktopProtocol,
|
||||
options?: { splitFromSessionId?: string },
|
||||
) {
|
||||
const { addConnectionLog, connectToHostRemoteDesktop, identities, resolveEffectiveHost, systemInfoRef } = getCtx();
|
||||
const effectiveHost = resolveEffectiveHost(host);
|
||||
const spec = resolveRemoteDesktopConnectionSpec(effectiveHost, protocol, identities ?? []);
|
||||
const sessionId = connectToHostRemoteDesktop(effectiveHost, protocol, options);
|
||||
if (!sessionId) return null;
|
||||
const { username: localUsername, hostname: localHostname } = systemInfoRef.current;
|
||||
addConnectionLog({
|
||||
sessionId,
|
||||
hostId: host.id,
|
||||
hostLabel: spec.isCompanion ? `${spec.label} (${protocol.toUpperCase()})` : spec.label,
|
||||
hostname: spec.hostHostname,
|
||||
username: spec.username,
|
||||
protocol,
|
||||
...getLogHostVisualSnapshot(effectiveHost),
|
||||
startTime: Date.now(),
|
||||
localUsername,
|
||||
localHostname,
|
||||
saved: false,
|
||||
});
|
||||
return sessionId;
|
||||
}
|
||||
|
||||
export async function handleOpenSystemRemoteDesktopImpl(
|
||||
getCtx: AppContextGetter,
|
||||
host: Host,
|
||||
protocol: RemoteDesktopProtocol,
|
||||
rawRdpContent?: string,
|
||||
) {
|
||||
const {
|
||||
groupConfigs,
|
||||
hosts,
|
||||
identities,
|
||||
keys,
|
||||
knownHosts,
|
||||
netcattyBridge,
|
||||
proxyProfiles,
|
||||
resolveEffectiveHost,
|
||||
toast,
|
||||
} = getCtx();
|
||||
const rdBridge = netcattyBridge.get()?.remoteDesktop;
|
||||
if (!rdBridge?.openSystemClient) {
|
||||
toast?.error?.('System remote desktop launch is unavailable');
|
||||
return { ok: false };
|
||||
}
|
||||
const effectiveHost = resolveEffectiveHost(host);
|
||||
const chainHosts = resolveTerminalChainHosts({
|
||||
host: effectiveHost,
|
||||
hosts: hosts ?? [],
|
||||
groupConfigs: groupConfigs ?? [],
|
||||
proxyProfiles: proxyProfiles ?? [],
|
||||
});
|
||||
const payload = buildSystemRemoteDesktopPayload({
|
||||
host: effectiveHost,
|
||||
protocol,
|
||||
chainHosts,
|
||||
keys: keys ?? [],
|
||||
identities: identities ?? [],
|
||||
knownHosts: knownHosts ?? [],
|
||||
rawRdpContent,
|
||||
});
|
||||
try {
|
||||
const result = await rdBridge.openSystemClient(payload);
|
||||
if (!result?.ok) {
|
||||
toast?.error?.(result?.error || 'Failed to open system remote desktop client');
|
||||
}
|
||||
return result;
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : 'Failed to open system remote desktop client';
|
||||
toast?.error?.(message);
|
||||
return { ok: false, error: message };
|
||||
}
|
||||
}
|
||||
|
||||
export function startRestoredSessionConnectionLogImpl(getCtx: AppContextGetter, session: TerminalSession) {
|
||||
const { addConnectionLog, systemInfoRef } = getCtx();
|
||||
const { username, hostname } = systemInfoRef.current;
|
||||
@@ -1575,16 +1408,10 @@ export async function handleTerminalDataCaptureImpl(getCtx: AppContextGetter, se
|
||||
// The IndexedDB replay write commits asynchronously. Waiting here keeps
|
||||
// a crash during session teardown from dropping the newest capture any
|
||||
// more often than the old synchronous localStorage write.
|
||||
const isRemoteDesktopLog = isRemoteDesktopProtocol(session?.protocol ?? matchingLog.protocol);
|
||||
await updateConnectionLog(
|
||||
matchingLog.id,
|
||||
isRemoteDesktopLog && !data
|
||||
? { endTime: Date.now() }
|
||||
: {
|
||||
endTime: Date.now(),
|
||||
terminalData: data,
|
||||
},
|
||||
);
|
||||
await updateConnectionLog(matchingLog.id, {
|
||||
endTime: Date.now(),
|
||||
terminalData: data,
|
||||
});
|
||||
if (IS_DEV) console.log('[handleTerminalDataCapture] Updated log with terminalData');
|
||||
|
||||
// Auto-save is now handled by real-time streaming in the main process
|
||||
@@ -1606,7 +1433,8 @@ export function hasMultipleProtocolsImpl(getCtx: AppContextGetter, host: Host) {
|
||||
// SSH/Telnet pickers driven by an inherited group Telnet flag. Hosts
|
||||
// without an explicit protocol are legacy SSH entries.
|
||||
const effective = resolveEffectiveHost(host);
|
||||
return shouldPromptHostProtocolOnConnect(effective);
|
||||
const effectiveProtocol = effective.protocol ?? 'ssh';
|
||||
return effectiveProtocol === 'ssh' && Boolean(effective.telnetEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1623,40 +1451,18 @@ export function handleHostConnectWithProtocolCheckImpl(getCtx: AppContextGetter,
|
||||
}
|
||||
}
|
||||
|
||||
export function handleProtocolSelectImpl(
|
||||
getCtx: AppContextGetter,
|
||||
protocol: HostProtocol,
|
||||
port: number,
|
||||
rememberDefault?: boolean,
|
||||
) {
|
||||
const {
|
||||
handleConnectToHost,
|
||||
handleConnectRemoteDesktop,
|
||||
protocolSelectHost,
|
||||
setProtocolSelectHost,
|
||||
updateHosts,
|
||||
} = getCtx();
|
||||
export function handleProtocolSelectImpl(getCtx: AppContextGetter, protocol: HostProtocol, port: number) {
|
||||
const { handleConnectToHost, protocolSelectHost, setProtocolSelectHost } = getCtx();
|
||||
{
|
||||
if (protocolSelectHost) {
|
||||
if (
|
||||
rememberDefault &&
|
||||
typeof updateHosts === 'function' &&
|
||||
(protocol === 'ssh' || protocol === 'mosh' || protocol === 'et' || protocol === 'rdp' || protocol === 'vnc' || protocol === 'telnet')
|
||||
) {
|
||||
updateHosts((prev: Host[]) =>
|
||||
prev.map((h) =>
|
||||
h.id === protocolSelectHost.id
|
||||
? applyHostDefaultConnectProtocol(h, protocol)
|
||||
: h,
|
||||
),
|
||||
);
|
||||
}
|
||||
const dispatch = buildHostForProtocolOverride(protocolSelectHost, protocol, port);
|
||||
if (dispatch.mode === 'remoteDesktop' && typeof handleConnectRemoteDesktop === 'function') {
|
||||
handleConnectRemoteDesktop(dispatch.host, dispatch.protocol);
|
||||
} else {
|
||||
handleConnectToHost(dispatch.host);
|
||||
}
|
||||
const hostWithProtocol: Host = {
|
||||
...protocolSelectHost,
|
||||
protocol: (protocol === 'mosh' || protocol === 'et') ? 'ssh' : protocol,
|
||||
port,
|
||||
moshEnabled: protocol === 'mosh',
|
||||
etEnabled: protocol === 'et',
|
||||
};
|
||||
handleConnectToHost(hostWithProtocol);
|
||||
setProtocolSelectHost(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import React, { Suspense, lazy, useMemo, useState } from 'react';
|
||||
import React, { useMemo, useState } from 'react';
|
||||
|
||||
import type { WorkSurfaceHostEditorTarget } from '../state/useWorkSurfaceHostEditor';
|
||||
import type { EditorTabChrome } from '../state/editorTabStore';
|
||||
import type { LogView } from '../state/logViewState';
|
||||
import { useI18n } from '../i18n/I18nProvider';
|
||||
const HostDetailsPanel = lazy(() => import('../../components/HostDetailsPanel'));
|
||||
const LocalShellHostDetailsPanel = lazy(() => import('../../components/LocalShellHostDetailsPanel'));
|
||||
const SerialHostDetailsPanel = lazy(() => import('../../components/SerialHostDetailsPanel'));
|
||||
import HostDetailsPanel from '../../components/HostDetailsPanel';
|
||||
import LocalShellHostDetailsPanel from '../../components/LocalShellHostDetailsPanel';
|
||||
import SerialHostDetailsPanel from '../../components/SerialHostDetailsPanel';
|
||||
import { PortalContainerProvider } from '../../components/ui/portal-container';
|
||||
import { resolveGroupDefaults } from '../../domain/groupConfig';
|
||||
import { STORAGE_KEY_VAULT_HOST_PANEL_WIDTH } from '@/infrastructure/config/storageKeys';
|
||||
@@ -163,7 +163,6 @@ export const AppHostEditorLayer: React.FC<AppHostEditorLayerProps> = ({
|
||||
style={getAppHostEditorLayerStyle(surfaceVisible)}
|
||||
>
|
||||
<PortalContainerProvider container={portalContainer}>
|
||||
<Suspense fallback={null}>
|
||||
{target.mode === 'edit' && target.openedHost.protocol === 'local' ? (
|
||||
<LocalShellHostDetailsPanel
|
||||
key={editorKey}
|
||||
@@ -216,7 +215,6 @@ export const AppHostEditorLayer: React.FC<AppHostEditorLayerProps> = ({
|
||||
{...hostPanelResizeProps}
|
||||
/>
|
||||
)}
|
||||
</Suspense>
|
||||
</PortalContainerProvider>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { Suspense, lazy, memo, useMemo, useRef, useState } from 'react';
|
||||
import React, { memo, useMemo, useRef } from 'react';
|
||||
|
||||
import { useActiveTabId } from '../state/activeTabStore';
|
||||
import { useAppearanceChromeStore } from '../state/appearanceChromeStore';
|
||||
@@ -6,6 +6,7 @@ import type { EditorTabChrome } from '../state/editorTabStore';
|
||||
import type { LogView } from '../state/logViewState';
|
||||
import { useTerminalHostTreeOpen } from '../state/terminalHostTreeStore';
|
||||
import { useManualTerminalChromeSurfaceInjection } from '../state/useManualTerminalChromeSurfaceInjection';
|
||||
import { TerminalHostTreeSidebar } from '../../components/terminalLayer/TerminalHostTreeSidebar';
|
||||
import type {
|
||||
ResolvedAppearance,
|
||||
TerminalAppearanceHostScope,
|
||||
@@ -17,12 +18,6 @@ import {
|
||||
resolveWorkTabActiveHostId,
|
||||
} from './workTabSurface';
|
||||
|
||||
const TerminalHostTreeSidebar = lazy(() =>
|
||||
import('../../components/terminalLayer/TerminalHostTreeSidebar').then((mod) => ({
|
||||
default: mod.TerminalHostTreeSidebar,
|
||||
})),
|
||||
);
|
||||
|
||||
interface AppHostTreeLayerProps {
|
||||
enabled: boolean;
|
||||
hosts: Host[];
|
||||
@@ -39,8 +34,6 @@ interface AppHostTreeLayerProps {
|
||||
themeById: ReadonlyMap<string, TerminalTheme>;
|
||||
resolveSessionAppearance?: (hostScope: TerminalAppearanceHostScope) => ResolvedAppearance;
|
||||
onConnect: (host: Host) => void;
|
||||
onConnectRemoteDesktop?: (host: Host, protocol: 'vnc' | 'rdp') => void;
|
||||
onOpenSystemRemoteDesktop?: (host: Host, protocol: 'vnc' | 'rdp') => void;
|
||||
onNewHost?: (defaultGroup?: string) => void;
|
||||
onEditHost?: (host: Host) => void;
|
||||
onCreateLocalTerminal?: () => void;
|
||||
@@ -75,8 +68,6 @@ function appHostTreeLayerAreEqual(
|
||||
&& prev.themeById === next.themeById
|
||||
&& prev.resolveSessionAppearance === next.resolveSessionAppearance
|
||||
&& prev.onConnect === next.onConnect
|
||||
&& prev.onConnectRemoteDesktop === next.onConnectRemoteDesktop
|
||||
&& prev.onOpenSystemRemoteDesktop === next.onOpenSystemRemoteDesktop
|
||||
&& prev.onNewHost === next.onNewHost
|
||||
&& prev.onEditHost === next.onEditHost
|
||||
&& prev.onCreateLocalTerminal === next.onCreateLocalTerminal;
|
||||
@@ -98,8 +89,6 @@ const AppHostTreeLayerInner: React.FC<AppHostTreeLayerProps> = ({
|
||||
themeById,
|
||||
resolveSessionAppearance,
|
||||
onConnect,
|
||||
onConnectRemoteDesktop,
|
||||
onOpenSystemRemoteDesktop,
|
||||
onNewHost,
|
||||
onEditHost,
|
||||
onCreateLocalTerminal,
|
||||
@@ -127,10 +116,6 @@ const AppHostTreeLayerInner: React.FC<AppHostTreeLayerProps> = ({
|
||||
workspaceIds,
|
||||
});
|
||||
const sidebarActive = surfaceVisible && enabled && isHostTreeOpen;
|
||||
const [hasMountedSidebar, setHasMountedSidebar] = useState(sidebarActive);
|
||||
if (sidebarActive && !hasMountedSidebar) {
|
||||
setHasMountedSidebar(true);
|
||||
}
|
||||
|
||||
const activeHostId = useMemo(() => (
|
||||
sidebarActive
|
||||
@@ -191,25 +176,19 @@ const AppHostTreeLayerInner: React.FC<AppHostTreeLayerProps> = ({
|
||||
data-section="app-host-tree-layer"
|
||||
style={getAppHostTreeLayerStyle(surfaceVisible)}
|
||||
>
|
||||
{hasMountedSidebar ? (
|
||||
<Suspense fallback={null}>
|
||||
<TerminalHostTreeSidebar
|
||||
enabled={enabled}
|
||||
surfaceVisible={surfaceVisible}
|
||||
hosts={hosts}
|
||||
customGroups={customGroups}
|
||||
groupConfigs={groupConfigs}
|
||||
resolvedPreviewTheme={sidebarPreviewTheme}
|
||||
activeHostId={activeHostId}
|
||||
onConnect={onConnect}
|
||||
onConnectRemoteDesktop={onConnectRemoteDesktop}
|
||||
onOpenSystemRemoteDesktop={onOpenSystemRemoteDesktop}
|
||||
onNewHost={onNewHost}
|
||||
onEditHost={onEditHost}
|
||||
onCreateLocalTerminal={onCreateLocalTerminal}
|
||||
/>
|
||||
</Suspense>
|
||||
) : null}
|
||||
<TerminalHostTreeSidebar
|
||||
enabled={enabled}
|
||||
surfaceVisible={surfaceVisible}
|
||||
hosts={hosts}
|
||||
customGroups={customGroups}
|
||||
groupConfigs={groupConfigs}
|
||||
resolvedPreviewTheme={sidebarPreviewTheme}
|
||||
activeHostId={activeHostId}
|
||||
onConnect={onConnect}
|
||||
onNewHost={onNewHost}
|
||||
onEditHost={onEditHost}
|
||||
onCreateLocalTerminal={onCreateLocalTerminal}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -196,9 +196,9 @@ export const TerminalLayerMount: React.FC<TerminalLayerProps> = (props) => {
|
||||
const isVisible = isTerminalSurfaceActive || !!props.draggingSessionId;
|
||||
// Silent MCP sessions never become the activeTabId, so `isVisible` alone
|
||||
// would leave this whole layer (and its PTY-starting TerminalPane) unmounted
|
||||
// after host_open returns — racing an immediate terminal_execute.
|
||||
// for up to 5s (the idle-callback fallback below) after host_open returns —
|
||||
// long enough for an immediate terminal_execute to race an unstarted session.
|
||||
const hasHiddenSession = props.sessions.some((session) => session.hiddenFromTabs);
|
||||
const hasTerminalContent = props.sessions.length > 0 || props.workspaces.length > 0;
|
||||
const [shouldMount, setShouldMount] = useState(isVisible || hasHiddenSession);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -206,8 +206,19 @@ export const TerminalLayerMount: React.FC<TerminalLayerProps> = (props) => {
|
||||
}, [isVisible, hasHiddenSession]);
|
||||
|
||||
useEffect(() => {
|
||||
if (hasTerminalContent) setShouldMount(true);
|
||||
}, [hasTerminalContent]);
|
||||
if (shouldMount) return;
|
||||
type IdleWindow = Window & {
|
||||
requestIdleCallback?: (callback: () => void, options?: { timeout: number }) => number;
|
||||
cancelIdleCallback?: (id: number) => void;
|
||||
};
|
||||
const idleWindow = window as IdleWindow;
|
||||
if (typeof idleWindow.requestIdleCallback === "function") {
|
||||
const id = idleWindow.requestIdleCallback(() => setShouldMount(true), { timeout: 5000 });
|
||||
return () => idleWindow.cancelIdleCallback?.(id);
|
||||
}
|
||||
const id = window.setTimeout(() => setShouldMount(true), 5000);
|
||||
return () => window.clearTimeout(id);
|
||||
}, [shouldMount]);
|
||||
|
||||
const shouldRender = shouldRenderTerminalLayerMount(isVisible, shouldMount);
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import React, { useEffect, useMemo } from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
import { PluginContributionHost } from '../../components/plugins/PluginContributionHost';
|
||||
import {
|
||||
isRemoteDesktopGrabReleaseChord,
|
||||
isTargetInsideRemoteDesktopCapture,
|
||||
} from '../../components/remoteDesktop/remoteDesktopHelpers';
|
||||
import type { TerminalSession, Workspace } from '../../types';
|
||||
import { useActiveTabId } from '../state/activeTabStore';
|
||||
import { resolveActivePluginKeybindingContext } from '../state/pluginContributionContexts';
|
||||
@@ -29,21 +25,6 @@ export function AppPluginKeybindingHost({
|
||||
workspaces: Workspace[];
|
||||
}) {
|
||||
const activeTabId = useActiveTabId();
|
||||
|
||||
// Short-circuit plugin keybindings when keyboard focus is inside an active
|
||||
// remote desktop capture surface (except for the grab-release chord).
|
||||
useEffect(() => {
|
||||
const onDocumentKeyDown = (event: KeyboardEvent) => {
|
||||
if (!isTargetInsideRemoteDesktopCapture(event.target, event.composedPath?.bind(event))) {
|
||||
return;
|
||||
}
|
||||
if (isRemoteDesktopGrabReleaseChord(event)) return;
|
||||
event.preventDefault();
|
||||
};
|
||||
document.addEventListener('keydown', onDocumentKeyDown);
|
||||
return () => document.removeEventListener('keydown', onDocumentKeyDown);
|
||||
}, []);
|
||||
|
||||
const keybindingContext = useMemo(() => {
|
||||
// AI chat recency drives the workspace anchor fallback (#4098 phase 2).
|
||||
// Read without subscribing: keybinding context is best-effort and refreshes
|
||||
|
||||
@@ -104,8 +104,7 @@ import { collectSnippetDeleteIds } from '../../domain/snippetSelection.ts';
|
||||
import { shouldOpenLocalTerminalOnStartup, resolveStartupLandingSetting } from '../../domain/startupLanding';
|
||||
import { createOpenTerminalQueue } from './openTerminalQueue';
|
||||
import { useAppStartupEffects } from './useAppStartupEffects';
|
||||
import { handleTrayJumpToSessionImpl, handleTrayTogglePortForwardImpl, handleTrayPanelConnectImpl, handleTrayPanelConnectRequestImpl, flushQueuedTrayPanelConnectHostsImpl, handleGlobalHotkeyKeyDownImpl, handleEscapeKeyDownImpl, handleKeyboardInteractiveSubmitImpl, handleKeyboardInteractiveCancelImpl, handlePassphraseSubmitImpl, handlePassphraseCancelImpl, handlePassphraseSkipImpl, handleFidoPromptSubmitImpl, handleFidoPromptCancelImpl, createLocalTerminalWithCurrentShellImpl, splitSessionWithCurrentShellImpl, copySessionWithCurrentShellImpl, duplicateSessionWithCurrentShellImpl, copyWorkspaceWithCurrentShellImpl, copySessionToNewWindowWithCurrentShellImpl, moveSessionToNewWindowImpl, confirmIfBusyLocalTerminalImpl, closeTabsBatchImpl, executeHotkeyActionImpl, handleCreateLocalTerminalImpl, handleConnectToHostImpl, handleConnectRemoteDesktopImpl, handleOpenSystemRemoteDesktopImpl, handleTerminalDataCaptureImpl, startRestoredSessionConnectionLogImpl, hasMultipleProtocolsImpl, handleHostConnectWithProtocolCheckImpl, handleProtocolSelectImpl, handleRootContextMenuImpl, markForwardedNativeShortcutEvent } from './AppHandlers';
|
||||
import type { RemoteDesktopProtocol } from '../../domain/remoteDesktop';
|
||||
import { handleTrayJumpToSessionImpl, handleTrayTogglePortForwardImpl, handleTrayPanelConnectImpl, handleTrayPanelConnectRequestImpl, flushQueuedTrayPanelConnectHostsImpl, handleGlobalHotkeyKeyDownImpl, handleEscapeKeyDownImpl, handleKeyboardInteractiveSubmitImpl, handleKeyboardInteractiveCancelImpl, handlePassphraseSubmitImpl, handlePassphraseCancelImpl, handlePassphraseSkipImpl, handleFidoPromptSubmitImpl, handleFidoPromptCancelImpl, createLocalTerminalWithCurrentShellImpl, splitSessionWithCurrentShellImpl, copySessionWithCurrentShellImpl, duplicateSessionWithCurrentShellImpl, copyWorkspaceWithCurrentShellImpl, copySessionToNewWindowWithCurrentShellImpl, moveSessionToNewWindowImpl, confirmIfBusyLocalTerminalImpl, closeTabsBatchImpl, executeHotkeyActionImpl, handleCreateLocalTerminalImpl, handleConnectToHostImpl, handleTerminalDataCaptureImpl, startRestoredSessionConnectionLogImpl, hasMultipleProtocolsImpl, handleHostConnectWithProtocolCheckImpl, handleProtocolSelectImpl, handleRootContextMenuImpl, markForwardedNativeShortcutEvent } from './AppHandlers';
|
||||
|
||||
type OpenSessionInNewWindowPayload = {
|
||||
title?: string;
|
||||
@@ -261,7 +260,6 @@ export function AppSideEffects() {
|
||||
createLocalTerminal,
|
||||
createSerialSession,
|
||||
connectToHost,
|
||||
connectToHostRemoteDesktop,
|
||||
appendHostToWorkspaceConfirmed,
|
||||
closeSession,
|
||||
closeSessions,
|
||||
@@ -1519,38 +1517,6 @@ export function AppSideEffects() {
|
||||
}), connectionHost, hidden);
|
||||
}, [addConnectionLog, appendHostToWorkspaceConfirmed, connectToHost, resolveEffectiveHost, identities, keys, discoveredShells]);
|
||||
|
||||
const handleConnectRemoteDesktop = useCallback((
|
||||
host: Host,
|
||||
protocol: RemoteDesktopProtocol,
|
||||
options?: { splitFromSessionId?: string },
|
||||
) => {
|
||||
return handleConnectRemoteDesktopImpl(() => ({
|
||||
addConnectionLog,
|
||||
connectToHostRemoteDesktop,
|
||||
identities,
|
||||
resolveEffectiveHost,
|
||||
systemInfoRef,
|
||||
}), host, protocol, options);
|
||||
}, [addConnectionLog, connectToHostRemoteDesktop, identities, resolveEffectiveHost]);
|
||||
|
||||
const handleOpenSystemRemoteDesktop = useCallback((
|
||||
host: Host,
|
||||
protocol: RemoteDesktopProtocol,
|
||||
rawRdpContent?: string,
|
||||
) => {
|
||||
void handleOpenSystemRemoteDesktopImpl(() => ({
|
||||
groupConfigs,
|
||||
hosts,
|
||||
identities,
|
||||
keys,
|
||||
knownHosts: knownHostsRef.current,
|
||||
netcattyBridge,
|
||||
proxyProfiles,
|
||||
resolveEffectiveHost,
|
||||
toast,
|
||||
}), host, protocol, rawRdpContent);
|
||||
}, [groupConfigs, hosts, identities, keys, proxyProfiles, resolveEffectiveHost]);
|
||||
|
||||
const handleConnectToHostWithTabName = useCallback((host: Host, tabName?: string) => {
|
||||
const sessionId = handleConnectToHost(host);
|
||||
if (sessionId && tabName) {
|
||||
@@ -1803,33 +1769,6 @@ export function AppSideEffects() {
|
||||
}
|
||||
return;
|
||||
}
|
||||
const targetProtocol = result.target.protocol.toLowerCase();
|
||||
const jumpServerRdpLaunchMode = settings.jumpServerRdpLaunchMode ?? 'builtin';
|
||||
if (
|
||||
targetProtocol === 'rdp'
|
||||
&& jumpServerRdpLaunchMode === 'system'
|
||||
&& result.target.rawRdpFileContent
|
||||
) {
|
||||
const rdBridge = netcattyBridge.get()?.remoteDesktop;
|
||||
if (rdBridge?.openSystemClient) {
|
||||
void rdBridge.openSystemClient({
|
||||
protocol: 'rdp',
|
||||
hostname: result.target.hostname,
|
||||
port: result.target.port,
|
||||
username: result.target.username || undefined,
|
||||
domain: result.target.domain || undefined,
|
||||
label: result.target.label,
|
||||
rdpContent: result.target.rawRdpFileContent,
|
||||
}).then((res) => {
|
||||
if (!res?.ok) {
|
||||
toast.error(res?.error || 'Failed to launch system RDP client');
|
||||
}
|
||||
}).catch((err) => {
|
||||
toast.error(err instanceof Error ? err.message : 'Failed to launch system RDP client');
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
const ephemeralHost = buildJmsDeepLinkEphemeralHost(result.target, {
|
||||
id: crypto.randomUUID(),
|
||||
now: Date.now(),
|
||||
@@ -2070,26 +2009,7 @@ export function AppSideEffects() {
|
||||
const handleHostConnectWithProtocolCheck = useCallback((host: Host) => { return handleHostConnectWithProtocolCheckImpl(() => ({ handleConnectToHost, hasMultipleProtocols, host, resolveEffectiveHost, setIsQuickSwitcherOpen, setProtocolSelectHost }), host); }, [hasMultipleProtocols, handleConnectToHost, resolveEffectiveHost]);
|
||||
|
||||
// Handle protocol selection from dialog
|
||||
const handleProtocolSelect = useCallback(
|
||||
(protocol: HostProtocol, port: number, rememberDefault?: boolean) => {
|
||||
return handleProtocolSelectImpl(
|
||||
() => ({
|
||||
handleConnectToHost,
|
||||
handleConnectRemoteDesktop,
|
||||
port,
|
||||
protocol,
|
||||
protocolSelectHost,
|
||||
rememberDefault,
|
||||
setProtocolSelectHost,
|
||||
updateHosts,
|
||||
}),
|
||||
protocol,
|
||||
port,
|
||||
rememberDefault,
|
||||
);
|
||||
},
|
||||
[protocolSelectHost, handleConnectToHost, handleConnectRemoteDesktop, updateHosts],
|
||||
);
|
||||
const handleProtocolSelect = useCallback((protocol: HostProtocol, port: number) => { return handleProtocolSelectImpl(() => ({ handleConnectToHost, port, protocol, protocolSelectHost, setProtocolSelectHost }), protocol, port); }, [protocolSelectHost, handleConnectToHost]);
|
||||
|
||||
const handleOpenQuickSwitcher = useCallback(() => {
|
||||
setIsQuickSwitcherOpen(true);
|
||||
@@ -2182,8 +2102,6 @@ export function AppSideEffects() {
|
||||
createWorkspaceWithHosts: createWorkspaceWithEffectiveHosts,
|
||||
handleConnectSerial,
|
||||
handleConnectToHost,
|
||||
handleConnectRemoteDesktop,
|
||||
handleOpenSystemRemoteDesktop,
|
||||
handleCreateLocalTerminal,
|
||||
handleHotkeyAction,
|
||||
handleSessionStatusChange,
|
||||
@@ -2263,8 +2181,6 @@ export function AppSideEffects() {
|
||||
createWorkspaceWithEffectiveHosts,
|
||||
handleConnectSerial,
|
||||
handleConnectToHost,
|
||||
handleConnectRemoteDesktop,
|
||||
handleOpenSystemRemoteDesktop,
|
||||
handleCreateLocalTerminal,
|
||||
handleHotkeyAction,
|
||||
handleSessionStatusChange,
|
||||
|
||||
@@ -277,7 +277,7 @@ function AppViewInner({ domains }: AppViewProps) {
|
||||
convertKnownHostToHost, createWorkspaceFromSessions, createWorkspaceFromTargets, createWorkspaceWithHosts,
|
||||
customGroups, currentTerminalTheme, deepLinkHostDraft, draggingSessionId, effectiveKnownHosts, editorTabs, editorWordWrap, emptyVaultConflict,
|
||||
followAppTerminalTheme,
|
||||
groupConfigs, handleAddKnownHost, handleConnectSerial, handleConnectToHost, handleConnectRemoteDesktop, handleOpenSystemRemoteDesktop, handleCreateLocalTerminal, handleDefaultTerminalThemeChange, handleDeleteHost,
|
||||
groupConfigs, handleAddKnownHost, handleConnectSerial, handleConnectToHost, handleCreateLocalTerminal, handleDefaultTerminalThemeChange, handleDeleteHost,
|
||||
handleEndSessionDrag, handleFollowAppTerminalThemeChange, handleHostConnectWithProtocolCheck, handleHotkeyAction, handleKeyboardInteractiveCancel, handleKeyboardInteractiveSubmit,
|
||||
handleOpenHostFromVaultNote, handleOpenQuickSwitcher, handleOpenSettings, handleOpenVaultHostFromChat, handleOpenVaultNoteFromChat, handleOpenVaultSectionFromChat, handleOpenVaultSnippetFromChat, handleRootContextMenu, handlePassphraseCancel, handlePassphraseSkip, handlePassphraseSubmit, handleFidoPromptSubmit, handleFidoPromptCancel, handleProtocolSelect,
|
||||
handleRequestCloseEditorTabRef, handleSessionStatusChange, handleSyncNowManual, handleTerminalDataCapture, handleUpdateHostFromTerminal,
|
||||
@@ -621,8 +621,6 @@ function AppViewInner({ domains }: AppViewProps) {
|
||||
themeById={themeById}
|
||||
resolveSessionAppearance={resolveSessionAppearance}
|
||||
onConnect={handleConnectToHost}
|
||||
onConnectRemoteDesktop={handleConnectRemoteDesktop}
|
||||
onOpenSystemRemoteDesktop={handleOpenSystemRemoteDesktop}
|
||||
onNewHost={workSurfaceHostEditor.openNew}
|
||||
onEditHost={workSurfaceHostEditor.openEdit}
|
||||
onCreateLocalTerminal={handleCreateLocalTerminal}
|
||||
@@ -674,8 +672,6 @@ function AppViewInner({ domains }: AppViewProps) {
|
||||
onConnectSerial={handleConnectSerial}
|
||||
onDeleteHost={handleDeleteHost}
|
||||
onConnect={handleConnectToHost}
|
||||
onConnectRemoteDesktop={handleConnectRemoteDesktop}
|
||||
onOpenSystemRemoteDesktop={handleOpenSystemRemoteDesktop}
|
||||
onOpenHostFromNote={handleOpenHostFromVaultNote}
|
||||
groupConfigs={groupConfigs}
|
||||
onUpdateGroupConfigs={updateGroupConfigs}
|
||||
@@ -804,8 +800,6 @@ function AppViewInner({ domains }: AppViewProps) {
|
||||
onCopySessionToNewWindow={copySessionToNewWindowWithCurrentShell}
|
||||
onSplitSession={splitSessionWithCurrentShell}
|
||||
onConnectToHost={handleConnectToHost}
|
||||
onConnectRemoteDesktop={handleConnectRemoteDesktop}
|
||||
onOpenSystemRemoteDesktop={handleOpenSystemRemoteDesktop}
|
||||
openNoteRequest={openNoteRequest}
|
||||
onOpenVaultNoteFromChat={handleOpenVaultNoteFromChat}
|
||||
onOpenVaultHostFromChat={handleOpenVaultHostFromChat}
|
||||
|
||||
@@ -3,7 +3,6 @@ import React, { Suspense, lazy, useMemo, useState } from 'react';
|
||||
import type { QuickSwitcherProps } from '../../components/QuickSwitcher';
|
||||
import { LazyLoadBoundary } from '../../components/ui/lazy-load-boundary';
|
||||
import { getHostSearchMatch } from '../../domain/searchMatcher';
|
||||
import { usePinyinMatcherVersion } from '../state/usePinyinMatcherVersion';
|
||||
import type { Host } from '../../types';
|
||||
|
||||
const LazyQuickSwitcher = lazy(() =>
|
||||
@@ -38,11 +37,7 @@ export type QuickSwitcherOverlayProps =
|
||||
*/
|
||||
export function QuickSwitcherOverlay({ hosts, ...props }: QuickSwitcherOverlayProps) {
|
||||
const [query, setQuery] = useState('');
|
||||
const pinyinMatcherVersion = usePinyinMatcherVersion();
|
||||
const results = useMemo(() => {
|
||||
void pinyinMatcherVersion;
|
||||
return filterQuickSwitcherHosts(hosts, query);
|
||||
}, [hosts, query, pinyinMatcherVersion]);
|
||||
const results = useMemo(() => filterQuickSwitcherHosts(hosts, query), [hosts, query]);
|
||||
return (
|
||||
<LazyLoadBoundary name="Quick switcher" resetKey={query}>
|
||||
<Suspense fallback={null}>
|
||||
|
||||
@@ -195,8 +195,6 @@ export function TerminalHost() {
|
||||
resolveSessionAppearance: resolveFocusedAppearance,
|
||||
handleConnectSerial: handlers.handleConnectSerial,
|
||||
handleConnectToHost: handlers.handleConnectToHost,
|
||||
handleConnectRemoteDesktop: handlers.handleConnectRemoteDesktop,
|
||||
handleOpenSystemRemoteDesktop: handlers.handleOpenSystemRemoteDesktop,
|
||||
handleCreateLocalTerminal: handlers.handleCreateLocalTerminal,
|
||||
handleDefaultTerminalThemeChange,
|
||||
handleFollowAppTerminalThemeChange,
|
||||
|
||||
@@ -32,66 +32,41 @@ function loadComponent(path: string, name: string, bindings: Record<string, unkn
|
||||
}) as React.ComponentType;
|
||||
}
|
||||
|
||||
test('App no longer mounts retired built-in MonitorRuntimeHost or MonitorHostKeyDialog', async () => {
|
||||
const env = globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT?: boolean };
|
||||
const previous = env.IS_REACT_ACT_ENVIRONMENT;
|
||||
env.IS_REACT_ACT_ENVIRONMENT = true;
|
||||
let sideEffectRenders = 0;
|
||||
let shellRenders = 0;
|
||||
const appSource = readFileSync(new URL('../../App.tsx', import.meta.url), 'utf8');
|
||||
assert.doesNotMatch(appSource, /MonitorRuntimeHost/, 'App must not mount retired MonitorRuntimeHost');
|
||||
assert.doesNotMatch(appSource, /MonitorHostKeyDialog/, 'App must not mount retired MonitorHostKeyDialog');
|
||||
|
||||
const App = loadComponent('../../App.tsx', 'App', {
|
||||
performance: { mark: () => {} },
|
||||
AppLocalStateProvider: ({ children }: { children: React.ReactNode }) => children,
|
||||
AppSideEffects: () => { sideEffectRenders += 1; return null; },
|
||||
AppShell: React.memo(() => { shellRenders += 1; return null; }),
|
||||
});
|
||||
let renderer: ReturnType<typeof create> | undefined;
|
||||
try {
|
||||
await act(async () => { renderer = create(React.createElement(App)); });
|
||||
assert.equal(sideEffectRenders, 1);
|
||||
assert.equal(shellRenders, 1);
|
||||
} finally {
|
||||
await act(async () => renderer?.unmount());
|
||||
env.IS_REACT_ACT_ENVIRONMENT = previous;
|
||||
}
|
||||
});
|
||||
|
||||
test('MonitorRuntimeHost keeps monitor runtime updates isolated from sibling components when mounted', async () => {
|
||||
test('monitor controls update their runtime without rendering unrelated app siblings', async () => {
|
||||
const env = globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT?: boolean };
|
||||
const previous = env.IS_REACT_ACT_ENVIRONMENT;
|
||||
env.IS_REACT_ACT_ENVIRONMENT = true;
|
||||
let updateMonitor: (() => void) | undefined;
|
||||
let runtimeRenders = 0;
|
||||
let siblingRenders = 0;
|
||||
let sideEffectRenders = 0;
|
||||
let shellRenders = 0;
|
||||
const useMonitorRuntime = () => {
|
||||
const [, setVersion] = useState(0);
|
||||
updateMonitor = () => setVersion((version) => version + 1);
|
||||
runtimeRenders += 1;
|
||||
};
|
||||
const MonitorRuntimeHost = loadComponent('./MonitorRuntimeHost.tsx', 'MonitorRuntimeHost', { useMonitorRuntime });
|
||||
const StableSibling = React.memo(() => { siblingRenders += 1; return null; });
|
||||
const App = loadComponent('../../App.tsx', 'App', {
|
||||
performance: { mark: () => {} },
|
||||
useMonitorRuntime,
|
||||
MonitorRuntimeHost,
|
||||
AppLocalStateProvider: ({ children }: { children: React.ReactNode }) => children,
|
||||
AppSideEffects: () => { sideEffectRenders += 1; return null; },
|
||||
MonitorHostKeyDialog: () => null,
|
||||
AppShell: React.memo(() => { shellRenders += 1; return null; }),
|
||||
});
|
||||
let renderer: ReturnType<typeof create> | undefined;
|
||||
try {
|
||||
await act(async () => {
|
||||
renderer = create(
|
||||
React.createElement(
|
||||
React.Fragment,
|
||||
null,
|
||||
React.createElement(MonitorRuntimeHost),
|
||||
React.createElement(StableSibling),
|
||||
),
|
||||
);
|
||||
});
|
||||
await act(async () => { renderer = create(React.createElement(App)); });
|
||||
const initialRuntimeRenders = runtimeRenders;
|
||||
const initialSiblingRenders = siblingRenders;
|
||||
const initialSideEffectRenders = sideEffectRenders;
|
||||
const initialShellRenders = shellRenders;
|
||||
for (let i = 0; i < 10; i += 1) {
|
||||
await act(async () => updateMonitor!());
|
||||
}
|
||||
assert.equal(runtimeRenders - initialRuntimeRenders, 10, 'monitor updates must run inside MonitorRuntimeHost');
|
||||
assert.equal(siblingRenders - initialSiblingRenders, 0, 'monitor updates must not re-render siblings');
|
||||
assert.equal(runtimeRenders - initialRuntimeRenders, 10, 'monitor updates must still run');
|
||||
assert.equal(sideEffectRenders - initialSideEffectRenders, 0, 'monitor-only state must not render AppSideEffects');
|
||||
assert.equal(shellRenders - initialShellRenders, 0, 'monitor controls must leave the shell stable');
|
||||
} finally {
|
||||
await act(async () => renderer?.unmount());
|
||||
env.IS_REACT_ACT_ENVIRONMENT = previous;
|
||||
|
||||
@@ -53,7 +53,6 @@ export function SessionPublisher({ persistSessionRestore, children }: SessionPub
|
||||
createLocalTerminal,
|
||||
createSerialSession,
|
||||
connectToHost,
|
||||
connectToHostRemoteDesktop,
|
||||
updateSessionStatus,
|
||||
updateSessionFontSize,
|
||||
clearSessionFontSizeOverride,
|
||||
@@ -142,7 +141,6 @@ export function SessionPublisher({ persistSessionRestore, children }: SessionPub
|
||||
createLocalTerminal,
|
||||
createSerialSession,
|
||||
connectToHost,
|
||||
connectToHostRemoteDesktop,
|
||||
updateSessionStatus,
|
||||
updateSessionFontSize,
|
||||
clearSessionFontSizeOverride,
|
||||
@@ -190,7 +188,6 @@ export function SessionPublisher({ persistSessionRestore, children }: SessionPub
|
||||
closeSessions,
|
||||
closeWorkspace,
|
||||
connectToHost,
|
||||
connectToHostRemoteDesktop,
|
||||
copySession,
|
||||
copyWorkspace,
|
||||
createLocalTerminal,
|
||||
|
||||
@@ -835,15 +835,6 @@ export const enAiMessages: Messages = {
|
||||
'ai.chat.artifact.scriptRunPaused': 'Script run paused',
|
||||
'ai.chat.artifact.scriptRunResumed': 'Script run resumed',
|
||||
'ai.chat.artifact.scriptReference': 'nct API reference',
|
||||
'ai.chat.artifact.rdScreenRead': 'Read remote screen',
|
||||
'ai.chat.artifact.rdScreenGrid': 'Read remote screen (grid)',
|
||||
'ai.chat.artifact.rdScreenCropped': 'Captured zoomed region',
|
||||
'ai.chat.artifact.rdActionExecuted': 'Ran {count} remote actions',
|
||||
'ai.chat.artifact.rdActionCount': '{count} actions',
|
||||
'ai.chat.artifact.rdActionPreempted': 'Remote action paused by user',
|
||||
'ai.chat.artifact.rdScreenFailed': 'Remote screen capture failed',
|
||||
'ai.chat.artifact.rdActionFailed': 'Remote desktop action failed',
|
||||
'ai.chat.artifact.rdPreviewScreen': 'Preview captured screen',
|
||||
'zmodem.waitingForRemote': 'Waiting for remote...',
|
||||
'zmodem.uploading': 'Uploading',
|
||||
'zmodem.downloading': 'Downloading',
|
||||
@@ -877,21 +868,4 @@ export const enAiMessages: Messages = {
|
||||
"ai.toolSettings.conflict": "Settings changed in another window. Your draft is preserved. Cancel and reopen to load the saved settings.",
|
||||
"ai.toolSettings.retry": "Retry",
|
||||
"ai.toolSettings.applyingHttp": "Applying HTTP configuration...",
|
||||
"ai.vision.quickPrompt.explainError": "Explain current error",
|
||||
"ai.vision.quickPrompt.diagnoseUi": "Diagnose UI issue",
|
||||
"ai.vision.quickPrompt.summarizeScreen": "Summarize screen",
|
||||
"ai.vision.unsupportedModelWarning": "Current model ({model}) does not support image input. Switch to a vision-capable model to read remote screens.",
|
||||
"ai.vision.switchModel": "Switch model",
|
||||
"ai.vision.modelSupportsVision": "Supports image input",
|
||||
"ai.vision.snip.hint": "Drag to select a region · Esc to cancel",
|
||||
"ai.vision.snip.cancel": "Cancel region snip",
|
||||
"ai.vision.snip.ariaLabel": "Select a region of the remote desktop screen",
|
||||
"ai.vision.privacyBlocked": "AI screen reading is blocked for this session.",
|
||||
"ai.vision.viewingScreen": "Catty is viewing desktop",
|
||||
"ai.vision.askAi": "Ask AI",
|
||||
"ai.vision.captureFullAndAsk": "Capture screen & ask AI",
|
||||
"ai.vision.snipRegionAndAsk": "Snip region & ask AI",
|
||||
"ai.vision.openAiChat": "Open AI assistant",
|
||||
"ai.vision.privacyLockOn": "AI screen reading blocked",
|
||||
"ai.vision.privacyLockOff": "Allow AI to read screen",
|
||||
};
|
||||
@@ -1174,16 +1174,6 @@ Highlight the focused split pane:
|
||||
'vault.nav.notes': 'Notes',
|
||||
'vault.nav.knownHosts': 'Known Hosts',
|
||||
'vault.nav.logs': 'Logs',
|
||||
'vault.nav.customize': 'Customize sidebar',
|
||||
'vault.nav.customizeHint': 'Drag items to reorder or toggle visibility.',
|
||||
'vault.nav.hideItem': 'Hide {label}',
|
||||
'vault.nav.moveUp': 'Move up',
|
||||
'vault.nav.moveDown': 'Move down',
|
||||
'vault.nav.resetDefault': 'Reset to default',
|
||||
'vault.nav.alwaysVisible': 'Always visible',
|
||||
'vault.nav.pluginBadge': 'Plugin',
|
||||
'vault.nav.dragToReorder': 'Drag to reorder {label}',
|
||||
'vault.nav.toggleVisibility': 'Toggle {label} visibility',
|
||||
|
||||
'proxyProfiles.action.add': 'Add Proxy',
|
||||
'proxyProfiles.search.placeholder': 'Search proxies…',
|
||||
@@ -1328,9 +1318,6 @@ Highlight the focused split pane:
|
||||
"plugins.sidebar.loading": "Loading extension page…",
|
||||
"plugins.vault.loading": "Loading plugin page…",
|
||||
"plugins.interaction.title": "Plugin request",
|
||||
"plugins.interaction.openUrlTitle": "Open external link?",
|
||||
"plugins.interaction.openUrlNote": "This plugin wants to open the following HTTPS URL in your default browser:",
|
||||
"plugins.interaction.openUrlAction": "Open URL",
|
||||
"plugins.interaction.sharing": "Text you share becomes available to this plugin and its granted capabilities, including network access. Reading does not approve a new network destination.",
|
||||
"plugins.interaction.input": "Input text",
|
||||
"plugins.interaction.filter": "Filter choices",
|
||||
|
||||
@@ -106,16 +106,4 @@ export const enMonitorMessages = {
|
||||
"monitor.status.disconnected": "Disconnected",
|
||||
"monitor.status.stale": "Out of date",
|
||||
"monitor.status.missing": "Host deleted",
|
||||
"monitor.status.online": "Online",
|
||||
"monitor.status.offline": "Offline",
|
||||
"monitor.checkNow": "Check now",
|
||||
"monitor.openRemoteDesktop": "Open {protocol}",
|
||||
"monitor.latencyTrend": "Latency trend",
|
||||
"monitor.bannerVerified": "Protocol verified",
|
||||
"monitor.bannerUnverified": "Port open (banner unverified)",
|
||||
"monitor.companionDesktops": "Remote Desktop Services",
|
||||
"monitor.reachabilityOnly": "Reachability probe only",
|
||||
"monitor.viaSsh": "via SSH",
|
||||
"monitor.direct": "Direct",
|
||||
"monitor.rttStats": "Min / Avg / Max",
|
||||
};
|
||||
@@ -214,25 +214,6 @@ export const enSystemManagerMessages: Messages = {
|
||||
'systemManager.ports.unknownProcess': 'Unknown process',
|
||||
'systemManager.ports.terminate': 'Terminate',
|
||||
'systemManager.ports.confirmTerminate': 'Send SIGTERM to process {{pid}} that holds this port?',
|
||||
'systemManager.ports.forwardedMeta': '{{count}} forwarded',
|
||||
'systemManager.ports.forward': 'Forward to local port',
|
||||
'systemManager.ports.stopForward': 'Stop port forwarding',
|
||||
'systemManager.ports.forwardTitle': 'Forward port to local',
|
||||
'systemManager.ports.forwardDesc': 'Create a local SSH port forward to this remote listener.',
|
||||
'systemManager.ports.forwardDescWithHost': 'Forward this listener on {{host}} to a local port over SSH.',
|
||||
'systemManager.ports.forwardLocalPort': 'Local port',
|
||||
'systemManager.ports.forwardBindAddress': 'Bind address',
|
||||
'systemManager.ports.forwardAction': 'Forward',
|
||||
'systemManager.ports.forwarding': 'Forwarding…',
|
||||
'systemManager.ports.forwardInvalidPort': 'Enter a valid port number between 1 and 65535.',
|
||||
'systemManager.ports.forwardInvalidBindAddress': 'Enter a valid bind address (e.g. 127.0.0.1 or 0.0.0.0).',
|
||||
'systemManager.ports.forwardPortInUse': 'Local port {{port}} is already used by "{{label}}".',
|
||||
'systemManager.ports.forwardFailed': 'Failed to start port forwarding.',
|
||||
'systemManager.ports.forwardStarted': 'Forwarding {{local}} → {{remote}}',
|
||||
'systemManager.ports.forwardStopped': 'Stopped forwarding {{local}}',
|
||||
'systemManager.ports.copiedEndpoint': 'Copied {{endpoint}}',
|
||||
'systemManager.ports.copyEndpointAria': 'Copy local address {{endpoint}}',
|
||||
'systemManager.ports.clickToCopy': 'Click to copy local address',
|
||||
|
||||
'systemManager.services.unavailable': 'systemctl is not available on this host.',
|
||||
'systemManager.services.loading': 'Loading systemd services…',
|
||||
|
||||
@@ -680,7 +680,6 @@ export const enVaultMessages: Messages = {
|
||||
|
||||
// Protocol select dialog
|
||||
'protocolSelect.chooseProtocol': 'Choose protocol',
|
||||
'protocolSelect.rememberDefault': 'Remember as default (skip this prompt next time)',
|
||||
'protocolSelect.port': 'port:',
|
||||
|
||||
// Host Details
|
||||
@@ -992,22 +991,7 @@ export const enVaultMessages: Messages = {
|
||||
'hostDetails.startupCommand.runMode.help': 'Choose how multi-line startup commands are sent after connection.',
|
||||
'hostDetails.startupCommand.runMode.lineDelay': 'Send line by line',
|
||||
'hostDetails.startupCommand.runMode.paste': 'Send all at once',
|
||||
'hostDetails.otherProtocols': 'Additional Protocols',
|
||||
'hostDetails.otherProtocolsHint': 'Attach secondary access methods to this SSH host without changing its default connection',
|
||||
'hostDetails.protocol.defaultHint': 'Default on double-click ({protocol})',
|
||||
'hostDetails.protocol.secondaryHint': 'Enabled as secondary protocol',
|
||||
'hostDetails.protocol.setDefault': 'Set as default',
|
||||
'hostDetails.protocol.remove': 'Remove',
|
||||
'hostDetails.protocol.doubleClick': 'On double-click',
|
||||
'hostDetails.protocol.connectOptionDefault': 'Default: {protocol}',
|
||||
'hostDetails.protocol.connectOptionAsk': 'Ask every time',
|
||||
'hostDetails.protocol.alsoEnable': 'Also enable',
|
||||
'hostDetails.protocol.removeProtocol': 'Remove {protocol}',
|
||||
'hostDetails.protocol.addProtocol': 'Add {protocol}',
|
||||
'hostDetails.section.connectBehavior': 'Connection Behavior',
|
||||
'hostDetails.protocol.notEnabledDesc': '{protocol} is not enabled on this host yet.',
|
||||
'hostDetails.protocol.addSecondary': 'Add {protocol} (keep {defaultProtocol} default)',
|
||||
'hostDetails.protocol.switchOnly': 'Use {protocol} only',
|
||||
'hostDetails.otherProtocols': 'Other Protocols',
|
||||
'hostDetails.telnetOn': 'Telnet on',
|
||||
'hostDetails.port': 'port',
|
||||
'hostDetails.telnet.credentials': 'Credentials',
|
||||
@@ -1107,349 +1091,4 @@ export const enVaultMessages: Messages = {
|
||||
'vault.import.plugins.moreItems': '{count} more items are included in this import.',
|
||||
'vault.import.plugins.moreDiagnostics': '{count} more diagnostics were omitted from this preview.',
|
||||
|
||||
// Remote Desktop (VNC / RDP / JumpServer RDP)
|
||||
'vault.hosts.newRdpHost': 'New RDP Host',
|
||||
'vault.hosts.newVncHost': 'New VNC Host',
|
||||
'vault.hosts.connectRdp': 'Connect RDP',
|
||||
'vault.hosts.connectSsh': 'Connect SSH',
|
||||
'vault.hosts.connectVnc': 'Connect VNC',
|
||||
'vault.hosts.openInSystemRdp': 'Open in System RDP',
|
||||
'vault.hosts.openInSystemVnc': 'Open in Screen Sharing',
|
||||
'settings.jmsDeepLink.rdpLaunchMode': 'Open JumpServer RDP in',
|
||||
'settings.jmsDeepLink.rdpLaunchModeDesc': 'Choose whether JumpServer jms:// RDP sessions open in Netcatty\'s built-in client or your system RDP app.',
|
||||
'settings.jmsDeepLink.rdpLaunchMode.builtin': 'Built-in Client',
|
||||
'settings.jmsDeepLink.rdpLaunchMode.system': 'System RDP Client',
|
||||
'vault.import.rdp.label': 'RDP (.rdp)',
|
||||
'vault.import.rdp.hint': 'Import one or more Microsoft / JumpServer .rdp files.',
|
||||
'vault.import.remoteDesktopTip': 'MobaXterm, CSV, and .rdp imports also support RDP and VNC hosts.',
|
||||
'keychain.identity.domain': 'Domain (RDP, optional)',
|
||||
'keychain.identity.domainPlaceholder': 'CORP or AD domain',
|
||||
'quickConnect.rdp.domain': 'Domain (optional)',
|
||||
'quickConnect.rdp.domainPlaceholder': 'CORP or leave empty for local account',
|
||||
'quickConnect.vnc.optionalUsername': 'Username (optional, for Apple ARD / VeNCrypt)',
|
||||
'quickConnect.vnc.optionalUsernameHint': 'Most VNC servers only require a password.',
|
||||
'quickConnect.vnc.passwordHint': 'Leave empty if the VNC server does not require authentication.',
|
||||
'quickConnect.vnc.displayHelper': 'Display {display}',
|
||||
'hostDetails.protocol.label': 'Protocol',
|
||||
'hostDetails.rdp.portLabel': 'RDP on',
|
||||
'hostDetails.vnc.portLabel': 'VNC on',
|
||||
'hostDetails.vnc.displayHint': 'Display {display}',
|
||||
'hostDetails.vnc.displayPlaceholder': '5900 or :0',
|
||||
'hostDetails.rdp.domain': 'Domain (optional)',
|
||||
'hostDetails.rdp.domainPlaceholder': 'CORP (optional)',
|
||||
'hostDetails.rdp.domainLabel': 'Domain',
|
||||
'hostDetails.rdp.usernamePlaceholder': 'Username, DOMAIN\\user, or JumpServer user|uuid',
|
||||
'hostDetails.vnc.optionalUsername': 'Username (Apple ARD / VeNCrypt)',
|
||||
'hostDetails.vnc.optionalUsernameHint': 'Optional. Standard VNC servers authenticate with password only.',
|
||||
'hostDetails.vnc.usernamePlaceholder': 'Username (optional)',
|
||||
'hostDetails.remoteDesktop.sectionTitle': 'Remote Desktop Display & Options',
|
||||
'hostDetails.rdp.resolutionMode': 'Resolution Mode',
|
||||
'hostDetails.rdp.resolutionMode.dynamic': 'Dynamic Resize',
|
||||
'hostDetails.rdp.resolutionMode.fit': 'Fit to Window',
|
||||
'hostDetails.rdp.resolutionMode.fixed': 'Fixed Size',
|
||||
'hostDetails.rdp.width': 'Width',
|
||||
'hostDetails.rdp.height': 'Height',
|
||||
'hostDetails.rdp.dimensionHint': 'Enter a whole number from 200 to 8192.',
|
||||
'hostDetails.rdp.colorDepth': 'Color Depth',
|
||||
'hostDetails.rdp.audio': 'Audio Output',
|
||||
'hostDetails.rdp.audioDesc': 'Play remote desktop sound locally',
|
||||
'hostDetails.rdp.clipboard': 'Clipboard Sync',
|
||||
'hostDetails.rdp.clipboardDesc': 'Share text and images with the remote desktop',
|
||||
'hostDetails.rdp.clipboardFiles': 'Clipboard File Transfer',
|
||||
'hostDetails.rdp.clipboardFilesDesc': 'Allow copying and dropping files via clipboard',
|
||||
'hostDetails.rdp.securityMode': 'Security Mode',
|
||||
'hostDetails.rdp.securityMode.auto': 'Auto',
|
||||
'hostDetails.rdp.securityMode.nla': 'NLA (CredSSP)',
|
||||
'hostDetails.rdp.securityMode.tls': 'TLS',
|
||||
'hostDetails.rdp.securityMode.rdp': 'Standard RDP',
|
||||
'hostDetails.rdp.ignoreCertErrors': 'Ignore Certificate Errors',
|
||||
'hostDetails.rdp.ignoreCertErrorsDesc': 'Skip TLS certificate trust prompts (not recommended)',
|
||||
'hostDetails.rdp.advanced': 'Advanced RDP Options',
|
||||
'hostDetails.rdp.loadBalanceInfo': 'Load Balance Info',
|
||||
'hostDetails.rdp.loadBalanceInfoPlaceholder': 'tsv://MS Terminal Services Plugin.1.Collection',
|
||||
'hostDetails.rdp.alternateShell': 'Alternate Shell',
|
||||
'hostDetails.rdp.alternateShellPlaceholder': 'Optional startup program path',
|
||||
'hostDetails.rdp.shellWorkingDir': 'Working Directory',
|
||||
'hostDetails.rdp.shellWorkingDirPlaceholder': 'Optional startup directory',
|
||||
'hostDetails.vnc.scalingMode': 'Scaling Mode',
|
||||
'hostDetails.vnc.scalingMode.fit': 'Fit to Window',
|
||||
'hostDetails.vnc.scalingMode.actual': 'Actual (1:1)',
|
||||
'hostDetails.vnc.scalingMode.stretch': 'Stretch',
|
||||
'hostDetails.vnc.scalingMode.dynamic': 'Dynamic Resize',
|
||||
'hostDetails.vnc.quality': 'Image Quality',
|
||||
'hostDetails.vnc.compression': 'Compression Level',
|
||||
'hostDetails.vnc.viewOnly': 'View-Only Mode',
|
||||
'hostDetails.vnc.viewOnlyDesc': 'Disable sending mouse and keyboard input',
|
||||
'hostDetails.vnc.sharedSession': 'Shared Session',
|
||||
'hostDetails.vnc.sharedSessionDesc': 'Keep other VNC clients connected',
|
||||
'hostDetails.vnc.clipboard': 'Clipboard Sync',
|
||||
'hostDetails.vnc.clipboardDesc': 'Sync UTF-8 clipboard text with remote desktop',
|
||||
'hostDetails.vnc.showRemoteCursor': 'Show Remote Cursor',
|
||||
'hostDetails.vnc.showRemoteCursorDesc': 'Render server-provided cursor shape',
|
||||
'hostDetails.companion.addVnc': 'Add VNC',
|
||||
'hostDetails.companion.addRdp': 'Add RDP',
|
||||
'hostDetails.companion.tunnelViaSsh': 'Tunnel via this host\'s SSH',
|
||||
'hostDetails.companion.tunnelViaSshDesc': 'Forward through this host\'s SSH connection automatically',
|
||||
'hostDetails.companion.tunnelTargetHost': 'Remote target address',
|
||||
'hostDetails.companion.credentialsSource': 'Credentials',
|
||||
'hostDetails.companion.credentials.host': 'Reuse host SSH credentials',
|
||||
'hostDetails.companion.credentials.manual': 'Custom username / password',
|
||||
'hostDetails.companion.credentials.manualHint': 'Saved securely to Keychain when you save this host',
|
||||
'hostDetails.companion.credentials.identity': 'Keychain Identity',
|
||||
'hostDetails.companion.credentials.ask': 'Ask on connect',
|
||||
'hostDetails.companion.identityPlaceholder': 'Select a saved identity',
|
||||
'hostDetails.companion.saveAsIdentity': 'Save as Identity',
|
||||
'hostDetails.companion.saveIdentityAction': 'Create & Select Identity',
|
||||
'hostDetails.companion.identityLabelPlaceholder': 'Identity label (e.g. Desktop VNC)',
|
||||
'hostDetails.companion.identitySaved': 'Identity saved and selected.',
|
||||
'hostDetails.companion.setDefaultRdp': 'Connect with RDP by default',
|
||||
'hostDetails.companion.setDefaultVnc': 'Connect with VNC by default',
|
||||
|
||||
// Known Hosts — Remote Desktop TLS Certificates
|
||||
'knownHosts.tabs.ssh': 'SSH Host Keys',
|
||||
'knownHosts.tabs.remoteDesktopCerts': 'Remote Desktop Certificates',
|
||||
'knownHosts.certs.clearAll': 'Clear All',
|
||||
'knownHosts.certs.expired': 'Expired',
|
||||
'knownHosts.certs.expiredNotice': 'This certificate has passed its validity expiration date.',
|
||||
'knownHosts.certs.copied': 'SHA-256 fingerprint copied',
|
||||
'knownHosts.certs.action.inspect': 'Inspect Certificate',
|
||||
'knownHosts.certs.action.copyFingerprint': 'Copy SHA-256',
|
||||
'knownHosts.certs.action.revoke': 'Revoke Trust',
|
||||
'knownHosts.certs.empty.title': 'No Trusted Remote Desktop Certificates',
|
||||
'knownHosts.certs.empty.desc': 'TLS certificates you trust while connecting to RDP or VeNCrypt VNC hosts will appear here.',
|
||||
'knownHosts.certs.empty.searchTitle': 'No Matching Certificates',
|
||||
'knownHosts.certs.empty.searchDesc': 'Try a different hostname, port, protocol, or SHA-256 fingerprint.',
|
||||
'knownHosts.certs.detail.subtitle': 'Pinned TLS certificate trusted on this device (TOFU)',
|
||||
'knownHosts.certs.detail.fingerprint': 'SHA-256 Fingerprint',
|
||||
'knownHosts.certs.detail.subject': 'Subject',
|
||||
'knownHosts.certs.detail.issuer': 'Issuer',
|
||||
'knownHosts.certs.detail.validFrom': 'Valid From',
|
||||
'knownHosts.certs.detail.validTo': 'Valid To',
|
||||
'knownHosts.certs.detail.trustedAt': 'Trusted At',
|
||||
'knownHosts.certs.detail.lastSeen': 'Last Seen',
|
||||
'knownHosts.certs.revokeConfirm.title': 'Revoke certificate for {endpoint}?',
|
||||
'knownHosts.certs.revokeConfirm.desc': 'You will be asked to verify this server\'s TLS certificate again on the next connection.',
|
||||
'knownHosts.certs.clearAllConfirm.title': 'Clear all trusted remote desktop certificates?',
|
||||
'knownHosts.certs.clearAllConfirm.desc': 'This will revoke all {count} pinned RDP/VNC certificates on this device.',
|
||||
'knownHosts.certs.toast.revoked': 'Certificate trust revoked',
|
||||
'knownHosts.certs.toast.clearedAll': 'Cleared {count} remote desktop certificates',
|
||||
|
||||
// Host Connection Test — RDP / VNC Probe
|
||||
'hostDetails.connectionTest.rdp': 'Test RDP',
|
||||
'hostDetails.connectionTest.vnc': 'Test VNC',
|
||||
'hostDetails.connectionTest.probe.rtt': 'Latency (RTT)',
|
||||
'hostDetails.connectionTest.probe.protocol': 'Protocol',
|
||||
'hostDetails.connectionTest.probe.security': 'Negotiated Security',
|
||||
'hostDetails.connectionTest.probe.rfbVersion': 'RFB Version',
|
||||
'hostDetails.connectionTest.probe.securityTypes': 'Security Types',
|
||||
'hostDetails.connectionTest.probe.tls': 'TLS',
|
||||
'hostDetails.connectionTest.probe.fingerprint': 'SHA-256 Fingerprint',
|
||||
'hostDetails.connectionTest.probe.trustStatus.trusted': 'Trusted',
|
||||
'hostDetails.connectionTest.probe.trustStatus.firstSeen': 'First Seen',
|
||||
'hostDetails.connectionTest.probe.trustStatus.changed': 'Changed',
|
||||
'hostDetails.connectionTest.probe.trustFingerprint': 'Trust Fingerprint',
|
||||
'hostDetails.connectionTest.probe.fingerprintTrusted': 'Certificate fingerprint trusted',
|
||||
|
||||
// Remote Desktop Toolbar — SFTP, CLIPRDR, Recording, Ask AI
|
||||
'remoteDesktop.toolbar.keysLocal': 'Keys: Local',
|
||||
'remoteDesktop.toolbar.keysRemote': 'Keys: Remote',
|
||||
'remoteDesktop.toolbar.keysLocalTip': 'Local tab/window shortcuts stay active. Click to capture shortcuts for remote desktop.',
|
||||
'remoteDesktop.toolbar.keysRemoteTip': 'App shortcuts are forwarded to remote. Press Ctrl+Alt+Shift or double-tap Right Alt/Option to release.',
|
||||
'remoteDesktop.toolbar.sendKeys': 'Send Keys',
|
||||
'remoteDesktop.toolbar.specialKeys': 'Special Key Chords',
|
||||
'remoteDesktop.toolbar.typeClipboard': 'Type Clipboard as Keystrokes',
|
||||
'remoteDesktop.toolbar.linuxTty': 'Linux Virtual Consoles',
|
||||
'remoteDesktop.toolbar.osChordNote': 'OS-reserved chords (Alt+Tab, Cmd+Tab, Ctrl+Alt+Del) are intercepted by your local OS and must be sent from this menu.',
|
||||
'remoteDesktop.toolbar.display': 'Display Scaling',
|
||||
'remoteDesktop.toolbar.sshTunneled': 'Tunneled over SSH',
|
||||
'remoteDesktop.toolbar.encrypted': 'Encrypted TLS connection',
|
||||
'remoteDesktop.toolbar.standardRdpSecurity': 'Standard RDP Security ({{cipher}})',
|
||||
'remoteDesktop.rdp.fallbackStandardRdp': 'Connected using Standard RDP Security.',
|
||||
'remoteDesktop.rdp.fallbackStandardRdpWithCipher': 'Connected using Standard RDP Security ({{cipher}}).',
|
||||
'remoteDesktop.toolbar.viewOnly': 'View-Only Mode',
|
||||
'remoteDesktop.toolbar.viewOnlyBadge': 'View',
|
||||
'remoteDesktop.toolbar.audio': 'RDP Audio',
|
||||
'remoteDesktop.toolbar.mute': 'Mute',
|
||||
'remoteDesktop.toolbar.unmute': 'Unmute',
|
||||
'remoteDesktop.toolbar.clipboard': 'Clipboard Sync',
|
||||
'remoteDesktop.toolbar.clipboardSync': 'Clipboard Sync',
|
||||
'remoteDesktop.toolbar.clipboardFiles': 'RDP Clipboard Files',
|
||||
'remoteDesktop.toolbar.clipboardFilesHint': 'Copy files on remote to download here, or drag local files onto the desktop to copy.',
|
||||
'remoteDesktop.toolbar.saveFile': 'Save File',
|
||||
'remoteDesktop.toolbar.options': 'Quality & Input Options',
|
||||
'remoteDesktop.toolbar.quality': 'Encoding Quality',
|
||||
'remoteDesktop.toolbar.screenshot': 'Screenshot',
|
||||
'remoteDesktop.toolbar.copyScreenshot': 'Copy PNG to Clipboard',
|
||||
'remoteDesktop.toolbar.saveScreenshot': 'Save PNG Screenshot',
|
||||
'remoteDesktop.toolbar.fullscreen': 'Fullscreen',
|
||||
'remoteDesktop.toolbar.exitFullscreen': 'Exit Fullscreen',
|
||||
'remoteDesktop.toolbar.pin': 'Pin toolbar',
|
||||
'remoteDesktop.toolbar.unpin': 'Unpin toolbar',
|
||||
'remoteDesktop.toolbar.popOut': 'Open in New Window',
|
||||
'remoteDesktop.toolbar.reconnect': 'Reconnect',
|
||||
'remoteDesktop.toolbar.disconnect': 'Disconnect',
|
||||
'remoteDesktop.toolbar.openSystemRdp': 'Open in System RDP',
|
||||
'remoteDesktop.toolbar.openSystemVnc': 'Open in Screen Sharing',
|
||||
'remoteDesktop.display.dynamic': 'Dynamic Resize',
|
||||
'remoteDesktop.display.fit': 'Fit to Pane',
|
||||
'remoteDesktop.display.actual': '1:1 Actual Size',
|
||||
'remoteDesktop.display.stretch': 'Stretch',
|
||||
'remoteDesktop.display.highDpi': 'Retina HiDPI',
|
||||
'remoteDesktop.display.unsupported': 'Unsupported',
|
||||
'remoteDesktop.toolbar.mapCmdToCtrl': 'Map Cmd → Ctrl',
|
||||
'remoteDesktop.toolbar.showRemoteCursor': 'Show Remote Cursor',
|
||||
'remoteDesktop.toolbar.refreshScreen': 'Force Full Screen Refresh',
|
||||
'remoteDesktop.xvp.title': 'Remote Power (XVP)',
|
||||
'remoteDesktop.xvp.reboot': 'Reboot',
|
||||
'remoteDesktop.xvp.shutdown': 'Shutdown',
|
||||
'remoteDesktop.xvp.reset': 'Hard Reset',
|
||||
'remoteDesktop.vnc.bell': 'Remote desktop bell',
|
||||
'remoteDesktop.toolbar.moreActions': 'More Actions',
|
||||
'remoteDesktop.clipboard.pushNow': 'Push Local Clipboard Now',
|
||||
'remoteDesktop.clipboard.pushed': 'Local clipboard synced to remote',
|
||||
'remoteDesktop.disconnected.title': 'Session Disconnected',
|
||||
'remoteDesktop.auth.reenter': 'Credentials',
|
||||
'remoteDesktop.auth.cancelled': 'Authentication cancelled.',
|
||||
'remoteDesktop.cert.rejected': 'TLS certificate rejected by user.',
|
||||
'remoteDesktop.step.bastion': 'Bastion',
|
||||
'remoteDesktop.step.network': 'Network',
|
||||
'remoteDesktop.step.nla': 'NLA Auth',
|
||||
'remoteDesktop.step.rfb': 'RFB Auth',
|
||||
'remoteDesktop.step.desktop': 'Desktop',
|
||||
'remoteDesktop.toolbar.openSftp': 'SFTP',
|
||||
'remoteDesktop.toolbar.record': 'Record session',
|
||||
'remoteDesktop.toolbar.stopRecording': 'Stop recording',
|
||||
'remoteDesktop.toolbar.recording': 'Recording',
|
||||
'remoteDesktop.toolbar.askAi': 'Ask AI',
|
||||
'remoteDesktop.toolbar.askAiFull': 'Capture Screen & Ask AI',
|
||||
'remoteDesktop.toolbar.askAiRegion': 'Select Region & Ask AI',
|
||||
'remoteDesktop.toolbar.aiReadAllowed': 'AI screen reading allowed',
|
||||
'remoteDesktop.toolbar.aiReadBlocked': 'AI screen reading blocked for this session',
|
||||
'remoteDesktop.toolbar.aiReadingBanner': 'AI is viewing this screen',
|
||||
'remoteDesktop.clipboard.dropTitle': 'Drop files to send to remote clipboard (CLIPRDR)',
|
||||
'remoteDesktop.clipboard.dropSubtitle': 'After dropping, press Ctrl+V inside the remote desktop to paste',
|
||||
'remoteDesktop.clipboard.dropFileCount': '{count} file(s)',
|
||||
'remoteDesktop.clipboard.dropBlockedViewOnly': 'File drop is disabled in View-Only mode',
|
||||
'remoteDesktop.clipboard.dropBlockedDisabled': 'Clipboard file transfer is disabled for this host',
|
||||
'remoteDesktop.clipboard.dropFolderUnsupported': 'Folders are not supported over RDP clipboard. Use SFTP or archive them as a .zip file.',
|
||||
'remoteDesktop.clipboard.stagedPill': '{count} file(s) · Ctrl+V',
|
||||
'remoteDesktop.clipboard.sendLocalFiles': 'Send Local Files...',
|
||||
'remoteDesktop.clipboard.uploading': 'Sending via clipboard',
|
||||
'remoteDesktop.clipboard.downloading': 'Receiving via clipboard',
|
||||
'remoteDesktop.clipboard.transferCompleted': 'Clipboard file transfer complete',
|
||||
'remoteDesktop.clipboard.transferFailed': 'Clipboard file transfer failed',
|
||||
'remoteDesktop.recording.started': 'Session recording started',
|
||||
'remoteDesktop.recording.saved': 'Session recording saved to Connection Logs',
|
||||
'remoteDesktop.recording.failed': 'Session recording failed',
|
||||
'remoteDesktop.recording.unsupported': 'Session recording is not supported in this environment',
|
||||
|
||||
// Remote Desktop — Resolution Presets, Multi-Monitor, RDPDR Shared Folders, Network Telemetry, AI Computer Use
|
||||
'remoteDesktop.display.resolutionPresets': 'Resolution Presets',
|
||||
'remoteDesktop.display.customWidth': 'Width',
|
||||
'remoteDesktop.display.customHeight': 'Height',
|
||||
'remoteDesktop.display.applyResolution': 'Apply',
|
||||
'remoteDesktop.display.multiMonitor': 'Multi-Monitor Layout',
|
||||
'remoteDesktop.display.monitorSingle': 'Single Monitor',
|
||||
'remoteDesktop.display.monitorDual': 'Dual Side-by-Side',
|
||||
'remoteDesktop.display.monitorAllLocal': 'Match Local Displays',
|
||||
'remoteDesktop.display.monitorAllLocalCount': 'Match Local Displays ({count})',
|
||||
'remoteDesktop.display.monitorSwitcher': 'Switch active monitor',
|
||||
'remoteDesktop.display.monitorAll': 'All',
|
||||
'remoteDesktop.sharedFolders.title': 'Shared Folders (RDPDR)',
|
||||
'remoteDesktop.sharedFolders.add': 'Add Folder',
|
||||
'remoteDesktop.sharedFolders.empty': 'Mount a local folder as a virtual drive on the remote Windows desktop.',
|
||||
'remoteDesktop.sharedFolders.remove': 'Remove folder',
|
||||
'remoteDesktop.sharedFolders.readOnly': 'Read-only',
|
||||
'remoteDesktop.sharedFolders.hint': 'Windows: This PC → <Folder> on Netcatty (\\\\tsclient\\<Name>). Local-only, never synced.',
|
||||
'remoteDesktop.sharedFolders.duplicate': 'This folder is already shared',
|
||||
'remoteDesktop.sharedFolders.mounted': 'Mounted "{name}" on remote desktop',
|
||||
'remoteDesktop.sharedFolders.unmounted': 'Unmounted "{name}"',
|
||||
'remoteDesktop.network.title': 'Connection Telemetry',
|
||||
'remoteDesktop.network.latency': 'Latency',
|
||||
'remoteDesktop.network.resolution': 'Resolution',
|
||||
'remoteDesktop.network.downlink': 'Downlink (RX)',
|
||||
'remoteDesktop.network.uplink': 'Uplink (TX)',
|
||||
'remoteDesktop.network.totalRx': 'Total RX',
|
||||
'remoteDesktop.network.totalTx': 'Total TX',
|
||||
'remoteDesktop.network.tlsEncrypted': 'TLS',
|
||||
'remoteDesktop.network.quality.excellent': 'Excellent',
|
||||
'remoteDesktop.network.quality.good': 'Good',
|
||||
'remoteDesktop.network.quality.fair': 'Fair',
|
||||
'remoteDesktop.network.quality.poor': 'Poor',
|
||||
'remoteDesktop.network.quality.unknown': 'Measuring',
|
||||
'remoteDesktop.ai.controllingBanner': 'Catty controlling · Click desktop or press Esc to take over',
|
||||
'remoteDesktop.ai.stopControl': 'Stop',
|
||||
'remoteDesktop.ai.preempted': 'AI control paused — you have taken over',
|
||||
'remoteDesktop.ai.preemptedStopped': 'AI control stopped — you have taken over',
|
||||
'remoteDesktop.ai.audit.menuItem': 'Computer Use Audit Log',
|
||||
'remoteDesktop.ai.audit.title': 'AI Computer Use Audit Log',
|
||||
'remoteDesktop.ai.audit.subtitleHost': 'Mouse and keyboard actions executed by AI on this remote desktop.',
|
||||
'remoteDesktop.ai.audit.subtitleAll': 'Local ring buffer of the latest 500 AI remote desktop actions (sensitive text redacted).',
|
||||
'remoteDesktop.ai.audit.searchPlaceholder': 'Filter by action, host, or error code...',
|
||||
'remoteDesktop.ai.audit.scopeSession': 'This session',
|
||||
'remoteDesktop.ai.audit.scopeAll': 'All',
|
||||
'remoteDesktop.ai.audit.filterAll': 'All',
|
||||
'remoteDesktop.ai.audit.filterOk': 'OK',
|
||||
'remoteDesktop.ai.audit.filterPreempted': 'Preempted',
|
||||
'remoteDesktop.ai.audit.filterIssues': 'Blocked/Err',
|
||||
'remoteDesktop.ai.audit.empty': 'No AI remote desktop actions recorded yet.',
|
||||
'remoteDesktop.ai.audit.outcomeOk': 'OK',
|
||||
'remoteDesktop.ai.audit.outcomePreempted': 'Preempted',
|
||||
'remoteDesktop.ai.audit.outcomeBlocked': 'Blocked',
|
||||
'remoteDesktop.ai.audit.outcomeDenied': 'Denied',
|
||||
'remoteDesktop.ai.audit.outcomeError': 'Error',
|
||||
'remoteDesktop.ai.audit.copyJson': 'Copy JSON',
|
||||
'remoteDesktop.ai.audit.copied': 'Copied',
|
||||
'remoteDesktop.ai.audit.clear': 'Clear',
|
||||
|
||||
// LogView — Remote Desktop Recordings & Metadata
|
||||
'logView.recording.download': 'Download .webm',
|
||||
'logView.recording.delete': 'Delete Recording',
|
||||
'logView.recording.loading': 'Loading session recording...',
|
||||
'logView.recording.withAudio': 'Audio',
|
||||
'logView.recording.missingTitle': 'Recording no longer on disk',
|
||||
'logView.recording.missingDesc': 'This .webm file was removed, cleaned up by retention settings, or moved from the recordings folder.',
|
||||
'logView.recording.playbackErrorTitle': 'Unable to play recording',
|
||||
'logView.recording.playbackErrorDesc': 'The video file may be incomplete or unsupported by the built-in player.',
|
||||
'logView.recording.exportSuccess': 'Recording exported',
|
||||
'logView.recording.exportFailed': 'Failed to export recording',
|
||||
'logView.recording.deleted': 'Recording deleted',
|
||||
'logView.recording.deleteFailed': 'Failed to delete recording',
|
||||
'logView.recording.deleteConfirmTitle': 'Delete this session recording?',
|
||||
'logView.recording.deleteConfirmDesc': 'The .webm video file will be permanently removed from disk. The connection log entry itself will remain.',
|
||||
'logView.remoteDesktop.noRecordingSubtitle': 'No screen recording was captured for this session',
|
||||
'logView.remoteDesktop.host': 'Host',
|
||||
'logView.remoteDesktop.protocol': 'Protocol',
|
||||
'logView.remoteDesktop.user': 'Username',
|
||||
'logView.remoteDesktop.started': 'Started',
|
||||
'logView.remoteDesktop.ended': 'Ended',
|
||||
'logView.remoteDesktop.duration': 'Duration',
|
||||
'logView.remoteDesktop.recordingTip': 'Click Record in the remote desktop toolbar or enable Auto-record in Settings -> System to save .webm replays here.',
|
||||
|
||||
// Settings -> System -> Remote Desktop Recordings
|
||||
'settings.remoteDesktopRecordings.title': 'Remote Desktop Recordings',
|
||||
'settings.remoteDesktopRecordings.autoRecord': 'Auto-record remote desktop sessions',
|
||||
'settings.remoteDesktopRecordings.autoRecordDesc': 'Automatically start recording RDP and VNC sessions once connected (off by default to conserve disk space).',
|
||||
'settings.remoteDesktopRecordings.fps': 'Recording frame rate',
|
||||
'settings.remoteDesktopRecordings.fpsDesc': 'Higher frame rates look smoother but use more CPU and disk space.',
|
||||
'settings.remoteDesktopRecordings.fpsOption': '{fps} FPS',
|
||||
'settings.remoteDesktopRecordings.includeAudio': 'Include RDP audio',
|
||||
'settings.remoteDesktopRecordings.includeAudioDesc': 'Merge remote desktop audio output into the recorded .webm video when available.',
|
||||
'settings.remoteDesktopRecordings.maxStorage': 'Maximum storage cap',
|
||||
'settings.remoteDesktopRecordings.maxStorageDesc': 'Oldest unsaved session recordings are automatically removed when total usage exceeds this limit.',
|
||||
'settings.remoteDesktopRecordings.retentionDays': 'Retention period',
|
||||
'settings.remoteDesktopRecordings.retentionDaysDesc': 'Automatically delete unsaved recordings older than this period.',
|
||||
'settings.remoteDesktopRecordings.retentionDaysOption': '{days} days',
|
||||
'settings.remoteDesktopRecordings.retentionUnlimited': 'Unlimited',
|
||||
'settings.remoteDesktopRecordings.storageUsage': 'Local recording storage',
|
||||
'settings.remoteDesktopRecordings.storageUsageSummary': '{count} files · {size}',
|
||||
'settings.remoteDesktopRecordings.storageUsageLoading': 'Calculating disk usage...',
|
||||
'settings.remoteDesktopRecordings.refresh': 'Refresh storage usage',
|
||||
'settings.remoteDesktopRecordings.openFolder': 'Open Folder',
|
||||
'settings.remoteDesktopRecordings.clearAll': 'Clear All Recordings',
|
||||
'settings.remoteDesktopRecordings.clearAllConfirmTitle': 'Clear all remote desktop recordings?',
|
||||
'settings.remoteDesktopRecordings.clearAllConfirmDesc': 'This will permanently delete {count} recorded .webm file(s) from this device.',
|
||||
'settings.remoteDesktopRecordings.clearResult': 'Removed {count} recording file(s).',
|
||||
'settings.remoteDesktopRecordings.hint': 'Recordings are stored locally on this device and never synced to the cloud. Bookmarked logs are protected from automatic cleanup.',
|
||||
|
||||
};
|
||||
@@ -835,15 +835,6 @@ export const esAiMessages: Messages = {
|
||||
'ai.chat.artifact.scriptRunPaused': 'Ejecución del script en pausa',
|
||||
'ai.chat.artifact.scriptRunResumed': 'Ejecución del script reanudada',
|
||||
'ai.chat.artifact.scriptReference': 'referencia de la API de nct',
|
||||
'ai.chat.artifact.rdScreenRead': 'Lectura de pantalla remota',
|
||||
'ai.chat.artifact.rdScreenGrid': 'Lectura de pantalla remota (cuadrícula)',
|
||||
'ai.chat.artifact.rdScreenCropped': 'Región ampliada capturada',
|
||||
'ai.chat.artifact.rdActionExecuted': 'Se ejecutaron {count} acciones remotas',
|
||||
'ai.chat.artifact.rdActionCount': '{count} acciones',
|
||||
'ai.chat.artifact.rdActionPreempted': 'Acción remota pausada por el usuario',
|
||||
'ai.chat.artifact.rdScreenFailed': 'Error al capturar la pantalla remota',
|
||||
'ai.chat.artifact.rdActionFailed': 'Error en la acción de escritorio remoto',
|
||||
'ai.chat.artifact.rdPreviewScreen': 'Vista previa de la captura',
|
||||
'zmodem.waitingForRemote': 'Esperando al servidor remoto...',
|
||||
'zmodem.uploading': 'Subiendo',
|
||||
'zmodem.downloading': 'Descargando',
|
||||
@@ -877,21 +868,4 @@ export const esAiMessages: Messages = {
|
||||
"ai.toolSettings.conflict": "La configuración cambió en otra ventana. Se conserva el borrador. Cancela y vuelve a abrir para cargar la configuración guardada.",
|
||||
"ai.toolSettings.retry": "Reintentar",
|
||||
"ai.toolSettings.applyingHttp": "Aplicando la configuración HTTP...",
|
||||
"ai.vision.quickPrompt.explainError": "Explicar el error actual",
|
||||
"ai.vision.quickPrompt.diagnoseUi": "Diagnosticar problema de interfaz",
|
||||
"ai.vision.quickPrompt.summarizeScreen": "Resumir pantalla",
|
||||
"ai.vision.unsupportedModelWarning": "El modelo actual ({model}) no admite entrada de imágenes. Cambia a un modelo con visión para leer pantallas remotas.",
|
||||
"ai.vision.switchModel": "Cambiar modelo",
|
||||
"ai.vision.modelSupportsVision": "Admite entrada de imágenes",
|
||||
"ai.vision.snip.hint": "Arrastra para seleccionar un área · Esc para cancelar",
|
||||
"ai.vision.snip.cancel": "Cancelar selección",
|
||||
"ai.vision.snip.ariaLabel": "Seleccionar un área de la pantalla del escritorio remoto",
|
||||
"ai.vision.privacyBlocked": "La lectura de pantalla por IA está bloqueada en esta sesión.",
|
||||
"ai.vision.viewingScreen": "Catty está viendo el escritorio",
|
||||
"ai.vision.askAi": "Preguntar a la IA",
|
||||
"ai.vision.captureFullAndAsk": "Capturar pantalla y preguntar a la IA",
|
||||
"ai.vision.snipRegionAndAsk": "Recortar área y preguntar a la IA",
|
||||
"ai.vision.openAiChat": "Abrir asistente de IA",
|
||||
"ai.vision.privacyLockOn": "Lectura de pantalla por IA bloqueada",
|
||||
"ai.vision.privacyLockOff": "Permitir lectura de pantalla por IA",
|
||||
};
|
||||
@@ -1174,16 +1174,6 @@ Resalta el panel dividido enfocado:
|
||||
'vault.nav.notes': 'Notas',
|
||||
'vault.nav.knownHosts': 'Hosts conocidos',
|
||||
'vault.nav.logs': 'Registros',
|
||||
'vault.nav.customize': 'Personalizar barra lateral',
|
||||
'vault.nav.customizeHint': 'Arrastra elementos para reordenar o alternar visibilidad.',
|
||||
'vault.nav.hideItem': 'Ocultar {label}',
|
||||
'vault.nav.moveUp': 'Subir',
|
||||
'vault.nav.moveDown': 'Bajar',
|
||||
'vault.nav.resetDefault': 'Restablecer a los valores predeterminados',
|
||||
'vault.nav.alwaysVisible': 'Siempre visible',
|
||||
'vault.nav.pluginBadge': 'Complemento',
|
||||
'vault.nav.dragToReorder': 'Arrastra para reordenar {label}',
|
||||
'vault.nav.toggleVisibility': 'Alternar visibilidad de {label}',
|
||||
|
||||
'proxyProfiles.action.add': 'Agregar proxy',
|
||||
'proxyProfiles.search.placeholder': 'Buscar proxies…',
|
||||
@@ -1328,9 +1318,6 @@ Resalta el panel dividido enfocado:
|
||||
"plugins.sidebar.loading": "Cargando página de extensión…",
|
||||
"plugins.vault.loading": "Cargando página del plugin…",
|
||||
"plugins.interaction.title": "Solicitud de complemento",
|
||||
"plugins.interaction.openUrlTitle": "¿Abrir enlace externo?",
|
||||
"plugins.interaction.openUrlNote": "Este complemento solicita abrir la siguiente URL HTTPS en tu navegador predeterminado:",
|
||||
"plugins.interaction.openUrlAction": "Abrir URL",
|
||||
"plugins.interaction.sharing": "El texto compartido estará disponible para este complemento y sus capacidades autorizadas, incluida la red. Leer no autoriza un nuevo destino de red.",
|
||||
"plugins.interaction.input": "Introducir texto",
|
||||
"plugins.interaction.filter": "Filtrar opciones",
|
||||
|
||||
@@ -106,16 +106,4 @@ export const esMonitorMessages = {
|
||||
"monitor.status.disconnected": "Desconectado",
|
||||
"monitor.status.stale": "Sin actualizar",
|
||||
"monitor.status.missing": "Equipo eliminado",
|
||||
"monitor.status.online": "En línea",
|
||||
"monitor.status.offline": "Sin conexión",
|
||||
"monitor.checkNow": "Comprobar ahora",
|
||||
"monitor.openRemoteDesktop": "Abrir {protocol}",
|
||||
"monitor.latencyTrend": "Tendencia de latencia",
|
||||
"monitor.bannerVerified": "Protocolo verificado",
|
||||
"monitor.bannerUnverified": "Puerto abierto (banner sin verificar)",
|
||||
"monitor.companionDesktops": "Servicios de escritorio remoto",
|
||||
"monitor.reachabilityOnly": "Solo sondeo de disponibilidad",
|
||||
"monitor.viaSsh": "vía SSH",
|
||||
"monitor.direct": "Directo",
|
||||
"monitor.rttStats": "Mín / Prom / Máx",
|
||||
};
|
||||
@@ -214,25 +214,6 @@ export const esSystemManagerMessages: Messages = {
|
||||
'systemManager.ports.unknownProcess': 'Proceso desconocido',
|
||||
'systemManager.ports.terminate': 'Terminar',
|
||||
'systemManager.ports.confirmTerminate': '¿Enviar SIGTERM al proceso {{pid}} que ocupa este puerto?',
|
||||
'systemManager.ports.forwardedMeta': '{{count}} reenviado(s)',
|
||||
'systemManager.ports.forward': 'Reenviar a puerto local',
|
||||
'systemManager.ports.stopForward': 'Detener reenvío de puerto',
|
||||
'systemManager.ports.forwardTitle': 'Reenviar puerto a local',
|
||||
'systemManager.ports.forwardDesc': 'Crea un reenvío local SSH hacia este puerto remoto en escucha.',
|
||||
'systemManager.ports.forwardDescWithHost': 'Reenvía este puerto en escucha de {{host}} a un puerto local por SSH.',
|
||||
'systemManager.ports.forwardLocalPort': 'Puerto local',
|
||||
'systemManager.ports.forwardBindAddress': 'Dirección de enlace',
|
||||
'systemManager.ports.forwardAction': 'Reenviar',
|
||||
'systemManager.ports.forwarding': 'Reenviando…',
|
||||
'systemManager.ports.forwardInvalidPort': 'Ingresa un número de puerto válido entre 1 y 65535.',
|
||||
'systemManager.ports.forwardInvalidBindAddress': 'Ingresa una dirección de enlace válida (p. ej., 127.0.0.1 o 0.0.0.0).',
|
||||
'systemManager.ports.forwardPortInUse': 'El puerto local {{port}} ya está en uso por «{{label}}».',
|
||||
'systemManager.ports.forwardFailed': 'No se pudo iniciar el reenvío de puerto.',
|
||||
'systemManager.ports.forwardStarted': 'Reenviando {{local}} → {{remote}}',
|
||||
'systemManager.ports.forwardStopped': 'Reenvío detenido en {{local}}',
|
||||
'systemManager.ports.copiedEndpoint': 'Copiado {{endpoint}}',
|
||||
'systemManager.ports.copyEndpointAria': 'Copiar dirección local {{endpoint}}',
|
||||
'systemManager.ports.clickToCopy': 'Haz clic para copiar la dirección local',
|
||||
|
||||
'systemManager.services.unavailable': 'systemctl no está disponible en este host.',
|
||||
'systemManager.services.loading': 'Cargando servicios de systemd…',
|
||||
|
||||
@@ -680,7 +680,6 @@ export const esVaultMessages: Messages = {
|
||||
|
||||
// Protocol select dialog
|
||||
'protocolSelect.chooseProtocol': 'Elegir protocolo',
|
||||
'protocolSelect.rememberDefault': 'Recordar como predeterminado (no preguntar la próxima vez)',
|
||||
'protocolSelect.port': 'puerto:',
|
||||
|
||||
// Host Details
|
||||
@@ -988,22 +987,7 @@ export const esVaultMessages: Messages = {
|
||||
'hostDetails.startupCommand.runMode.help': 'Elige cómo se envían los comandos de inicio multilínea después de la conexión.',
|
||||
'hostDetails.startupCommand.runMode.lineDelay': 'Enviar línea por línea',
|
||||
'hostDetails.startupCommand.runMode.paste': 'Enviar todo de una vez',
|
||||
'hostDetails.otherProtocols': 'Protocolos adicionales',
|
||||
'hostDetails.otherProtocolsHint': 'Adjunta métodos de acceso secundarios a este host SSH sin cambiar la conexión principal',
|
||||
'hostDetails.protocol.defaultHint': 'Predeterminado al hacer doble clic ({protocol})',
|
||||
'hostDetails.protocol.secondaryHint': 'Activado como protocolo secundario',
|
||||
'hostDetails.protocol.setDefault': 'Establecer por defecto',
|
||||
'hostDetails.protocol.remove': 'Quitar',
|
||||
'hostDetails.protocol.doubleClick': 'Al hacer doble clic',
|
||||
'hostDetails.protocol.connectOptionDefault': 'Por defecto: {protocol}',
|
||||
'hostDetails.protocol.connectOptionAsk': 'Preguntar cada vez',
|
||||
'hostDetails.protocol.alsoEnable': 'Activar también',
|
||||
'hostDetails.protocol.removeProtocol': 'Quitar {protocol}',
|
||||
'hostDetails.protocol.addProtocol': 'Añadir {protocol}',
|
||||
'hostDetails.section.connectBehavior': 'Comportamiento de conexión',
|
||||
'hostDetails.protocol.notEnabledDesc': '{protocol} aún no está habilitado en este host.',
|
||||
'hostDetails.protocol.addSecondary': 'Añadir {protocol} (mantener {defaultProtocol})',
|
||||
'hostDetails.protocol.switchOnly': 'Usar solo {protocol}',
|
||||
'hostDetails.otherProtocols': 'Otros protocolos',
|
||||
'hostDetails.telnetOn': 'Telnet activado',
|
||||
'hostDetails.port': 'puerto',
|
||||
'hostDetails.telnet.credentials': 'Credenciales',
|
||||
@@ -1109,347 +1093,4 @@ export const esVaultMessages: Messages = {
|
||||
'vault.import.plugins.moreItems': '{count} elementos más están incluidos en esta importación.',
|
||||
'vault.import.plugins.moreDiagnostics': '{count} diagnósticos más se omitieron de esta vista previa.',
|
||||
|
||||
// Remote Desktop (VNC / RDP / JumpServer RDP)
|
||||
'vault.hosts.newRdpHost': 'Nuevo host RDP',
|
||||
'vault.hosts.newVncHost': 'Nuevo host VNC',
|
||||
'vault.hosts.connectRdp': 'Conectar RDP',
|
||||
'vault.hosts.connectSsh': 'Conectar SSH',
|
||||
'vault.hosts.connectVnc': 'Conectar VNC',
|
||||
'vault.hosts.openInSystemRdp': 'Abrir en RDP del sistema',
|
||||
'vault.hosts.openInSystemVnc': 'Abrir en Compartir pantalla',
|
||||
'settings.jmsDeepLink.rdpLaunchMode': 'Abrir RDP de JumpServer en',
|
||||
'settings.jmsDeepLink.rdpLaunchModeDesc': 'Elige si las sesiones RDP de JumpServer jms:// se abren en el cliente integrado de Netcatty o en el cliente RDP del sistema.',
|
||||
'settings.jmsDeepLink.rdpLaunchMode.builtin': 'Cliente integrado',
|
||||
'settings.jmsDeepLink.rdpLaunchMode.system': 'Cliente RDP del sistema',
|
||||
'vault.import.rdp.label': 'RDP (.rdp)',
|
||||
'vault.import.rdp.hint': 'Importa uno o varios archivos .rdp de Microsoft o JumpServer.',
|
||||
'vault.import.remoteDesktopTip': 'Las importaciones de MobaXterm, CSV y .rdp también admiten hosts RDP y VNC.',
|
||||
'keychain.identity.domain': 'Dominio (RDP, opcional)',
|
||||
'keychain.identity.domainPlaceholder': 'CORP o dominio AD',
|
||||
'quickConnect.rdp.domain': 'Dominio (opcional)',
|
||||
'quickConnect.rdp.domainPlaceholder': 'CORP o déjalo vacío para cuenta local',
|
||||
'quickConnect.vnc.optionalUsername': 'Usuario (opcional, para Apple ARD / VeNCrypt)',
|
||||
'quickConnect.vnc.optionalUsernameHint': 'La mayoría de los servidores VNC solo requieren contraseña.',
|
||||
'quickConnect.vnc.passwordHint': 'Déjalo vacío si el servidor VNC no requiere autenticación.',
|
||||
'quickConnect.vnc.displayHelper': 'Pantalla {display}',
|
||||
'hostDetails.protocol.label': 'Protocolo',
|
||||
'hostDetails.rdp.portLabel': 'RDP en',
|
||||
'hostDetails.vnc.portLabel': 'VNC en',
|
||||
'hostDetails.vnc.displayHint': 'Pantalla {display}',
|
||||
'hostDetails.vnc.displayPlaceholder': '5900 o :0',
|
||||
'hostDetails.rdp.domain': 'Dominio (opcional)',
|
||||
'hostDetails.rdp.domainPlaceholder': 'CORP (opcional)',
|
||||
'hostDetails.rdp.domainLabel': 'Dominio',
|
||||
'hostDetails.rdp.usernamePlaceholder': 'Usuario, DOMINIO\\usuario o JumpServer user|uuid',
|
||||
'hostDetails.vnc.optionalUsername': 'Usuario (Apple ARD / VeNCrypt)',
|
||||
'hostDetails.vnc.optionalUsernameHint': 'Opcional. Los servidores VNC estándar solo usan contraseña.',
|
||||
'hostDetails.vnc.usernamePlaceholder': 'Usuario (opcional)',
|
||||
'hostDetails.remoteDesktop.sectionTitle': 'Pantalla y opciones de escritorio remoto',
|
||||
'hostDetails.rdp.resolutionMode': 'Modo de resolución',
|
||||
'hostDetails.rdp.resolutionMode.dynamic': 'Cambio dinámico',
|
||||
'hostDetails.rdp.resolutionMode.fit': 'Ajustar a la ventana',
|
||||
'hostDetails.rdp.resolutionMode.fixed': 'Tamaño fijo',
|
||||
'hostDetails.rdp.width': 'Ancho',
|
||||
'hostDetails.rdp.height': 'Alto',
|
||||
'hostDetails.rdp.dimensionHint': 'Introduce un número entero entre 200 y 8192.',
|
||||
'hostDetails.rdp.colorDepth': 'Profundidad de color',
|
||||
'hostDetails.rdp.audio': 'Salida de audio',
|
||||
'hostDetails.rdp.audioDesc': 'Reproducir el audio del escritorio remoto localmente',
|
||||
'hostDetails.rdp.clipboard': 'Sincronización de portapapeles',
|
||||
'hostDetails.rdp.clipboardDesc': 'Compartir texto e imágenes con el escritorio remoto',
|
||||
'hostDetails.rdp.clipboardFiles': 'Transferencia de archivos por portapapeles',
|
||||
'hostDetails.rdp.clipboardFilesDesc': 'Permitir copiar y arrastrar archivos mediante el portapapeles',
|
||||
'hostDetails.rdp.securityMode': 'Modo de seguridad',
|
||||
'hostDetails.rdp.securityMode.auto': 'Automático',
|
||||
'hostDetails.rdp.securityMode.nla': 'NLA (CredSSP)',
|
||||
'hostDetails.rdp.securityMode.tls': 'TLS',
|
||||
'hostDetails.rdp.securityMode.rdp': 'RDP estándar',
|
||||
'hostDetails.rdp.ignoreCertErrors': 'Ignorar errores de certificado',
|
||||
'hostDetails.rdp.ignoreCertErrorsDesc': 'Omitir avisos de confianza de certificados TLS (no recomendado)',
|
||||
'hostDetails.rdp.advanced': 'Opciones avanzadas de RDP',
|
||||
'hostDetails.rdp.loadBalanceInfo': 'Información de balanceo de carga',
|
||||
'hostDetails.rdp.loadBalanceInfoPlaceholder': 'tsv://MS Terminal Services Plugin.1.Collection',
|
||||
'hostDetails.rdp.alternateShell': 'Shell alternativo',
|
||||
'hostDetails.rdp.alternateShellPlaceholder': 'Ruta opcional del programa inicial',
|
||||
'hostDetails.rdp.shellWorkingDir': 'Directorio de trabajo',
|
||||
'hostDetails.rdp.shellWorkingDirPlaceholder': 'Directorio inicial opcional',
|
||||
'hostDetails.vnc.scalingMode': 'Modo de escala',
|
||||
'hostDetails.vnc.scalingMode.fit': 'Ajustar a la ventana',
|
||||
'hostDetails.vnc.scalingMode.actual': 'Tamaño real (1:1)',
|
||||
'hostDetails.vnc.scalingMode.stretch': 'Estirar',
|
||||
'hostDetails.vnc.scalingMode.dynamic': 'Cambio dinámico',
|
||||
'hostDetails.vnc.quality': 'Calidad de imagen',
|
||||
'hostDetails.vnc.compression': 'Nivel de compresión',
|
||||
'hostDetails.vnc.viewOnly': 'Modo solo lectura',
|
||||
'hostDetails.vnc.viewOnlyDesc': 'Desactivar el envío de entradas de ratón y teclado',
|
||||
'hostDetails.vnc.sharedSession': 'Sesión compartida',
|
||||
'hostDetails.vnc.sharedSessionDesc': 'Mantener conectados otros clientes VNC',
|
||||
'hostDetails.vnc.clipboard': 'Sincronización de portapapeles',
|
||||
'hostDetails.vnc.clipboardDesc': 'Sincronizar texto UTF-8 del portapapeles con el escritorio remoto',
|
||||
'hostDetails.vnc.showRemoteCursor': 'Mostrar cursor remoto',
|
||||
'hostDetails.vnc.showRemoteCursorDesc': 'Mostrar la forma del cursor enviada por el servidor',
|
||||
'hostDetails.companion.addVnc': 'Añadir VNC',
|
||||
'hostDetails.companion.addRdp': 'Añadir RDP',
|
||||
'hostDetails.companion.tunnelViaSsh': 'Túnel mediante el SSH de este host',
|
||||
'hostDetails.companion.tunnelViaSshDesc': 'Reenviar automáticamente a través de la conexión SSH de este host',
|
||||
'hostDetails.companion.tunnelTargetHost': 'Dirección de destino remota',
|
||||
'hostDetails.companion.credentialsSource': 'Credenciales',
|
||||
'hostDetails.companion.credentials.host': 'Reutilizar credenciales SSH del host',
|
||||
'hostDetails.companion.credentials.manual': 'Usuario y contraseña propios',
|
||||
'hostDetails.companion.credentials.manualHint': 'Se guarda de forma segura en el llavero al guardar el host',
|
||||
'hostDetails.companion.credentials.identity': 'Identidad del llavero',
|
||||
'hostDetails.companion.credentials.ask': 'Preguntar al conectar',
|
||||
'hostDetails.companion.identityPlaceholder': 'Seleccionar una identidad guardada',
|
||||
'hostDetails.companion.saveAsIdentity': 'Guardar como identidad',
|
||||
'hostDetails.companion.saveIdentityAction': 'Crear y seleccionar identidad',
|
||||
'hostDetails.companion.identityLabelPlaceholder': 'Nombre de identidad (p. ej. Desktop VNC)',
|
||||
'hostDetails.companion.identitySaved': 'Identidad guardada y seleccionada.',
|
||||
'hostDetails.companion.setDefaultRdp': 'Conectar con RDP por defecto',
|
||||
'hostDetails.companion.setDefaultVnc': 'Conectar con VNC por defecto',
|
||||
|
||||
// Known Hosts — Remote Desktop TLS Certificates
|
||||
'knownHosts.tabs.ssh': 'Claves de host SSH',
|
||||
'knownHosts.tabs.remoteDesktopCerts': 'Certificados de escritorio remoto',
|
||||
'knownHosts.certs.clearAll': 'Borrar todo',
|
||||
'knownHosts.certs.expired': 'Caducado',
|
||||
'knownHosts.certs.expiredNotice': 'Este certificado ha superado su fecha de caducidad.',
|
||||
'knownHosts.certs.copied': 'Huella SHA-256 copiada',
|
||||
'knownHosts.certs.action.inspect': 'Inspeccionar certificado',
|
||||
'knownHosts.certs.action.copyFingerprint': 'Copiar SHA-256',
|
||||
'knownHosts.certs.action.revoke': 'Revocar confianza',
|
||||
'knownHosts.certs.empty.title': 'Sin certificados de escritorio remoto confiables',
|
||||
'knownHosts.certs.empty.desc': 'Los certificados TLS en los que confíes al conectar a hosts RDP o VNC VeNCrypt aparecerán aquí.',
|
||||
'knownHosts.certs.empty.searchTitle': 'Sin certificados coincidentes',
|
||||
'knownHosts.certs.empty.searchDesc': 'Prueba con otro nombre de host, puerto, protocolo o huella SHA-256.',
|
||||
'knownHosts.certs.detail.subtitle': 'Certificado TLS fijado en este dispositivo (TOFU)',
|
||||
'knownHosts.certs.detail.fingerprint': 'Huella SHA-256',
|
||||
'knownHosts.certs.detail.subject': 'Asunto',
|
||||
'knownHosts.certs.detail.issuer': 'Emisor',
|
||||
'knownHosts.certs.detail.validFrom': 'Válido desde',
|
||||
'knownHosts.certs.detail.validTo': 'Válido hasta',
|
||||
'knownHosts.certs.detail.trustedAt': 'Confiado el',
|
||||
'knownHosts.certs.detail.lastSeen': 'Última conexión',
|
||||
'knownHosts.certs.revokeConfirm.title': '¿Revocar el certificado de {endpoint}?',
|
||||
'knownHosts.certs.revokeConfirm.desc': 'Se te pedirá volver a verificar el certificado TLS de este servidor en la próxima conexión.',
|
||||
'knownHosts.certs.clearAllConfirm.title': '¿Borrar todos los certificados confiables de escritorio remoto?',
|
||||
'knownHosts.certs.clearAllConfirm.desc': 'Se revocarán los {count} certificados RDP/VNC fijados en este dispositivo.',
|
||||
'knownHosts.certs.toast.revoked': 'Confianza del certificado revocada',
|
||||
'knownHosts.certs.toast.clearedAll': 'Se borraron {count} certificados de escritorio remoto',
|
||||
|
||||
// Host Connection Test — RDP / VNC Probe
|
||||
'hostDetails.connectionTest.rdp': 'Probar RDP',
|
||||
'hostDetails.connectionTest.vnc': 'Probar VNC',
|
||||
'hostDetails.connectionTest.probe.rtt': 'Latencia (RTT)',
|
||||
'hostDetails.connectionTest.probe.protocol': 'Protocolo',
|
||||
'hostDetails.connectionTest.probe.security': 'Seguridad negociada',
|
||||
'hostDetails.connectionTest.probe.rfbVersion': 'Versión RFB',
|
||||
'hostDetails.connectionTest.probe.securityTypes': 'Tipos de seguridad',
|
||||
'hostDetails.connectionTest.probe.tls': 'TLS',
|
||||
'hostDetails.connectionTest.probe.fingerprint': 'Huella SHA-256',
|
||||
'hostDetails.connectionTest.probe.trustStatus.trusted': 'Confiable',
|
||||
'hostDetails.connectionTest.probe.trustStatus.firstSeen': 'Primera vez',
|
||||
'hostDetails.connectionTest.probe.trustStatus.changed': 'Modificado',
|
||||
'hostDetails.connectionTest.probe.trustFingerprint': 'Confiar en huella',
|
||||
'hostDetails.connectionTest.probe.fingerprintTrusted': 'Huella del certificado confiada',
|
||||
|
||||
// Remote Desktop Toolbar — SFTP, CLIPRDR, Recording, Ask AI
|
||||
'remoteDesktop.toolbar.keysLocal': 'Teclas: Local',
|
||||
'remoteDesktop.toolbar.keysRemote': 'Teclas: Remoto',
|
||||
'remoteDesktop.toolbar.keysLocalTip': 'Los atajos locales de pestaña/ventana siguen activos. Haz clic para capturar atajos para el escritorio remoto.',
|
||||
'remoteDesktop.toolbar.keysRemoteTip': 'Los atajos de la app se envían al equipo remoto. Pulsa Ctrl+Alt+Shift o pulsa dos veces Alt/Opción derecho para liberar.',
|
||||
'remoteDesktop.toolbar.sendKeys': 'Enviar teclas',
|
||||
'remoteDesktop.toolbar.specialKeys': 'Combinaciones especiales',
|
||||
'remoteDesktop.toolbar.typeClipboard': 'Escribir portapapeles como pulsaciones',
|
||||
'remoteDesktop.toolbar.linuxTty': 'Consolas virtuales de Linux',
|
||||
'remoteDesktop.toolbar.osChordNote': 'Las combinaciones reservadas del sistema (Alt+Tab, Cmd+Tab, Ctrl+Alt+Del) son interceptadas localmente y deben enviarse desde este menú.',
|
||||
'remoteDesktop.toolbar.display': 'Escala de pantalla',
|
||||
'remoteDesktop.toolbar.sshTunneled': 'Tunelizado por SSH',
|
||||
'remoteDesktop.toolbar.encrypted': 'Conexión TLS cifrada',
|
||||
'remoteDesktop.toolbar.standardRdpSecurity': 'Seguridad RDP estándar ({{cipher}})',
|
||||
'remoteDesktop.rdp.fallbackStandardRdp': 'Conectado con seguridad RDP estándar.',
|
||||
'remoteDesktop.rdp.fallbackStandardRdpWithCipher': 'Conectado con seguridad RDP estándar ({{cipher}}).',
|
||||
'remoteDesktop.toolbar.viewOnly': 'Modo solo lectura',
|
||||
'remoteDesktop.toolbar.viewOnlyBadge': 'Ver',
|
||||
'remoteDesktop.toolbar.audio': 'Audio RDP',
|
||||
'remoteDesktop.toolbar.mute': 'Silenciar',
|
||||
'remoteDesktop.toolbar.unmute': 'Activar sonido',
|
||||
'remoteDesktop.toolbar.clipboard': 'Sincronización de portapapeles',
|
||||
'remoteDesktop.toolbar.clipboardSync': 'Sincronización de portapapeles',
|
||||
'remoteDesktop.toolbar.clipboardFiles': 'Archivos del portapapeles RDP',
|
||||
'remoteDesktop.toolbar.clipboardFilesHint': 'Copia archivos en el equipo remoto para descargarlos aquí, o arrastra archivos locales al escritorio para copiarlos.',
|
||||
'remoteDesktop.toolbar.saveFile': 'Guardar archivo',
|
||||
'remoteDesktop.toolbar.options': 'Opciones de calidad y entrada',
|
||||
'remoteDesktop.toolbar.quality': 'Calidad de codificación',
|
||||
'remoteDesktop.toolbar.screenshot': 'Captura de pantalla',
|
||||
'remoteDesktop.toolbar.copyScreenshot': 'Copiar PNG al portapapeles',
|
||||
'remoteDesktop.toolbar.saveScreenshot': 'Guardar captura PNG',
|
||||
'remoteDesktop.toolbar.fullscreen': 'Pantalla completa',
|
||||
'remoteDesktop.toolbar.exitFullscreen': 'Salir de pantalla completa',
|
||||
'remoteDesktop.toolbar.pin': 'Fijar barra',
|
||||
'remoteDesktop.toolbar.unpin': 'Desfijar barra',
|
||||
'remoteDesktop.toolbar.popOut': 'Abrir en nueva ventana',
|
||||
'remoteDesktop.toolbar.reconnect': 'Reconectar',
|
||||
'remoteDesktop.toolbar.disconnect': 'Desconectar',
|
||||
'remoteDesktop.toolbar.openSystemRdp': 'Abrir en RDP del sistema',
|
||||
'remoteDesktop.toolbar.openSystemVnc': 'Abrir en Compartir pantalla',
|
||||
'remoteDesktop.display.dynamic': 'Ajuste dinámico',
|
||||
'remoteDesktop.display.fit': 'Ajustar al panel',
|
||||
'remoteDesktop.display.actual': 'Tamaño real 1:1',
|
||||
'remoteDesktop.display.stretch': 'Estirar',
|
||||
'remoteDesktop.display.highDpi': 'Retina HiDPI',
|
||||
'remoteDesktop.display.unsupported': 'No compatible',
|
||||
'remoteDesktop.toolbar.mapCmdToCtrl': 'Mapear Cmd → Ctrl',
|
||||
'remoteDesktop.toolbar.showRemoteCursor': 'Mostrar cursor remoto',
|
||||
'remoteDesktop.toolbar.refreshScreen': 'Forzar actualización completa de pantalla',
|
||||
'remoteDesktop.xvp.title': 'Energía remota (XVP)',
|
||||
'remoteDesktop.xvp.reboot': 'Reiniciar',
|
||||
'remoteDesktop.xvp.shutdown': 'Apagar',
|
||||
'remoteDesktop.xvp.reset': 'Reinicio forzado',
|
||||
'remoteDesktop.vnc.bell': 'Aviso sonoro del escritorio remoto',
|
||||
'remoteDesktop.toolbar.moreActions': 'Más acciones',
|
||||
'remoteDesktop.clipboard.pushNow': 'Enviar portapapeles local ahora',
|
||||
'remoteDesktop.clipboard.pushed': 'Portapapeles local sincronizado con el remoto',
|
||||
'remoteDesktop.disconnected.title': 'Sesión desconectada',
|
||||
'remoteDesktop.auth.reenter': 'Credenciales',
|
||||
'remoteDesktop.auth.cancelled': 'Autenticación cancelada.',
|
||||
'remoteDesktop.cert.rejected': 'Certificado TLS rechazado por el usuario.',
|
||||
'remoteDesktop.step.bastion': 'Bastión',
|
||||
'remoteDesktop.step.network': 'Red',
|
||||
'remoteDesktop.step.nla': 'Auth NLA',
|
||||
'remoteDesktop.step.rfb': 'Auth RFB',
|
||||
'remoteDesktop.step.desktop': 'Escritorio',
|
||||
'remoteDesktop.display.resolutionPresets': 'Resoluciones predefinidas',
|
||||
'remoteDesktop.display.customWidth': 'Ancho',
|
||||
'remoteDesktop.display.customHeight': 'Alto',
|
||||
'remoteDesktop.display.applyResolution': 'Aplicar',
|
||||
'remoteDesktop.display.multiMonitor': 'Disposición multimonitor',
|
||||
'remoteDesktop.display.monitorSingle': 'Un solo monitor',
|
||||
'remoteDesktop.display.monitorDual': 'Doble lado a lado',
|
||||
'remoteDesktop.display.monitorAllLocal': 'Igualar pantallas locales',
|
||||
'remoteDesktop.display.monitorAllLocalCount': 'Igualar pantallas locales ({count})',
|
||||
'remoteDesktop.display.monitorSwitcher': 'Cambiar monitor activo',
|
||||
'remoteDesktop.display.monitorAll': 'Todos',
|
||||
'remoteDesktop.sharedFolders.title': 'Carpetas compartidas (RDPDR)',
|
||||
'remoteDesktop.sharedFolders.add': 'Añadir carpeta',
|
||||
'remoteDesktop.sharedFolders.empty': 'Monta una carpeta local como unidad virtual en el escritorio remoto de Windows.',
|
||||
'remoteDesktop.sharedFolders.remove': 'Quitar carpeta',
|
||||
'remoteDesktop.sharedFolders.readOnly': 'Solo lectura',
|
||||
'remoteDesktop.sharedFolders.hint': 'Windows: Este equipo → <Carpeta> en Netcatty (\\\\tsclient\\<Nombre>). Solo local, nunca sincronizado.',
|
||||
'remoteDesktop.sharedFolders.duplicate': 'Esta carpeta ya está compartida',
|
||||
'remoteDesktop.sharedFolders.mounted': 'Se montó "{name}" en el escritorio remoto',
|
||||
'remoteDesktop.sharedFolders.unmounted': 'Se desmontó "{name}"',
|
||||
'remoteDesktop.network.title': 'Telemetría de conexión',
|
||||
'remoteDesktop.network.latency': 'Latencia',
|
||||
'remoteDesktop.network.resolution': 'Resolución',
|
||||
'remoteDesktop.network.downlink': 'Bajada (RX)',
|
||||
'remoteDesktop.network.uplink': 'Subida (TX)',
|
||||
'remoteDesktop.network.totalRx': 'Total RX',
|
||||
'remoteDesktop.network.totalTx': 'Total TX',
|
||||
'remoteDesktop.network.tlsEncrypted': 'TLS',
|
||||
'remoteDesktop.network.quality.excellent': 'Excelente',
|
||||
'remoteDesktop.network.quality.good': 'Buena',
|
||||
'remoteDesktop.network.quality.fair': 'Regular',
|
||||
'remoteDesktop.network.quality.poor': 'Baja',
|
||||
'remoteDesktop.network.quality.unknown': 'Midiendo',
|
||||
'remoteDesktop.ai.controllingBanner': 'Catty controlando · Haz clic en el escritorio o pulsa Esc para tomar el control',
|
||||
'remoteDesktop.ai.stopControl': 'Detener',
|
||||
'remoteDesktop.ai.preempted': 'Control de IA pausado: has tomado el control',
|
||||
'remoteDesktop.ai.preemptedStopped': 'Control de IA detenido: has tomado el control',
|
||||
'remoteDesktop.ai.audit.menuItem': 'Registro de auditoría de control IA',
|
||||
'remoteDesktop.ai.audit.title': 'Registro de auditoría de control IA',
|
||||
'remoteDesktop.ai.audit.subtitleHost': 'Acciones de ratón y teclado ejecutadas por la IA en este escritorio remoto.',
|
||||
'remoteDesktop.ai.audit.subtitleAll': 'Historial local de las últimas 500 acciones de IA en escritorio remoto (texto sensible oculto).',
|
||||
'remoteDesktop.ai.audit.searchPlaceholder': 'Filtrar por acción, host o código de error...',
|
||||
'remoteDesktop.ai.audit.scopeSession': 'Esta sesión',
|
||||
'remoteDesktop.ai.audit.scopeAll': 'Todas',
|
||||
'remoteDesktop.ai.audit.filterAll': 'Todas',
|
||||
'remoteDesktop.ai.audit.filterOk': 'OK',
|
||||
'remoteDesktop.ai.audit.filterPreempted': 'Retomado',
|
||||
'remoteDesktop.ai.audit.filterIssues': 'Bloqueado/Err',
|
||||
'remoteDesktop.ai.audit.empty': 'Aún no se han registrado acciones de IA en el escritorio remoto.',
|
||||
'remoteDesktop.ai.audit.outcomeOk': 'OK',
|
||||
'remoteDesktop.ai.audit.outcomePreempted': 'Retomado',
|
||||
'remoteDesktop.ai.audit.outcomeBlocked': 'Bloqueado',
|
||||
'remoteDesktop.ai.audit.outcomeDenied': 'Denegado',
|
||||
'remoteDesktop.ai.audit.outcomeError': 'Error',
|
||||
'remoteDesktop.ai.audit.copyJson': 'Copiar JSON',
|
||||
'remoteDesktop.ai.audit.copied': 'Copiado',
|
||||
'remoteDesktop.ai.audit.clear': 'Limpiar',
|
||||
'remoteDesktop.toolbar.openSftp': 'SFTP',
|
||||
'remoteDesktop.toolbar.record': 'Grabar sesión',
|
||||
'remoteDesktop.toolbar.stopRecording': 'Detener grabación',
|
||||
'remoteDesktop.toolbar.recording': 'Grabando',
|
||||
'remoteDesktop.toolbar.askAi': 'Preguntar a la IA',
|
||||
'remoteDesktop.toolbar.askAiFull': 'Capturar pantalla y preguntar a la IA',
|
||||
'remoteDesktop.toolbar.askAiRegion': 'Seleccionar región y preguntar a la IA',
|
||||
'remoteDesktop.toolbar.aiReadAllowed': 'Lectura de pantalla por IA permitida',
|
||||
'remoteDesktop.toolbar.aiReadBlocked': 'Lectura de pantalla por IA bloqueada en esta sesión',
|
||||
'remoteDesktop.toolbar.aiReadingBanner': 'La IA está viendo esta pantalla',
|
||||
'remoteDesktop.clipboard.dropTitle': 'Suelta archivos para enviarlos al portapapeles remoto (CLIPRDR)',
|
||||
'remoteDesktop.clipboard.dropSubtitle': 'Después de soltar, pulsa Ctrl+V en el escritorio remoto para pegar',
|
||||
'remoteDesktop.clipboard.dropFileCount': '{count} archivo(s)',
|
||||
'remoteDesktop.clipboard.dropBlockedViewOnly': 'No se pueden soltar archivos en modo solo lectura',
|
||||
'remoteDesktop.clipboard.dropBlockedDisabled': 'La transferencia de archivos por portapapeles está desactivada en este host',
|
||||
'remoteDesktop.clipboard.dropFolderUnsupported': 'Las carpetas no son compatibles por el portapapeles RDP. Usa SFTP o comprímelas en un archivo .zip.',
|
||||
'remoteDesktop.clipboard.stagedPill': '{count} archivo(s) · Ctrl+V',
|
||||
'remoteDesktop.clipboard.sendLocalFiles': 'Enviar archivos locales...',
|
||||
'remoteDesktop.clipboard.uploading': 'Enviando por portapapeles',
|
||||
'remoteDesktop.clipboard.downloading': 'Recibiendo por portapapeles',
|
||||
'remoteDesktop.clipboard.transferCompleted': 'Transferencia de archivos por portapapeles completada',
|
||||
'remoteDesktop.clipboard.transferFailed': 'Error en la transferencia de archivos por portapapeles',
|
||||
'remoteDesktop.recording.started': 'Grabación de sesión iniciada',
|
||||
'remoteDesktop.recording.saved': 'Grabación de sesión guardada en los registros de conexión',
|
||||
'remoteDesktop.recording.failed': 'Error al grabar la sesión',
|
||||
'remoteDesktop.recording.unsupported': 'La grabación de sesiones no es compatible en este entorno',
|
||||
|
||||
// LogView — Remote Desktop Recordings & Metadata
|
||||
'logView.recording.download': 'Descargar .webm',
|
||||
'logView.recording.delete': 'Eliminar grabación',
|
||||
'logView.recording.loading': 'Cargando grabación de sesión...',
|
||||
'logView.recording.withAudio': 'Audio',
|
||||
'logView.recording.missingTitle': 'La grabación ya no está en el disco',
|
||||
'logView.recording.missingDesc': 'Este archivo .webm fue eliminado, limpiado por la política de retención o movido de la carpeta de grabaciones.',
|
||||
'logView.recording.playbackErrorTitle': 'No se puede reproducir la grabación',
|
||||
'logView.recording.playbackErrorDesc': 'El archivo de vídeo puede estar incompleto o no ser compatible con el reproductor integrado.',
|
||||
'logView.recording.exportSuccess': 'Grabación exportada',
|
||||
'logView.recording.exportFailed': 'Error al exportar la grabación',
|
||||
'logView.recording.deleted': 'Grabación eliminada',
|
||||
'logView.recording.deleteFailed': 'Error al eliminar la grabación',
|
||||
'logView.recording.deleteConfirmTitle': '¿Eliminar esta grabación de sesión?',
|
||||
'logView.recording.deleteConfirmDesc': 'El archivo de vídeo .webm se eliminará permanentemente del disco. La entrada del registro de conexión se conservará.',
|
||||
'logView.remoteDesktop.noRecordingSubtitle': 'No se capturó ninguna grabación de pantalla para esta sesión',
|
||||
'logView.remoteDesktop.host': 'Host',
|
||||
'logView.remoteDesktop.protocol': 'Protocolo',
|
||||
'logView.remoteDesktop.user': 'Usuario',
|
||||
'logView.remoteDesktop.started': 'Inicio',
|
||||
'logView.remoteDesktop.ended': 'Fin',
|
||||
'logView.remoteDesktop.duration': 'Duración',
|
||||
'logView.remoteDesktop.recordingTip': 'Haz clic en Grabar en la barra de escritorio remoto o activa la grabación automática en Ajustes → Sistema para guardar repeticiones .webm aquí.',
|
||||
|
||||
// Settings -> System -> Remote Desktop Recordings
|
||||
'settings.remoteDesktopRecordings.title': 'Grabaciones de escritorio remoto',
|
||||
'settings.remoteDesktopRecordings.autoRecord': 'Grabar automáticamente sesiones de escritorio remoto',
|
||||
'settings.remoteDesktopRecordings.autoRecordDesc': 'Iniciar la grabación de sesiones RDP y VNC al conectarse (desactivado por defecto para ahorrar espacio en disco).',
|
||||
'settings.remoteDesktopRecordings.fps': 'Frecuencia de fotogramas',
|
||||
'settings.remoteDesktopRecordings.fpsDesc': 'Una mayor frecuencia ofrece más fluidez pero consume más CPU y espacio en disco.',
|
||||
'settings.remoteDesktopRecordings.fpsOption': '{fps} FPS',
|
||||
'settings.remoteDesktopRecordings.includeAudio': 'Incluir audio RDP',
|
||||
'settings.remoteDesktopRecordings.includeAudioDesc': 'Combinar la salida de audio del escritorio remoto en el vídeo .webm cuando esté disponible.',
|
||||
'settings.remoteDesktopRecordings.maxStorage': 'Límite máximo de almacenamiento',
|
||||
'settings.remoteDesktopRecordings.maxStorageDesc': 'Las grabaciones más antiguas sin guardar se eliminan automáticamente al superar este límite.',
|
||||
'settings.remoteDesktopRecordings.retentionDays': 'Periodo de retención',
|
||||
'settings.remoteDesktopRecordings.retentionDaysDesc': 'Eliminar automáticamente las grabaciones sin guardar más antiguas que este periodo.',
|
||||
'settings.remoteDesktopRecordings.retentionDaysOption': '{days} días',
|
||||
'settings.remoteDesktopRecordings.retentionUnlimited': 'Ilimitado',
|
||||
'settings.remoteDesktopRecordings.storageUsage': 'Almacenamiento local de grabaciones',
|
||||
'settings.remoteDesktopRecordings.storageUsageSummary': '{count} archivos · {size}',
|
||||
'settings.remoteDesktopRecordings.storageUsageLoading': 'Calculando uso de disco...',
|
||||
'settings.remoteDesktopRecordings.refresh': 'Actualizar uso de almacenamiento',
|
||||
'settings.remoteDesktopRecordings.openFolder': 'Abrir carpeta',
|
||||
'settings.remoteDesktopRecordings.clearAll': 'Borrar todas las grabaciones',
|
||||
'settings.remoteDesktopRecordings.clearAllConfirmTitle': '¿Borrar todas las grabaciones de escritorio remoto?',
|
||||
'settings.remoteDesktopRecordings.clearAllConfirmDesc': 'Se eliminarán permanentemente {count} archivo(s) .webm grabados en este dispositivo.',
|
||||
'settings.remoteDesktopRecordings.clearResult': 'Se eliminaron {count} archivo(s) de grabación.',
|
||||
'settings.remoteDesktopRecordings.hint': 'Las grabaciones se guardan solo localmente en este dispositivo y nunca se sincronizan en la nube. Los registros guardados están protegidos frente a la limpieza automática.',
|
||||
|
||||
};
|
||||
@@ -134,9 +134,3 @@ test("every locale outside the pending list is at full parity with en", () => {
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test("every locale explains the fixed RDP dimension limits", () => {
|
||||
for (const messages of [en, es, ru, zhCN, zhTW]) {
|
||||
assert.match(messages["hostDetails.rdp.dimensionHint"] ?? "", /200.*8192/);
|
||||
}
|
||||
});
|
||||
@@ -765,15 +765,6 @@ export const ruAiMessages: Messages = {
|
||||
'ai.chat.artifact.scriptRunPaused': 'Запуск скрипта приостановлен',
|
||||
'ai.chat.artifact.scriptRunResumed': 'Запуск скрипта возобновлён',
|
||||
'ai.chat.artifact.scriptReference': 'Справка nct API',
|
||||
'ai.chat.artifact.rdScreenRead': 'Снимок удалённого экрана',
|
||||
'ai.chat.artifact.rdScreenGrid': 'Снимок удалённого экрана (сетка)',
|
||||
'ai.chat.artifact.rdScreenCropped': 'Снимок увеличенной области',
|
||||
'ai.chat.artifact.rdActionExecuted': 'Выполнено удалённых действий: {count}',
|
||||
'ai.chat.artifact.rdActionCount': 'действий: {count}',
|
||||
'ai.chat.artifact.rdActionPreempted': 'Удалённое действие прервано пользователем',
|
||||
'ai.chat.artifact.rdScreenFailed': 'Не удалось снять удалённый экран',
|
||||
'ai.chat.artifact.rdActionFailed': 'Ошибка действия на удалённом рабочем столе',
|
||||
'ai.chat.artifact.rdPreviewScreen': 'Предпросмотр снимка экрана',
|
||||
'zmodem.waitingForRemote': 'Ожидание удалённой стороны...',
|
||||
'zmodem.uploading': 'Загрузка',
|
||||
'zmodem.downloading': 'Скачивание',
|
||||
@@ -807,21 +798,4 @@ export const ruAiMessages: Messages = {
|
||||
"ai.toolSettings.conflict": "Настройки изменены в другом окне. Черновик сохранён. Отмените и откройте окно снова, чтобы загрузить сохранённые настройки.",
|
||||
"ai.toolSettings.retry": "Повторить",
|
||||
"ai.toolSettings.applyingHttp": "Применение настроек HTTP...",
|
||||
"ai.vision.quickPrompt.explainError": "Объяснить текущую ошибку",
|
||||
"ai.vision.quickPrompt.diagnoseUi": "Диагностировать проблему интерфейса",
|
||||
"ai.vision.quickPrompt.summarizeScreen": "Кратко описать экран",
|
||||
"ai.vision.unsupportedModelWarning": "Текущая модель ({model}) не поддерживает изображения. Переключитесь на модель с поддержкой зрения для просмотра удалённого экрана.",
|
||||
"ai.vision.switchModel": "Сменить модель",
|
||||
"ai.vision.modelSupportsVision": "Поддерживает изображения",
|
||||
"ai.vision.snip.hint": "Выделите область мышью · Esc для отмены",
|
||||
"ai.vision.snip.cancel": "Отменить выделение",
|
||||
"ai.vision.snip.ariaLabel": "Выделить область экрана удалённого рабочего стола",
|
||||
"ai.vision.privacyBlocked": "Чтение экрана ИИ заблокировано для этой сессии.",
|
||||
"ai.vision.viewingScreen": "Catty просматривает рабочий стол",
|
||||
"ai.vision.askAi": "Спросить ИИ",
|
||||
"ai.vision.captureFullAndAsk": "Снимок экрана и вопрос ИИ",
|
||||
"ai.vision.snipRegionAndAsk": "Выделить область и спросить ИИ",
|
||||
"ai.vision.openAiChat": "Открыть ИИ-ассистента",
|
||||
"ai.vision.privacyLockOn": "Чтение экрана ИИ заблокировано",
|
||||
"ai.vision.privacyLockOff": "Разрешить ИИ чтение экрана",
|
||||
};
|
||||
@@ -1087,16 +1087,6 @@ export const ruCoreMessages: Messages = {
|
||||
'vault.nav.notes': 'Заметки',
|
||||
'vault.nav.knownHosts': 'Известные хосты',
|
||||
'vault.nav.logs': 'Журналы',
|
||||
'vault.nav.customize': 'Настроить боковую панель',
|
||||
'vault.nav.customizeHint': 'Перетаскивайте элементы для сортировки или переключения видимости.',
|
||||
'vault.nav.hideItem': 'Скрыть «{label}»',
|
||||
'vault.nav.moveUp': 'Переместить выше',
|
||||
'vault.nav.moveDown': 'Переместить ниже',
|
||||
'vault.nav.resetDefault': 'Сбросить по умолчанию',
|
||||
'vault.nav.alwaysVisible': 'Всегда видно',
|
||||
'vault.nav.pluginBadge': 'Плагин',
|
||||
'vault.nav.dragToReorder': 'Перетащите, чтобы изменить порядок «{label}»',
|
||||
'vault.nav.toggleVisibility': 'Переключить видимость «{label}»',
|
||||
|
||||
'proxyProfiles.action.add': 'Добавить прокси',
|
||||
'proxyProfiles.search.placeholder': 'Поиск прокси…',
|
||||
@@ -1196,9 +1186,6 @@ export const ruCoreMessages: Messages = {
|
||||
"plugins.sidebar.loading": "Загрузка страницы расширения…",
|
||||
"plugins.vault.loading": "Загрузка страницы плагина…",
|
||||
"plugins.interaction.title": "Запрос плагина",
|
||||
"plugins.interaction.openUrlTitle": "Открыть внешнюю ссылку?",
|
||||
"plugins.interaction.openUrlNote": "Этот плагин запрашивает открытие следующего HTTPS-адреса в браузере по умолчанию:",
|
||||
"plugins.interaction.openUrlAction": "Открыть URL",
|
||||
"plugins.interaction.sharing": "Переданный текст доступен плагину и его разрешённым возможностям, включая сеть. Чтение не разрешает новый сетевой адрес.",
|
||||
"plugins.interaction.input": "Ввести текст",
|
||||
"plugins.interaction.filter": "Фильтр вариантов",
|
||||
|
||||
@@ -105,16 +105,4 @@ export const ruMonitorMessages = {
|
||||
"monitor.status.disconnected": "Отключено",
|
||||
"monitor.status.stale": "Устарело",
|
||||
"monitor.status.missing": "Сервер удалён",
|
||||
"monitor.status.online": "В сети",
|
||||
"monitor.status.offline": "Не в сети",
|
||||
"monitor.checkNow": "Проверить сейчас",
|
||||
"monitor.openRemoteDesktop": "Открыть {protocol}",
|
||||
"monitor.latencyTrend": "График задержки",
|
||||
"monitor.bannerVerified": "Протокол подтверждён",
|
||||
"monitor.bannerUnverified": "Порт открыт (баннер не проверен)",
|
||||
"monitor.companionDesktops": "Службы удалённого рабочего стола",
|
||||
"monitor.reachabilityOnly": "Только проверка доступности",
|
||||
"monitor.viaSsh": "через SSH",
|
||||
"monitor.direct": "Напрямую",
|
||||
"monitor.rttStats": "Мин / Сред / Макс",
|
||||
};
|
||||
@@ -197,25 +197,6 @@ export const ruSystemManagerMessages: Messages = {
|
||||
'systemManager.ports.unknownProcess': 'Неизвестный процесс',
|
||||
'systemManager.ports.terminate': 'Завершить',
|
||||
'systemManager.ports.confirmTerminate': 'Отправить SIGTERM процессу {{pid}}, занимающему этот порт?',
|
||||
'systemManager.ports.forwardedMeta': 'проброшено: {{count}}',
|
||||
'systemManager.ports.forward': 'Пробросить на локальный порт',
|
||||
'systemManager.ports.stopForward': 'Остановить проброс порта',
|
||||
'systemManager.ports.forwardTitle': 'Пробросить порт локально',
|
||||
'systemManager.ports.forwardDesc': 'Создать локальный SSH-туннель к этому удалённому порту.',
|
||||
'systemManager.ports.forwardDescWithHost': 'Пробросить этот порт на {{host}} на локальный порт через SSH.',
|
||||
'systemManager.ports.forwardLocalPort': 'Локальный порт',
|
||||
'systemManager.ports.forwardBindAddress': 'Адрес привязки',
|
||||
'systemManager.ports.forwardAction': 'Пробросить',
|
||||
'systemManager.ports.forwarding': 'Проброс…',
|
||||
'systemManager.ports.forwardInvalidPort': 'Введите корректный номер порта от 1 до 65535.',
|
||||
'systemManager.ports.forwardInvalidBindAddress': 'Введите корректный адрес привязки (например, 127.0.0.1 или 0.0.0.0).',
|
||||
'systemManager.ports.forwardPortInUse': 'Локальный порт {{port}} уже занят правилом «{{label}}».',
|
||||
'systemManager.ports.forwardFailed': 'Не удалось запустить проброс порта.',
|
||||
'systemManager.ports.forwardStarted': 'Проброс {{local}} → {{remote}} запущен',
|
||||
'systemManager.ports.forwardStopped': 'Проброс {{local}} остановлен',
|
||||
'systemManager.ports.copiedEndpoint': 'Скопировано: {{endpoint}}',
|
||||
'systemManager.ports.copyEndpointAria': 'Скопировать локальный адрес {{endpoint}}',
|
||||
'systemManager.ports.clickToCopy': 'Нажмите, чтобы скопировать локальный адрес',
|
||||
|
||||
'systemManager.services.unavailable': 'systemctl недоступен на этом хосте.',
|
||||
'systemManager.services.loading': 'Загрузка служб systemd…',
|
||||
|
||||
@@ -723,7 +723,6 @@ export const ruVaultMessages: Messages = {
|
||||
|
||||
// Protocol select dialog
|
||||
'protocolSelect.chooseProtocol': 'Выберите протокол',
|
||||
'protocolSelect.rememberDefault': 'Запомнить по умолчанию (больше не спрашивать)',
|
||||
'protocolSelect.port': 'порт:',
|
||||
|
||||
// Host Details
|
||||
@@ -1030,22 +1029,7 @@ export const ruVaultMessages: Messages = {
|
||||
'hostDetails.startupCommand.runMode.help': 'Выберите, как отправлять многострочные команды запуска после подключения.',
|
||||
'hostDetails.startupCommand.runMode.lineDelay': 'Отправлять построчно',
|
||||
'hostDetails.startupCommand.runMode.paste': 'Отправить сразу',
|
||||
'hostDetails.otherProtocols': 'Дополнительные протоколы',
|
||||
'hostDetails.otherProtocolsHint': 'Добавьте вспомогательные способы подключения к этому SSH-хосту без смены основного протокола',
|
||||
'hostDetails.protocol.defaultHint': 'По умолчанию при двойном клике ({protocol})',
|
||||
'hostDetails.protocol.secondaryHint': 'Включён как дополнительный протокол',
|
||||
'hostDetails.protocol.setDefault': 'Сделать основным',
|
||||
'hostDetails.protocol.remove': 'Удалить',
|
||||
'hostDetails.protocol.doubleClick': 'По двойному клику',
|
||||
'hostDetails.protocol.connectOptionDefault': 'По умолчанию: {protocol}',
|
||||
'hostDetails.protocol.connectOptionAsk': 'Спрашивать каждый раз',
|
||||
'hostDetails.protocol.alsoEnable': 'Также включить',
|
||||
'hostDetails.protocol.removeProtocol': 'Удалить {protocol}',
|
||||
'hostDetails.protocol.addProtocol': 'Добавить {protocol}',
|
||||
'hostDetails.section.connectBehavior': 'Поведение подключения',
|
||||
'hostDetails.protocol.notEnabledDesc': 'Протокол {protocol} ещё не включён для этого хоста.',
|
||||
'hostDetails.protocol.addSecondary': 'Добавить {protocol} (оставить {defaultProtocol})',
|
||||
'hostDetails.protocol.switchOnly': 'Использовать только {protocol}',
|
||||
'hostDetails.otherProtocols': 'Другие протоколы',
|
||||
'hostDetails.telnetOn': 'Telnet на',
|
||||
'hostDetails.port': 'порт',
|
||||
'hostDetails.telnet.credentials': 'Учётные данные',
|
||||
@@ -1125,347 +1109,4 @@ export const ruVaultMessages: Messages = {
|
||||
'vault.import.plugins.moreItems': 'В импорт включено ещё элементов: {count}.',
|
||||
'vault.import.plugins.moreDiagnostics': 'В предварительном просмотре скрыто ещё сообщений: {count}.',
|
||||
|
||||
// Remote Desktop (VNC / RDP / JumpServer RDP)
|
||||
'vault.hosts.newRdpHost': 'Новый хост RDP',
|
||||
'vault.hosts.newVncHost': 'Новый хост VNC',
|
||||
'vault.hosts.connectRdp': 'Подключить RDP',
|
||||
'vault.hosts.connectSsh': 'Подключить SSH',
|
||||
'vault.hosts.connectVnc': 'Подключить VNC',
|
||||
'vault.hosts.openInSystemRdp': 'Открыть в системном RDP',
|
||||
'vault.hosts.openInSystemVnc': 'Открыть в системном VNC',
|
||||
'settings.jmsDeepLink.rdpLaunchMode': 'Открывать JumpServer RDP в',
|
||||
'settings.jmsDeepLink.rdpLaunchModeDesc': 'Выберите, открывать ли RDP-сессии JumpServer jms:// во встроенном клиенте Netcatty или в системном RDP-клиенте.',
|
||||
'settings.jmsDeepLink.rdpLaunchMode.builtin': 'Встроенный клиент',
|
||||
'settings.jmsDeepLink.rdpLaunchMode.system': 'Системный клиент RDP',
|
||||
'vault.import.rdp.label': 'RDP (.rdp)',
|
||||
'vault.import.rdp.hint': 'Импорт одного или нескольких файлов Microsoft / JumpServer .rdp.',
|
||||
'vault.import.remoteDesktopTip': 'Импорт MobaXterm, CSV и .rdp также поддерживает хосты RDP и VNC.',
|
||||
'keychain.identity.domain': 'Домен (RDP, необязательно)',
|
||||
'keychain.identity.domainPlaceholder': 'CORP или домен AD',
|
||||
'quickConnect.rdp.domain': 'Домен (необязательно)',
|
||||
'quickConnect.rdp.domainPlaceholder': 'CORP или оставьте пустым для локальной учётной записи',
|
||||
'quickConnect.vnc.optionalUsername': 'Имя пользователя (необязательно, для Apple ARD / VeNCrypt)',
|
||||
'quickConnect.vnc.optionalUsernameHint': 'Большинство серверов VNC требуют только пароль.',
|
||||
'quickConnect.vnc.passwordHint': 'Оставьте пустым, если сервер VNC не требует аутентификации.',
|
||||
'quickConnect.vnc.displayHelper': 'Дисплей {display}',
|
||||
'hostDetails.protocol.label': 'Протокол',
|
||||
'hostDetails.rdp.portLabel': 'RDP на',
|
||||
'hostDetails.vnc.portLabel': 'VNC на',
|
||||
'hostDetails.vnc.displayHint': 'Дисплей {display}',
|
||||
'hostDetails.vnc.displayPlaceholder': '5900 или :0',
|
||||
'hostDetails.rdp.domain': 'Домен (необязательно)',
|
||||
'hostDetails.rdp.domainPlaceholder': 'CORP (необязательно)',
|
||||
'hostDetails.rdp.domainLabel': 'Домен',
|
||||
'hostDetails.rdp.usernamePlaceholder': 'Имя пользователя, DOMAIN\\user или JumpServer user|uuid',
|
||||
'hostDetails.vnc.optionalUsername': 'Имя пользователя (Apple ARD / VeNCrypt)',
|
||||
'hostDetails.vnc.optionalUsernameHint': 'Необязательно. Стандартный VNC использует только пароль.',
|
||||
'hostDetails.vnc.usernamePlaceholder': 'Имя пользователя (необязательно)',
|
||||
'hostDetails.remoteDesktop.sectionTitle': 'Экран и параметры удалённого рабочего стола',
|
||||
'hostDetails.rdp.resolutionMode': 'Режим разрешения',
|
||||
'hostDetails.rdp.resolutionMode.dynamic': 'Динамический размер',
|
||||
'hostDetails.rdp.resolutionMode.fit': 'По размеру окна',
|
||||
'hostDetails.rdp.resolutionMode.fixed': 'Фиксированный размер',
|
||||
'hostDetails.rdp.width': 'Ширина',
|
||||
'hostDetails.rdp.height': 'Высота',
|
||||
'hostDetails.rdp.dimensionHint': 'Введите целое число от 200 до 8192.',
|
||||
'hostDetails.rdp.colorDepth': 'Глубина цвета',
|
||||
'hostDetails.rdp.audio': 'Вывод звука',
|
||||
'hostDetails.rdp.audioDesc': 'Воспроизводить звук удалённого рабочего стола локально',
|
||||
'hostDetails.rdp.clipboard': 'Синхронизация буфера обмена',
|
||||
'hostDetails.rdp.clipboardDesc': 'Обмен текстом и изображениями с удалённым рабочим столом',
|
||||
'hostDetails.rdp.clipboardFiles': 'Передача файлов через буфер обмена',
|
||||
'hostDetails.rdp.clipboardFilesDesc': 'Разрешить копирование и перетаскивание файлов через буфер обмена',
|
||||
'hostDetails.rdp.securityMode': 'Режим безопасности',
|
||||
'hostDetails.rdp.securityMode.auto': 'Авто',
|
||||
'hostDetails.rdp.securityMode.nla': 'NLA (CredSSP)',
|
||||
'hostDetails.rdp.securityMode.tls': 'TLS',
|
||||
'hostDetails.rdp.securityMode.rdp': 'Стандартный RDP',
|
||||
'hostDetails.rdp.ignoreCertErrors': 'Игнорировать ошибки сертификатов',
|
||||
'hostDetails.rdp.ignoreCertErrorsDesc': 'Пропускать проверку доверия TLS-сертификатов (не рекомендуется)',
|
||||
'hostDetails.rdp.advanced': 'Дополнительные параметры RDP',
|
||||
'hostDetails.rdp.loadBalanceInfo': 'Информация балансировки (Load Balance Info)',
|
||||
'hostDetails.rdp.loadBalanceInfoPlaceholder': 'tsv://MS Terminal Services Plugin.1.Collection',
|
||||
'hostDetails.rdp.alternateShell': 'Альтернативная оболочка',
|
||||
'hostDetails.rdp.alternateShellPlaceholder': 'Необязательный путь к программе запуска',
|
||||
'hostDetails.rdp.shellWorkingDir': 'Рабочий каталог',
|
||||
'hostDetails.rdp.shellWorkingDirPlaceholder': 'Необязательный рабочий каталог запуска',
|
||||
'hostDetails.vnc.scalingMode': 'Масштабирование',
|
||||
'hostDetails.vnc.scalingMode.fit': 'По размеру окна',
|
||||
'hostDetails.vnc.scalingMode.actual': 'Исходный (1:1)',
|
||||
'hostDetails.vnc.scalingMode.stretch': 'Растянуть',
|
||||
'hostDetails.vnc.scalingMode.dynamic': 'Динамический размер',
|
||||
'hostDetails.vnc.quality': 'Качество изображения',
|
||||
'hostDetails.vnc.compression': 'Уровень сжатия',
|
||||
'hostDetails.vnc.viewOnly': 'Только просмотр',
|
||||
'hostDetails.vnc.viewOnlyDesc': 'Отключить передачу ввода мыши и клавиатуры',
|
||||
'hostDetails.vnc.sharedSession': 'Совместная сессия',
|
||||
'hostDetails.vnc.sharedSessionDesc': 'Не отключать другие VNC-клиенты',
|
||||
'hostDetails.vnc.clipboard': 'Синхронизация буфера обмена',
|
||||
'hostDetails.vnc.clipboardDesc': 'Синхронизировать текст UTF-8 с удалённым рабочим столом',
|
||||
'hostDetails.vnc.showRemoteCursor': 'Показывать удалённый курсор',
|
||||
'hostDetails.vnc.showRemoteCursorDesc': 'Отображать курсор, передаваемый сервером',
|
||||
'hostDetails.companion.addVnc': 'Добавить VNC',
|
||||
'hostDetails.companion.addRdp': 'Добавить RDP',
|
||||
'hostDetails.companion.tunnelViaSsh': 'Туннель через SSH этого хоста',
|
||||
'hostDetails.companion.tunnelViaSshDesc': 'Автоматическая переадресация через SSH-подключение этого хоста',
|
||||
'hostDetails.companion.tunnelTargetHost': 'Удалённый целевой адрес',
|
||||
'hostDetails.companion.credentialsSource': 'Учётные данные',
|
||||
'hostDetails.companion.credentials.host': 'Использовать SSH-данные хоста',
|
||||
'hostDetails.companion.credentials.manual': 'Свой логин и пароль',
|
||||
'hostDetails.companion.credentials.manualHint': 'Безопасно сохранится в связке ключей при сохранении хоста',
|
||||
'hostDetails.companion.credentials.identity': 'Учётные данные из связки',
|
||||
'hostDetails.companion.credentials.ask': 'Спрашивать при подключении',
|
||||
'hostDetails.companion.identityPlaceholder': 'Выберите сохранённую учётную запись',
|
||||
'hostDetails.companion.saveAsIdentity': 'Сохранить как учётную запись',
|
||||
'hostDetails.companion.saveIdentityAction': 'Создать и выбрать',
|
||||
'hostDetails.companion.identityLabelPlaceholder': 'Название (например, Desktop VNC)',
|
||||
'hostDetails.companion.identitySaved': 'Учётная запись сохранена и выбрана.',
|
||||
'hostDetails.companion.setDefaultRdp': 'Подключаться по RDP по умолчанию',
|
||||
'hostDetails.companion.setDefaultVnc': 'Подключаться по VNC по умолчанию',
|
||||
|
||||
// Known Hosts — Remote Desktop TLS Certificates
|
||||
'knownHosts.tabs.ssh': 'Ключи хостов SSH',
|
||||
'knownHosts.tabs.remoteDesktopCerts': 'Сертификаты удалённого рабочего стола',
|
||||
'knownHosts.certs.clearAll': 'Очистить все',
|
||||
'knownHosts.certs.expired': 'Истёк',
|
||||
'knownHosts.certs.expiredNotice': 'Срок действия этого сертификата истёк.',
|
||||
'knownHosts.certs.copied': 'Отпечаток SHA-256 скопирован',
|
||||
'knownHosts.certs.action.inspect': 'Просмотреть сертификат',
|
||||
'knownHosts.certs.action.copyFingerprint': 'Копировать SHA-256',
|
||||
'knownHosts.certs.action.revoke': 'Отозвать доверие',
|
||||
'knownHosts.certs.empty.title': 'Нет доверенных сертификатов удалённого рабочего стола',
|
||||
'knownHosts.certs.empty.desc': 'TLS-сертификаты, которым вы доверились при подключении к хостам RDP или VeNCrypt VNC, появятся здесь.',
|
||||
'knownHosts.certs.empty.searchTitle': 'Подходящие сертификаты не найдены',
|
||||
'knownHosts.certs.empty.searchDesc': 'Попробуйте другой хост, порт, протокол или отпечаток SHA-256.',
|
||||
'knownHosts.certs.detail.subtitle': 'Закреплённый TLS-сертификат на этом устройстве (TOFU)',
|
||||
'knownHosts.certs.detail.fingerprint': 'Отпечаток SHA-256',
|
||||
'knownHosts.certs.detail.subject': 'Субъект',
|
||||
'knownHosts.certs.detail.issuer': 'Издатель',
|
||||
'knownHosts.certs.detail.validFrom': 'Действителен с',
|
||||
'knownHosts.certs.detail.validTo': 'Действителен до',
|
||||
'knownHosts.certs.detail.trustedAt': 'Доверен с',
|
||||
'knownHosts.certs.detail.lastSeen': 'Последнее подключение',
|
||||
'knownHosts.certs.revokeConfirm.title': 'Отозвать сертификат для {endpoint}?',
|
||||
'knownHosts.certs.revokeConfirm.desc': 'При следующем подключении потребуется повторно подтвердить TLS-сертификат этого сервера.',
|
||||
'knownHosts.certs.clearAllConfirm.title': 'Очистить все доверенные сертификаты удалённого рабочего стола?',
|
||||
'knownHosts.certs.clearAllConfirm.desc': 'Будет отозвано доверие для всех закреплённых сертификатов RDP/VNC ({count}) на этом устройстве.',
|
||||
'knownHosts.certs.toast.revoked': 'Доверие к сертификату отозвано',
|
||||
'knownHosts.certs.toast.clearedAll': 'Очищено сертификатов удалённого рабочего стола: {count}',
|
||||
|
||||
// Host Connection Test — RDP / VNC Probe
|
||||
'hostDetails.connectionTest.rdp': 'Проверить RDP',
|
||||
'hostDetails.connectionTest.vnc': 'Проверить VNC',
|
||||
'hostDetails.connectionTest.probe.rtt': 'Задержка (RTT)',
|
||||
'hostDetails.connectionTest.probe.protocol': 'Протокол',
|
||||
'hostDetails.connectionTest.probe.security': 'Согласованная защита',
|
||||
'hostDetails.connectionTest.probe.rfbVersion': 'Версия RFB',
|
||||
'hostDetails.connectionTest.probe.securityTypes': 'Типы аутентификации',
|
||||
'hostDetails.connectionTest.probe.tls': 'TLS',
|
||||
'hostDetails.connectionTest.probe.fingerprint': 'Отпечаток SHA-256',
|
||||
'hostDetails.connectionTest.probe.trustStatus.trusted': 'Доверенный',
|
||||
'hostDetails.connectionTest.probe.trustStatus.firstSeen': 'Впервые встречен',
|
||||
'hostDetails.connectionTest.probe.trustStatus.changed': 'Изменён',
|
||||
'hostDetails.connectionTest.probe.trustFingerprint': 'Доверять отпечатку',
|
||||
'hostDetails.connectionTest.probe.fingerprintTrusted': 'Отпечаток сертификата добавлен в доверенные',
|
||||
|
||||
// Remote Desktop Toolbar — SFTP, CLIPRDR, Recording, Ask AI
|
||||
'remoteDesktop.toolbar.keysLocal': 'Клавиши: локально',
|
||||
'remoteDesktop.toolbar.keysRemote': 'Клавиши: удалённо',
|
||||
'remoteDesktop.toolbar.keysLocalTip': 'Локальные сочетания вкладок и окон активны. Нажмите, чтобы перехватывать сочетания для удалённого рабочего стола.',
|
||||
'remoteDesktop.toolbar.keysRemoteTip': 'Сочетания приложения передаются на удалённый компьютер. Нажмите Ctrl+Alt+Shift или дважды правый Alt/Option для освобождения.',
|
||||
'remoteDesktop.toolbar.sendKeys': 'Отправить клавиши',
|
||||
'remoteDesktop.toolbar.specialKeys': 'Специальные сочетания',
|
||||
'remoteDesktop.toolbar.typeClipboard': 'Ввести буфер обмена как нажатия клавиш',
|
||||
'remoteDesktop.toolbar.linuxTty': 'Виртуальные консоли Linux',
|
||||
'remoteDesktop.toolbar.osChordNote': 'Системные сочетания (Alt+Tab, Cmd+Tab, Ctrl+Alt+Del) перехватываются локальной ОС и отправляются через это меню.',
|
||||
'remoteDesktop.toolbar.display': 'Масштаб экрана',
|
||||
'remoteDesktop.toolbar.sshTunneled': 'Туннель через SSH',
|
||||
'remoteDesktop.toolbar.encrypted': 'Шифрованное TLS-соединение',
|
||||
'remoteDesktop.toolbar.standardRdpSecurity': 'Стандартная безопасность RDP ({{cipher}})',
|
||||
'remoteDesktop.rdp.fallbackStandardRdp': 'Подключено через стандартную безопасность RDP.',
|
||||
'remoteDesktop.rdp.fallbackStandardRdpWithCipher': 'Подключено через стандартную безопасность RDP ({{cipher}}).',
|
||||
'remoteDesktop.toolbar.viewOnly': 'Режим «Только просмотр»',
|
||||
'remoteDesktop.toolbar.viewOnlyBadge': 'Просмотр',
|
||||
'remoteDesktop.toolbar.audio': 'Звук RDP',
|
||||
'remoteDesktop.toolbar.mute': 'Выкл. звук',
|
||||
'remoteDesktop.toolbar.unmute': 'Вкл. звук',
|
||||
'remoteDesktop.toolbar.clipboard': 'Синхронизация буфера обмена',
|
||||
'remoteDesktop.toolbar.clipboardSync': 'Синхронизация буфера обмена',
|
||||
'remoteDesktop.toolbar.clipboardFiles': 'Файлы буфера обмена RDP',
|
||||
'remoteDesktop.toolbar.clipboardFilesHint': 'Скопируйте файлы на удалённом компьютере для скачивания или перетащите локальные файлы на рабочий стол.',
|
||||
'remoteDesktop.toolbar.saveFile': 'Сохранить файл',
|
||||
'remoteDesktop.toolbar.options': 'Качество и параметры ввода',
|
||||
'remoteDesktop.toolbar.quality': 'Качество кодирования',
|
||||
'remoteDesktop.toolbar.screenshot': 'Снимок экрана',
|
||||
'remoteDesktop.toolbar.copyScreenshot': 'Копировать PNG в буфер',
|
||||
'remoteDesktop.toolbar.saveScreenshot': 'Сохранить снимок PNG',
|
||||
'remoteDesktop.toolbar.fullscreen': 'Полный экран',
|
||||
'remoteDesktop.toolbar.exitFullscreen': 'Выйти из полного экрана',
|
||||
'remoteDesktop.toolbar.pin': 'Закрепить панель',
|
||||
'remoteDesktop.toolbar.unpin': 'Открепить панель',
|
||||
'remoteDesktop.toolbar.popOut': 'Открыть в новом окне',
|
||||
'remoteDesktop.toolbar.reconnect': 'Переподключиться',
|
||||
'remoteDesktop.toolbar.disconnect': 'Отключиться',
|
||||
'remoteDesktop.toolbar.openSystemRdp': 'Открыть в системном RDP',
|
||||
'remoteDesktop.toolbar.openSystemVnc': 'Открыть в общем экране',
|
||||
'remoteDesktop.display.dynamic': 'Динамический размер',
|
||||
'remoteDesktop.display.fit': 'По размеру окна',
|
||||
'remoteDesktop.display.actual': '1:1 исходный размер',
|
||||
'remoteDesktop.display.stretch': 'Растянуть',
|
||||
'remoteDesktop.display.highDpi': 'Retina HiDPI',
|
||||
'remoteDesktop.display.unsupported': 'Не поддерживается',
|
||||
'remoteDesktop.toolbar.mapCmdToCtrl': 'Сопоставить Cmd → Ctrl',
|
||||
'remoteDesktop.toolbar.showRemoteCursor': 'Показывать удалённый курсор',
|
||||
'remoteDesktop.toolbar.refreshScreen': 'Принудительно обновить экран',
|
||||
'remoteDesktop.xvp.title': 'Питание сервера (XVP)',
|
||||
'remoteDesktop.xvp.reboot': 'Перезагрузить',
|
||||
'remoteDesktop.xvp.shutdown': 'Выключить',
|
||||
'remoteDesktop.xvp.reset': 'Жёсткий сброс',
|
||||
'remoteDesktop.vnc.bell': 'Звуковой сигнал удалённого рабочего стола',
|
||||
'remoteDesktop.toolbar.moreActions': 'Ещё действия',
|
||||
'remoteDesktop.clipboard.pushNow': 'Отправить локальный буфер обмена',
|
||||
'remoteDesktop.clipboard.pushed': 'Локальный буфер обмена синхронизирован с удалённым',
|
||||
'remoteDesktop.disconnected.title': 'Сессия отключена',
|
||||
'remoteDesktop.auth.reenter': 'Учётные данные',
|
||||
'remoteDesktop.auth.cancelled': 'Аутентификация отменена.',
|
||||
'remoteDesktop.cert.rejected': 'TLS-сертификат отклонён пользователем.',
|
||||
'remoteDesktop.step.bastion': 'Бастион',
|
||||
'remoteDesktop.step.network': 'Сеть',
|
||||
'remoteDesktop.step.nla': 'NLA Auth',
|
||||
'remoteDesktop.step.rfb': 'RFB Auth',
|
||||
'remoteDesktop.step.desktop': 'Рабочий стол',
|
||||
'remoteDesktop.display.resolutionPresets': 'Пресеты разрешения',
|
||||
'remoteDesktop.display.customWidth': 'Ширина',
|
||||
'remoteDesktop.display.customHeight': 'Высота',
|
||||
'remoteDesktop.display.applyResolution': 'Применить',
|
||||
'remoteDesktop.display.multiMonitor': 'Мультимониторная раскладка',
|
||||
'remoteDesktop.display.monitorSingle': 'Один монитор',
|
||||
'remoteDesktop.display.monitorDual': 'Два рядом',
|
||||
'remoteDesktop.display.monitorAllLocal': 'Как локальные мониторы',
|
||||
'remoteDesktop.display.monitorAllLocalCount': 'Как локальные мониторы ({count})',
|
||||
'remoteDesktop.display.monitorSwitcher': 'Переключить активный монитор',
|
||||
'remoteDesktop.display.monitorAll': 'Все',
|
||||
'remoteDesktop.sharedFolders.title': 'Общие папки (RDPDR)',
|
||||
'remoteDesktop.sharedFolders.add': 'Добавить папку',
|
||||
'remoteDesktop.sharedFolders.empty': 'Подключите локальную папку как виртуальный диск на удалённом рабочем столе Windows.',
|
||||
'remoteDesktop.sharedFolders.remove': 'Удалить папку',
|
||||
'remoteDesktop.sharedFolders.readOnly': 'Только чтение',
|
||||
'remoteDesktop.sharedFolders.hint': 'Windows: Этот компьютер → <Папка> на Netcatty (\\\\tsclient\\<Имя>). Хранится только локально, без синхронизации.',
|
||||
'remoteDesktop.sharedFolders.duplicate': 'Эта папка уже добавлена',
|
||||
'remoteDesktop.sharedFolders.mounted': 'Папка «{name}» подключена к удалённому рабочему столу',
|
||||
'remoteDesktop.sharedFolders.unmounted': 'Папка «{name}» отключена',
|
||||
'remoteDesktop.network.title': 'Телеметрия соединения',
|
||||
'remoteDesktop.network.latency': 'Задержка',
|
||||
'remoteDesktop.network.resolution': 'Разрешение',
|
||||
'remoteDesktop.network.downlink': 'Загрузка (RX)',
|
||||
'remoteDesktop.network.uplink': 'Отдача (TX)',
|
||||
'remoteDesktop.network.totalRx': 'Всего RX',
|
||||
'remoteDesktop.network.totalTx': 'Всего TX',
|
||||
'remoteDesktop.network.tlsEncrypted': 'TLS',
|
||||
'remoteDesktop.network.quality.excellent': 'Отлично',
|
||||
'remoteDesktop.network.quality.good': 'Хорошо',
|
||||
'remoteDesktop.network.quality.fair': 'Средне',
|
||||
'remoteDesktop.network.quality.poor': 'Плохо',
|
||||
'remoteDesktop.network.quality.unknown': 'Измерение',
|
||||
'remoteDesktop.ai.controllingBanner': 'Catty управляет · Нажмите на экран или Esc, чтобы перехватить управление',
|
||||
'remoteDesktop.ai.stopControl': 'Стоп',
|
||||
'remoteDesktop.ai.preempted': 'Управление ИИ приостановлено — вы перехватили управление',
|
||||
'remoteDesktop.ai.preemptedStopped': 'Управление ИИ остановлено — вы перехватили управление',
|
||||
'remoteDesktop.ai.audit.menuItem': 'Журнал аудита управления ИИ',
|
||||
'remoteDesktop.ai.audit.title': 'Журнал аудита управления ИИ',
|
||||
'remoteDesktop.ai.audit.subtitleHost': 'Действия мыши и клавиатуры, выполненные ИИ на этом удалённом рабочем столе.',
|
||||
'remoteDesktop.ai.audit.subtitleAll': 'Локальный буфер последних 500 действий ИИ на удалённом рабочем столе (секреты скрыты).',
|
||||
'remoteDesktop.ai.audit.searchPlaceholder': 'Фильтр по действию, хосту или коду ошибки...',
|
||||
'remoteDesktop.ai.audit.scopeSession': 'Эта сессия',
|
||||
'remoteDesktop.ai.audit.scopeAll': 'Все',
|
||||
'remoteDesktop.ai.audit.filterAll': 'Все',
|
||||
'remoteDesktop.ai.audit.filterOk': 'ОК',
|
||||
'remoteDesktop.ai.audit.filterPreempted': 'Перехват',
|
||||
'remoteDesktop.ai.audit.filterIssues': 'Блок/Ошибки',
|
||||
'remoteDesktop.ai.audit.empty': 'Действий ИИ на удалённом рабочем столе пока не зафиксировано.',
|
||||
'remoteDesktop.ai.audit.outcomeOk': 'ОК',
|
||||
'remoteDesktop.ai.audit.outcomePreempted': 'Перехвачено',
|
||||
'remoteDesktop.ai.audit.outcomeBlocked': 'Заблокировано',
|
||||
'remoteDesktop.ai.audit.outcomeDenied': 'Отклонено',
|
||||
'remoteDesktop.ai.audit.outcomeError': 'Ошибка',
|
||||
'remoteDesktop.ai.audit.copyJson': 'Копировать JSON',
|
||||
'remoteDesktop.ai.audit.copied': 'Скопировано',
|
||||
'remoteDesktop.ai.audit.clear': 'Очистить',
|
||||
'remoteDesktop.toolbar.openSftp': 'SFTP',
|
||||
'remoteDesktop.toolbar.record': 'Записать сессию',
|
||||
'remoteDesktop.toolbar.stopRecording': 'Остановить запись',
|
||||
'remoteDesktop.toolbar.recording': 'Запись',
|
||||
'remoteDesktop.toolbar.askAi': 'Спросить ИИ',
|
||||
'remoteDesktop.toolbar.askAiFull': 'Снять экран и спросить ИИ',
|
||||
'remoteDesktop.toolbar.askAiRegion': 'Выбрать область и спросить ИИ',
|
||||
'remoteDesktop.toolbar.aiReadAllowed': 'Чтение экрана ИИ разрешено',
|
||||
'remoteDesktop.toolbar.aiReadBlocked': 'Чтение экрана ИИ запрещено для этой сессии',
|
||||
'remoteDesktop.toolbar.aiReadingBanner': 'ИИ просматривает экран',
|
||||
'remoteDesktop.clipboard.dropTitle': 'Перетащите файлы для отправки в удалённый буфер обмена (CLIPRDR)',
|
||||
'remoteDesktop.clipboard.dropSubtitle': 'После перетаскивания нажмите Ctrl+V на удалённом рабочем столе',
|
||||
'remoteDesktop.clipboard.dropFileCount': 'Файлов: {count}',
|
||||
'remoteDesktop.clipboard.dropBlockedViewOnly': 'Перетаскивание файлов отключено в режиме «Только просмотр»',
|
||||
'remoteDesktop.clipboard.dropBlockedDisabled': 'Передача файлов через буфер обмена отключена для этого хоста',
|
||||
'remoteDesktop.clipboard.dropFolderUnsupported': 'Папки не поддерживаются буфером обмена RDP. Используйте SFTP или упакуйте их в .zip.',
|
||||
'remoteDesktop.clipboard.stagedPill': 'Файлов: {count} · Ctrl+V',
|
||||
'remoteDesktop.clipboard.sendLocalFiles': 'Выбрать локальные файлы...',
|
||||
'remoteDesktop.clipboard.uploading': 'Отправка через буфер обмена',
|
||||
'remoteDesktop.clipboard.downloading': 'Получение через буфер обмена',
|
||||
'remoteDesktop.clipboard.transferCompleted': 'Передача файлов через буфер обмена завершена',
|
||||
'remoteDesktop.clipboard.transferFailed': 'Ошибка передачи файлов через буфер обмена',
|
||||
'remoteDesktop.recording.started': 'Запись сессии начата',
|
||||
'remoteDesktop.recording.saved': 'Запись сессии сохранена в журналах подключений',
|
||||
'remoteDesktop.recording.failed': 'Ошибка записи сессии',
|
||||
'remoteDesktop.recording.unsupported': 'Запись сессий не поддерживается в этой среде',
|
||||
|
||||
// LogView — Remote Desktop Recordings & Metadata
|
||||
'logView.recording.download': 'Скачать .webm',
|
||||
'logView.recording.delete': 'Удалить запись',
|
||||
'logView.recording.loading': 'Загрузка записи сессии...',
|
||||
'logView.recording.withAudio': 'Звук',
|
||||
'logView.recording.missingTitle': 'Файл записи отсутствует на диске',
|
||||
'logView.recording.missingDesc': 'Этот файл .webm был удалён, очищен по сроку хранения или перемещён из папки записей.',
|
||||
'logView.recording.playbackErrorTitle': 'Не удалось воспроизвести запись',
|
||||
'logView.recording.playbackErrorDesc': 'Видеофайл может быть повреждён или не поддерживается встроенным плеером.',
|
||||
'logView.recording.exportSuccess': 'Запись экспортирована',
|
||||
'logView.recording.exportFailed': 'Не удалось экспортировать запись',
|
||||
'logView.recording.deleted': 'Запись удалена',
|
||||
'logView.recording.deleteFailed': 'Не удалось удалить запись',
|
||||
'logView.recording.deleteConfirmTitle': 'Удалить эту запись сессии?',
|
||||
'logView.recording.deleteConfirmDesc': 'Видеофайл .webm будет безвозвратно удалён с диска. Сама запись в журнале подключений сохранится.',
|
||||
'logView.remoteDesktop.noRecordingSubtitle': 'Для этой сессии видеозапись экрана не велась',
|
||||
'logView.remoteDesktop.host': 'Хост',
|
||||
'logView.remoteDesktop.protocol': 'Протокол',
|
||||
'logView.remoteDesktop.user': 'Пользователь',
|
||||
'logView.remoteDesktop.started': 'Начало',
|
||||
'logView.remoteDesktop.ended': 'Окончание',
|
||||
'logView.remoteDesktop.duration': 'Длительность',
|
||||
'logView.remoteDesktop.recordingTip': 'Нажмите «Записать сессию» на панели удалённого рабочего стола или включите автозапись в Настройки → Система, чтобы сохранять повторы .webm.',
|
||||
|
||||
// Settings -> System -> Remote Desktop Recordings
|
||||
'settings.remoteDesktopRecordings.title': 'Записи удалённого рабочего стола',
|
||||
'settings.remoteDesktopRecordings.autoRecord': 'Автозапись сессий удалённого рабочего стола',
|
||||
'settings.remoteDesktopRecordings.autoRecordDesc': 'Автоматически начинать запись RDP и VNC после подключения (выключено по умолчанию для экономии места).',
|
||||
'settings.remoteDesktopRecordings.fps': 'Частота кадров записи',
|
||||
'settings.remoteDesktopRecordings.fpsDesc': 'Более высокая частота делает видео плавнее, но увеличивает нагрузку на ЦП и размер файлов.',
|
||||
'settings.remoteDesktopRecordings.fpsOption': '{fps} FPS',
|
||||
'settings.remoteDesktopRecordings.includeAudio': 'Включать звук RDP',
|
||||
'settings.remoteDesktopRecordings.includeAudioDesc': 'Записывать звук удалённого рабочего стола в видео .webm, если он доступен.',
|
||||
'settings.remoteDesktopRecordings.maxStorage': 'Лимит места на диске',
|
||||
'settings.remoteDesktopRecordings.maxStorageDesc': 'Самые старые несохранённые записи автоматически удаляются при превышении лимита.',
|
||||
'settings.remoteDesktopRecordings.retentionDays': 'Срок хранения',
|
||||
'settings.remoteDesktopRecordings.retentionDaysDesc': 'Автоматически удалять несохранённые записи старше указанного срока.',
|
||||
'settings.remoteDesktopRecordings.retentionDaysOption': '{days} дн.',
|
||||
'settings.remoteDesktopRecordings.retentionUnlimited': 'Без ограничений',
|
||||
'settings.remoteDesktopRecordings.storageUsage': 'Локальное хранилище записей',
|
||||
'settings.remoteDesktopRecordings.storageUsageSummary': 'Файлов: {count} · {size}',
|
||||
'settings.remoteDesktopRecordings.storageUsageLoading': 'Подсчёт занятого места...',
|
||||
'settings.remoteDesktopRecordings.refresh': 'Обновить статистику',
|
||||
'settings.remoteDesktopRecordings.openFolder': 'Открыть папку',
|
||||
'settings.remoteDesktopRecordings.clearAll': 'Очистить все записи',
|
||||
'settings.remoteDesktopRecordings.clearAllConfirmTitle': 'Очистить все записи удалённого рабочего стола?',
|
||||
'settings.remoteDesktopRecordings.clearAllConfirmDesc': 'С этого устройства будут безвозвратно удалены файлы .webm ({count}).',
|
||||
'settings.remoteDesktopRecordings.clearResult': 'Удалено файлов записей: {count}.',
|
||||
'settings.remoteDesktopRecordings.hint': 'Записи хранятся только локально на этом устройстве и не синхронизируются с облаком. Закреплённые журналы защищены от автоматической очистки.',
|
||||
|
||||
};
|
||||
@@ -835,15 +835,6 @@ export const zhCNAiMessages: Messages = {
|
||||
'ai.chat.artifact.scriptRunPaused': '脚本运行已暂停',
|
||||
'ai.chat.artifact.scriptRunResumed': '脚本运行已恢复',
|
||||
'ai.chat.artifact.scriptReference': 'nct API 参考',
|
||||
'ai.chat.artifact.rdScreenRead': '读取远程屏幕',
|
||||
'ai.chat.artifact.rdScreenGrid': '读取远程屏幕(坐标网格)',
|
||||
'ai.chat.artifact.rdScreenCropped': '局部放大截屏',
|
||||
'ai.chat.artifact.rdActionExecuted': '已执行 {count} 步远程操作',
|
||||
'ai.chat.artifact.rdActionCount': '{count} 个操作',
|
||||
'ai.chat.artifact.rdActionPreempted': '远程操作已由用户接管',
|
||||
'ai.chat.artifact.rdScreenFailed': '远程截屏失败',
|
||||
'ai.chat.artifact.rdActionFailed': '远程桌面操作失败',
|
||||
'ai.chat.artifact.rdPreviewScreen': '预览截取的画面',
|
||||
'zmodem.waitingForRemote': '等待远端...',
|
||||
'zmodem.uploading': '上传中',
|
||||
'zmodem.downloading': '下载中',
|
||||
@@ -877,21 +868,4 @@ export const zhCNAiMessages: Messages = {
|
||||
"ai.toolSettings.conflict": "设置已在另一窗口更改,当前草稿已保留。请取消并重新打开以加载已保存的设置。",
|
||||
"ai.toolSettings.retry": "重试",
|
||||
"ai.toolSettings.applyingHttp": "正在应用 HTTP 配置…",
|
||||
"ai.vision.quickPrompt.explainError": "解释当前报错",
|
||||
"ai.vision.quickPrompt.diagnoseUi": "诊断界面问题",
|
||||
"ai.vision.quickPrompt.summarizeScreen": "总结屏幕内容",
|
||||
"ai.vision.unsupportedModelWarning": "当前模型({model})不支持图片输入,切换至支持视觉的模型即可看图读屏。",
|
||||
"ai.vision.switchModel": "切换模型",
|
||||
"ai.vision.modelSupportsVision": "支持图片输入",
|
||||
"ai.vision.snip.hint": "拖拽框选区域 · 按 Esc 取消",
|
||||
"ai.vision.snip.cancel": "取消框选",
|
||||
"ai.vision.snip.ariaLabel": "框选远程桌面画面区域",
|
||||
"ai.vision.privacyBlocked": "当前会话已禁止 AI 读屏。",
|
||||
"ai.vision.viewingScreen": "Catty 正在查看桌面",
|
||||
"ai.vision.askAi": "问 AI",
|
||||
"ai.vision.captureFullAndAsk": "一键截屏问 AI",
|
||||
"ai.vision.snipRegionAndAsk": "框选区域问 AI",
|
||||
"ai.vision.openAiChat": "打开 AI 助手",
|
||||
"ai.vision.privacyLockOn": "已禁止 AI 读屏",
|
||||
"ai.vision.privacyLockOff": "允许 AI 读屏",
|
||||
};
|
||||
@@ -734,16 +734,6 @@ Vaults 标签保持扁平,不使用这块背景。
|
||||
'vault.nav.notes': '笔记',
|
||||
'vault.nav.knownHosts': '已知主机',
|
||||
'vault.nav.logs': '日志',
|
||||
'vault.nav.customize': '自定义侧边栏',
|
||||
'vault.nav.customizeHint': '拖动项目以调整顺序,或切换显示状态。',
|
||||
'vault.nav.hideItem': '隐藏「{label}」',
|
||||
'vault.nav.moveUp': '上移',
|
||||
'vault.nav.moveDown': '下移',
|
||||
'vault.nav.resetDefault': '恢复默认',
|
||||
'vault.nav.alwaysVisible': '始终显示',
|
||||
'vault.nav.pluginBadge': '插件',
|
||||
'vault.nav.dragToReorder': '拖动以调整「{label}」的顺序',
|
||||
'vault.nav.toggleVisibility': '切换「{label}」的显示状态',
|
||||
|
||||
'proxyProfiles.action.add': '添加代理',
|
||||
'proxyProfiles.search.placeholder': '搜索代理…',
|
||||
@@ -1245,9 +1235,6 @@ Vaults 标签保持扁平,不使用这块背景。
|
||||
"plugins.sidebar.loading": "正在加载扩展页面…",
|
||||
"plugins.vault.loading": "正在加载插件页面…",
|
||||
"plugins.interaction.title": "插件请求",
|
||||
"plugins.interaction.openUrlTitle": "打开外部链接?",
|
||||
"plugins.interaction.openUrlNote": "此插件请求在默认浏览器中打开以下 HTTPS 链接:",
|
||||
"plugins.interaction.openUrlAction": "打开链接",
|
||||
"plugins.interaction.sharing": "分享的文本将交给此插件及其已授权的能力(包括网络访问)。读取文本不代表批准新的网络目标。",
|
||||
"plugins.interaction.input": "输入文本",
|
||||
"plugins.interaction.filter": "筛选选项",
|
||||
|
||||
@@ -101,16 +101,4 @@ export const zhCNMonitorMessages = {
|
||||
"monitor.status.disconnected": "已断开",
|
||||
"monitor.status.stale": "读数过期",
|
||||
"monitor.status.missing": "主机已删除",
|
||||
"monitor.status.online": "在线",
|
||||
"monitor.status.offline": "离线",
|
||||
"monitor.checkNow": "立即检测",
|
||||
"monitor.openRemoteDesktop": "打开 {protocol}",
|
||||
"monitor.latencyTrend": "延迟趋势",
|
||||
"monitor.bannerVerified": "协议已校验",
|
||||
"monitor.bannerUnverified": "端口已开放(未校验协议)",
|
||||
"monitor.companionDesktops": "伴生远程桌面服务",
|
||||
"monitor.reachabilityOnly": "仅在线与延迟探测",
|
||||
"monitor.viaSsh": "经由 SSH",
|
||||
"monitor.direct": "直连",
|
||||
"monitor.rttStats": "最小 / 平均 / 最大",
|
||||
};
|
||||
@@ -214,25 +214,6 @@ export const zhCnSystemManagerMessages: Messages = {
|
||||
'systemManager.ports.unknownProcess': '未知进程',
|
||||
'systemManager.ports.terminate': '结束进程',
|
||||
'systemManager.ports.confirmTerminate': '向占用该端口的进程 {{pid}} 发送 SIGTERM?',
|
||||
'systemManager.ports.forwardedMeta': '{{count}} 个已转发',
|
||||
'systemManager.ports.forward': '转发到本地端口',
|
||||
'systemManager.ports.stopForward': '停止端口转发',
|
||||
'systemManager.ports.forwardTitle': '转发端口到本地',
|
||||
'systemManager.ports.forwardDesc': '通过 SSH 将此远程监听端口转发到本地端口。',
|
||||
'systemManager.ports.forwardDescWithHost': '通过 SSH 将 {{host}} 上的此监听端口转发到本地端口。',
|
||||
'systemManager.ports.forwardLocalPort': '本地端口',
|
||||
'systemManager.ports.forwardBindAddress': '绑定地址',
|
||||
'systemManager.ports.forwardAction': '开始转发',
|
||||
'systemManager.ports.forwarding': '转发中…',
|
||||
'systemManager.ports.forwardInvalidPort': '请输入 1 到 65535 之间的有效端口号。',
|
||||
'systemManager.ports.forwardInvalidBindAddress': '请输入有效的绑定地址(如 127.0.0.1 或 0.0.0.0)。',
|
||||
'systemManager.ports.forwardPortInUse': '本地端口 {{port}} 已被「{{label}}」占用。',
|
||||
'systemManager.ports.forwardFailed': '启动端口转发失败。',
|
||||
'systemManager.ports.forwardStarted': '已开始转发 {{local}} → {{remote}}',
|
||||
'systemManager.ports.forwardStopped': '已停止转发 {{local}}',
|
||||
'systemManager.ports.copiedEndpoint': '已复制 {{endpoint}}',
|
||||
'systemManager.ports.copyEndpointAria': '复制本地地址 {{endpoint}}',
|
||||
'systemManager.ports.clickToCopy': '点击复制本地地址',
|
||||
|
||||
'systemManager.services.unavailable': '此主机未检测到 systemctl。',
|
||||
'systemManager.services.loading': '正在加载 systemd 服务…',
|
||||
|
||||
@@ -109,7 +109,6 @@ export const zhCNVaultMessages: Messages = {
|
||||
|
||||
// Protocol select dialog
|
||||
'protocolSelect.chooseProtocol': '选择协议',
|
||||
'protocolSelect.rememberDefault': '记住为默认连接(下次不再询问)',
|
||||
'protocolSelect.port': '端口:',
|
||||
// Host Details
|
||||
'hostDetails.title.details': '主机详情',
|
||||
@@ -380,22 +379,7 @@ export const zhCNVaultMessages: Messages = {
|
||||
'hostDetails.startupCommand.runMode.help': '选择连接后如何发送多行启动命令。',
|
||||
'hostDetails.startupCommand.runMode.lineDelay': '逐行发送',
|
||||
'hostDetails.startupCommand.runMode.paste': '一次性发送',
|
||||
'hostDetails.otherProtocols': '附加协议',
|
||||
'hostDetails.otherProtocolsHint': '为当前 SSH 主机挂载辅助连接方式,不影响默认连接',
|
||||
'hostDetails.protocol.defaultHint': '双击默认使用 {protocol}',
|
||||
'hostDetails.protocol.secondaryHint': '已作为附加协议启用',
|
||||
'hostDetails.protocol.setDefault': '设为默认',
|
||||
'hostDetails.protocol.remove': '移除',
|
||||
'hostDetails.protocol.doubleClick': '双击连接',
|
||||
'hostDetails.protocol.connectOptionDefault': '默认 {protocol}',
|
||||
'hostDetails.protocol.connectOptionAsk': '每次询问',
|
||||
'hostDetails.protocol.alsoEnable': '同时启用',
|
||||
'hostDetails.protocol.removeProtocol': '移除 {protocol}',
|
||||
'hostDetails.protocol.addProtocol': '添加 {protocol}',
|
||||
'hostDetails.section.connectBehavior': '连接行为',
|
||||
'hostDetails.protocol.notEnabledDesc': '当前主机尚未启用 {protocol} 协议。',
|
||||
'hostDetails.protocol.addSecondary': '添加 {protocol}(保留 {defaultProtocol} 默认)',
|
||||
'hostDetails.protocol.switchOnly': '仅使用 {protocol}',
|
||||
'hostDetails.otherProtocols': '其他协议',
|
||||
'hostDetails.telnetOn': 'Telnet on',
|
||||
'hostDetails.port': '端口',
|
||||
'hostDetails.telnet.credentials': '凭据',
|
||||
@@ -1071,349 +1055,4 @@ export const zhCNVaultMessages: Messages = {
|
||||
'vault.import.plugins.moreItems': '本次导入还包含 {count} 个项目。',
|
||||
'vault.import.plugins.moreDiagnostics': '预览中省略了另外 {count} 条诊断信息。',
|
||||
|
||||
// Remote Desktop (VNC / RDP / JumpServer RDP)
|
||||
'vault.hosts.newRdpHost': '新建 RDP 主机',
|
||||
'vault.hosts.newVncHost': '新建 VNC 主机',
|
||||
'vault.hosts.connectRdp': '连接 RDP',
|
||||
'vault.hosts.connectSsh': '连接 SSH',
|
||||
'vault.hosts.connectVnc': '连接 VNC',
|
||||
'vault.hosts.openInSystemRdp': '在系统 RDP 客户端中打开',
|
||||
'vault.hosts.openInSystemVnc': '在系统屏幕共享中打开',
|
||||
'settings.jmsDeepLink.rdpLaunchMode': 'JumpServer RDP 打开方式',
|
||||
'settings.jmsDeepLink.rdpLaunchModeDesc': '选择通过 JumpServer jms:// 启动 Windows RDP 会话时使用 Netcatty 内置客户端还是系统 RDP 客户端。',
|
||||
'settings.jmsDeepLink.rdpLaunchMode.builtin': '内置客户端',
|
||||
'settings.jmsDeepLink.rdpLaunchMode.system': '系统 RDP 客户端',
|
||||
'vault.import.rdp.label': 'RDP (.rdp)',
|
||||
'vault.import.rdp.hint': '导入单个或多个 Microsoft / JumpServer .rdp 文件。',
|
||||
'vault.import.remoteDesktopTip': 'MobaXterm、CSV 与 .rdp 导入均支持 RDP 和 VNC 主机。',
|
||||
'keychain.identity.domain': '域 (RDP,可选)',
|
||||
'keychain.identity.domainPlaceholder': 'CORP 或 AD 域名',
|
||||
'quickConnect.rdp.domain': '域(可选)',
|
||||
'quickConnect.rdp.domainPlaceholder': 'CORP 或留空使用本地账户',
|
||||
'quickConnect.vnc.optionalUsername': '用户名(可选,用于 Apple ARD / VeNCrypt)',
|
||||
'quickConnect.vnc.optionalUsernameHint': '大多数 VNC 服务器仅需密码认证。',
|
||||
'quickConnect.vnc.passwordHint': '如果 VNC 服务器无需密码,可留空直接连接。',
|
||||
'quickConnect.vnc.displayHelper': '显示器 {display}',
|
||||
'hostDetails.protocol.label': '协议',
|
||||
'hostDetails.rdp.portLabel': 'RDP 端口',
|
||||
'hostDetails.vnc.portLabel': 'VNC 端口',
|
||||
'hostDetails.vnc.displayHint': '显示器 {display}',
|
||||
'hostDetails.vnc.displayPlaceholder': '5900 或 :0',
|
||||
'hostDetails.rdp.domain': '域(可选)',
|
||||
'hostDetails.rdp.domainPlaceholder': 'CORP(可选)',
|
||||
'hostDetails.rdp.domainLabel': '域',
|
||||
'hostDetails.rdp.usernamePlaceholder': '用户名、DOMAIN\\user 或 JumpServer user|uuid',
|
||||
'hostDetails.vnc.optionalUsername': '用户名(Apple ARD / VeNCrypt)',
|
||||
'hostDetails.vnc.optionalUsernameHint': '可选。标准 VNC 服务器仅使用密码认证。',
|
||||
'hostDetails.vnc.usernamePlaceholder': '用户名(可选)',
|
||||
'hostDetails.remoteDesktop.sectionTitle': '远程桌面显示与选项',
|
||||
'hostDetails.rdp.resolutionMode': '分辨率模式',
|
||||
'hostDetails.rdp.resolutionMode.dynamic': '动态自适应',
|
||||
'hostDetails.rdp.resolutionMode.fit': '适应窗口',
|
||||
'hostDetails.rdp.resolutionMode.fixed': '固定尺寸',
|
||||
'hostDetails.rdp.width': '宽度',
|
||||
'hostDetails.rdp.height': '高度',
|
||||
'hostDetails.rdp.dimensionHint': '请输入 200 到 8192 之间的整数。',
|
||||
'hostDetails.rdp.colorDepth': '色深',
|
||||
'hostDetails.rdp.audio': '音频输出',
|
||||
'hostDetails.rdp.audioDesc': '在本地播放远程桌面声音',
|
||||
'hostDetails.rdp.clipboard': '剪贴板同步',
|
||||
'hostDetails.rdp.clipboardDesc': '与远程桌面共享文本与图片',
|
||||
'hostDetails.rdp.clipboardFiles': '剪贴板文件传输',
|
||||
'hostDetails.rdp.clipboardFilesDesc': '允许通过剪贴板复制和拖拽传输文件',
|
||||
'hostDetails.rdp.securityMode': '安全模式',
|
||||
'hostDetails.rdp.securityMode.auto': '自动',
|
||||
'hostDetails.rdp.securityMode.nla': 'NLA (CredSSP)',
|
||||
'hostDetails.rdp.securityMode.tls': 'TLS',
|
||||
'hostDetails.rdp.securityMode.rdp': '标准 RDP',
|
||||
'hostDetails.rdp.ignoreCertErrors': '忽略证书错误',
|
||||
'hostDetails.rdp.ignoreCertErrorsDesc': '跳过 TLS 证书信任提示(不推荐)',
|
||||
'hostDetails.rdp.advanced': '高级 RDP 选项',
|
||||
'hostDetails.rdp.loadBalanceInfo': '负载均衡信息 (Load Balance Info)',
|
||||
'hostDetails.rdp.loadBalanceInfoPlaceholder': 'tsv://MS Terminal Services Plugin.1.Collection',
|
||||
'hostDetails.rdp.alternateShell': '启动程序 (Alternate Shell)',
|
||||
'hostDetails.rdp.alternateShellPlaceholder': '可选的启动程序路径',
|
||||
'hostDetails.rdp.shellWorkingDir': '工作目录',
|
||||
'hostDetails.rdp.shellWorkingDirPlaceholder': '可选的启动工作目录',
|
||||
'hostDetails.vnc.scalingMode': '缩放模式',
|
||||
'hostDetails.vnc.scalingMode.fit': '适应窗口',
|
||||
'hostDetails.vnc.scalingMode.actual': '原始比例 (1:1)',
|
||||
'hostDetails.vnc.scalingMode.stretch': '拉伸填充',
|
||||
'hostDetails.vnc.scalingMode.dynamic': '动态自适应',
|
||||
'hostDetails.vnc.quality': '画质等级',
|
||||
'hostDetails.vnc.compression': '压缩等级',
|
||||
'hostDetails.vnc.viewOnly': '只读模式',
|
||||
'hostDetails.vnc.viewOnlyDesc': '禁止向远端发送鼠标和键盘输入',
|
||||
'hostDetails.vnc.sharedSession': '共享会话',
|
||||
'hostDetails.vnc.sharedSessionDesc': '连接时保持其他 VNC 客户端不断开',
|
||||
'hostDetails.vnc.clipboard': '剪贴板同步',
|
||||
'hostDetails.vnc.clipboardDesc': '与远程桌面同步 UTF-8 剪贴板文本',
|
||||
'hostDetails.vnc.showRemoteCursor': '显示远程光标',
|
||||
'hostDetails.vnc.showRemoteCursorDesc': '渲染服务端下发的光标样式',
|
||||
'hostDetails.companion.addVnc': '添加 VNC',
|
||||
'hostDetails.companion.addRdp': '添加 RDP',
|
||||
'hostDetails.companion.tunnelViaSsh': '通过当前主机 SSH 隧道直连',
|
||||
'hostDetails.companion.tunnelViaSshDesc': '自动经由当前主机的 SSH 连接转发端口',
|
||||
'hostDetails.companion.tunnelTargetHost': '远端目标地址',
|
||||
'hostDetails.companion.credentialsSource': '凭证来源',
|
||||
'hostDetails.companion.credentials.host': '复用主机 SSH 凭证',
|
||||
'hostDetails.companion.credentials.manual': '独立用户名 / 密码',
|
||||
'hostDetails.companion.credentials.manualHint': '保存主机时自动加密存入钥匙串',
|
||||
'hostDetails.companion.credentials.identity': '钥匙串身份',
|
||||
'hostDetails.companion.credentials.ask': '每次连接时询问',
|
||||
'hostDetails.companion.identityPlaceholder': '选择已保存的身份',
|
||||
'hostDetails.companion.saveAsIdentity': '保存为身份',
|
||||
'hostDetails.companion.saveIdentityAction': '创建并选择身份',
|
||||
'hostDetails.companion.identityLabelPlaceholder': '身份名称(如 Desktop VNC)',
|
||||
'hostDetails.companion.identitySaved': '已保存并选中该身份。',
|
||||
'hostDetails.companion.setDefaultRdp': '默认使用 RDP 连接',
|
||||
'hostDetails.companion.setDefaultVnc': '默认使用 VNC 连接',
|
||||
|
||||
// Known Hosts — Remote Desktop TLS Certificates
|
||||
'knownHosts.tabs.ssh': 'SSH 主机密钥',
|
||||
'knownHosts.tabs.remoteDesktopCerts': '远程桌面证书',
|
||||
'knownHosts.certs.clearAll': '全部清空',
|
||||
'knownHosts.certs.expired': '已过期',
|
||||
'knownHosts.certs.expiredNotice': '该证书已超过有效期。',
|
||||
'knownHosts.certs.copied': '已复制 SHA-256 指纹',
|
||||
'knownHosts.certs.action.inspect': '查看证书详情',
|
||||
'knownHosts.certs.action.copyFingerprint': '复制 SHA-256',
|
||||
'knownHosts.certs.action.revoke': '吊销信任',
|
||||
'knownHosts.certs.empty.title': '暂无已信任的远程桌面证书',
|
||||
'knownHosts.certs.empty.desc': '连接 RDP 或 VeNCrypt VNC 主机并选择信任的 TLS 证书将显示在此处。',
|
||||
'knownHosts.certs.empty.searchTitle': '未找到匹配的证书',
|
||||
'knownHosts.certs.empty.searchDesc': '请尝试搜索其他主机名、端口、协议或 SHA-256 指纹。',
|
||||
'knownHosts.certs.detail.subtitle': '本设备已固定信任的 TLS 证书(TOFU)',
|
||||
'knownHosts.certs.detail.fingerprint': 'SHA-256 指纹',
|
||||
'knownHosts.certs.detail.subject': '颁发给 (Subject)',
|
||||
'knownHosts.certs.detail.issuer': '颁发者 (Issuer)',
|
||||
'knownHosts.certs.detail.validFrom': '生效时间',
|
||||
'knownHosts.certs.detail.validTo': '过期时间',
|
||||
'knownHosts.certs.detail.trustedAt': '首次信任',
|
||||
'knownHosts.certs.detail.lastSeen': '最近连接',
|
||||
'knownHosts.certs.revokeConfirm.title': '吊销 {endpoint} 的证书信任?',
|
||||
'knownHosts.certs.revokeConfirm.desc': '下次连接该服务器时将重新要求验证其 TLS 证书指纹。',
|
||||
'knownHosts.certs.clearAllConfirm.title': '清空所有已信任的远程桌面证书?',
|
||||
'knownHosts.certs.clearAllConfirm.desc': '将吊销本设备上全部 {count} 条已固定的 RDP/VNC 证书信任记录。',
|
||||
'knownHosts.certs.toast.revoked': '已吊销证书信任',
|
||||
'knownHosts.certs.toast.clearedAll': '已清空 {count} 条远程桌面证书',
|
||||
|
||||
// Host Connection Test — RDP / VNC Probe
|
||||
'hostDetails.connectionTest.rdp': '测试 RDP',
|
||||
'hostDetails.connectionTest.vnc': '测试 VNC',
|
||||
'hostDetails.connectionTest.probe.rtt': '网络延迟 (RTT)',
|
||||
'hostDetails.connectionTest.probe.protocol': '协议',
|
||||
'hostDetails.connectionTest.probe.security': '协商安全模式',
|
||||
'hostDetails.connectionTest.probe.rfbVersion': 'RFB 版本',
|
||||
'hostDetails.connectionTest.probe.securityTypes': '支持的安全类型',
|
||||
'hostDetails.connectionTest.probe.tls': 'TLS',
|
||||
'hostDetails.connectionTest.probe.fingerprint': 'SHA-256 指纹',
|
||||
'hostDetails.connectionTest.probe.trustStatus.trusted': '已信任',
|
||||
'hostDetails.connectionTest.probe.trustStatus.firstSeen': '首次见到',
|
||||
'hostDetails.connectionTest.probe.trustStatus.changed': '指纹已变更',
|
||||
'hostDetails.connectionTest.probe.trustFingerprint': '信任此指纹',
|
||||
'hostDetails.connectionTest.probe.fingerprintTrusted': '已信任该证书指纹',
|
||||
|
||||
// Remote Desktop Toolbar — SFTP, CLIPRDR, Recording, Ask AI
|
||||
'remoteDesktop.toolbar.keysLocal': '快捷键:本地',
|
||||
'remoteDesktop.toolbar.keysRemote': '快捷键:远端',
|
||||
'remoteDesktop.toolbar.keysLocalTip': '当前保留本地标签/窗口快捷键,点击可将组合键转发至远程桌面。',
|
||||
'remoteDesktop.toolbar.keysRemoteTip': '快捷键已转发至远程桌面。按 Ctrl+Alt+Shift 或双击右 Alt/Option 释放。',
|
||||
'remoteDesktop.toolbar.sendKeys': '发送按键',
|
||||
'remoteDesktop.toolbar.specialKeys': '常用组合键',
|
||||
'remoteDesktop.toolbar.typeClipboard': '将剪贴板按键盘输入',
|
||||
'remoteDesktop.toolbar.linuxTty': 'Linux 虚拟终端',
|
||||
'remoteDesktop.toolbar.osChordNote': '系统保留组合键(如 Alt+Tab、Cmd+Tab、Ctrl+Alt+Del)会被本机拦截,请通过此菜单发送。',
|
||||
'remoteDesktop.toolbar.display': '显示缩放',
|
||||
'remoteDesktop.toolbar.sshTunneled': '通过 SSH 隧道加密转发',
|
||||
'remoteDesktop.toolbar.encrypted': 'TLS 加密连接',
|
||||
'remoteDesktop.toolbar.standardRdpSecurity': '标准 RDP 安全层({{cipher}})',
|
||||
'remoteDesktop.rdp.fallbackStandardRdp': '已回退并使用标准 RDP 安全层连接。',
|
||||
'remoteDesktop.rdp.fallbackStandardRdpWithCipher': '已回退并使用标准 RDP 安全层连接({{cipher}})。',
|
||||
'remoteDesktop.toolbar.viewOnly': '只读模式',
|
||||
'remoteDesktop.toolbar.viewOnlyBadge': '只读',
|
||||
'remoteDesktop.toolbar.audio': 'RDP 音频',
|
||||
'remoteDesktop.toolbar.mute': '静音',
|
||||
'remoteDesktop.toolbar.unmute': '取消静音',
|
||||
'remoteDesktop.toolbar.clipboard': '剪贴板同步',
|
||||
'remoteDesktop.toolbar.clipboardSync': '同步剪贴板',
|
||||
'remoteDesktop.toolbar.clipboardFiles': 'RDP 剪贴板文件',
|
||||
'remoteDesktop.toolbar.clipboardFilesHint': '在远程复制文件后可在此下载,或直接拖拽本地文件到画布中粘贴。',
|
||||
'remoteDesktop.toolbar.saveFile': '保存文件',
|
||||
'remoteDesktop.toolbar.options': '画质与输入选项',
|
||||
'remoteDesktop.toolbar.quality': '画面编码质量',
|
||||
'remoteDesktop.toolbar.screenshot': '截屏',
|
||||
'remoteDesktop.toolbar.copyScreenshot': '复制 PNG 到剪贴板',
|
||||
'remoteDesktop.toolbar.saveScreenshot': '保存 PNG 截图',
|
||||
'remoteDesktop.toolbar.fullscreen': '全屏',
|
||||
'remoteDesktop.toolbar.exitFullscreen': '退出全屏',
|
||||
'remoteDesktop.toolbar.pin': '固定工具栏',
|
||||
'remoteDesktop.toolbar.unpin': '取消固定工具栏',
|
||||
'remoteDesktop.toolbar.popOut': '在新窗口中打开',
|
||||
'remoteDesktop.toolbar.reconnect': '重新连接',
|
||||
'remoteDesktop.toolbar.disconnect': '断开连接',
|
||||
'remoteDesktop.toolbar.openSystemRdp': '使用系统 RDP 打开',
|
||||
'remoteDesktop.toolbar.openSystemVnc': '使用系统屏幕共享打开',
|
||||
'remoteDesktop.display.dynamic': '动态自适应',
|
||||
'remoteDesktop.display.fit': '适应窗口',
|
||||
'remoteDesktop.display.actual': '1:1 原始尺寸',
|
||||
'remoteDesktop.display.stretch': '拉伸填充',
|
||||
'remoteDesktop.display.highDpi': 'Retina 高清缩放',
|
||||
'remoteDesktop.display.unsupported': '服务端不支持',
|
||||
'remoteDesktop.toolbar.mapCmdToCtrl': 'Cmd 映射为 Ctrl',
|
||||
'remoteDesktop.toolbar.showRemoteCursor': '显示远程光标',
|
||||
'remoteDesktop.toolbar.refreshScreen': '强制刷新整屏画面',
|
||||
'remoteDesktop.xvp.title': '远程电源控制 (XVP)',
|
||||
'remoteDesktop.xvp.reboot': '重启',
|
||||
'remoteDesktop.xvp.shutdown': '关机',
|
||||
'remoteDesktop.xvp.reset': '强制复位',
|
||||
'remoteDesktop.vnc.bell': '远程桌面响铃提示',
|
||||
'remoteDesktop.toolbar.moreActions': '更多操作',
|
||||
'remoteDesktop.clipboard.pushNow': '立即推送本机剪贴板',
|
||||
'remoteDesktop.clipboard.pushed': '已同步本机剪贴板到远程桌面',
|
||||
'remoteDesktop.disconnected.title': '远程桌面会话已断开',
|
||||
'remoteDesktop.auth.reenter': '修改凭证',
|
||||
'remoteDesktop.auth.cancelled': '已取消身份验证。',
|
||||
'remoteDesktop.cert.rejected': '已拒绝该 TLS 证书。',
|
||||
'remoteDesktop.step.bastion': '跳板隧道',
|
||||
'remoteDesktop.step.network': '网络连接',
|
||||
'remoteDesktop.step.nla': 'NLA 验证',
|
||||
'remoteDesktop.step.rfb': 'RFB 验证',
|
||||
'remoteDesktop.step.desktop': '桌面会话',
|
||||
'remoteDesktop.toolbar.openSftp': 'SFTP',
|
||||
'remoteDesktop.toolbar.record': '录制会话',
|
||||
'remoteDesktop.toolbar.stopRecording': '停止录制',
|
||||
'remoteDesktop.toolbar.recording': '录制中',
|
||||
'remoteDesktop.toolbar.askAi': '问 AI',
|
||||
'remoteDesktop.toolbar.askAiFull': '截全屏问 AI',
|
||||
'remoteDesktop.toolbar.askAiRegion': '框选区域问 AI',
|
||||
'remoteDesktop.toolbar.aiReadAllowed': '允许 AI 读取屏幕',
|
||||
'remoteDesktop.toolbar.aiReadBlocked': '已禁止 AI 读取当前会话屏幕',
|
||||
'remoteDesktop.toolbar.aiReadingBanner': 'AI 正在查看画面',
|
||||
'remoteDesktop.clipboard.dropTitle': '拖放文件以发送到远程剪贴板 (CLIPRDR)',
|
||||
'remoteDesktop.clipboard.dropSubtitle': '松手后,在远程桌面中按 Ctrl+V 即可粘贴',
|
||||
'remoteDesktop.clipboard.dropFileCount': '{count} 个文件',
|
||||
'remoteDesktop.clipboard.dropBlockedViewOnly': '只读模式下无法拖放文件',
|
||||
'remoteDesktop.clipboard.dropBlockedDisabled': '该主机未启用剪贴板文件传输',
|
||||
'remoteDesktop.clipboard.dropFolderUnsupported': 'RDP 剪贴板不支持直接发送文件夹,请改用 SFTP 或压缩为 .zip 后发送。',
|
||||
'remoteDesktop.clipboard.stagedPill': '{count} 个文件 · Ctrl+V',
|
||||
'remoteDesktop.clipboard.sendLocalFiles': '选择本地文件发送...',
|
||||
'remoteDesktop.clipboard.uploading': '正在通过剪贴板发送',
|
||||
'remoteDesktop.clipboard.downloading': '正在通过剪贴板接收',
|
||||
'remoteDesktop.clipboard.transferCompleted': '剪贴板文件传输完成',
|
||||
'remoteDesktop.clipboard.transferFailed': '剪贴板文件传输失败',
|
||||
'remoteDesktop.recording.started': '已开始录制会话',
|
||||
'remoteDesktop.recording.saved': '会话录屏已保存到连接日志',
|
||||
'remoteDesktop.recording.failed': '会话录制失败',
|
||||
'remoteDesktop.recording.unsupported': '当前环境不支持会话录制',
|
||||
|
||||
// Remote Desktop — Resolution Presets, Multi-Monitor, RDPDR Shared Folders, Network Telemetry, AI Computer Use
|
||||
'remoteDesktop.display.resolutionPresets': '分辨率预设',
|
||||
'remoteDesktop.display.customWidth': '宽度',
|
||||
'remoteDesktop.display.customHeight': '高度',
|
||||
'remoteDesktop.display.applyResolution': '应用',
|
||||
'remoteDesktop.display.multiMonitor': '多显示器布局',
|
||||
'remoteDesktop.display.monitorSingle': '单显示器',
|
||||
'remoteDesktop.display.monitorDual': '双屏并排',
|
||||
'remoteDesktop.display.monitorAllLocal': '匹配本机显示器',
|
||||
'remoteDesktop.display.monitorAllLocalCount': '匹配本机显示器 ({count})',
|
||||
'remoteDesktop.display.monitorSwitcher': '切换当前显示器',
|
||||
'remoteDesktop.display.monitorAll': '全部',
|
||||
'remoteDesktop.sharedFolders.title': '共享文件夹 (RDPDR)',
|
||||
'remoteDesktop.sharedFolders.add': '添加文件夹',
|
||||
'remoteDesktop.sharedFolders.empty': '将本机文件夹挂载为远程 Windows 桌面上的虚拟磁盘。',
|
||||
'remoteDesktop.sharedFolders.remove': '移除文件夹',
|
||||
'remoteDesktop.sharedFolders.readOnly': '只读',
|
||||
'remoteDesktop.sharedFolders.hint': 'Windows:此电脑 → Netcatty 上的 <文件夹> (\\\\tsclient\\<名称>)。仅保存在本机,不参与云同步。',
|
||||
'remoteDesktop.sharedFolders.duplicate': '该文件夹已在共享列表中',
|
||||
'remoteDesktop.sharedFolders.mounted': '已在远程桌面挂载「{name}」',
|
||||
'remoteDesktop.sharedFolders.unmounted': '已取消挂载「{name}」',
|
||||
'remoteDesktop.network.title': '连接遥测',
|
||||
'remoteDesktop.network.latency': '延迟',
|
||||
'remoteDesktop.network.resolution': '分辨率',
|
||||
'remoteDesktop.network.downlink': '下行 (RX)',
|
||||
'remoteDesktop.network.uplink': '上行 (TX)',
|
||||
'remoteDesktop.network.totalRx': '总接收',
|
||||
'remoteDesktop.network.totalTx': '总发送',
|
||||
'remoteDesktop.network.tlsEncrypted': 'TLS',
|
||||
'remoteDesktop.network.quality.excellent': '极佳',
|
||||
'remoteDesktop.network.quality.good': '良好',
|
||||
'remoteDesktop.network.quality.fair': '一般',
|
||||
'remoteDesktop.network.quality.poor': '较差',
|
||||
'remoteDesktop.network.quality.unknown': '测量中',
|
||||
'remoteDesktop.ai.controllingBanner': 'Catty 控制中 · 点击桌面或按 Esc 立即接管',
|
||||
'remoteDesktop.ai.stopControl': '停止',
|
||||
'remoteDesktop.ai.preempted': '已暂停 AI 控制 — 您已接管桌面',
|
||||
'remoteDesktop.ai.preemptedStopped': '已停止 AI 控制 — 您已接管桌面',
|
||||
'remoteDesktop.ai.audit.menuItem': 'AI 操控审计日志',
|
||||
'remoteDesktop.ai.audit.title': 'AI 桌面操控审计日志',
|
||||
'remoteDesktop.ai.audit.subtitleHost': '记录此远程桌面上执行的 AI 鼠标与键盘操作。',
|
||||
'remoteDesktop.ai.audit.subtitleAll': '本地记录最近 500 条 AI 远程桌面操控记录(敏感文本已脱敏)。',
|
||||
'remoteDesktop.ai.audit.searchPlaceholder': '按操作、主机或错误码筛选...',
|
||||
'remoteDesktop.ai.audit.scopeSession': '当前会话',
|
||||
'remoteDesktop.ai.audit.scopeAll': '全部',
|
||||
'remoteDesktop.ai.audit.filterAll': '全部',
|
||||
'remoteDesktop.ai.audit.filterOk': '成功',
|
||||
'remoteDesktop.ai.audit.filterPreempted': '接管',
|
||||
'remoteDesktop.ai.audit.filterIssues': '拦截/错误',
|
||||
'remoteDesktop.ai.audit.empty': '暂无 AI 远程桌面操控记录。',
|
||||
'remoteDesktop.ai.audit.outcomeOk': '成功',
|
||||
'remoteDesktop.ai.audit.outcomePreempted': '已接管',
|
||||
'remoteDesktop.ai.audit.outcomeBlocked': '已拦截',
|
||||
'remoteDesktop.ai.audit.outcomeDenied': '已拒绝',
|
||||
'remoteDesktop.ai.audit.outcomeError': '失败',
|
||||
'remoteDesktop.ai.audit.copyJson': '复制 JSON',
|
||||
'remoteDesktop.ai.audit.copied': '已复制',
|
||||
'remoteDesktop.ai.audit.clear': '清空',
|
||||
|
||||
// LogView — Remote Desktop Recordings & Metadata
|
||||
'logView.recording.download': '下载 .webm',
|
||||
'logView.recording.delete': '删除录屏',
|
||||
'logView.recording.loading': '正在加载会话录屏...',
|
||||
'logView.recording.withAudio': '含音频',
|
||||
'logView.recording.missingTitle': '录屏文件已不在磁盘上',
|
||||
'logView.recording.missingDesc': '该 .webm 文件已被删除、因保留策略自动清理或被移出录屏目录。',
|
||||
'logView.recording.playbackErrorTitle': '无法播放录屏',
|
||||
'logView.recording.playbackErrorDesc': '视频文件可能不完整,或内置播放器不支持该编码格式。',
|
||||
'logView.recording.exportSuccess': '已导出录屏文件',
|
||||
'logView.recording.exportFailed': '导出录屏失败',
|
||||
'logView.recording.deleted': '已删除录屏',
|
||||
'logView.recording.deleteFailed': '删除录屏失败',
|
||||
'logView.recording.deleteConfirmTitle': '删除这条会话录屏?',
|
||||
'logView.recording.deleteConfirmDesc': '磁盘上的 .webm 视频文件将被永久删除,连接日志记录本身会保留。',
|
||||
'logView.remoteDesktop.noRecordingSubtitle': '此次远程桌面会话未录制视频',
|
||||
'logView.remoteDesktop.host': '主机',
|
||||
'logView.remoteDesktop.protocol': '协议',
|
||||
'logView.remoteDesktop.user': '用户名',
|
||||
'logView.remoteDesktop.started': '开始时间',
|
||||
'logView.remoteDesktop.ended': '结束时间',
|
||||
'logView.remoteDesktop.duration': '持续时长',
|
||||
'logView.remoteDesktop.recordingTip': '点击远程桌面工具栏的录制按钮,或在「设置 → 系统」中开启自动录制,即可在此回放 .webm 录屏。',
|
||||
|
||||
// Settings -> System -> Remote Desktop Recordings
|
||||
'settings.remoteDesktopRecordings.title': '远程桌面录屏',
|
||||
'settings.remoteDesktopRecordings.autoRecord': '自动录制远程桌面会话',
|
||||
'settings.remoteDesktopRecordings.autoRecordDesc': 'RDP/VNC 会话连接成功后自动开始录制(默认关闭以节省磁盘空间)。',
|
||||
'settings.remoteDesktopRecordings.fps': '录制帧率',
|
||||
'settings.remoteDesktopRecordings.fpsDesc': '帧率越高画面越流畅,但会占用更多 CPU 和磁盘空间。',
|
||||
'settings.remoteDesktopRecordings.fpsOption': '{fps} FPS',
|
||||
'settings.remoteDesktopRecordings.includeAudio': '包含 RDP 音频',
|
||||
'settings.remoteDesktopRecordings.includeAudioDesc': '在可用时将远程桌面音频合并录制到 .webm 视频中。',
|
||||
'settings.remoteDesktopRecordings.maxStorage': '最大存储空间上限',
|
||||
'settings.remoteDesktopRecordings.maxStorageDesc': '总占用超出上限时,自动优先清理最早的未收藏会话录屏。',
|
||||
'settings.remoteDesktopRecordings.retentionDays': '录屏保留天数',
|
||||
'settings.remoteDesktopRecordings.retentionDaysDesc': '自动删除超过保留期的未收藏会话录屏。',
|
||||
'settings.remoteDesktopRecordings.retentionDaysOption': '{days} 天',
|
||||
'settings.remoteDesktopRecordings.retentionUnlimited': '不限制',
|
||||
'settings.remoteDesktopRecordings.storageUsage': '本地录屏存储占用',
|
||||
'settings.remoteDesktopRecordings.storageUsageSummary': '{count} 个文件 · {size}',
|
||||
'settings.remoteDesktopRecordings.storageUsageLoading': '正在计算磁盘占用...',
|
||||
'settings.remoteDesktopRecordings.refresh': '刷新存储统计',
|
||||
'settings.remoteDesktopRecordings.openFolder': '打开文件夹',
|
||||
'settings.remoteDesktopRecordings.clearAll': '清空全部录屏',
|
||||
'settings.remoteDesktopRecordings.clearAllConfirmTitle': '清空全部远程桌面录屏?',
|
||||
'settings.remoteDesktopRecordings.clearAllConfirmDesc': '将从此设备永久删除 {count} 个 .webm 录屏文件。',
|
||||
'settings.remoteDesktopRecordings.clearResult': '已删除 {count} 个录屏文件。',
|
||||
'settings.remoteDesktopRecordings.hint': '录屏文件仅保存在本设备本地,绝不上传云同步;已收藏的连接日志录屏不会在自动清理中被删除。',
|
||||
|
||||
};
|
||||
@@ -834,15 +834,6 @@ export const zhTWAiMessages: Messages = {
|
||||
'ai.chat.artifact.scriptRunPaused': '指令碼執行已暫停',
|
||||
'ai.chat.artifact.scriptRunResumed': '指令碼執行已恢復',
|
||||
'ai.chat.artifact.scriptReference': 'nct API 參考',
|
||||
'ai.chat.artifact.rdScreenRead': '讀取遠端畫面',
|
||||
'ai.chat.artifact.rdScreenGrid': '讀取遠端畫面(座標網格)',
|
||||
'ai.chat.artifact.rdScreenCropped': '局部放大截圖',
|
||||
'ai.chat.artifact.rdActionExecuted': '已執行 {count} 步遠端操作',
|
||||
'ai.chat.artifact.rdActionCount': '{count} 個操作',
|
||||
'ai.chat.artifact.rdActionPreempted': '遠端操作已由使用者接管',
|
||||
'ai.chat.artifact.rdScreenFailed': '遠端截圖失敗',
|
||||
'ai.chat.artifact.rdActionFailed': '遠端桌面操作失敗',
|
||||
'ai.chat.artifact.rdPreviewScreen': '預覽擷取的畫面',
|
||||
'zmodem.waitingForRemote': '等待遠端...',
|
||||
'zmodem.uploading': '上傳中',
|
||||
'zmodem.downloading': '下載中',
|
||||
@@ -876,21 +867,4 @@ export const zhTWAiMessages: Messages = {
|
||||
"ai.toolSettings.conflict": "設定已在其他視窗變更,目前草稿已保留。請取消並重新開啟以載入已儲存的設定。",
|
||||
"ai.toolSettings.retry": "重試",
|
||||
"ai.toolSettings.applyingHttp": "正在套用 HTTP 設定…",
|
||||
"ai.vision.quickPrompt.explainError": "解釋目前錯誤",
|
||||
"ai.vision.quickPrompt.diagnoseUi": "診斷介面問題",
|
||||
"ai.vision.quickPrompt.summarizeScreen": "總結畫面內容",
|
||||
"ai.vision.unsupportedModelWarning": "目前模型({model})不支援圖片輸入,切換至支援視覺的模型即可看圖讀屏。",
|
||||
"ai.vision.switchModel": "切換模型",
|
||||
"ai.vision.modelSupportsVision": "支援圖片輸入",
|
||||
"ai.vision.snip.hint": "拖曳框選區域 · 按 Esc 取消",
|
||||
"ai.vision.snip.cancel": "取消框選",
|
||||
"ai.vision.snip.ariaLabel": "框選遠端桌面畫面區域",
|
||||
"ai.vision.privacyBlocked": "目前工作階段已禁止 AI 讀屏。",
|
||||
"ai.vision.viewingScreen": "Catty 正在檢視桌面",
|
||||
"ai.vision.askAi": "問 AI",
|
||||
"ai.vision.captureFullAndAsk": "一鍵截圖問 AI",
|
||||
"ai.vision.snipRegionAndAsk": "框選區域問 AI",
|
||||
"ai.vision.openAiChat": "開啟 AI 助手",
|
||||
"ai.vision.privacyLockOn": "已禁止 AI 讀屏",
|
||||
"ai.vision.privacyLockOff": "允許 AI 讀屏",
|
||||
};
|
||||
@@ -734,16 +734,6 @@ Vaults 分頁維持扁平,不使用這塊背景。
|
||||
'vault.nav.notes': '筆記',
|
||||
'vault.nav.knownHosts': '已知主機',
|
||||
'vault.nav.logs': '日誌',
|
||||
'vault.nav.customize': '自訂側邊欄',
|
||||
'vault.nav.customizeHint': '拖曳項目以調整順序,或切換顯示狀態。',
|
||||
'vault.nav.hideItem': '隱藏「{label}」',
|
||||
'vault.nav.moveUp': '上移',
|
||||
'vault.nav.moveDown': '下移',
|
||||
'vault.nav.resetDefault': '恢復預設',
|
||||
'vault.nav.alwaysVisible': '始終顯示',
|
||||
'vault.nav.pluginBadge': '外掛',
|
||||
'vault.nav.dragToReorder': '拖曳以調整「{label}」的順序',
|
||||
'vault.nav.toggleVisibility': '切換「{label}」的顯示狀態',
|
||||
|
||||
'proxyProfiles.action.add': '新增代理',
|
||||
'proxyProfiles.search.placeholder': '搜尋代理…',
|
||||
@@ -1246,9 +1236,6 @@ Vaults 分頁維持扁平,不使用這塊背景。
|
||||
"plugins.sidebar.loading": "正在載入擴充功能頁面…",
|
||||
"plugins.vault.loading": "正在載入擴充功能頁面…",
|
||||
"plugins.interaction.title": "外掛請求",
|
||||
"plugins.interaction.openUrlTitle": "開啟外部連結?",
|
||||
"plugins.interaction.openUrlNote": "此外掛請求在預設瀏覽器中開啟以下 HTTPS 連結:",
|
||||
"plugins.interaction.openUrlAction": "開啟連結",
|
||||
"plugins.interaction.sharing": "分享的文字會交給此外掛及其已授權能力(包括網路存取)。讀取文字不代表核准新的網路目的地。",
|
||||
"plugins.interaction.input": "輸入文字",
|
||||
"plugins.interaction.filter": "篩選選項",
|
||||
|
||||
@@ -101,16 +101,4 @@ export const zhTWMonitorMessages = {
|
||||
"monitor.status.disconnected": "已中斷",
|
||||
"monitor.status.stale": "讀數過期",
|
||||
"monitor.status.missing": "主機已刪除",
|
||||
"monitor.status.online": "線上",
|
||||
"monitor.status.offline": "離線",
|
||||
"monitor.checkNow": "立即檢測",
|
||||
"monitor.openRemoteDesktop": "開啟 {protocol}",
|
||||
"monitor.latencyTrend": "延遲趨勢",
|
||||
"monitor.bannerVerified": "協定已驗證",
|
||||
"monitor.bannerUnverified": "連接埠已開啟(未驗證協定)",
|
||||
"monitor.companionDesktops": "伴生遠端桌面服務",
|
||||
"monitor.reachabilityOnly": "僅線上與延遲探測",
|
||||
"monitor.viaSsh": "經由 SSH",
|
||||
"monitor.direct": "直連",
|
||||
"monitor.rttStats": "最小 / 平均 / 最大",
|
||||
};
|
||||
@@ -214,25 +214,6 @@ export const zhTwSystemManagerMessages: Messages = {
|
||||
'systemManager.ports.unknownProcess': '未知行程',
|
||||
'systemManager.ports.terminate': '結束行程',
|
||||
'systemManager.ports.confirmTerminate': '向佔用該連接埠的行程 {{pid}} 傳送 SIGTERM?',
|
||||
'systemManager.ports.forwardedMeta': '{{count}} 個已轉發',
|
||||
'systemManager.ports.forward': '轉發至本機連接埠',
|
||||
'systemManager.ports.stopForward': '停止連接埠轉發',
|
||||
'systemManager.ports.forwardTitle': '轉發連接埠至本機',
|
||||
'systemManager.ports.forwardDesc': '透過 SSH 將此遠端監聽連接埠轉發至本機連接埠。',
|
||||
'systemManager.ports.forwardDescWithHost': '透過 SSH 將 {{host}} 上的此監聽連接埠轉發至本機連接埠。',
|
||||
'systemManager.ports.forwardLocalPort': '本機連接埠',
|
||||
'systemManager.ports.forwardBindAddress': '繫結位址',
|
||||
'systemManager.ports.forwardAction': '開始轉發',
|
||||
'systemManager.ports.forwarding': '轉發中…',
|
||||
'systemManager.ports.forwardInvalidPort': '請輸入 1 到 65535 之間的有效連接埠號碼。',
|
||||
'systemManager.ports.forwardInvalidBindAddress': '請輸入有效的繫結位址(例如 127.0.0.1 或 0.0.0.0)。',
|
||||
'systemManager.ports.forwardPortInUse': '本機連接埠 {{port}} 已被「{{label}}」佔用。',
|
||||
'systemManager.ports.forwardFailed': '啟動連接埠轉發失敗。',
|
||||
'systemManager.ports.forwardStarted': '已開始轉發 {{local}} → {{remote}}',
|
||||
'systemManager.ports.forwardStopped': '已停止轉發 {{local}}',
|
||||
'systemManager.ports.copiedEndpoint': '已複製 {{endpoint}}',
|
||||
'systemManager.ports.copyEndpointAria': '複製本機位址 {{endpoint}}',
|
||||
'systemManager.ports.clickToCopy': '點擊複製本機位址',
|
||||
|
||||
'systemManager.services.unavailable': '此主機未偵測到 systemctl。',
|
||||
'systemManager.services.loading': '正在載入 systemd 服務…',
|
||||
|
||||
@@ -109,7 +109,6 @@ export const zhTWVaultMessages: Messages = {
|
||||
|
||||
// Protocol select dialog
|
||||
'protocolSelect.chooseProtocol': '選擇協定',
|
||||
'protocolSelect.rememberDefault': '記住為預設連線(下次不再詢問)',
|
||||
'protocolSelect.port': '埠:',
|
||||
// Host Details
|
||||
'hostDetails.title.details': '主機詳情',
|
||||
@@ -380,22 +379,7 @@ export const zhTWVaultMessages: Messages = {
|
||||
'hostDetails.startupCommand.runMode.help': '選擇連線後如何傳送多行啟動指令。',
|
||||
'hostDetails.startupCommand.runMode.lineDelay': '逐行傳送',
|
||||
'hostDetails.startupCommand.runMode.paste': '一次性傳送',
|
||||
'hostDetails.otherProtocols': '附加協定',
|
||||
'hostDetails.otherProtocolsHint': '為目前 SSH 主機掛載輔助連線方式,不影響預設連線',
|
||||
'hostDetails.protocol.defaultHint': '雙擊預設使用 {protocol}',
|
||||
'hostDetails.protocol.secondaryHint': '已作為附加協定啟用',
|
||||
'hostDetails.protocol.setDefault': '設為預設',
|
||||
'hostDetails.protocol.remove': '移除',
|
||||
'hostDetails.protocol.doubleClick': '雙擊連線',
|
||||
'hostDetails.protocol.connectOptionDefault': '預設 {protocol}',
|
||||
'hostDetails.protocol.connectOptionAsk': '每次詢問',
|
||||
'hostDetails.protocol.alsoEnable': '同時啟用',
|
||||
'hostDetails.protocol.removeProtocol': '移除 {protocol}',
|
||||
'hostDetails.protocol.addProtocol': '新增 {protocol}',
|
||||
'hostDetails.section.connectBehavior': '連線行為',
|
||||
'hostDetails.protocol.notEnabledDesc': '目前主機尚未啟用 {protocol} 協定。',
|
||||
'hostDetails.protocol.addSecondary': '新增 {protocol}(保留 {defaultProtocol} 預設)',
|
||||
'hostDetails.protocol.switchOnly': '僅使用 {protocol}',
|
||||
'hostDetails.otherProtocols': '其他協定',
|
||||
'hostDetails.telnetOn': 'Telnet on',
|
||||
'hostDetails.port': '埠',
|
||||
'hostDetails.telnet.credentials': '憑證',
|
||||
@@ -1071,349 +1055,4 @@ export const zhTWVaultMessages: Messages = {
|
||||
'vault.import.plugins.moreItems': '本次匯入還包含 {count} 個項目。',
|
||||
'vault.import.plugins.moreDiagnostics': '預覽中省略了另外 {count} 則診斷資訊。',
|
||||
|
||||
// Remote Desktop (VNC / RDP / JumpServer RDP)
|
||||
'vault.hosts.newRdpHost': '新增 RDP 主機',
|
||||
'vault.hosts.newVncHost': '新增 VNC 主機',
|
||||
'vault.hosts.connectRdp': '連線 RDP',
|
||||
'vault.hosts.connectSsh': '連線 SSH',
|
||||
'vault.hosts.connectVnc': '連線 VNC',
|
||||
'vault.hosts.openInSystemRdp': '在系統 RDP 用戶端中開啟',
|
||||
'vault.hosts.openInSystemVnc': '在系統螢幕共享中開啟',
|
||||
'settings.jmsDeepLink.rdpLaunchMode': 'JumpServer RDP 開啟方式',
|
||||
'settings.jmsDeepLink.rdpLaunchModeDesc': '選擇透過 JumpServer jms:// 啟動 Windows RDP 工作階段時使用 Netcatty 內建用戶端或系統 RDP 用戶端。',
|
||||
'settings.jmsDeepLink.rdpLaunchMode.builtin': '內建用戶端',
|
||||
'settings.jmsDeepLink.rdpLaunchMode.system': '系統 RDP 用戶端',
|
||||
'vault.import.rdp.label': 'RDP (.rdp)',
|
||||
'vault.import.rdp.hint': '匯入單一或多個 Microsoft / JumpServer .rdp 檔案。',
|
||||
'vault.import.remoteDesktopTip': 'MobaXterm、CSV 與 .rdp 匯入皆支援 RDP 與 VNC 主機。',
|
||||
'keychain.identity.domain': '網域 (RDP,選填)',
|
||||
'keychain.identity.domainPlaceholder': 'CORP 或 AD 網域',
|
||||
'quickConnect.rdp.domain': '網域(選填)',
|
||||
'quickConnect.rdp.domainPlaceholder': 'CORP 或留空使用本機帳戶',
|
||||
'quickConnect.vnc.optionalUsername': '使用者名稱(選填,用於 Apple ARD / VeNCrypt)',
|
||||
'quickConnect.vnc.optionalUsernameHint': '多數 VNC 伺服器僅需密碼驗證。',
|
||||
'quickConnect.vnc.passwordHint': '若 VNC 伺服器不需密碼,可留空直接連線。',
|
||||
'quickConnect.vnc.displayHelper': '顯示器 {display}',
|
||||
'hostDetails.protocol.label': '通訊協定',
|
||||
'hostDetails.rdp.portLabel': 'RDP 連接埠',
|
||||
'hostDetails.vnc.portLabel': 'VNC 連接埠',
|
||||
'hostDetails.vnc.displayHint': '顯示器 {display}',
|
||||
'hostDetails.vnc.displayPlaceholder': '5900 或 :0',
|
||||
'hostDetails.rdp.domain': '網域(選填)',
|
||||
'hostDetails.rdp.domainPlaceholder': 'CORP(選填)',
|
||||
'hostDetails.rdp.domainLabel': '網域',
|
||||
'hostDetails.rdp.usernamePlaceholder': '使用者名稱、DOMAIN\\user 或 JumpServer user|uuid',
|
||||
'hostDetails.vnc.optionalUsername': '使用者名稱(Apple ARD / VeNCrypt)',
|
||||
'hostDetails.vnc.optionalUsernameHint': '選填。標準 VNC 伺服器僅使用密碼驗證。',
|
||||
'hostDetails.vnc.usernamePlaceholder': '使用者名稱(選填)',
|
||||
'hostDetails.remoteDesktop.sectionTitle': '遠端桌面顯示與選項',
|
||||
'hostDetails.rdp.resolutionMode': '解析度模式',
|
||||
'hostDetails.rdp.resolutionMode.dynamic': '動態自適應',
|
||||
'hostDetails.rdp.resolutionMode.fit': '符合視窗',
|
||||
'hostDetails.rdp.resolutionMode.fixed': '固定尺寸',
|
||||
'hostDetails.rdp.width': '寬度',
|
||||
'hostDetails.rdp.height': '高度',
|
||||
'hostDetails.rdp.dimensionHint': '請輸入 200 到 8192 之間的整數。',
|
||||
'hostDetails.rdp.colorDepth': '色彩深度',
|
||||
'hostDetails.rdp.audio': '音訊輸出',
|
||||
'hostDetails.rdp.audioDesc': '在本機播放遠端桌面音效',
|
||||
'hostDetails.rdp.clipboard': '剪貼簿同步',
|
||||
'hostDetails.rdp.clipboardDesc': '與遠端桌面共用文字與圖片',
|
||||
'hostDetails.rdp.clipboardFiles': '剪貼簿檔案傳輸',
|
||||
'hostDetails.rdp.clipboardFilesDesc': '允許透過剪貼簿複製與拖曳傳輸檔案',
|
||||
'hostDetails.rdp.securityMode': '安全性模式',
|
||||
'hostDetails.rdp.securityMode.auto': '自動',
|
||||
'hostDetails.rdp.securityMode.nla': 'NLA (CredSSP)',
|
||||
'hostDetails.rdp.securityMode.tls': 'TLS',
|
||||
'hostDetails.rdp.securityMode.rdp': '標準 RDP',
|
||||
'hostDetails.rdp.ignoreCertErrors': '忽略憑證錯誤',
|
||||
'hostDetails.rdp.ignoreCertErrorsDesc': '略過 TLS 憑證信任提示(不建議)',
|
||||
'hostDetails.rdp.advanced': '進階 RDP 選項',
|
||||
'hostDetails.rdp.loadBalanceInfo': '負載平衡資訊 (Load Balance Info)',
|
||||
'hostDetails.rdp.loadBalanceInfoPlaceholder': 'tsv://MS Terminal Services Plugin.1.Collection',
|
||||
'hostDetails.rdp.alternateShell': '啟動程式 (Alternate Shell)',
|
||||
'hostDetails.rdp.alternateShellPlaceholder': '選填的啟動程式路徑',
|
||||
'hostDetails.rdp.shellWorkingDir': '工作目錄',
|
||||
'hostDetails.rdp.shellWorkingDirPlaceholder': '選填的啟動工作目錄',
|
||||
'hostDetails.vnc.scalingMode': '縮放模式',
|
||||
'hostDetails.vnc.scalingMode.fit': '符合視窗',
|
||||
'hostDetails.vnc.scalingMode.actual': '原始比例 (1:1)',
|
||||
'hostDetails.vnc.scalingMode.stretch': '延展填滿',
|
||||
'hostDetails.vnc.scalingMode.dynamic': '動態自適應',
|
||||
'hostDetails.vnc.quality': '畫質等級',
|
||||
'hostDetails.vnc.compression': '壓縮等級',
|
||||
'hostDetails.vnc.viewOnly': '唯讀模式',
|
||||
'hostDetails.vnc.viewOnlyDesc': '停用傳送滑鼠與鍵盤輸入',
|
||||
'hostDetails.vnc.sharedSession': '共用工作階段',
|
||||
'hostDetails.vnc.sharedSessionDesc': '連線時保持其他 VNC 用戶端不斷線',
|
||||
'hostDetails.vnc.clipboard': '剪貼簿同步',
|
||||
'hostDetails.vnc.clipboardDesc': '與遠端桌面同步 UTF-8 剪貼簿文字',
|
||||
'hostDetails.vnc.showRemoteCursor': '顯示遠端游標',
|
||||
'hostDetails.vnc.showRemoteCursorDesc': '呈現伺服器提供的游標形狀',
|
||||
'hostDetails.companion.addVnc': '新增 VNC',
|
||||
'hostDetails.companion.addRdp': '新增 RDP',
|
||||
'hostDetails.companion.tunnelViaSsh': '透過此主機 SSH 通道連線',
|
||||
'hostDetails.companion.tunnelViaSshDesc': '自動經由此主機的 SSH 連線轉發連接埠',
|
||||
'hostDetails.companion.tunnelTargetHost': '遠端目標位址',
|
||||
'hostDetails.companion.credentialsSource': '憑證來源',
|
||||
'hostDetails.companion.credentials.host': '沿用主機 SSH 憑證',
|
||||
'hostDetails.companion.credentials.manual': '獨立使用者名稱 / 密碼',
|
||||
'hostDetails.companion.credentials.manualHint': '儲存主機時自動加密存入鑰匙圈',
|
||||
'hostDetails.companion.credentials.identity': '鑰匙圈身分',
|
||||
'hostDetails.companion.credentials.ask': '每次連線時詢問',
|
||||
'hostDetails.companion.identityPlaceholder': '選擇已儲存的身分',
|
||||
'hostDetails.companion.saveAsIdentity': '儲存為身分',
|
||||
'hostDetails.companion.saveIdentityAction': '建立並選擇身分',
|
||||
'hostDetails.companion.identityLabelPlaceholder': '身分名稱(如 Desktop VNC)',
|
||||
'hostDetails.companion.identitySaved': '已儲存並選取該身分。',
|
||||
'hostDetails.companion.setDefaultRdp': '預設使用 RDP 連線',
|
||||
'hostDetails.companion.setDefaultVnc': '預設使用 VNC 連線',
|
||||
|
||||
// Known Hosts — Remote Desktop TLS Certificates
|
||||
'knownHosts.tabs.ssh': 'SSH 主機金鑰',
|
||||
'knownHosts.tabs.remoteDesktopCerts': '遠端桌面憑證',
|
||||
'knownHosts.certs.clearAll': '全部清除',
|
||||
'knownHosts.certs.expired': '已過期',
|
||||
'knownHosts.certs.expiredNotice': '此憑證已超過有效期限。',
|
||||
'knownHosts.certs.copied': '已複製 SHA-256 指紋',
|
||||
'knownHosts.certs.action.inspect': '檢視憑證詳情',
|
||||
'knownHosts.certs.action.copyFingerprint': '複製 SHA-256',
|
||||
'knownHosts.certs.action.revoke': '撤銷信任',
|
||||
'knownHosts.certs.empty.title': '尚無已信任的遠端桌面憑證',
|
||||
'knownHosts.certs.empty.desc': '連線至 RDP 或 VeNCrypt VNC 主機並選擇信任的 TLS 憑證將顯示於此處。',
|
||||
'knownHosts.certs.empty.searchTitle': '找不到符合的憑證',
|
||||
'knownHosts.certs.empty.searchDesc': '請嘗試搜尋其他主機名稱、連接埠、通訊協定或 SHA-256 指紋。',
|
||||
'knownHosts.certs.detail.subtitle': '本裝置已固定信任的 TLS 憑證(TOFU)',
|
||||
'knownHosts.certs.detail.fingerprint': 'SHA-256 指紋',
|
||||
'knownHosts.certs.detail.subject': '主體 (Subject)',
|
||||
'knownHosts.certs.detail.issuer': '簽發者 (Issuer)',
|
||||
'knownHosts.certs.detail.validFrom': '生效時間',
|
||||
'knownHosts.certs.detail.validTo': '到期時間',
|
||||
'knownHosts.certs.detail.trustedAt': '首次信任',
|
||||
'knownHosts.certs.detail.lastSeen': '最近連線',
|
||||
'knownHosts.certs.revokeConfirm.title': '要撤銷 {endpoint} 的憑證信任嗎?',
|
||||
'knownHosts.certs.revokeConfirm.desc': '下次連線至此伺服器時將重新要求驗證其 TLS 憑證指紋。',
|
||||
'knownHosts.certs.clearAllConfirm.title': '要清除所有已信任的遠端桌面憑證嗎?',
|
||||
'knownHosts.certs.clearAllConfirm.desc': '這將撤銷本裝置上全部 {count} 筆已固定的 RDP/VNC 憑證信任紀錄。',
|
||||
'knownHosts.certs.toast.revoked': '已撤銷憑證信任',
|
||||
'knownHosts.certs.toast.clearedAll': '已清除 {count} 筆遠端桌面憑證',
|
||||
|
||||
// Host Connection Test — RDP / VNC Probe
|
||||
'hostDetails.connectionTest.rdp': '測試 RDP',
|
||||
'hostDetails.connectionTest.vnc': '測試 VNC',
|
||||
'hostDetails.connectionTest.probe.rtt': '網路延遲 (RTT)',
|
||||
'hostDetails.connectionTest.probe.protocol': '通訊協定',
|
||||
'hostDetails.connectionTest.probe.security': '協商安全模式',
|
||||
'hostDetails.connectionTest.probe.rfbVersion': 'RFB 版本',
|
||||
'hostDetails.connectionTest.probe.securityTypes': '支援的安全類型',
|
||||
'hostDetails.connectionTest.probe.tls': 'TLS',
|
||||
'hostDetails.connectionTest.probe.fingerprint': 'SHA-256 指紋',
|
||||
'hostDetails.connectionTest.probe.trustStatus.trusted': '已信任',
|
||||
'hostDetails.connectionTest.probe.trustStatus.firstSeen': '首次見到',
|
||||
'hostDetails.connectionTest.probe.trustStatus.changed': '指紋已變更',
|
||||
'hostDetails.connectionTest.probe.trustFingerprint': '信任此指紋',
|
||||
'hostDetails.connectionTest.probe.fingerprintTrusted': '已信任此憑證指紋',
|
||||
|
||||
// Remote Desktop Toolbar — SFTP, CLIPRDR, Recording, Ask AI
|
||||
'remoteDesktop.toolbar.openSftp': 'SFTP',
|
||||
'remoteDesktop.toolbar.record': '錄製工作階段',
|
||||
'remoteDesktop.toolbar.stopRecording': '停止錄製',
|
||||
'remoteDesktop.toolbar.recording': '錄製中',
|
||||
'remoteDesktop.toolbar.askAi': '詢問 AI',
|
||||
'remoteDesktop.toolbar.askAiFull': '擷取全螢幕詢問 AI',
|
||||
'remoteDesktop.toolbar.askAiRegion': '框選區域詢問 AI',
|
||||
'remoteDesktop.toolbar.aiReadAllowed': '允許 AI 讀取畫面',
|
||||
'remoteDesktop.toolbar.aiReadBlocked': '已禁止 AI 讀取此工作階段畫面',
|
||||
'remoteDesktop.toolbar.aiReadingBanner': 'AI 正在檢視畫面',
|
||||
'remoteDesktop.clipboard.dropTitle': '拖放檔案以傳送到遠端剪貼簿 (CLIPRDR)',
|
||||
'remoteDesktop.clipboard.dropSubtitle': '放開後,在遠端桌面中按 Ctrl+V 即可貼上',
|
||||
'remoteDesktop.clipboard.dropFileCount': '{count} 個檔案',
|
||||
'remoteDesktop.clipboard.dropBlockedViewOnly': '唯讀模式下無法拖放檔案',
|
||||
'remoteDesktop.clipboard.dropBlockedDisabled': '此主機未啟用剪貼簿檔案傳輸',
|
||||
'remoteDesktop.clipboard.dropFolderUnsupported': 'RDP 剪貼簿不支援直接傳送資料夾,請改用 SFTP 或壓縮為 .zip 後再傳送。',
|
||||
'remoteDesktop.clipboard.stagedPill': '{count} 個檔案 · Ctrl+V',
|
||||
'remoteDesktop.clipboard.sendLocalFiles': '選擇本機檔案傳送...',
|
||||
'remoteDesktop.clipboard.uploading': '正在透過剪貼簿傳送',
|
||||
'remoteDesktop.clipboard.downloading': '正在透過剪貼簿接收',
|
||||
'remoteDesktop.clipboard.transferCompleted': '剪貼簿檔案傳輸完成',
|
||||
'remoteDesktop.clipboard.transferFailed': '剪貼簿檔案傳輸失敗',
|
||||
'remoteDesktop.recording.started': '已開始錄製工作階段',
|
||||
'remoteDesktop.recording.saved': '工作階段錄影已儲存至連線日誌',
|
||||
'remoteDesktop.recording.failed': '工作階段錄製失敗',
|
||||
'remoteDesktop.recording.unsupported': '目前環境不支援工作階段錄製',
|
||||
|
||||
// LogView — Remote Desktop Recordings & Metadata
|
||||
'remoteDesktop.toolbar.keysLocal': '快速鍵:本機',
|
||||
'remoteDesktop.toolbar.keysRemote': '快速鍵:遠端',
|
||||
'remoteDesktop.toolbar.keysLocalTip': '本機分頁與視窗快速鍵維持啟用。點擊可擷取快速鍵並傳送至遠端桌面。',
|
||||
'remoteDesktop.toolbar.keysRemoteTip': '應用程式快速鍵會轉送至遠端。按 Ctrl+Alt+Shift 或連按兩下右 Alt/Option 即可釋放。',
|
||||
'remoteDesktop.toolbar.sendKeys': '傳送按鍵',
|
||||
'remoteDesktop.toolbar.specialKeys': '特殊組合鍵',
|
||||
'remoteDesktop.toolbar.typeClipboard': '以鍵盤輸入剪貼簿內容',
|
||||
'remoteDesktop.toolbar.linuxTty': 'Linux 虛擬主控台',
|
||||
'remoteDesktop.toolbar.osChordNote': '作業系統保留的組合鍵(Alt+Tab、Cmd+Tab、Ctrl+Alt+Del)會由本機系統攔截,請由此選單傳送。',
|
||||
'remoteDesktop.toolbar.display': '顯示縮放',
|
||||
'remoteDesktop.toolbar.sshTunneled': '透過 SSH 通道連線',
|
||||
'remoteDesktop.toolbar.encrypted': 'TLS 加密連線',
|
||||
'remoteDesktop.toolbar.standardRdpSecurity': '標準 RDP 安全層({{cipher}})',
|
||||
'remoteDesktop.rdp.fallbackStandardRdp': '已回退並使用標準 RDP 安全層連線。',
|
||||
'remoteDesktop.rdp.fallbackStandardRdpWithCipher': '已回退並使用標準 RDP 安全層連線({{cipher}})。',
|
||||
'remoteDesktop.toolbar.viewOnly': '唯讀檢視模式',
|
||||
'remoteDesktop.toolbar.viewOnlyBadge': '檢視',
|
||||
'remoteDesktop.toolbar.audio': 'RDP 音訊',
|
||||
'remoteDesktop.toolbar.mute': '靜音',
|
||||
'remoteDesktop.toolbar.unmute': '取消靜音',
|
||||
'remoteDesktop.toolbar.clipboard': '剪貼簿同步',
|
||||
'remoteDesktop.toolbar.clipboardSync': '剪貼簿同步',
|
||||
'remoteDesktop.toolbar.clipboardFiles': 'RDP 剪貼簿檔案',
|
||||
'remoteDesktop.toolbar.clipboardFilesHint': '在遠端複製檔案即可在此下載,或將本機檔案拖放至桌面進行複製。',
|
||||
'remoteDesktop.toolbar.saveFile': '儲存檔案',
|
||||
'remoteDesktop.toolbar.options': '畫質與輸入選項',
|
||||
'remoteDesktop.toolbar.quality': '編碼畫質',
|
||||
'remoteDesktop.toolbar.screenshot': '擷取畫面',
|
||||
'remoteDesktop.toolbar.copyScreenshot': '複製 PNG 至剪貼簿',
|
||||
'remoteDesktop.toolbar.saveScreenshot': '儲存 PNG 截圖',
|
||||
'remoteDesktop.toolbar.fullscreen': '全螢幕',
|
||||
'remoteDesktop.toolbar.exitFullscreen': '離開全螢幕',
|
||||
'remoteDesktop.toolbar.pin': '釘選工具列',
|
||||
'remoteDesktop.toolbar.unpin': '取消釘選工具列',
|
||||
'remoteDesktop.toolbar.popOut': '在新視窗中開啟',
|
||||
'remoteDesktop.toolbar.reconnect': '重新連線',
|
||||
'remoteDesktop.toolbar.disconnect': '中斷連線',
|
||||
'remoteDesktop.toolbar.openSystemRdp': '以系統 RDP 開啟',
|
||||
'remoteDesktop.toolbar.openSystemVnc': '以系統螢幕共享開啟',
|
||||
'remoteDesktop.display.dynamic': '動態調整大小',
|
||||
'remoteDesktop.display.fit': '符合視窗',
|
||||
'remoteDesktop.display.actual': '1:1 原始大小',
|
||||
'remoteDesktop.display.stretch': '延展填滿',
|
||||
'remoteDesktop.display.highDpi': 'Retina 高解析縮放',
|
||||
'remoteDesktop.display.unsupported': '伺服器不支援',
|
||||
'remoteDesktop.toolbar.mapCmdToCtrl': '將 Cmd 對應至 Ctrl',
|
||||
'remoteDesktop.toolbar.showRemoteCursor': '顯示遠端游標',
|
||||
'remoteDesktop.toolbar.refreshScreen': '強制重新整理整個畫面',
|
||||
'remoteDesktop.xvp.title': '遠端電源控制 (XVP)',
|
||||
'remoteDesktop.xvp.reboot': '重新啟動',
|
||||
'remoteDesktop.xvp.shutdown': '關機',
|
||||
'remoteDesktop.xvp.reset': '強制重設',
|
||||
'remoteDesktop.vnc.bell': '遠端桌面響鈴提示',
|
||||
'remoteDesktop.toolbar.moreActions': '更多動作',
|
||||
'remoteDesktop.clipboard.pushNow': '立即推送本機剪貼簿',
|
||||
'remoteDesktop.clipboard.pushed': '已將本機剪貼簿同步至遠端',
|
||||
'remoteDesktop.disconnected.title': '工作階段已中斷連線',
|
||||
'remoteDesktop.auth.reenter': '憑證',
|
||||
'remoteDesktop.auth.cancelled': '已取消身分驗證。',
|
||||
'remoteDesktop.cert.rejected': '使用者已拒絕 TLS 憑證。',
|
||||
'remoteDesktop.step.bastion': '跳板通道',
|
||||
'remoteDesktop.step.network': '網路連線',
|
||||
'remoteDesktop.step.nla': 'NLA 驗證',
|
||||
'remoteDesktop.step.rfb': 'RFB 驗證',
|
||||
'remoteDesktop.step.desktop': '桌面',
|
||||
'remoteDesktop.display.resolutionPresets': '解析度預設',
|
||||
'remoteDesktop.display.customWidth': '寬度',
|
||||
'remoteDesktop.display.customHeight': '高度',
|
||||
'remoteDesktop.display.applyResolution': '套用',
|
||||
'remoteDesktop.display.multiMonitor': '多顯示器配置',
|
||||
'remoteDesktop.display.monitorSingle': '單顯示器',
|
||||
'remoteDesktop.display.monitorDual': '雙螢幕並排',
|
||||
'remoteDesktop.display.monitorAllLocal': '符合本機顯示器',
|
||||
'remoteDesktop.display.monitorAllLocalCount': '符合本機顯示器 ({count})',
|
||||
'remoteDesktop.display.monitorSwitcher': '切換目前顯示器',
|
||||
'remoteDesktop.display.monitorAll': '全部',
|
||||
'remoteDesktop.sharedFolders.title': '共享資料夾 (RDPDR)',
|
||||
'remoteDesktop.sharedFolders.add': '新增資料夾',
|
||||
'remoteDesktop.sharedFolders.empty': '將本機資料夾掛載為遠端 Windows 桌面上的虛擬磁碟機。',
|
||||
'remoteDesktop.sharedFolders.remove': '移除資料夾',
|
||||
'remoteDesktop.sharedFolders.readOnly': '唯讀',
|
||||
'remoteDesktop.sharedFolders.hint': 'Windows:本機 → Netcatty 上的 <資料夾> (\\\\tsclient\\<名稱>)。僅儲存於本機,不會同步至雲端。',
|
||||
'remoteDesktop.sharedFolders.duplicate': '此資料夾已在共享清單中',
|
||||
'remoteDesktop.sharedFolders.mounted': '已在遠端桌面掛載「{name}」',
|
||||
'remoteDesktop.sharedFolders.unmounted': '已卸載「{name}」',
|
||||
'remoteDesktop.network.title': '連線遙測',
|
||||
'remoteDesktop.network.latency': '延遲',
|
||||
'remoteDesktop.network.resolution': '解析度',
|
||||
'remoteDesktop.network.downlink': '下載 (RX)',
|
||||
'remoteDesktop.network.uplink': '上傳 (TX)',
|
||||
'remoteDesktop.network.totalRx': '總接收',
|
||||
'remoteDesktop.network.totalTx': '總傳送',
|
||||
'remoteDesktop.network.tlsEncrypted': 'TLS',
|
||||
'remoteDesktop.network.quality.excellent': '極佳',
|
||||
'remoteDesktop.network.quality.good': '良好',
|
||||
'remoteDesktop.network.quality.fair': '一般',
|
||||
'remoteDesktop.network.quality.poor': '較差',
|
||||
'remoteDesktop.network.quality.unknown': '量測中',
|
||||
'remoteDesktop.ai.controllingBanner': 'Catty 控制中 · 點擊桌面或按 Esc 立即接管',
|
||||
'remoteDesktop.ai.stopControl': '停止',
|
||||
'remoteDesktop.ai.preempted': '已暫停 AI 控制 — 您已接管桌面',
|
||||
'remoteDesktop.ai.preemptedStopped': '已停止 AI 控制 — 您已接管桌面',
|
||||
'remoteDesktop.ai.audit.menuItem': 'AI 操控稽核日誌',
|
||||
'remoteDesktop.ai.audit.title': 'AI 桌面操控稽核日誌',
|
||||
'remoteDesktop.ai.audit.subtitleHost': '記錄此遠端桌面上執行的 AI 滑鼠與鍵盤操作。',
|
||||
'remoteDesktop.ai.audit.subtitleAll': '本機記錄最近 500 筆 AI 遠端桌面操控紀錄(敏感文字已去識別化)。',
|
||||
'remoteDesktop.ai.audit.searchPlaceholder': '依操作、主機或錯誤碼篩選...',
|
||||
'remoteDesktop.ai.audit.scopeSession': '此工作階段',
|
||||
'remoteDesktop.ai.audit.scopeAll': '全部',
|
||||
'remoteDesktop.ai.audit.filterAll': '全部',
|
||||
'remoteDesktop.ai.audit.filterOk': '成功',
|
||||
'remoteDesktop.ai.audit.filterPreempted': '已接管',
|
||||
'remoteDesktop.ai.audit.filterIssues': '封鎖/錯誤',
|
||||
'remoteDesktop.ai.audit.empty': '尚無 AI 遠端桌面操控紀錄。',
|
||||
'remoteDesktop.ai.audit.outcomeOk': '成功',
|
||||
'remoteDesktop.ai.audit.outcomePreempted': '已接管',
|
||||
'remoteDesktop.ai.audit.outcomeBlocked': '已封鎖',
|
||||
'remoteDesktop.ai.audit.outcomeDenied': '已拒絕',
|
||||
'remoteDesktop.ai.audit.outcomeError': '失敗',
|
||||
'remoteDesktop.ai.audit.copyJson': '複製 JSON',
|
||||
'remoteDesktop.ai.audit.copied': '已複製',
|
||||
'remoteDesktop.ai.audit.clear': '清除',
|
||||
|
||||
// LogView — Remote Desktop Recordings & Metadata
|
||||
'logView.recording.download': '下載 .webm',
|
||||
'logView.recording.delete': '刪除錄影',
|
||||
'logView.recording.loading': '正在載入工作階段錄影...',
|
||||
'logView.recording.withAudio': '含音訊',
|
||||
'logView.recording.missingTitle': '錄影檔案已不在磁碟上',
|
||||
'logView.recording.missingDesc': '此 .webm 檔案已被刪除、因保留設定自動清理或移出錄影資料夾。',
|
||||
'logView.recording.playbackErrorTitle': '無法播放錄影',
|
||||
'logView.recording.playbackErrorDesc': '影片檔案可能不完整,或內建播放器不支援此編碼格式。',
|
||||
'logView.recording.exportSuccess': '已匯出錄影檔案',
|
||||
'logView.recording.exportFailed': '匯出錄影失敗',
|
||||
'logView.recording.deleted': '已刪除錄影',
|
||||
'logView.recording.deleteFailed': '刪除錄影失敗',
|
||||
'logView.recording.deleteConfirmTitle': '要刪除此工作階段錄影嗎?',
|
||||
'logView.recording.deleteConfirmDesc': '磁碟上的 .webm 影片檔案將被永久刪除,連線日誌紀錄本身會保留。',
|
||||
'logView.remoteDesktop.noRecordingSubtitle': '此遠端桌面工作階段未錄製影片',
|
||||
'logView.remoteDesktop.host': '主機',
|
||||
'logView.remoteDesktop.protocol': '通訊協定',
|
||||
'logView.remoteDesktop.user': '使用者名稱',
|
||||
'logView.remoteDesktop.started': '開始時間',
|
||||
'logView.remoteDesktop.ended': '結束時間',
|
||||
'logView.remoteDesktop.duration': '持續時間',
|
||||
'logView.remoteDesktop.recordingTip': '點擊遠端桌面工具列的錄製按鈕,或在「設定 → 系統」中開啟自動錄製,即可在此重播 .webm 錄影。',
|
||||
|
||||
// Settings -> System -> Remote Desktop Recordings
|
||||
'settings.remoteDesktopRecordings.title': '遠端桌面錄影',
|
||||
'settings.remoteDesktopRecordings.autoRecord': '自動錄製遠端桌面工作階段',
|
||||
'settings.remoteDesktopRecordings.autoRecordDesc': 'RDP/VNC 工作階段連線成功後自動開始錄製(預設關閉以節省磁碟空間)。',
|
||||
'settings.remoteDesktopRecordings.fps': '錄製影格率',
|
||||
'settings.remoteDesktopRecordings.fpsDesc': '影格率越高畫面越流暢,但會佔用較多 CPU 與磁碟空間。',
|
||||
'settings.remoteDesktopRecordings.fpsOption': '{fps} FPS',
|
||||
'settings.remoteDesktopRecordings.includeAudio': '包含 RDP 音訊',
|
||||
'settings.remoteDesktopRecordings.includeAudioDesc': '在可用時將遠端桌面音訊合併錄製至 .webm 影片中。',
|
||||
'settings.remoteDesktopRecordings.maxStorage': '最大儲存空間上限',
|
||||
'settings.remoteDesktopRecordings.maxStorageDesc': '總使用量超出上限時,自動優先清理最早的未收藏工作階段錄影。',
|
||||
'settings.remoteDesktopRecordings.retentionDays': '錄影保留天數',
|
||||
'settings.remoteDesktopRecordings.retentionDaysDesc': '自動刪除超過保留期限的未收藏工作階段錄影。',
|
||||
'settings.remoteDesktopRecordings.retentionDaysOption': '{days} 天',
|
||||
'settings.remoteDesktopRecordings.retentionUnlimited': '不限制',
|
||||
'settings.remoteDesktopRecordings.storageUsage': '本機錄影儲存使用量',
|
||||
'settings.remoteDesktopRecordings.storageUsageSummary': '{count} 個檔案 · {size}',
|
||||
'settings.remoteDesktopRecordings.storageUsageLoading': '正在計算磁碟使用量...',
|
||||
'settings.remoteDesktopRecordings.refresh': '重新整理儲存統計',
|
||||
'settings.remoteDesktopRecordings.openFolder': '開啟資料夾',
|
||||
'settings.remoteDesktopRecordings.clearAll': '清除全部錄影',
|
||||
'settings.remoteDesktopRecordings.clearAllConfirmTitle': '要清除全部遠端桌面錄影嗎?',
|
||||
'settings.remoteDesktopRecordings.clearAllConfirmDesc': '將從此裝置永久刪除 {count} 個 .webm 錄影檔案。',
|
||||
'settings.remoteDesktopRecordings.clearResult': '已刪除 {count} 個錄影檔案。',
|
||||
'settings.remoteDesktopRecordings.hint': '錄影檔案僅儲存在本裝置本機,絕不上傳雲端同步;已收藏的連線日誌錄影不會在自動清理中被刪除。',
|
||||
|
||||
};
|
||||
@@ -70,11 +70,7 @@ export function pruneInactiveScopedSessions(
|
||||
orphanedSessionIds: string[];
|
||||
} {
|
||||
const orphanedSessionIds = sessions
|
||||
.filter((session) => (
|
||||
(session.scope.type === "terminal" || session.scope.type === "workspace")
|
||||
&& session.scope.targetId
|
||||
&& !activeTargetIds.has(session.scope.targetId)
|
||||
))
|
||||
.filter((session) => session.scope.targetId && !activeTargetIds.has(session.scope.targetId))
|
||||
.filter((session) => !activeSessionIds.has(session.id))
|
||||
.map((session) => session.id);
|
||||
|
||||
|
||||
@@ -116,9 +116,6 @@ function isScopeKeyActive(scopeKey: string, activeTargetIds: Set<string>) {
|
||||
const separatorIndex = scopeKey.indexOf(':');
|
||||
if (separatorIndex === -1) return true;
|
||||
|
||||
const scopeType = scopeKey.slice(0, separatorIndex);
|
||||
if (scopeType === 'global') return true;
|
||||
|
||||
const targetId = scopeKey.slice(separatorIndex + 1);
|
||||
if (!targetId) return true;
|
||||
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
import type { ApprovalRequest } from '../../infrastructure/ai/shared/approvalGate';
|
||||
import toolNameIndex from '../../infrastructure/ai/harness/generated/toolNameIndex.json';
|
||||
import cattyToolSpecs from '../../infrastructure/ai/harness/generated/cattyToolSpecs.json';
|
||||
import { netcattyBridge } from '../../infrastructure/services/netcattyBridge';
|
||||
import {
|
||||
readExternalMcpApprovalAlertMode,
|
||||
type ExternalMcpApprovalAlertMode,
|
||||
} from './useExternalMcpToggleState';
|
||||
|
||||
const mcpToolNameByRpcMethod = toolNameIndex.sidebarByRpcMethod as Record<string, string>;
|
||||
type CatalogToolSpec = {
|
||||
toolName?: string;
|
||||
rpcMethod?: string | null;
|
||||
};
|
||||
|
||||
const mcpToolNameByRpcMethod = new Map<string, string>();
|
||||
for (const spec of cattyToolSpecs as CatalogToolSpec[]) {
|
||||
if (!spec.rpcMethod || !spec.toolName || mcpToolNameByRpcMethod.has(spec.rpcMethod)) continue;
|
||||
mcpToolNameByRpcMethod.set(spec.rpcMethod, spec.toolName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name shown on the External MCP approval card.
|
||||
@@ -16,7 +25,7 @@ const mcpToolNameByRpcMethod = toolNameIndex.sidebarByRpcMethod as Record<string
|
||||
export function externalMcpApprovalToolLabel(toolName: string | undefined): string {
|
||||
const raw = toolName?.trim() || '';
|
||||
if (!raw) return '';
|
||||
return mcpToolNameByRpcMethod[raw] || raw;
|
||||
return mcpToolNameByRpcMethod.get(raw) || raw;
|
||||
}
|
||||
|
||||
export type ExternalMcpApprovalNotification = {
|
||||
|
||||
@@ -24,22 +24,11 @@ export class PluginHostActionResources {
|
||||
const entry = this.entries.get(id);
|
||||
if (!entry) throw new Error('Selected host is unavailable');
|
||||
const host = entry.host;
|
||||
const osValue = typeof host.os === 'string'
|
||||
? Array.from(host.os).filter((ch) => {
|
||||
const code = ch.charCodeAt(0);
|
||||
return code >= 0x20 && code !== 0x7f;
|
||||
}).join('').slice(0, 128)
|
||||
: '';
|
||||
const notesValue = typeof host.notes === 'string'
|
||||
? host.notes.split('\0').join('').slice(0, 4096)
|
||||
: '';
|
||||
return {
|
||||
resourceId: host.id, revision: entry.revision,
|
||||
label: host.label, hostname: host.hostname, username: host.username,
|
||||
...(host.port === undefined ? {} : { port: host.port }), protocol: host.protocol ?? 'ssh',
|
||||
group: host.group ?? '', tags: [...host.tags],
|
||||
...(osValue ? { os: osValue } : {}),
|
||||
...(notesValue ? { notes: notesValue } : {}),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -6,17 +6,10 @@ type WireNode = { id: string; type: 3 | 8; data: string } | {
|
||||
};
|
||||
type WireTree = { children: WireNode[] };
|
||||
|
||||
const validatedTrees = new WeakSet<object>();
|
||||
|
||||
export function isValidatedPluginRemoteTree(tree: unknown): boolean {
|
||||
return Boolean(tree && typeof tree === 'object' && validatedTrees.has(tree));
|
||||
}
|
||||
|
||||
/** Data-only staging area: untrusted changes are never applied directly to the host DOM. */
|
||||
export function createPluginRemoteTree() {
|
||||
const receiver = new RemoteReceiver();
|
||||
let current: WireTree = { children: [] };
|
||||
validatedTrees.add(current);
|
||||
let failed = false;
|
||||
const project = (node: unknown): WireNode => {
|
||||
const value = node as { id: string; type: number; data?: string; element?: string; attributes?: Record<string, string>; children?: unknown[] };
|
||||
@@ -34,13 +27,11 @@ export function createPluginRemoteTree() {
|
||||
receiver.connection.mutate(batch as unknown as Parameters<typeof receiver.connection.mutate>[0]);
|
||||
const next = { children: receiver.root.children.map(project) };
|
||||
validatePluginRemoteTree(next);
|
||||
validatedTrees.add(next);
|
||||
current = next;
|
||||
return next;
|
||||
} catch (error) {
|
||||
failed = true;
|
||||
current = { children: [] };
|
||||
validatedTrees.add(current);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,397 +0,0 @@
|
||||
import type { Host, PortForwardingRule, Snippet } from '../../domain/models';
|
||||
import { applyGroupDefaults, resolveGroupDefaults } from '../../domain/groupConfig';
|
||||
import { materializeHostProxyProfile } from '../../domain/proxyProfiles';
|
||||
import { resolveEffectiveTerminalProtocol } from '../../domain/terminalProtocol';
|
||||
import {
|
||||
migratePortForwardingRulesFromStorage,
|
||||
toPersistedPortForwardingRules,
|
||||
} from '../../domain/portForwardingPersistence';
|
||||
import { STORAGE_KEY_PORT_FORWARDING } from '../../infrastructure/config/storageKeys';
|
||||
import { localStorageAdapter } from '../../infrastructure/persistence/localStorageAdapter';
|
||||
import { netcattyBridge } from '../../infrastructure/services/netcattyBridge';
|
||||
import { preparePluginHostStream } from '../../infrastructure/services/pluginHostStreamService';
|
||||
import { startPortForward, stopAndCleanupRule } from '../../infrastructure/services/portForwardingService';
|
||||
import { captureScreenSnapshot } from '../../infrastructure/scripts/screenSnapshotRegistry';
|
||||
import { activeTabStore } from './activeTabStore';
|
||||
import {
|
||||
getAppSessionRuntime,
|
||||
getAppSettingsRuntime,
|
||||
type AppVaultRuntime,
|
||||
} from './appRuntimeBridge';
|
||||
import type { PluginHostActionResources } from './pluginHostActionResources';
|
||||
|
||||
export type PluginVaultDataContext = {
|
||||
getVault: () => AppVaultRuntime & ReturnType<AppVaultRuntime['readCurrentHostActionState']>;
|
||||
resources: PluginHostActionResources;
|
||||
};
|
||||
|
||||
function readPortForwardRules(): PortForwardingRule[] {
|
||||
const raw = localStorageAdapter.read<PortForwardingRule[]>(STORAGE_KEY_PORT_FORWARDING);
|
||||
return migratePortForwardingRulesFromStorage(Array.isArray(raw) ? raw : []);
|
||||
}
|
||||
|
||||
function writePortForwardRules(rules: PortForwardingRule[]): void {
|
||||
localStorageAdapter.write(STORAGE_KEY_PORT_FORWARDING, toPersistedPortForwardingRules(rules));
|
||||
}
|
||||
|
||||
function summarizePortForwardRule(rule: PortForwardingRule, hosts: readonly Host[]) {
|
||||
const host = rule.hostId ? hosts.find((candidate) => candidate.id === rule.hostId) : undefined;
|
||||
return {
|
||||
id: rule.id,
|
||||
label: rule.label,
|
||||
type: rule.type,
|
||||
localPort: rule.localPort,
|
||||
bindAddress: rule.bindAddress || '127.0.0.1',
|
||||
...(rule.remoteHost ? { remoteHost: rule.remoteHost } : {}),
|
||||
...(typeof rule.remotePort === 'number' && rule.remotePort >= 1 ? { remotePort: rule.remotePort } : {}),
|
||||
...(host?.label ? { hostLabel: host.label } : {}),
|
||||
...(host?.hostname ? { hostname: host.hostname } : {}),
|
||||
status: rule.status ?? 'inactive',
|
||||
...(rule.error ? { error: rule.error.slice(0, 512) } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
function summarizeSnippet(snippet: Snippet) {
|
||||
return {
|
||||
id: snippet.id,
|
||||
label: snippet.label,
|
||||
command: snippet.command,
|
||||
...(snippet.package ? { package: snippet.package } : {}),
|
||||
...(Array.isArray(snippet.tags) && snippet.tags.length > 0 ? { tags: [...snippet.tags] } : {}),
|
||||
...(snippet.shortcut ? { shortcut: snippet.shortcut } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
function effectiveHost(
|
||||
host: Host,
|
||||
vault: Pick<AppVaultRuntime, 'groupConfigs' | 'proxyProfiles'>,
|
||||
): Host {
|
||||
const validProxyProfileIds = new Set(vault.proxyProfiles.map((p) => p.id));
|
||||
const defaults = host.group
|
||||
? resolveGroupDefaults(host.group, vault.groupConfigs, { validProxyProfileIds })
|
||||
: {};
|
||||
return materializeHostProxyProfile(
|
||||
applyGroupDefaults(host, defaults, { validProxyProfileIds }),
|
||||
vault.proxyProfiles,
|
||||
);
|
||||
}
|
||||
|
||||
export async function handlePluginVaultDataRequest(
|
||||
kind: string,
|
||||
payload: Record<string, unknown>,
|
||||
ctx: PluginVaultDataContext,
|
||||
): Promise<unknown> {
|
||||
const vault = ctx.getVault();
|
||||
|
||||
switch (kind) {
|
||||
case 'resolveMetadata': {
|
||||
const hostIds = Array.isArray(payload.hostIds) ? payload.hostIds : [];
|
||||
const hosts: Record<string, Record<string, unknown>> = {};
|
||||
for (const hostId of hostIds) {
|
||||
if (typeof hostId !== 'string') continue;
|
||||
const found = vault.hosts.find((candidate) => candidate.id === hostId);
|
||||
if (!found) continue;
|
||||
const { resourceId: _resourceId, revision: _revision, ...meta } = ctx.resources.metadata(found.id);
|
||||
hosts[hostId] = meta;
|
||||
}
|
||||
return { hosts };
|
||||
}
|
||||
|
||||
case 'prepareConnection': {
|
||||
const hostId = typeof payload.hostId === 'string' ? payload.hostId : '';
|
||||
const host = vault.hosts.find((candidate) => candidate.id === hostId);
|
||||
if (!host) throw new Error('Saved SSH host no longer exists');
|
||||
const settings = getAppSettingsRuntime();
|
||||
if (!settings) throw new Error('Terminal settings unavailable');
|
||||
const connectionOptions = await preparePluginHostStream(host, vault, settings.terminalSettings);
|
||||
return { connectionOptions };
|
||||
}
|
||||
|
||||
case 'prepareProbeTarget': {
|
||||
const hostId = typeof payload.hostId === 'string' ? payload.hostId : '';
|
||||
const rawHost = vault.hosts.find((candidate) => candidate.id === hostId);
|
||||
if (!rawHost) throw new Error('Saved host no longer exists');
|
||||
const host = effectiveHost(rawHost, vault);
|
||||
const defaultProtocol = resolveEffectiveTerminalProtocol(host);
|
||||
const rdpPort = host.rdpConfig?.port ?? (defaultProtocol === 'rdp' ? (host.port || 3389) : undefined);
|
||||
const vncPort = host.vncConfig?.port ?? (defaultProtocol === 'vnc' ? (host.port || 5900) : undefined);
|
||||
const isRemoteDesktopOnly = defaultProtocol === 'rdp' || defaultProtocol === 'vnc';
|
||||
return {
|
||||
hostname: host.hostname,
|
||||
...(!isRemoteDesktopOnly ? { sshPort: host.port || 22 } : {}),
|
||||
...(rdpPort ? { rdpPort } : {}),
|
||||
...(vncPort ? { vncPort } : {}),
|
||||
defaultProtocol,
|
||||
...(host.rdpConfig?.securityMode ? { rdpSecurityMode: host.rdpConfig.securityMode } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
case 'listGroups': {
|
||||
const counts = new Map<string, number>();
|
||||
for (const groupPath of vault.customGroups) {
|
||||
if (groupPath) counts.set(groupPath, counts.get(groupPath) ?? 0);
|
||||
}
|
||||
for (const host of vault.hosts) {
|
||||
if (host.group) counts.set(host.group, (counts.get(host.group) ?? 0) + 1);
|
||||
}
|
||||
const groups = [...counts.entries()]
|
||||
.sort(([a], [b]) => a.localeCompare(b))
|
||||
.slice(0, 1000)
|
||||
.map(([path, hostCount]) => ({ path, hostCount }));
|
||||
return { groups };
|
||||
}
|
||||
|
||||
case 'updateHostNotes': {
|
||||
const hostId = typeof payload.hostId === 'string' ? payload.hostId : '';
|
||||
const notes = typeof payload.notes === 'string' ? payload.notes.slice(0, 4096) : '';
|
||||
const host = vault.hosts.find((candidate) => candidate.id === hostId);
|
||||
if (!host) throw new Error('Saved host no longer exists');
|
||||
if (host.managedSourceId) throw new Error('Managed SSH config hosts cannot be edited directly');
|
||||
vault.updateHosts((prev) => prev.map((item) => (item.id === hostId ? { ...item, notes } : item)));
|
||||
return { updated: true };
|
||||
}
|
||||
|
||||
case 'updateHostTags': {
|
||||
const hostId = typeof payload.hostId === 'string' ? payload.hostId : '';
|
||||
const tags = Array.isArray(payload.tags)
|
||||
? payload.tags.filter((t): t is string => typeof t === 'string' && t.length > 0).slice(0, 128)
|
||||
: [];
|
||||
const host = vault.hosts.find((candidate) => candidate.id === hostId);
|
||||
if (!host) throw new Error('Saved host no longer exists');
|
||||
if (host.managedSourceId) throw new Error('Managed SSH config hosts cannot be edited directly');
|
||||
vault.updateHosts((prev) => prev.map((item) => (item.id === hostId ? { ...item, tags } : item)));
|
||||
return { updated: true };
|
||||
}
|
||||
|
||||
case 'portForward.list': {
|
||||
const rules = readPortForwardRules().slice(0, 500);
|
||||
return { rules: rules.map((rule) => summarizePortForwardRule(rule, vault.hosts)) };
|
||||
}
|
||||
|
||||
case 'portForward.create': {
|
||||
const hostId = typeof payload.hostId === 'string' ? payload.hostId : '';
|
||||
const host = vault.hosts.find((candidate) => candidate.id === hostId);
|
||||
if (!host) throw new Error('Bound host no longer exists');
|
||||
const rule: PortForwardingRule = {
|
||||
id: crypto.randomUUID(),
|
||||
label: String(payload.label ?? '').slice(0, 256),
|
||||
type: (payload.type === 'remote' || payload.type === 'dynamic' ? payload.type : 'local'),
|
||||
localPort: Number(payload.localPort),
|
||||
bindAddress: typeof payload.bindAddress === 'string' && payload.bindAddress ? payload.bindAddress : '127.0.0.1',
|
||||
...(typeof payload.remoteHost === 'string' ? { remoteHost: payload.remoteHost } : {}),
|
||||
...(typeof payload.remotePort === 'number' ? { remotePort: payload.remotePort } : {}),
|
||||
hostId: host.id,
|
||||
status: 'inactive',
|
||||
createdAt: Date.now(),
|
||||
};
|
||||
const existing = readPortForwardRules();
|
||||
writePortForwardRules([...existing, rule]);
|
||||
return { ok: true, rule: summarizePortForwardRule(rule, vault.hosts) };
|
||||
}
|
||||
|
||||
case 'portForward.start': {
|
||||
const ruleId = typeof payload.ruleId === 'string' ? payload.ruleId : '';
|
||||
const rules = readPortForwardRules();
|
||||
const rule = rules.find((item) => item.id === ruleId);
|
||||
if (!rule) return { ok: false, error: 'Port forwarding rule not found' };
|
||||
const rawHost = rule.hostId ? vault.hosts.find((h) => h.id === rule.hostId) : undefined;
|
||||
if (!rawHost) return { ok: false, error: 'Target host for port forwarding rule not found' };
|
||||
const settings = getAppSettingsRuntime();
|
||||
const resolvedHost = effectiveHost(rawHost, vault);
|
||||
const resolvedHosts = vault.hosts.map((h) => effectiveHost(h, vault));
|
||||
const res = await startPortForward(
|
||||
rule,
|
||||
resolvedHost,
|
||||
resolvedHosts,
|
||||
vault.keys,
|
||||
vault.identities,
|
||||
(status, error) => {
|
||||
const latest = readPortForwardRules();
|
||||
writePortForwardRules(latest.map((item) => (item.id === ruleId ? { ...item, status, error } : item)));
|
||||
},
|
||||
false,
|
||||
settings?.terminalSettings,
|
||||
vault.knownHosts,
|
||||
);
|
||||
const updated = readPortForwardRules().find((item) => item.id === ruleId) ?? rule;
|
||||
return {
|
||||
ok: Boolean(res.success),
|
||||
rule: summarizePortForwardRule(updated, vault.hosts),
|
||||
...(res.error ? { error: String(res.error).slice(0, 512) } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
case 'portForward.stop': {
|
||||
const ruleId = typeof payload.ruleId === 'string' ? payload.ruleId : '';
|
||||
const rules = readPortForwardRules();
|
||||
const rule = rules.find((item) => item.id === ruleId);
|
||||
if (!rule) return { ok: false, error: 'Port forwarding rule not found' };
|
||||
await stopAndCleanupRule(ruleId);
|
||||
const latestRules = readPortForwardRules();
|
||||
const nextRules = latestRules.map((item) => (item.id === ruleId ? { ...item, status: 'inactive' as const, error: undefined } : item));
|
||||
writePortForwardRules(nextRules);
|
||||
const updated = nextRules.find((item) => item.id === ruleId) ?? rule;
|
||||
return { ok: true, rule: summarizePortForwardRule(updated, vault.hosts) };
|
||||
}
|
||||
|
||||
case 'portForward.delete': {
|
||||
const ruleId = typeof payload.ruleId === 'string' ? payload.ruleId : '';
|
||||
const rules = readPortForwardRules();
|
||||
if (!rules.some((item) => item.id === ruleId)) {
|
||||
return { ok: false, error: 'Port forwarding rule not found' };
|
||||
}
|
||||
await stopAndCleanupRule(ruleId).catch(() => {});
|
||||
const latestRules = readPortForwardRules();
|
||||
writePortForwardRules(latestRules.filter((item) => item.id !== ruleId));
|
||||
return { ok: true };
|
||||
}
|
||||
|
||||
case 'snippets.list': {
|
||||
const query = typeof payload.query === 'string' ? payload.query.trim().toLowerCase() : '';
|
||||
const tag = typeof payload.tag === 'string' ? payload.tag : '';
|
||||
const pkg = typeof payload.package === 'string' ? payload.package : '';
|
||||
const filtered = vault.snippets.filter((snippet) => {
|
||||
if (pkg && snippet.package !== pkg) return false;
|
||||
if (tag && !(snippet.tags ?? []).includes(tag)) return false;
|
||||
if (query) {
|
||||
const hay = `${snippet.label} ${snippet.command} ${(snippet.tags ?? []).join(' ')}`.toLowerCase();
|
||||
if (!hay.includes(query)) return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
return { snippets: filtered.slice(0, 1000).map(summarizeSnippet) };
|
||||
}
|
||||
|
||||
case 'snippets.get': {
|
||||
const id = typeof payload.id === 'string' ? payload.id : '';
|
||||
const found = vault.snippets.find((item) => item.id === id);
|
||||
return found ? { found: true, snippet: summarizeSnippet(found) } : { found: false };
|
||||
}
|
||||
|
||||
case 'snippets.save': {
|
||||
const id = typeof payload.id === 'string' && payload.id ? payload.id : crypto.randomUUID();
|
||||
const existing = vault.snippets.find((item) => item.id === id);
|
||||
const nextSnippet: Snippet = {
|
||||
...(existing ?? {}),
|
||||
id,
|
||||
label: String(payload.label ?? '').slice(0, 256),
|
||||
command: String(payload.command ?? '').slice(0, 65536),
|
||||
...(typeof payload.package === 'string' ? { package: payload.package } : {}),
|
||||
...(Array.isArray(payload.tags) ? { tags: payload.tags.filter((t): t is string => typeof t === 'string') } : {}),
|
||||
...(typeof payload.shortcut === 'string' ? { shortcut: payload.shortcut } : {}),
|
||||
};
|
||||
const nextList = existing
|
||||
? vault.snippets.map((item) => (item.id === id ? nextSnippet : item))
|
||||
: [...vault.snippets, nextSnippet];
|
||||
vault.updateSnippets(nextList);
|
||||
return { snippet: summarizeSnippet(nextSnippet) };
|
||||
}
|
||||
|
||||
case 'snippets.delete': {
|
||||
const id = typeof payload.id === 'string' ? payload.id : '';
|
||||
const exists = vault.snippets.some((item) => item.id === id);
|
||||
if (exists) {
|
||||
vault.updateSnippets(vault.snippets.filter((item) => item.id !== id));
|
||||
}
|
||||
return { deleted: exists };
|
||||
}
|
||||
|
||||
case 'terminals.listSessions': {
|
||||
const sessionRuntime = getAppSessionRuntime();
|
||||
const activeId = activeTabStore.getActiveTabId();
|
||||
const sessions = (sessionRuntime?.sessions ?? []).slice(0, 200).map((session) => ({
|
||||
sessionId: session.id,
|
||||
label: session.hostLabel || session.hostname || session.id,
|
||||
hostname: session.hostname || '',
|
||||
...(session.username ? { username: session.username } : {}),
|
||||
protocol: session.protocol || 'ssh',
|
||||
status: session.status || 'connecting',
|
||||
...(session.workspaceId ? { workspaceId: session.workspaceId } : {}),
|
||||
active: session.id === activeId || (Boolean(session.workspaceId) && session.workspaceId === activeId),
|
||||
}));
|
||||
return { sessions };
|
||||
}
|
||||
|
||||
case 'terminals.readScreen': {
|
||||
const sessionId = typeof payload.sessionId === 'string' ? payload.sessionId : '';
|
||||
const maxRows = typeof payload.maxRows === 'number' ? Math.max(1, Math.min(300, payload.maxRows)) : 80;
|
||||
const sessionRuntime = getAppSessionRuntime();
|
||||
if (!sessionRuntime?.sessions.some((s) => s.id === sessionId)) {
|
||||
throw new Error('Terminal session not found');
|
||||
}
|
||||
const snapshot = captureScreenSnapshot(sessionId);
|
||||
const lines = (snapshot.lines ?? []).slice(-maxRows);
|
||||
return {
|
||||
sessionId,
|
||||
rows: snapshot.rows ?? lines.length,
|
||||
cols: snapshot.cols ?? 80,
|
||||
lines,
|
||||
};
|
||||
}
|
||||
|
||||
case 'terminals.sendInput': {
|
||||
const sessionId = typeof payload.sessionId === 'string' ? payload.sessionId : '';
|
||||
const data = typeof payload.data === 'string' ? payload.data : '';
|
||||
const sessionRuntime = getAppSessionRuntime();
|
||||
if (!sessionRuntime?.sessions.some((s) => s.id === sessionId)) {
|
||||
throw new Error('Terminal session not found');
|
||||
}
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.writeToSession) throw new Error('Terminal input bridge is unavailable');
|
||||
bridge.writeToSession(sessionId, data);
|
||||
return { sent: true };
|
||||
}
|
||||
|
||||
case 'terminals.openLocal': {
|
||||
const sessionRuntime = getAppSessionRuntime();
|
||||
if (!sessionRuntime?.createLocalTerminal) throw new Error('Local terminal is unavailable');
|
||||
const sessionId = sessionRuntime.createLocalTerminal();
|
||||
return { opened: true, ...(typeof sessionId === 'string' ? { sessionId } : {}) };
|
||||
}
|
||||
|
||||
case 'workspace.listTabs': {
|
||||
const sessionRuntime = getAppSessionRuntime();
|
||||
const activeTabId = activeTabStore.getActiveTabId();
|
||||
const tabs: Array<{ id: string; kind: 'vault' | 'sftp' | 'session' | 'workspace' | 'log'; title: string; active: boolean }> = [
|
||||
{ id: 'vault', kind: 'vault', title: 'Vault', active: activeTabId === 'vault' },
|
||||
{ id: 'sftp', kind: 'sftp', title: 'SFTP', active: activeTabId === 'sftp' },
|
||||
];
|
||||
for (const workspace of sessionRuntime?.workspaces ?? []) {
|
||||
tabs.push({ id: workspace.id, kind: 'workspace', title: workspace.title || 'Workspace', active: activeTabId === workspace.id });
|
||||
}
|
||||
for (const session of sessionRuntime?.sessions ?? []) {
|
||||
if (session.workspaceId) continue;
|
||||
tabs.push({ id: session.id, kind: 'session', title: session.hostLabel || session.hostname || 'Terminal', active: activeTabId === session.id });
|
||||
}
|
||||
for (const logView of sessionRuntime?.logViews ?? []) {
|
||||
tabs.push({ id: logView.id, kind: 'log', title: logView.title || 'Log', active: activeTabId === logView.id });
|
||||
}
|
||||
return { activeTabId, tabs: tabs.slice(0, 200) };
|
||||
}
|
||||
|
||||
case 'workspace.focusTab': {
|
||||
const tabId = typeof payload.tabId === 'string' ? payload.tabId : '';
|
||||
const sessionRuntime = getAppSessionRuntime();
|
||||
const known = new Set<string>(['vault', 'sftp']);
|
||||
for (const workspace of sessionRuntime?.workspaces ?? []) known.add(workspace.id);
|
||||
for (const session of sessionRuntime?.sessions ?? []) {
|
||||
if (!session.workspaceId) known.add(session.id);
|
||||
}
|
||||
for (const logView of sessionRuntime?.logViews ?? []) known.add(logView.id);
|
||||
let resolvedTabId = known.has(tabId) ? tabId : null;
|
||||
if (!resolvedTabId) {
|
||||
const memberSession = (sessionRuntime?.sessions ?? []).find((s) => s.id === tabId && s.workspaceId);
|
||||
if (memberSession?.workspaceId && known.has(memberSession.workspaceId)) {
|
||||
resolvedTabId = memberSession.workspaceId;
|
||||
}
|
||||
}
|
||||
if (!resolvedTabId) return { focused: false };
|
||||
if (sessionRuntime?.setActiveTabId) sessionRuntime.setActiveTabId(resolvedTabId);
|
||||
else activeTabStore.setActiveTabId(resolvedTabId);
|
||||
return { focused: true };
|
||||
}
|
||||
|
||||
default:
|
||||
throw new Error(`Unsupported Vault data request: ${kind}`);
|
||||
}
|
||||
}
|
||||
@@ -39,24 +39,3 @@ test('idle instances are evicted while active instances are never silently repla
|
||||
assert.throws(() => store.acquire('two', f.bridge, request), /Too many/); first.release();
|
||||
const second = store.acquire('two', f.bridge, request); assert.notEqual(second, first); assert.equal(f.closes.length, 1); store.dispose();
|
||||
});
|
||||
test('cssUnchanged updates retain previously validated stylesheet and peek returns live session synchronously', () => {
|
||||
const f = fixture(); const store = new PluginViewSessions();
|
||||
assert.equal(store.peek('view'), null);
|
||||
const view = store.acquire('view', f.bridge, request); const id = f.opened[0].instanceId;
|
||||
assert.equal(store.peek('view'), view);
|
||||
f.update({ kind: 'host-ui.update', viewId: request.viewId, instanceId: id, sequence: 1, css: '.a{display:flex}', mutations: [] });
|
||||
assert.equal(view.getSnapshot().css, '.a{display:flex}');
|
||||
f.update({ kind: 'host-ui.update', viewId: request.viewId, instanceId: id, sequence: 2, css: '', cssUnchanged: true, mutations: [[0, '~', { id: 't', type: 3, data: 'hi' }, 0]] } as Update);
|
||||
assert.equal(view.getSnapshot().css, '.a{display:flex}');
|
||||
assert.deepEqual(view.getSnapshot().tree.children[0], { id: 't', type: 3, data: 'hi' });
|
||||
store.dispose();
|
||||
});
|
||||
test('empty first update holds loading briefly to prevent blank-frame flash then completes cleanly', async () => {
|
||||
const f = fixture(); const store = new PluginViewSessions();
|
||||
const view = store.acquire('empty-grace', f.bridge, request); const id = f.opened[0].instanceId;
|
||||
f.update({ kind: 'host-ui.update', viewId: request.viewId, instanceId: id, sequence: 1, css: '', mutations: [] });
|
||||
assert.equal(view.getSnapshot().loading, true, 'empty first update holds loading briefly');
|
||||
await new Promise((resolve) => setTimeout(resolve, 90));
|
||||
assert.equal(view.getSnapshot().loading, false, 'truly empty view finishes loading after grace window');
|
||||
store.dispose();
|
||||
});
|
||||
@@ -6,17 +6,6 @@ import type { HostDrawnViewEvent } from '@netcatty/plugin-contract';
|
||||
type Bridge = Pick<NonNullable<ReturnType<typeof import('../../infrastructure/services/netcattyBridge').netcattyBridge.get>>, 'openHostDrawnPluginView' | 'closeHostDrawnPluginView' | 'onHostDrawnPluginViewUpdate' | 'onPluginViewClosed' | 'sendHostDrawnPluginViewEvent' | 'getPluginViewResource'>;
|
||||
export type PluginViewSnapshot = { tree: ReturnType<ReturnType<typeof createPluginRemoteTree>['snapshot']>; css: string; loading: boolean; error: boolean; settled: boolean };
|
||||
const empty = (): PluginViewSnapshot => ({ tree: { children: [] }, css: '', loading: true, error: false, settled: true });
|
||||
const EMPTY_FIRST_FRAME_GRACE_MS = 60;
|
||||
|
||||
function hasRenderableTreeContent(tree: PluginViewSnapshot['tree']): boolean {
|
||||
for (const child of tree.children) {
|
||||
if (child.type === 3 && child.data.trim().length > 0) return true;
|
||||
if (child.type === 1) {
|
||||
if (child.element !== 'div' || child.children.length > 0) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Owns a window's bounded, retained UI instances independently of React mounts. */
|
||||
export class PluginViewSessions {
|
||||
@@ -26,15 +15,13 @@ export class PluginViewSessions {
|
||||
const id = crypto.randomUUID();
|
||||
const tree = createPluginRemoteTree();
|
||||
let state = empty(); let sequence = 1; let eventId = 0; let disposed = false; let users = 0;
|
||||
let lastRawCss: string | null = null;
|
||||
let timer: ReturnType<typeof setTimeout> | undefined;
|
||||
let emptyFrameTimer: ReturnType<typeof setTimeout> | undefined;
|
||||
const listeners = new Set<() => void>();
|
||||
const publish = (next: PluginViewSnapshot) => { state = next; for (const listener of listeners) listener(); };
|
||||
const cleanup: Array<() => void> = [];
|
||||
const dispose = (failed = false) => {
|
||||
if (disposed) return;
|
||||
disposed = true; clearTimeout(timer); clearTimeout(emptyFrameTimer); cleanup.forEach((stop) => stop());
|
||||
disposed = true; clearTimeout(timer); cleanup.forEach((stop) => stop());
|
||||
this.sessions.delete(key);
|
||||
publish({ ...empty(), loading: false, error: failed });
|
||||
void bridge.closeHostDrawnPluginView?.(id).catch(() => {});
|
||||
@@ -44,30 +31,7 @@ export class PluginViewSessions {
|
||||
if (disposed || update.kind !== 'host-ui.update' || update.instanceId !== id || update.viewId !== request.viewId) return;
|
||||
try {
|
||||
if (update.sequence !== sequence++) throw new Error('Invalid plugin update order');
|
||||
const nextCss = update.cssUnchanged
|
||||
? state.css
|
||||
: (lastRawCss !== null && update.css === lastRawCss)
|
||||
? state.css
|
||||
: ((lastRawCss = update.css), validatePluginStylesheet(update.css));
|
||||
const nextTree = tree.apply(update.mutations);
|
||||
const settled = (update.acknowledgedEvent ?? 0) >= eventId;
|
||||
if (state.loading && !hasRenderableTreeContent(nextTree)) {
|
||||
// Hold the host loading surface briefly while an older SDK flushes its
|
||||
// initial React commit so users never see an empty blank frame flash.
|
||||
publish({ tree: nextTree, css: nextCss, loading: true, error: false, settled });
|
||||
if (emptyFrameTimer === undefined) {
|
||||
emptyFrameTimer = setTimeout(() => {
|
||||
emptyFrameTimer = undefined;
|
||||
if (!disposed && state.loading) publish({ ...state, loading: false });
|
||||
}, EMPTY_FIRST_FRAME_GRACE_MS);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (emptyFrameTimer !== undefined) {
|
||||
clearTimeout(emptyFrameTimer);
|
||||
emptyFrameTimer = undefined;
|
||||
}
|
||||
publish({ tree: nextTree, css: nextCss, loading: false, error: false, settled });
|
||||
publish({ tree: tree.apply(update.mutations), css: validatePluginStylesheet(update.css), loading: false, error: false, settled: (update.acknowledgedEvent ?? 0) >= eventId });
|
||||
} catch { dispose(true); }
|
||||
}));
|
||||
cleanup.push(bridge.onPluginViewClosed((event) => { if (event.instanceId === id) dispose(true); }));
|
||||
@@ -105,9 +69,6 @@ export class PluginViewSessions {
|
||||
dispose,
|
||||
};
|
||||
}
|
||||
peek(key: string) {
|
||||
return this.sessions.get(key) ?? null;
|
||||
}
|
||||
acquire(key: string, bridge: Bridge, request: Omit<import('@netcatty/plugin-contract').HostDrawnViewOpenRequest, 'instanceId'>) {
|
||||
let session = this.sessions.get(key);
|
||||
if (!session) {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { netcattyBridge } from '../../infrastructure/services/netcattyBridge';
|
||||
|
||||
type CloseablePluginViewSessions = {
|
||||
closeView(viewId: string): void;
|
||||
};
|
||||
@@ -18,7 +16,3 @@ export function registerLoadedPluginViewSessions(sessions: CloseablePluginViewSe
|
||||
export function closePluginViewSessionIfLoaded(viewId: string): void {
|
||||
loadedSessions?.closeView(viewId);
|
||||
}
|
||||
|
||||
export function prewarmHostDrawnPluginView(viewId: string): void {
|
||||
void netcattyBridge.get()?.prewarmHostDrawnPluginView?.(viewId)?.catch?.(() => {});
|
||||
}
|
||||
@@ -14,15 +14,11 @@ const getSession = (sessionId: string) => (
|
||||
|
||||
function createHarness() {
|
||||
const changes: Change[] = [];
|
||||
const nested: boolean[] = [];
|
||||
const controller = createPromptHostnameSessionSignalController({
|
||||
getSession,
|
||||
onChange: (sessionId, hostname, options) => {
|
||||
changes.push([sessionId, hostname]);
|
||||
nested.push(options?.fromJumpServer === true);
|
||||
},
|
||||
onChange: (sessionId, hostname) => changes.push([sessionId, hostname]),
|
||||
});
|
||||
return { changes, controller, nested };
|
||||
return { changes, controller };
|
||||
}
|
||||
|
||||
test('prompt observations are independent of IP, alias, and matching connection addresses', () => {
|
||||
@@ -56,56 +52,11 @@ test('prompt host controller observes the initial jumpserver prompt', () => {
|
||||
});
|
||||
|
||||
test('prompt host controller publishes a nested target and de-duplicates it', () => {
|
||||
const { changes, controller, nested } = createHarness();
|
||||
controller.handleTerminalOutput('ssh-1', 'Welcome\r\nOpt> ');
|
||||
const { changes, controller } = createHarness();
|
||||
controller.handleTerminalOutput('ssh-1', '[root@jump.example.com ~]# ');
|
||||
controller.handleTerminalOutput('ssh-1', 'ssh root@10.1.64.1\r\n[root@10.1.64.1 ~]# ');
|
||||
controller.handleTerminalOutput('ssh-1', '\r\n[root@10.1.64.1 ~]# ');
|
||||
assert.deepEqual(changes, [['ssh-1', '10.1.64.1']]);
|
||||
assert.deepEqual(nested, [true]);
|
||||
});
|
||||
|
||||
test('prompt host controller marks ordinary direct prompts as non-jump hosts', () => {
|
||||
const { changes, controller, nested } = createHarness();
|
||||
controller.handleTerminalOutput('ssh-1', 'Last login\r\n[root@vm-prod ~]# ');
|
||||
assert.deepEqual(changes, [['ssh-1', 'vm-prod']]);
|
||||
assert.deepEqual(nested, [false]);
|
||||
});
|
||||
|
||||
test('prompt host controller tracks a JumpServer menu split across chunks', () => {
|
||||
const { changes, controller, nested } = createHarness();
|
||||
controller.handleTerminalOutput('ssh-1', 'Welcome\r\nO');
|
||||
controller.handleTerminalOutput('ssh-1', 'pt> ');
|
||||
controller.handleTerminalOutput('ssh-1', '10.1.64.1\r\n[root@k8s-10-1-64-1 ~]# ');
|
||||
assert.deepEqual(changes, [['ssh-1', 'k8s-10-1-64-1']]);
|
||||
assert.deepEqual(nested, [true]);
|
||||
});
|
||||
|
||||
test('prompt host controller detects ANSI-styled JumpServer menus and upgrades matching hostnames', () => {
|
||||
const { changes, controller, nested } = createHarness();
|
||||
controller.handleTerminalOutput('ssh-1', '[root@app-01 ~]# ');
|
||||
controller.handleTerminalOutput('ssh-1', 'ssh jump\r\n\x1b[32mOpt\x1b[0m> \r\n[root@app-01 ~]# ');
|
||||
assert.deepEqual(changes, [['ssh-1', 'app-01'], ['ssh-1', 'app-01']]);
|
||||
assert.deepEqual(nested, [false, true]);
|
||||
});
|
||||
|
||||
test('prompt host controller detects consumed JumpServer prompts in coalesced output', () => {
|
||||
for (const coalesced of [
|
||||
'Welcome\r\nOpt> 42\r\n[root@target-01 ~]# ',
|
||||
'Welcome\r\n[Host]> 10.1.64.1\r\n[root@target-01 ~]# ',
|
||||
'Welcome\r\n\x1b[32mOpt> \x1b[0m42\r\n[root@target-01 ~]# ',
|
||||
]) {
|
||||
const { changes, controller, nested } = createHarness();
|
||||
controller.handleTerminalOutput('ssh-1', coalesced);
|
||||
assert.deepEqual(changes, [['ssh-1', 'target-01']], JSON.stringify(coalesced));
|
||||
assert.deepEqual(nested, [true], JSON.stringify(coalesced));
|
||||
}
|
||||
|
||||
// Also works when the consumed menu prompt is split across chunks.
|
||||
const { changes, controller, nested } = createHarness();
|
||||
controller.handleTerminalOutput('ssh-1', 'Welcome\r\nO');
|
||||
controller.handleTerminalOutput('ssh-1', 'pt> 42\r\n[root@target-02 ~]# ');
|
||||
assert.deepEqual(changes, [['ssh-1', 'target-02']]);
|
||||
assert.deepEqual(nested, [true]);
|
||||
assert.deepEqual(changes, [['ssh-1', getSession('ssh-1').hostname], ['ssh-1', '10.1.64.1']]);
|
||||
});
|
||||
|
||||
test('prompt host controller observes the original host when returning from a target', () => {
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
import type { TerminalSession } from '../../domain/models';
|
||||
import {
|
||||
extractTerminalPromptHostname,
|
||||
isJumpServerMenuLine,
|
||||
isJumpServerMenuPrompt,
|
||||
} from '../../domain/terminalPromptSecurity';
|
||||
|
||||
type PromptHostnameSessionSignalOptions = {
|
||||
getSession: (sessionId: string) => Pick<TerminalSession, 'protocol'> | undefined;
|
||||
onChange: (
|
||||
sessionId: string,
|
||||
hostname: string | null,
|
||||
options: { fromJumpServer: boolean },
|
||||
) => void;
|
||||
onChange: (sessionId: string, hostname: string | null) => void;
|
||||
maxTailChars?: number;
|
||||
};
|
||||
|
||||
@@ -28,19 +23,17 @@ export function createPromptHostnameSessionSignalController({
|
||||
}: PromptHostnameSessionSignalOptions) {
|
||||
const tails = new Map<string, string>();
|
||||
const published = new Map<string, string>();
|
||||
const jumpServerSessions = new Set<string>();
|
||||
const tailLimit = Math.max(256, maxTailChars);
|
||||
|
||||
const forgetSession = (sessionId: string): void => {
|
||||
tails.delete(sessionId);
|
||||
published.delete(sessionId);
|
||||
jumpServerSessions.delete(sessionId);
|
||||
};
|
||||
|
||||
return {
|
||||
forgetSession,
|
||||
pruneSessions(validSessionIds: ReadonlySet<string>): void {
|
||||
for (const sessionId of [...tails.keys(), ...published.keys(), ...jumpServerSessions]) {
|
||||
for (const sessionId of [...tails.keys(), ...published.keys()]) {
|
||||
if (!validSessionIds.has(sessionId)) {
|
||||
forgetSession(sessionId);
|
||||
}
|
||||
@@ -57,19 +50,12 @@ export function createPromptHostnameSessionSignalController({
|
||||
const combined = `${tails.get(sessionId) ?? ''}${chunk}`;
|
||||
const tail = combined.slice(-tailLimit);
|
||||
tails.set(sessionId, tail);
|
||||
if (
|
||||
!jumpServerSessions.has(sessionId)
|
||||
&& combined.includes('>')
|
||||
&& combined.split(/\r\n|\r|\n/u).some((line) => isJumpServerMenuLine(line))
|
||||
) {
|
||||
jumpServerSessions.add(sessionId);
|
||||
}
|
||||
|
||||
const detected = extractTerminalPromptHostname(tail);
|
||||
if (!detected) {
|
||||
if (isJumpServerMenuPrompt(tail) && published.has(sessionId)) {
|
||||
published.delete(sessionId);
|
||||
onChange(sessionId, null, { fromJumpServer: true });
|
||||
onChange(sessionId, null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -77,13 +63,11 @@ export function createPromptHostnameSessionSignalController({
|
||||
const detectedKey = normalizedHostname(detected);
|
||||
if (!detectedKey) return;
|
||||
|
||||
const fromJumpServer = jumpServerSessions.has(sessionId);
|
||||
const publishKey = `${detectedKey}\0${fromJumpServer ? '1' : '0'}`;
|
||||
// Observe the prompt, not whether its hostname matches an IP or DNS alias.
|
||||
// The domain title policy decides if this presentation is shown.
|
||||
if (published.get(sessionId) === publishKey) return;
|
||||
published.set(sessionId, publishKey);
|
||||
onChange(sessionId, detected, { fromJumpServer });
|
||||
if (published.get(sessionId) === detectedKey) return;
|
||||
published.set(sessionId, detectedKey);
|
||||
onChange(sessionId, detected);
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -1,12 +1,4 @@
|
||||
import type { Host, SerialConfig, TerminalSession } from "../../domain/models";
|
||||
import {
|
||||
DEFAULT_RDP_PORT,
|
||||
DEFAULT_VNC_PORT,
|
||||
isRemoteDesktopProtocol,
|
||||
sanitizeRdpConfig,
|
||||
sanitizeVncConfig,
|
||||
type RemoteDesktopProtocol,
|
||||
} from "../../domain/remoteDesktop";
|
||||
import { classifyLocalShellType } from "../../lib/localShell";
|
||||
|
||||
export interface LocalTerminalOptions {
|
||||
@@ -129,30 +121,6 @@ export const createHostTerminalSession = (
|
||||
};
|
||||
}
|
||||
|
||||
if (isRemoteDesktopProtocol(host.protocol)) {
|
||||
const protocol = host.protocol;
|
||||
const sanitizedRdp = protocol === "rdp" ? sanitizeRdpConfig(host.rdpConfig) : undefined;
|
||||
const sanitizedVnc = protocol === "vnc" ? sanitizeVncConfig(host.vncConfig) : undefined;
|
||||
const defaultPort = protocol === "rdp" ? DEFAULT_RDP_PORT : DEFAULT_VNC_PORT;
|
||||
const resolvedPort =
|
||||
(protocol === "rdp" ? sanitizedRdp?.port : sanitizedVnc?.port)
|
||||
?? host.port
|
||||
?? defaultPort;
|
||||
return {
|
||||
id: sessionId,
|
||||
hostId: host.id,
|
||||
hostLabel: host.label || host.hostname,
|
||||
hostname: host.hostname,
|
||||
username: host.username ?? "",
|
||||
status: "connecting",
|
||||
protocol,
|
||||
port: resolvedPort,
|
||||
...(sanitizedRdp ? { rdpConfig: sanitizedRdp } : {}),
|
||||
...(sanitizedVnc ? { vncConfig: sanitizedVnc } : {}),
|
||||
...(host.ephemeral ? { ephemeralHost: true } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
id: sessionId,
|
||||
hostId: host.id,
|
||||
@@ -197,39 +165,6 @@ export const createHostTerminalSession = (
|
||||
};
|
||||
};
|
||||
|
||||
export const createRemoteDesktopSession = (
|
||||
sessionId: string,
|
||||
host: Host,
|
||||
protocol: RemoteDesktopProtocol,
|
||||
options?: { workspaceId?: string },
|
||||
): TerminalSession => {
|
||||
const isCompanion = host.protocol !== protocol;
|
||||
const sanitizedRdp = protocol === "rdp" ? sanitizeRdpConfig(host.rdpConfig) : undefined;
|
||||
const sanitizedVnc = protocol === "vnc" ? sanitizeVncConfig(host.vncConfig) : undefined;
|
||||
const defaultPort = protocol === "rdp" ? DEFAULT_RDP_PORT : DEFAULT_VNC_PORT;
|
||||
const resolvedPort = isCompanion
|
||||
? ((protocol === "rdp" ? sanitizedRdp?.port : sanitizedVnc?.port) ?? defaultPort)
|
||||
: ((protocol === "rdp" ? sanitizedRdp?.port : sanitizedVnc?.port) ?? host.port ?? defaultPort);
|
||||
const baseLabel = host.label || host.hostname;
|
||||
const hostLabel = isCompanion ? `${baseLabel} (${protocol.toUpperCase()})` : baseLabel;
|
||||
|
||||
return {
|
||||
id: sessionId,
|
||||
hostId: host.id,
|
||||
hostLabel,
|
||||
hostname: host.hostname,
|
||||
username: (protocol === "rdp" ? sanitizedRdp?.username : sanitizedVnc?.username) ?? host.username ?? "",
|
||||
status: "connecting",
|
||||
protocol,
|
||||
port: resolvedPort,
|
||||
...(sanitizedRdp ? { rdpConfig: sanitizedRdp } : {}),
|
||||
...(sanitizedVnc ? { vncConfig: sanitizedVnc } : {}),
|
||||
...(isCompanion ? { remoteDesktopCompanion: true } : {}),
|
||||
...(host.ephemeral ? { ephemeralHost: true } : {}),
|
||||
...(options?.workspaceId ? { workspaceId: options.workspaceId } : {}),
|
||||
};
|
||||
};
|
||||
|
||||
export const createWorkspaceHostTerminalSession = (
|
||||
sessionId: string,
|
||||
host: Host,
|
||||
|
||||
@@ -131,14 +131,13 @@ test('session snapshot distinguishes missing fields from null tombstones', () =>
|
||||
|
||||
test('prompt hostnames overlay as presentation without replacing configured hostname', () => {
|
||||
sessionPresentationStore.clearSession('prompt-host');
|
||||
publishSessionPromptHost('prompt-host', '10.1.64.1', { fromJumpServer: true });
|
||||
publishSessionPromptHost('prompt-host', '10.1.64.1');
|
||||
const merged = applySessionPresentation(session({
|
||||
id: 'prompt-host',
|
||||
hostLabel: 'jumpserver',
|
||||
hostname: 'jumpserver.example.com',
|
||||
}));
|
||||
assert.equal(merged.promptHostname, '10.1.64.1');
|
||||
assert.equal(merged.promptHostnameFromJumpServer, true);
|
||||
assert.equal(merged.hostname, 'jumpserver.example.com');
|
||||
sessionPresentationStore.clearSession('prompt-host');
|
||||
});
|
||||
@@ -5,14 +5,13 @@ import type { CodingCliProviderId } from '../../domain/codingCliProviders';
|
||||
export type SessionPresentation = {
|
||||
dynamicTitle?: string | null;
|
||||
promptHostname?: string | null;
|
||||
promptHostnameFromJumpServer?: boolean | null;
|
||||
codingCliProviderId?: CodingCliProviderId | null;
|
||||
};
|
||||
|
||||
type Listener = () => void;
|
||||
|
||||
/** Encode undefined / null / present distinctly for useSyncExternalStore snapshots. */
|
||||
function encodePresentationField(value: string | boolean | null | undefined): string {
|
||||
function encodePresentationField(value: string | null | undefined): string {
|
||||
if (value === undefined) return 'u';
|
||||
if (value === null) return 'n';
|
||||
return `v:${value}`;
|
||||
@@ -43,7 +42,7 @@ class SessionPresentationStore {
|
||||
getSessionSnapshot = (sessionId: string): string => {
|
||||
const presentation = this.bySession.get(sessionId);
|
||||
if (!presentation) return '';
|
||||
return `${encodePresentationField(presentation.dynamicTitle)}\0${encodePresentationField(presentation.promptHostname)}\0${encodePresentationField(presentation.promptHostnameFromJumpServer)}\0${encodePresentationField(presentation.codingCliProviderId)}`;
|
||||
return `${encodePresentationField(presentation.dynamicTitle)}\0${encodePresentationField(presentation.promptHostname)}\0${encodePresentationField(presentation.codingCliProviderId)}`;
|
||||
};
|
||||
|
||||
subscribe = (listener: Listener): (() => void) => {
|
||||
@@ -62,7 +61,6 @@ class SessionPresentationStore {
|
||||
if (
|
||||
prev.dynamicTitle === next.dynamicTitle
|
||||
&& prev.promptHostname === next.promptHostname
|
||||
&& prev.promptHostnameFromJumpServer === next.promptHostnameFromJumpServer
|
||||
&& prev.codingCliProviderId === next.codingCliProviderId
|
||||
) {
|
||||
return;
|
||||
@@ -106,22 +104,14 @@ export function publishSessionCodingCliProvider(
|
||||
sessionPresentationStore.setPresentation(sessionId, { codingCliProviderId: providerId });
|
||||
}
|
||||
|
||||
export function publishSessionPromptHost(
|
||||
sessionId: string,
|
||||
hostname: string | null,
|
||||
options: { fromJumpServer?: boolean } = {},
|
||||
): void {
|
||||
sessionPresentationStore.setPresentation(sessionId, {
|
||||
promptHostname: hostname,
|
||||
promptHostnameFromJumpServer: hostname && options.fromJumpServer === true ? true : null,
|
||||
});
|
||||
export function publishSessionPromptHost(sessionId: string, hostname: string | null): void {
|
||||
sessionPresentationStore.setPresentation(sessionId, { promptHostname: hostname });
|
||||
}
|
||||
|
||||
type SessionWithPresentation = {
|
||||
id: string;
|
||||
dynamicTitle?: string;
|
||||
promptHostname?: string;
|
||||
promptHostnameFromJumpServer?: boolean;
|
||||
codingCliProviderId?: CodingCliProviderId;
|
||||
};
|
||||
|
||||
@@ -139,16 +129,12 @@ export function applySessionPresentation<T extends SessionWithPresentation>(sess
|
||||
const nextPromptHost = presentation.promptHostname === undefined
|
||||
? session.promptHostname
|
||||
: (presentation.promptHostname ?? undefined);
|
||||
const nextPromptHostFromJumpServer = presentation.promptHostnameFromJumpServer === undefined
|
||||
? session.promptHostnameFromJumpServer
|
||||
: (presentation.promptHostnameFromJumpServer ?? undefined);
|
||||
const nextProvider = presentation.codingCliProviderId === undefined
|
||||
? session.codingCliProviderId
|
||||
: (presentation.codingCliProviderId ?? undefined);
|
||||
if (
|
||||
nextTitle === session.dynamicTitle
|
||||
&& nextPromptHost === session.promptHostname
|
||||
&& nextPromptHostFromJumpServer === session.promptHostnameFromJumpServer
|
||||
&& nextProvider === session.codingCliProviderId
|
||||
) {
|
||||
return session;
|
||||
@@ -157,7 +143,6 @@ export function applySessionPresentation<T extends SessionWithPresentation>(sess
|
||||
...session,
|
||||
dynamicTitle: nextTitle,
|
||||
promptHostname: nextPromptHost,
|
||||
promptHostnameFromJumpServer: nextPromptHostFromJumpServer,
|
||||
codingCliProviderId: nextProvider,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -84,7 +84,6 @@ test('session actions register and unregister', () => {
|
||||
createLocalTerminal: noop,
|
||||
createSerialSession: noop,
|
||||
connectToHost: noop,
|
||||
connectToHostRemoteDesktop: noop,
|
||||
updateSessionStatus: noop,
|
||||
updateSessionFontSize: noop,
|
||||
clearSessionFontSizeOverride: noop,
|
||||
|
||||
@@ -51,7 +51,6 @@ export type SessionSnapshotActions = Pick<
|
||||
| 'createLocalTerminal'
|
||||
| 'createSerialSession'
|
||||
| 'connectToHost'
|
||||
| 'connectToHostRemoteDesktop'
|
||||
| 'updateSessionStatus'
|
||||
| 'updateSessionFontSize'
|
||||
| 'clearSessionFontSizeOverride'
|
||||
|
||||
@@ -72,11 +72,6 @@ import {
|
||||
import { isTerminalSidePanelAutoOpenTab, type TerminalSidePanelAutoOpenTab } from '../../domain/terminalSidePanelAutoOpen';
|
||||
import { isStartupLanding, type StartupLanding } from '../../domain/startupLanding';
|
||||
import type { AppearanceSyncEvent } from './appearanceSync';
|
||||
import {
|
||||
isJumpServerRdpLaunchMode,
|
||||
STORAGE_KEY_JUMPSERVER_RDP_LAUNCH_MODE,
|
||||
type JumpServerRdpLaunchMode,
|
||||
} from './settingsStorageSync';
|
||||
|
||||
interface UseSettingsIpcSyncParams {
|
||||
enabled?: boolean;
|
||||
@@ -99,7 +94,6 @@ interface UseSettingsIpcSyncParams {
|
||||
setSshDebugLogsEnabled: Dispatch<SetStateAction<boolean>>;
|
||||
setSshDeepLinkEnabledState: (enabled: boolean) => void;
|
||||
setJmsDeepLinkEnabledState: (enabled: boolean) => void;
|
||||
setJumpServerRdpLaunchModeState: Dispatch<SetStateAction<JumpServerRdpLaunchMode>>;
|
||||
setExplorerContextMenuEnabledState: (enabled: boolean) => void;
|
||||
setHotkeyScheme: Dispatch<SetStateAction<HotkeyScheme>>;
|
||||
applyIncomingCustomKeyBindings: (incoming: { bindings: CustomKeyBindings; version: number; origin: string }) => void;
|
||||
@@ -150,7 +144,6 @@ export function useSettingsIpcSync({
|
||||
setSshDebugLogsEnabled,
|
||||
setSshDeepLinkEnabledState,
|
||||
setJmsDeepLinkEnabledState,
|
||||
setJumpServerRdpLaunchModeState,
|
||||
setExplorerContextMenuEnabledState,
|
||||
setHotkeyScheme,
|
||||
applyIncomingCustomKeyBindings,
|
||||
@@ -268,9 +261,6 @@ export function useSettingsIpcSync({
|
||||
if (key === STORAGE_KEY_JMS_DEEP_LINK_ENABLED && typeof value === 'boolean') {
|
||||
setJmsDeepLinkEnabledState(value);
|
||||
}
|
||||
if (key === STORAGE_KEY_JUMPSERVER_RDP_LAUNCH_MODE && isJumpServerRdpLaunchMode(value)) {
|
||||
setJumpServerRdpLaunchModeState((prev) => (prev === value ? prev : value));
|
||||
}
|
||||
if (key === STORAGE_KEY_EXPLORER_CONTEXT_MENU_ENABLED && typeof value === 'boolean') {
|
||||
setExplorerContextMenuEnabledState(value);
|
||||
}
|
||||
@@ -397,7 +387,6 @@ export function useSettingsIpcSync({
|
||||
setSessionLogsTimestampsEnabled,
|
||||
setSshDeepLinkEnabledState,
|
||||
setJmsDeepLinkEnabledState,
|
||||
setJumpServerRdpLaunchModeState,
|
||||
setExplorerContextMenuEnabledState,
|
||||
setSshDebugLogsEnabled,
|
||||
setSftpAutoOpenSidebar,
|
||||
|
||||
@@ -55,11 +55,6 @@ import {
|
||||
STORAGE_KEY_WINDOW_OPACITY,
|
||||
STORAGE_KEY_WINDOW_BACKGROUND_BLUR,
|
||||
STORAGE_KEY_APP_ICON_VARIANT,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_AUTO_RECORD,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_FPS,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_MAX_MB,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS,
|
||||
} from '../../infrastructure/config/storageKeys';
|
||||
import { resolveAppIconVariant, type AppIconVariant } from '../../domain/appIconVariant';
|
||||
import { resolveAppearanceStorageEvent } from './appearanceSync';
|
||||
@@ -71,42 +66,6 @@ import { isTerminalSidePanelAutoOpenTab, type TerminalSidePanelAutoOpenTab } fro
|
||||
import { isHostClickBehavior, type HostClickBehavior } from '../../domain/hostClickBehavior';
|
||||
import { isStartupLanding, type StartupLanding } from '../../domain/startupLanding';
|
||||
|
||||
export type JumpServerRdpLaunchMode = 'builtin' | 'system';
|
||||
|
||||
export const STORAGE_KEY_JUMPSERVER_RDP_LAUNCH_MODE = 'netcatty_jumpserver_rdp_launch_mode_v1';
|
||||
|
||||
export const DEFAULT_JUMPSERVER_RDP_LAUNCH_MODE: JumpServerRdpLaunchMode = 'builtin';
|
||||
|
||||
export const isJumpServerRdpLaunchMode = (value: unknown): value is JumpServerRdpLaunchMode => (
|
||||
value === 'builtin' || value === 'system'
|
||||
);
|
||||
|
||||
export type RemoteDesktopRecordingFps = 5 | 10 | 15;
|
||||
|
||||
export const DEFAULT_REMOTE_DESKTOP_AUTO_RECORD = false;
|
||||
export const DEFAULT_REMOTE_DESKTOP_RECORDING_FPS: RemoteDesktopRecordingFps = 10;
|
||||
export const DEFAULT_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO = true;
|
||||
export const DEFAULT_REMOTE_DESKTOP_RECORDING_MAX_MB = 1024;
|
||||
export const DEFAULT_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS = 30;
|
||||
|
||||
export const normalizeRemoteDesktopRecordingFps = (value: unknown): RemoteDesktopRecordingFps => {
|
||||
const num = typeof value === 'number' ? value : Number(value);
|
||||
if (num === 5 || num === 10 || num === 15) return num;
|
||||
return DEFAULT_REMOTE_DESKTOP_RECORDING_FPS;
|
||||
};
|
||||
|
||||
export const normalizeRemoteDesktopRecordingMaxMb = (value: unknown): number => {
|
||||
const num = typeof value === 'number' ? value : Number(value);
|
||||
if (Number.isFinite(num) && num >= 64 && num <= 102400) return Math.round(num);
|
||||
return DEFAULT_REMOTE_DESKTOP_RECORDING_MAX_MB;
|
||||
};
|
||||
|
||||
export const normalizeRemoteDesktopRecordingRetentionDays = (value: unknown): number => {
|
||||
const num = typeof value === 'number' ? value : Number(value);
|
||||
if (Number.isFinite(num) && num >= 0 && num <= 3650) return Math.round(num);
|
||||
return DEFAULT_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS;
|
||||
};
|
||||
|
||||
interface UseSettingsStorageSyncParams {
|
||||
enabled?: boolean;
|
||||
theme: 'dark' | 'light' | 'system';
|
||||
@@ -151,15 +110,9 @@ interface UseSettingsStorageSyncParams {
|
||||
sessionLogsDir: string;
|
||||
sessionLogsFormat: SessionLogFormat;
|
||||
sessionLogsTimestampsEnabled: boolean;
|
||||
remoteDesktopAutoRecord: boolean;
|
||||
remoteDesktopRecordingFps: RemoteDesktopRecordingFps;
|
||||
remoteDesktopRecordingIncludeAudio: boolean;
|
||||
remoteDesktopRecordingMaxMb: number;
|
||||
remoteDesktopRecordingRetentionDays: number;
|
||||
sshDebugLogsEnabled: boolean;
|
||||
sshDeepLinkEnabled: boolean;
|
||||
jmsDeepLinkEnabled: boolean;
|
||||
jumpServerRdpLaunchMode: JumpServerRdpLaunchMode;
|
||||
explorerContextMenuEnabled: boolean;
|
||||
globalHotkeyEnabled: boolean;
|
||||
autoUpdateEnabled: boolean;
|
||||
@@ -209,15 +162,9 @@ interface UseSettingsStorageSyncParams {
|
||||
setSessionLogsDir: Dispatch<SetStateAction<string>>;
|
||||
setSessionLogsFormat: Dispatch<SetStateAction<SessionLogFormat>>;
|
||||
setSessionLogsTimestampsEnabled: Dispatch<SetStateAction<boolean>>;
|
||||
setRemoteDesktopAutoRecordState: Dispatch<SetStateAction<boolean>>;
|
||||
setRemoteDesktopRecordingFpsState: Dispatch<SetStateAction<RemoteDesktopRecordingFps>>;
|
||||
setRemoteDesktopRecordingIncludeAudioState: Dispatch<SetStateAction<boolean>>;
|
||||
setRemoteDesktopRecordingMaxMbState: Dispatch<SetStateAction<number>>;
|
||||
setRemoteDesktopRecordingRetentionDaysState: Dispatch<SetStateAction<number>>;
|
||||
setSshDebugLogsEnabled: Dispatch<SetStateAction<boolean>>;
|
||||
setSshDeepLinkEnabledState: (enabled: boolean) => void;
|
||||
setJmsDeepLinkEnabledState: (enabled: boolean) => void;
|
||||
setJumpServerRdpLaunchModeState: Dispatch<SetStateAction<JumpServerRdpLaunchMode>>;
|
||||
setExplorerContextMenuEnabledState: (enabled: boolean) => void;
|
||||
setGlobalHotkeyEnabled: Dispatch<SetStateAction<boolean>>;
|
||||
setWindowOpacity: (raw: unknown) => void;
|
||||
@@ -239,9 +186,7 @@ export function useSettingsStorageSync({
|
||||
sftpDoubleClickBehavior, sftpAutoSync, sftpShowHiddenFiles,
|
||||
sftpUseCompressedUpload, sftpSkipUnchanged, sftpAutoOpenSidebar, sftpFollowTerminalCwd, sftpDefaultViewMode,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, localShellSidePanelAutoOpen, localShellSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd, startupLanding,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled,
|
||||
remoteDesktopAutoRecord, remoteDesktopRecordingFps, remoteDesktopRecordingIncludeAudio, remoteDesktopRecordingMaxMb, remoteDesktopRecordingRetentionDays,
|
||||
sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, jumpServerRdpLaunchMode, explorerContextMenuEnabled,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled, sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, explorerContextMenuEnabled,
|
||||
globalHotkeyEnabled, autoUpdateEnabled, windowOpacity, windowBackgroundBlur, appIconVariant,
|
||||
setTheme, setLightUiThemeId, setDarkUiThemeId, setAccentMode, applyIncomingCustomAccent,
|
||||
setCustomCSS, setUiFontFamilyId, setHotkeyScheme, setUiLanguage,
|
||||
@@ -250,9 +195,7 @@ export function useSettingsStorageSync({
|
||||
setSftpDoubleClickBehavior, setSftpAutoSync, setSftpShowHiddenFiles,
|
||||
setSftpUseCompressedUpload, setSftpSkipUnchanged, setSftpAutoOpenSidebar, setSftpFollowTerminalCwd, setSftpDefaultViewMode,
|
||||
setShowRecentHostsState, setHostClickBehaviorState, setShowOnlyUngroupedHostsInRootState, setShowSftpTabState, setShowHostTreeSidebarState, setTerminalSidePanelAutoOpenState, setTerminalSidePanelAutoOpenTabState, setLocalShellSidePanelAutoOpenState, setLocalShellSidePanelAutoOpenTabState, setShellOnlyTabNumberShortcutsState, setShowTabNumberBadgesState, setDisableTerminalFontZoomState, setRestorePreviousSessionState, setRestoreTerminalCwdState, setStartupLandingState,
|
||||
setEditorWordWrapState, setSessionLogsEnabled, setSessionLogsDir, setSessionLogsFormat, setSessionLogsTimestampsEnabled,
|
||||
setRemoteDesktopAutoRecordState, setRemoteDesktopRecordingFpsState, setRemoteDesktopRecordingIncludeAudioState, setRemoteDesktopRecordingMaxMbState, setRemoteDesktopRecordingRetentionDaysState,
|
||||
setSshDebugLogsEnabled, setSshDeepLinkEnabledState, setJmsDeepLinkEnabledState, setJumpServerRdpLaunchModeState, setExplorerContextMenuEnabledState,
|
||||
setEditorWordWrapState, setSessionLogsEnabled, setSessionLogsDir, setSessionLogsFormat, setSessionLogsTimestampsEnabled, setSshDebugLogsEnabled, setSshDeepLinkEnabledState, setJmsDeepLinkEnabledState, setExplorerContextMenuEnabledState,
|
||||
setGlobalHotkeyEnabled, setWindowOpacity, setWindowBackgroundBlur, setAppIconVariant, setAutoUpdateEnabled, setWorkspaceFocusStyleState,
|
||||
setSftpTransferConcurrencyState, setSshTransportIdleTtlMsState,
|
||||
applyIncomingCustomKeyBindings, mergeIncomingTerminalSettings,
|
||||
@@ -267,9 +210,7 @@ export function useSettingsStorageSync({
|
||||
sftpDoubleClickBehavior, sftpAutoSync, sftpShowHiddenFiles,
|
||||
sftpUseCompressedUpload, sftpSkipUnchanged, sftpAutoOpenSidebar, sftpFollowTerminalCwd, sftpDefaultViewMode,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, localShellSidePanelAutoOpen, localShellSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd, startupLanding,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled,
|
||||
remoteDesktopAutoRecord, remoteDesktopRecordingFps, remoteDesktopRecordingIncludeAudio, remoteDesktopRecordingMaxMb, remoteDesktopRecordingRetentionDays,
|
||||
sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, jumpServerRdpLaunchMode, explorerContextMenuEnabled,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled, sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, explorerContextMenuEnabled,
|
||||
globalHotkeyEnabled, autoUpdateEnabled, windowOpacity, windowBackgroundBlur, appIconVariant,
|
||||
});
|
||||
settingsSnapshotRef.current = {
|
||||
@@ -279,9 +220,7 @@ export function useSettingsStorageSync({
|
||||
sftpDoubleClickBehavior, sftpAutoSync, sftpShowHiddenFiles,
|
||||
sftpUseCompressedUpload, sftpSkipUnchanged, sftpAutoOpenSidebar, sftpFollowTerminalCwd, sftpDefaultViewMode,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, localShellSidePanelAutoOpen, localShellSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd, startupLanding,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled,
|
||||
remoteDesktopAutoRecord, remoteDesktopRecordingFps, remoteDesktopRecordingIncludeAudio, remoteDesktopRecordingMaxMb, remoteDesktopRecordingRetentionDays,
|
||||
sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, jumpServerRdpLaunchMode, explorerContextMenuEnabled,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled, sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, explorerContextMenuEnabled,
|
||||
globalHotkeyEnabled, autoUpdateEnabled, windowOpacity, windowBackgroundBlur, appIconVariant,
|
||||
};
|
||||
|
||||
@@ -428,36 +367,6 @@ export function useSettingsStorageSync({
|
||||
setSessionLogsTimestampsEnabled(newValue);
|
||||
}
|
||||
}
|
||||
if (e.key === STORAGE_KEY_REMOTE_DESKTOP_AUTO_RECORD && e.newValue !== null) {
|
||||
const newValue = e.newValue === 'true';
|
||||
if (newValue !== s.remoteDesktopAutoRecord) {
|
||||
setRemoteDesktopAutoRecordState(newValue);
|
||||
}
|
||||
}
|
||||
if (e.key === STORAGE_KEY_REMOTE_DESKTOP_RECORDING_FPS && e.newValue !== null) {
|
||||
const next = normalizeRemoteDesktopRecordingFps(e.newValue);
|
||||
if (next !== s.remoteDesktopRecordingFps) {
|
||||
setRemoteDesktopRecordingFpsState(next);
|
||||
}
|
||||
}
|
||||
if (e.key === STORAGE_KEY_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO && e.newValue !== null) {
|
||||
const newValue = e.newValue === 'true';
|
||||
if (newValue !== s.remoteDesktopRecordingIncludeAudio) {
|
||||
setRemoteDesktopRecordingIncludeAudioState(newValue);
|
||||
}
|
||||
}
|
||||
if (e.key === STORAGE_KEY_REMOTE_DESKTOP_RECORDING_MAX_MB && e.newValue !== null) {
|
||||
const next = normalizeRemoteDesktopRecordingMaxMb(e.newValue);
|
||||
if (next !== s.remoteDesktopRecordingMaxMb) {
|
||||
setRemoteDesktopRecordingMaxMbState(next);
|
||||
}
|
||||
}
|
||||
if (e.key === STORAGE_KEY_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS && e.newValue !== null) {
|
||||
const next = normalizeRemoteDesktopRecordingRetentionDays(e.newValue);
|
||||
if (next !== s.remoteDesktopRecordingRetentionDays) {
|
||||
setRemoteDesktopRecordingRetentionDaysState(next);
|
||||
}
|
||||
}
|
||||
if (e.key === STORAGE_KEY_SSH_DEBUG_LOGS_ENABLED && e.newValue !== null) {
|
||||
const newValue = e.newValue === 'true';
|
||||
if (newValue !== s.sshDebugLogsEnabled) {
|
||||
@@ -476,11 +385,6 @@ export function useSettingsStorageSync({
|
||||
setJmsDeepLinkEnabledState(newValue);
|
||||
}
|
||||
}
|
||||
if (e.key === STORAGE_KEY_JUMPSERVER_RDP_LAUNCH_MODE && e.newValue !== null) {
|
||||
if (isJumpServerRdpLaunchMode(e.newValue) && e.newValue !== s.jumpServerRdpLaunchMode) {
|
||||
setJumpServerRdpLaunchModeState(e.newValue);
|
||||
}
|
||||
}
|
||||
if (e.key === STORAGE_KEY_EXPLORER_CONTEXT_MENU_ENABLED && e.newValue !== null) {
|
||||
const newValue = e.newValue === 'true';
|
||||
if (newValue !== s.explorerContextMenuEnabled) {
|
||||
@@ -679,14 +583,8 @@ export function useSettingsStorageSync({
|
||||
setSessionLogsEnabled,
|
||||
setSessionLogsFormat,
|
||||
setSessionLogsTimestampsEnabled,
|
||||
setRemoteDesktopAutoRecordState,
|
||||
setRemoteDesktopRecordingFpsState,
|
||||
setRemoteDesktopRecordingIncludeAudioState,
|
||||
setRemoteDesktopRecordingMaxMbState,
|
||||
setRemoteDesktopRecordingRetentionDaysState,
|
||||
setSshDeepLinkEnabledState,
|
||||
setJmsDeepLinkEnabledState,
|
||||
setJumpServerRdpLaunchModeState,
|
||||
setExplorerContextMenuEnabledState,
|
||||
setSshDebugLogsEnabled,
|
||||
setSftpAutoOpenSidebar,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Host, TerminalSettings } from "../../domain/models";
|
||||
import type { TerminalSettings } from "../../domain/models";
|
||||
import { normalizeSshAutoReconnectInterval } from "../../domain/models/terminal";
|
||||
import type { TerminalSessionExitEvent } from "./resolveTerminalSessionExitIntent";
|
||||
|
||||
@@ -11,7 +11,7 @@ export function getTerminalAutoReconnectDelayMs(
|
||||
}
|
||||
|
||||
type AutoReconnectHost = {
|
||||
protocol?: Host["protocol"];
|
||||
protocol?: "ssh" | "telnet" | "local" | "serial" | "mosh" | "et";
|
||||
hostname?: string;
|
||||
moshEnabled?: boolean;
|
||||
etEnabled?: boolean;
|
||||
|
||||
@@ -109,8 +109,7 @@ export interface UseAIChatStreamingReturn {
|
||||
export interface SendToCattyContext {
|
||||
activeProvider: ProviderConfig | undefined;
|
||||
activeModelId: string;
|
||||
reasoningEffort?: string;
|
||||
scopeType: 'terminal' | 'workspace' | 'global';
|
||||
scopeType: 'terminal' | 'workspace';
|
||||
scopeTargetId?: string;
|
||||
scopeLabel?: string;
|
||||
globalPermissionMode: AIPermissionMode;
|
||||
@@ -126,7 +125,6 @@ export interface SendToCattyContext {
|
||||
selectedUserSkillSlugs?: string[];
|
||||
permissionMode?: AIPermissionMode;
|
||||
forceCompaction?: boolean;
|
||||
pluginContext?: import('../../infrastructure/ai/pluginAiSidebarTypes').PluginAISidebarTurnContext | null;
|
||||
}
|
||||
|
||||
export interface SendToExternalContext {
|
||||
|
||||
@@ -31,10 +31,8 @@ import type {
|
||||
} from '../../infrastructure/ai/types';
|
||||
import {
|
||||
DEFAULT_COMMAND_TIMEOUT_SECONDS,
|
||||
DEFAULT_MAX_ITERATIONS,
|
||||
DEFAULT_RESPONSE_IDLE_TIMEOUT_SECONDS,
|
||||
normalizeCommandTimeoutSeconds,
|
||||
normalizeMaxIterations,
|
||||
normalizeResponseIdleTimeoutSeconds,
|
||||
} from '../../infrastructure/ai/types';
|
||||
import { removeProviderReferences } from './aiProviderCleanup';
|
||||
@@ -134,9 +132,7 @@ export function useSharedAISettingsState(options?: SharedAISettingsStateOptions)
|
||||
)
|
||||
);
|
||||
const [maxIterations, setMaxIterationsRaw] = useState<number>(() =>
|
||||
normalizeMaxIterations(
|
||||
localStorageAdapter.readNumber(STORAGE_KEY_AI_MAX_ITERATIONS) ?? DEFAULT_MAX_ITERATIONS,
|
||||
)
|
||||
localStorageAdapter.readNumber(STORAGE_KEY_AI_MAX_ITERATIONS) ?? 20
|
||||
);
|
||||
const [toolOutputMaxChars, setToolOutputMaxCharsRaw] = useState<number>(() =>
|
||||
normalizeAiToolOutputMaxChars(
|
||||
@@ -257,10 +253,9 @@ export function useSharedAISettingsState(options?: SharedAISettingsStateOptions)
|
||||
}, []);
|
||||
|
||||
const setMaxIterations = useCallback((value: number) => {
|
||||
const normalizedValue = normalizeMaxIterations(value);
|
||||
setMaxIterationsRaw(normalizedValue);
|
||||
localStorageAdapter.writeNumber(STORAGE_KEY_AI_MAX_ITERATIONS, normalizedValue);
|
||||
getAIBridge()?.aiMcpSetMaxIterations?.(normalizedValue);
|
||||
setMaxIterationsRaw(value);
|
||||
localStorageAdapter.writeNumber(STORAGE_KEY_AI_MAX_ITERATIONS, value);
|
||||
getAIBridge()?.aiMcpSetMaxIterations?.(value);
|
||||
}, []);
|
||||
|
||||
const setToolOutputMaxChars = useCallback((value: number) => {
|
||||
@@ -355,11 +350,10 @@ export function useSharedAISettingsState(options?: SharedAISettingsStateOptions)
|
||||
break;
|
||||
}
|
||||
case STORAGE_KEY_AI_MAX_ITERATIONS: {
|
||||
const iters = localStorageAdapter.readNumber(STORAGE_KEY_AI_MAX_ITERATIONS) ?? DEFAULT_MAX_ITERATIONS;
|
||||
const iters = localStorageAdapter.readNumber(STORAGE_KEY_AI_MAX_ITERATIONS) ?? 20;
|
||||
if (!Number.isFinite(iters)) break;
|
||||
const normalizedIters = normalizeMaxIterations(iters);
|
||||
setMaxIterationsRaw(normalizedIters);
|
||||
getAIBridge()?.aiMcpSetMaxIterations?.(normalizedIters);
|
||||
setMaxIterationsRaw(iters);
|
||||
getAIBridge()?.aiMcpSetMaxIterations?.(iters);
|
||||
break;
|
||||
}
|
||||
case STORAGE_KEY_AI_TOOL_OUTPUT_MAX_CHARS: {
|
||||
|
||||
@@ -106,107 +106,3 @@ test("connection test countdown follows the probe timeouts and invalidates the a
|
||||
assert.equal(current().state.status, "disconnected");
|
||||
assert.equal(current().state.error, "Connection timed out. Please try again.");
|
||||
});
|
||||
|
||||
test("remote desktop host connection test routes to remoteDesktop.testConnection, surfaces probeResult, and cancels cleanly", async (t) => {
|
||||
const actEnvironment = globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT?: boolean };
|
||||
const previousActEnvironment = actEnvironment.IS_REACT_ACT_ENVIRONMENT;
|
||||
actEnvironment.IS_REACT_ACT_ENVIRONMENT = true;
|
||||
const previousWindowDescriptor = Object.getOwnPropertyDescriptor(globalThis, "window");
|
||||
|
||||
const rdpHost: Host = {
|
||||
id: "rdp-1",
|
||||
label: "Windows Box",
|
||||
hostname: "win.example.test",
|
||||
port: 3389,
|
||||
username: "admin",
|
||||
password: "DO_NOT_SEND_PASSWORD",
|
||||
tags: [],
|
||||
os: "windows",
|
||||
protocol: "rdp",
|
||||
};
|
||||
|
||||
let receivedOptions: Record<string, unknown> | null = null;
|
||||
const cancelledIds: string[] = [];
|
||||
const bridge = {
|
||||
remoteDesktop: {
|
||||
testConnection: async (opts: Record<string, unknown>) => {
|
||||
receivedOptions = opts;
|
||||
return {
|
||||
ok: true,
|
||||
protocol: "rdp",
|
||||
host: "win.example.test",
|
||||
port: 3389,
|
||||
rttMs: 14,
|
||||
bannerVerified: true,
|
||||
rdpSecurity: "nla",
|
||||
tlsVersion: "TLSv1.3",
|
||||
cert: {
|
||||
fingerprintSha256: "AA:BB:CC",
|
||||
subject: "CN=win.example.test",
|
||||
trustStatus: "first-seen",
|
||||
},
|
||||
checkedAt: Date.now(),
|
||||
};
|
||||
},
|
||||
cancelTestConnection: async (id: string) => {
|
||||
cancelledIds.push(id);
|
||||
return { ok: true };
|
||||
},
|
||||
},
|
||||
onChainProgress: () => () => {},
|
||||
onHostKeyVerification: () => () => {},
|
||||
respondHostKeyVerification: async () => ({ success: true }),
|
||||
};
|
||||
|
||||
Object.defineProperty(globalThis, "window", {
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: { netcatty: bridge },
|
||||
});
|
||||
|
||||
let api: HookApi | null = null;
|
||||
let renderer: ReactTestRenderer | null = null;
|
||||
const Probe = () => {
|
||||
api = useHostConnectionTest({ host: rdpHost, hosts: [rdpHost], keys: [] });
|
||||
return null;
|
||||
};
|
||||
const current = () => {
|
||||
assert.ok(api);
|
||||
return api;
|
||||
};
|
||||
|
||||
t.after(async () => {
|
||||
await act(async () => {
|
||||
renderer?.unmount();
|
||||
});
|
||||
if (previousWindowDescriptor) Object.defineProperty(globalThis, "window", previousWindowDescriptor);
|
||||
else delete (globalThis as { window?: unknown }).window;
|
||||
actEnvironment.IS_REACT_ACT_ENVIRONMENT = previousActEnvironment;
|
||||
});
|
||||
|
||||
await act(async () => {
|
||||
renderer = create(React.createElement(Probe));
|
||||
});
|
||||
await act(async () => {
|
||||
await current().startTest();
|
||||
});
|
||||
|
||||
assert.ok(receivedOptions);
|
||||
assert.equal((receivedOptions as { protocol: string }).protocol, "rdp");
|
||||
assert.ok(!JSON.stringify(receivedOptions).includes("DO_NOT_SEND_PASSWORD"));
|
||||
assert.equal(current().state.status, "connected");
|
||||
assert.equal(current().state.activeProtocol, "rdp");
|
||||
assert.equal(current().state.probeResult?.rttMs, 14);
|
||||
assert.equal(current().state.probeResult?.cert?.trustStatus, "first-seen");
|
||||
|
||||
await act(async () => {
|
||||
current().markProbeCertTrusted();
|
||||
});
|
||||
assert.equal(current().state.probeResult?.cert?.trustStatus, "trusted");
|
||||
|
||||
await act(async () => {
|
||||
current().cancelTest();
|
||||
});
|
||||
assert.equal(current().state.status, "idle");
|
||||
assert.equal(cancelledIds.length, 1);
|
||||
});
|
||||
@@ -7,16 +7,8 @@ import {
|
||||
buildHostConnectionTestPlan,
|
||||
formatConnectionTestProgressLog,
|
||||
resolveHostConnectionTestDeadlineMs,
|
||||
resolveRemoteDesktopConnectionTestDeadlineMs,
|
||||
type HostConnectionTestAuthOverride,
|
||||
type RemoteDesktopProbeResult,
|
||||
} from "../../domain/hostConnectionTest";
|
||||
import {
|
||||
isRemoteDesktopProtocol,
|
||||
resolveRemoteDesktopConnectionSpec,
|
||||
} from "../../domain/remoteDesktop";
|
||||
import { resolveEffectiveTerminalHost } from "../../domain/terminalHostResolution";
|
||||
import { getKnownRemoteDesktopFingerprints } from "../../components/remoteDesktop/knownRemoteDesktopCerts";
|
||||
import { useTerminalBackend } from "./useTerminalBackend";
|
||||
|
||||
export type ChainProgress = {
|
||||
@@ -46,8 +38,6 @@ export type HostConnectionTestState = {
|
||||
timeLeft: number;
|
||||
isAwaitingUserInput: boolean;
|
||||
isCancelling: boolean;
|
||||
probeResult: RemoteDesktopProbeResult | null;
|
||||
activeProtocol: "ssh" | "rdp" | "vnc";
|
||||
};
|
||||
|
||||
export type HostConnectionTestInput = {
|
||||
@@ -88,14 +78,8 @@ export function useHostConnectionTest(input: HostConnectionTestInput) {
|
||||
const [timeLeft, setTimeLeft] = useState(0);
|
||||
const [isAwaitingUserInput, setIsAwaitingUserInput] = useState(false);
|
||||
const [isCancelling, setIsCancelling] = useState(false);
|
||||
const [probeResult, setProbeResult] = useState<RemoteDesktopProbeResult | null>(null);
|
||||
const [activeProtocol, setActiveProtocol] = useState<"ssh" | "rdp" | "vnc">(
|
||||
isRemoteDesktopProtocol(host.protocol) ? host.protocol : "ssh",
|
||||
);
|
||||
|
||||
const sessionIdRef = useRef<string | null>(null);
|
||||
const activeKindRef = useRef<"ssh" | "remote-desktop">("ssh");
|
||||
const lastProtocolOverrideRef = useRef<"ssh" | "rdp" | "vnc" | undefined>(undefined);
|
||||
const bootEpochRef = useRef(0);
|
||||
const pendingHostKeyRequestIdRef = useRef<string | null>(null);
|
||||
const disposedRef = useRef(false);
|
||||
@@ -113,20 +97,14 @@ export function useHostConnectionTest(input: HostConnectionTestInput) {
|
||||
setIsAwaitingUserInput(false);
|
||||
setIsCancelling(false);
|
||||
setTimeLeft(0);
|
||||
setProbeResult(null);
|
||||
pendingHostKeyRequestIdRef.current = null;
|
||||
}, []);
|
||||
|
||||
const clearSession = useCallback(() => {
|
||||
const sessionId = sessionIdRef.current;
|
||||
const kind = activeKindRef.current;
|
||||
sessionIdRef.current = null;
|
||||
if (sessionId && !disposedRef.current) {
|
||||
if (kind === "remote-desktop") {
|
||||
void backend.cancelRemoteDesktopTestConnection(sessionId).catch(() => {});
|
||||
} else {
|
||||
void backend.cancelTestConnection(sessionId).catch(() => {});
|
||||
}
|
||||
void backend.cancelTestConnection(sessionId).catch(() => {});
|
||||
}
|
||||
}, [backend]);
|
||||
|
||||
@@ -204,36 +182,10 @@ export function useHostConnectionTest(input: HostConnectionTestInput) {
|
||||
}, [hostKeyVerification, respondHostKey]);
|
||||
|
||||
const startTest = useCallback(
|
||||
async (
|
||||
authOverride?: HostConnectionTestAuthOverride | null,
|
||||
protocolOverride?: "ssh" | "rdp" | "vnc",
|
||||
) => {
|
||||
async (authOverride?: HostConnectionTestAuthOverride | null) => {
|
||||
clearSession();
|
||||
resetState();
|
||||
|
||||
lastProtocolOverrideRef.current = protocolOverride;
|
||||
const targetProtocol: "ssh" | "rdp" | "vnc" =
|
||||
protocolOverride ?? (isRemoteDesktopProtocol(host.protocol) ? host.protocol : "ssh");
|
||||
setActiveProtocol(targetProtocol);
|
||||
|
||||
let knownRemoteDesktopFingerprints: string[] | undefined;
|
||||
if (targetProtocol === "rdp" || targetProtocol === "vnc") {
|
||||
const effective = resolveEffectiveTerminalHost({
|
||||
host,
|
||||
groupConfigs,
|
||||
proxyProfiles,
|
||||
});
|
||||
const spec = resolveRemoteDesktopConnectionSpec(effective, targetProtocol, identities);
|
||||
const certHost = spec.hostHostname || spec.hostname;
|
||||
if (certHost) {
|
||||
knownRemoteDesktopFingerprints = getKnownRemoteDesktopFingerprints(
|
||||
targetProtocol,
|
||||
certHost,
|
||||
spec.port,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const sessionId = crypto.randomUUID();
|
||||
const bootEpoch = (bootEpochRef.current += 1);
|
||||
sessionIdRef.current = sessionId;
|
||||
@@ -256,43 +208,14 @@ export function useHostConnectionTest(input: HostConnectionTestInput) {
|
||||
sessionId,
|
||||
bootEpoch,
|
||||
authOverride,
|
||||
protocolOverride,
|
||||
knownRemoteDesktopFingerprints,
|
||||
});
|
||||
|
||||
if (plan.ok === false) {
|
||||
if (!plan.ok) {
|
||||
setError(plan.error);
|
||||
setStatus("disconnected");
|
||||
return;
|
||||
}
|
||||
|
||||
if (plan.kind === "remote-desktop") {
|
||||
activeKindRef.current = "remote-desktop";
|
||||
deadlineMsRef.current = resolveRemoteDesktopConnectionTestDeadlineMs(plan.options);
|
||||
setStatus("connecting");
|
||||
setIsAwaitingUserInput(false);
|
||||
|
||||
try {
|
||||
const result = await backend.testRemoteDesktopConnection(plan.options);
|
||||
if (disposedRef.current || sessionIdRef.current !== sessionId) return;
|
||||
setProbeResult(result);
|
||||
setChainProgress(null);
|
||||
if (result.ok) {
|
||||
setProgressValue(100);
|
||||
setStatus("connected");
|
||||
} else {
|
||||
setError(result.error || "Connection test failed");
|
||||
setStatus("disconnected");
|
||||
}
|
||||
} catch (err) {
|
||||
if (disposedRef.current || sessionIdRef.current !== sessionId) return;
|
||||
setError(messageOf(err));
|
||||
setStatus("disconnected");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
activeKindRef.current = "ssh";
|
||||
if (plan.needsCredentialReentry) {
|
||||
setNeedsAuth(true);
|
||||
setStatus("connecting");
|
||||
@@ -330,19 +253,6 @@ export function useHostConnectionTest(input: HostConnectionTestInput) {
|
||||
],
|
||||
);
|
||||
|
||||
const markProbeCertTrusted = useCallback(() => {
|
||||
setProbeResult((prev) => {
|
||||
if (!prev || !prev.cert) return prev;
|
||||
return {
|
||||
...prev,
|
||||
cert: {
|
||||
...prev.cert,
|
||||
trustStatus: "trusted",
|
||||
},
|
||||
};
|
||||
});
|
||||
}, []);
|
||||
|
||||
const submitAuth = useCallback(
|
||||
(auth: HostConnectionTestAuthOverride) => {
|
||||
void startTest(auth);
|
||||
@@ -410,14 +320,11 @@ export function useHostConnectionTest(input: HostConnectionTestInput) {
|
||||
timeLeft,
|
||||
isAwaitingUserInput,
|
||||
isCancelling,
|
||||
probeResult,
|
||||
activeProtocol,
|
||||
} satisfies HostConnectionTestState,
|
||||
startTest,
|
||||
submitAuth,
|
||||
cancelTest,
|
||||
retry: () => void startTest(undefined, lastProtocolOverrideRef.current),
|
||||
markProbeCertTrusted,
|
||||
retry: () => void startTest(),
|
||||
handleHostKeyContinue,
|
||||
handleHostKeyAddAndContinue,
|
||||
handleHostKeyClose,
|
||||
|
||||
@@ -11,57 +11,32 @@ export function useHostDrawnPluginView({ viewId, version, slot, active, context,
|
||||
}) {
|
||||
const contextKey = JSON.stringify(context);
|
||||
const key = JSON.stringify([viewId, version, slot, contextKey]);
|
||||
const scopeId = typeof window !== 'undefined'
|
||||
? resolvePluginViewWindowScope({ pathname: window.location.pathname, search: window.location.search, hash: `${window.location.hash}|plugin-slot:${slot}` })
|
||||
: '';
|
||||
const sessionKey = scopeId ? JSON.stringify([scopeId, key]) : '';
|
||||
const cachedSession = active && sessionKey ? pluginViewSessions.peek(sessionKey) : null;
|
||||
const [state, setState] = useState<{
|
||||
key: string;
|
||||
snapshot: PluginViewSnapshot;
|
||||
image?: (path: string) => Promise<string>;
|
||||
}>(() => (
|
||||
cachedSession
|
||||
? { key, snapshot: cachedSession.getSnapshot(), image: cachedSession.image }
|
||||
: { key: '', snapshot: initial() }
|
||||
));
|
||||
const [state, setState] = useState<{ key: string; snapshot: PluginViewSnapshot }>({ key: '', snapshot: initial() });
|
||||
const [hidden, setHidden] = useState(false);
|
||||
const unavailableRef = useRef(unavailable); unavailableRef.current = unavailable;
|
||||
const sessionRef = useRef<{ key: string; image(path: string): Promise<string>; send(event: HostDrawnViewEvent): void } | null>(null);
|
||||
useEffect(() => {
|
||||
if (!active) {
|
||||
setHidden(false);
|
||||
return;
|
||||
}
|
||||
if (!active) return;
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge) { unavailableRef.current(); return; }
|
||||
const resolvedScopeId = resolvePluginViewWindowScope({ pathname: window.location.pathname, search: window.location.search, hash: `${window.location.hash}|plugin-slot:${slot}` });
|
||||
const scopeId = resolvePluginViewWindowScope({ pathname: window.location.pathname, search: window.location.search, hash: `${window.location.hash}|plugin-slot:${slot}` });
|
||||
try {
|
||||
const session = pluginViewSessions.acquire(JSON.stringify([resolvedScopeId, key]), bridge, { viewId, scopeId: resolvedScopeId, context: JSON.parse(contextKey) });
|
||||
sessionRef.current = { key, send: session.send, image: session.image };
|
||||
const update = () => { const snapshot = session.getSnapshot(); setState({ key, snapshot, image: session.image }); if (snapshot.error) unavailableRef.current(); };
|
||||
const session = pluginViewSessions.acquire(JSON.stringify([scopeId, key]), bridge, { viewId, scopeId, context: JSON.parse(contextKey) });
|
||||
const update = () => { const snapshot = session.getSnapshot(); setState({ key, snapshot }); if (snapshot.error) unavailableRef.current(); };
|
||||
const stop = session.subscribe(update); update(); setHidden(false);
|
||||
sessionRef.current = { key, send: session.send, image: session.image };
|
||||
const stopHidden = subscribeHidden(() => { sessionRef.current = null; setHidden(true); });
|
||||
return () => { sessionRef.current = null; stopHidden(); stop(); session.release(); };
|
||||
} catch { unavailableRef.current(); }
|
||||
}, [active, contextKey, key, slot, subscribeHidden, viewId]);
|
||||
const fallbackLoadImage = useCallback((path: string) => {
|
||||
const loadImage = useCallback((path: string) => {
|
||||
const session = sessionRef.current;
|
||||
return active && session?.key === key ? session.image(path) : Promise.reject(new Error('Plugin view unavailable'));
|
||||
}, [active, key]);
|
||||
const hasCurrentState = active && state.key === key && cachedSession !== null && state.image === cachedSession.image;
|
||||
const resolvedSnapshot = hasCurrentState
|
||||
? state.snapshot
|
||||
: cachedSession
|
||||
? cachedSession.getSnapshot()
|
||||
: initial();
|
||||
const loadImage = hasCurrentState && state.image
|
||||
? state.image
|
||||
: (cachedSession?.image ?? fallbackLoadImage);
|
||||
const sendEvent = useCallback((event: HostDrawnViewEvent) => {
|
||||
const session = sessionRef.current; if (active && session?.key === key) session.send(event);
|
||||
}, [active, key]);
|
||||
// A newly selected plugin must never receive values from the previous tree,
|
||||
// even during the render before effect cleanup and the next activation.
|
||||
return { ...resolvedSnapshot, visible: active && !hidden, loadImage, sendEvent };
|
||||
return { ...(state.key === key ? state.snapshot : initial()), visible: active && !hidden, loadImage, sendEvent };
|
||||
}
|
||||
@@ -1,12 +1,6 @@
|
||||
import { hostRestrictsExtraSshChannels } from "../../domain/host";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { buildHostConnectionTestPlan } from "../../domain/hostConnectionTest";
|
||||
import {
|
||||
hasCompanionRdp,
|
||||
hasCompanionVnc,
|
||||
isRemoteDesktopProtocol,
|
||||
resolveRemoteDesktopConnectionSpec,
|
||||
} from "../../domain/remoteDesktop";
|
||||
import { resolveEffectiveTerminalHost } from "../../domain/terminalHostResolution";
|
||||
import { getEffectiveKnownHosts } from "../../infrastructure/syncHelpers";
|
||||
import { netcattyBridge } from "../../infrastructure/services/netcattyBridge";
|
||||
@@ -23,10 +17,7 @@ import {
|
||||
publishMonitorSnapshot,
|
||||
publishMonitorUnavailable,
|
||||
} from "./monitorRuntimeStore";
|
||||
import type {
|
||||
MonitorPanelDemand,
|
||||
MonitorRemoteDesktopProbeOptions,
|
||||
} from "../../domain/monitorRuntime";
|
||||
import type { MonitorPanelDemand } from "../../domain/monitorRuntime";
|
||||
|
||||
/** Root lifetime, independent of Vault navigation. No runtime state is persisted. */
|
||||
export function useMonitorRuntime() {
|
||||
@@ -100,38 +91,8 @@ export function useMonitorRuntime() {
|
||||
interval: panel.interval,
|
||||
hosts: panel.hostIds.map((id) => {
|
||||
const host = hosts.find((h) => h.id === id);
|
||||
if (!host) return { id };
|
||||
if (isRemoteDesktopProtocol(host.protocol)) {
|
||||
const plan = buildHostConnectionTestPlan({
|
||||
host,
|
||||
hosts,
|
||||
keys,
|
||||
identities,
|
||||
groupConfigs,
|
||||
proxyProfiles,
|
||||
knownHosts: getEffectiveKnownHosts(knownHosts) ?? [],
|
||||
terminalSettings,
|
||||
sessionId: `monitor-probe-${id}`,
|
||||
bootEpoch: 0,
|
||||
});
|
||||
if (!plan.ok || plan.kind !== "remote-desktop") {
|
||||
return { id, status: "error" as const };
|
||||
}
|
||||
return {
|
||||
id,
|
||||
kind: "probe" as const,
|
||||
probe: {
|
||||
protocol: plan.options.protocol,
|
||||
hostname: plan.options.hostname,
|
||||
port: plan.options.port,
|
||||
proxy: plan.options.proxy,
|
||||
jumpHosts: plan.options.jumpHosts,
|
||||
bannerCheck: true,
|
||||
timeoutMs: 5000,
|
||||
},
|
||||
};
|
||||
}
|
||||
if (
|
||||
!host ||
|
||||
(host.protocol && host.protocol !== "ssh") ||
|
||||
hostRestrictsExtraSshChannels(host)
|
||||
)
|
||||
@@ -156,35 +117,17 @@ export function useMonitorRuntime() {
|
||||
? { ...credentials.current.get(id), authMethod: "password" }
|
||||
: null,
|
||||
});
|
||||
if (!plan.ok || plan.kind !== "ssh") return { id, status: "error" as const };
|
||||
if (!plan.ok) return { id, status: "error" as const };
|
||||
if (plan.needsCredentialReentry)
|
||||
return { id, status: "login" as const };
|
||||
const companionProbes: MonitorRemoteDesktopProbeOptions[] = [];
|
||||
for (const proto of ["rdp", "vnc"] as const) {
|
||||
const enabled = proto === "rdp" ? hasCompanionRdp(effective) : hasCompanionVnc(effective);
|
||||
if (!enabled) continue;
|
||||
const spec = resolveRemoteDesktopConnectionSpec(effective, proto, identities);
|
||||
companionProbes.push({
|
||||
protocol: proto,
|
||||
hostname: spec.hostname,
|
||||
port: spec.port,
|
||||
tunnelViaHostSsh: spec.tunnelViaHostSsh,
|
||||
tunnelTargetHost: spec.tunnelTargetHost,
|
||||
proxy: spec.tunnelViaHostSsh ? undefined : plan.options.proxy,
|
||||
bannerCheck: true,
|
||||
timeoutMs: 5000,
|
||||
});
|
||||
}
|
||||
return {
|
||||
id,
|
||||
kind: "ssh" as const,
|
||||
options: {
|
||||
...plan.options,
|
||||
singleChannelSsh: hostRestrictsExtraSshChannels(effective),
|
||||
sshAuthReadyTimeoutMs: 120000,
|
||||
agentForwarding: effective.agentForwarding,
|
||||
},
|
||||
...(companionProbes.length > 0 ? { companionProbes } : {}),
|
||||
};
|
||||
}),
|
||||
}));
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import { useSyncExternalStore } from 'react';
|
||||
import {
|
||||
getPinyinMatcherVersion,
|
||||
subscribePinyinMatcherReady,
|
||||
} from '../../domain/searchMatcher';
|
||||
|
||||
/**
|
||||
* Subscribes a React component to lazy `pinyin-pro` dictionary load completion
|
||||
* so active CJK search memos re-evaluate immediately once ready.
|
||||
*/
|
||||
export function usePinyinMatcherVersion(): number {
|
||||
return useSyncExternalStore(
|
||||
subscribePinyinMatcherReady,
|
||||
getPinyinMatcherVersion,
|
||||
getPinyinMatcherVersion,
|
||||
);
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { netcattyBridge } from '../../infrastructure/services/netcattyBridge';
|
||||
import { localStorageAdapter } from '../../infrastructure/persistence/localStorageAdapter';
|
||||
import type {
|
||||
PluginAISidebarContextSnapshot,
|
||||
PluginAISidebarToolSpec,
|
||||
PluginAISidebarTurnContext,
|
||||
} from '../../infrastructure/ai/pluginAiSidebarTypes';
|
||||
|
||||
const WIDTH_STORAGE_KEY = 'netcatty:plugin-ai-sidebar-width';
|
||||
export const DEFAULT_PLUGIN_AI_SIDEBAR_WIDTH = 400;
|
||||
export const MIN_PLUGIN_AI_SIDEBAR_WIDTH = 320;
|
||||
export const MAX_PLUGIN_AI_SIDEBAR_WIDTH = 680;
|
||||
|
||||
export function readPluginAiSidebarWidth(): number {
|
||||
const parsed = localStorageAdapter.readNumber(WIDTH_STORAGE_KEY);
|
||||
if (
|
||||
typeof parsed === 'number'
|
||||
&& Number.isFinite(parsed)
|
||||
&& parsed >= MIN_PLUGIN_AI_SIDEBAR_WIDTH
|
||||
&& parsed <= MAX_PLUGIN_AI_SIDEBAR_WIDTH
|
||||
) {
|
||||
return Math.round(parsed);
|
||||
}
|
||||
return DEFAULT_PLUGIN_AI_SIDEBAR_WIDTH;
|
||||
}
|
||||
|
||||
export function writePluginAiSidebarWidth(width: number): void {
|
||||
const clamped = Math.max(
|
||||
MIN_PLUGIN_AI_SIDEBAR_WIDTH,
|
||||
Math.min(MAX_PLUGIN_AI_SIDEBAR_WIDTH, Math.round(width)),
|
||||
);
|
||||
localStorageAdapter.writeNumber(WIDTH_STORAGE_KEY, clamped);
|
||||
}
|
||||
|
||||
const EMPTY_STATE: NetcattyPluginAiSidebarState = Object.freeze({
|
||||
contexts: Object.freeze([]),
|
||||
tools: Object.freeze([]),
|
||||
});
|
||||
|
||||
export interface PendingPluginSidebarPrompt {
|
||||
readonly id: number;
|
||||
readonly prompt: string;
|
||||
readonly autoSend?: boolean;
|
||||
}
|
||||
|
||||
let nextPromptSeq = 1;
|
||||
|
||||
export function usePluginAiSidebarForView(options: {
|
||||
pluginId: string;
|
||||
pluginName: string;
|
||||
viewId: string;
|
||||
enabled?: boolean;
|
||||
onCommand?: (command: NetcattyPluginAiSidebarCommand) => void;
|
||||
}) {
|
||||
const { pluginId, pluginName, viewId, enabled = true, onCommand } = options;
|
||||
const [state, setState] = useState<NetcattyPluginAiSidebarState>(EMPTY_STATE);
|
||||
|
||||
useEffect(() => {
|
||||
if (!enabled) {
|
||||
setState(EMPTY_STATE);
|
||||
return;
|
||||
}
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.getPluginAiSidebarState && !bridge?.onPluginAiSidebarStateChanged) {
|
||||
setState(EMPTY_STATE);
|
||||
return;
|
||||
}
|
||||
let active = true;
|
||||
let receivedPush = false;
|
||||
const unsubscribeState = bridge.onPluginAiSidebarStateChanged?.((next) => {
|
||||
if (!active) return;
|
||||
receivedPush = true;
|
||||
setState(next ?? EMPTY_STATE);
|
||||
});
|
||||
void bridge.getPluginAiSidebarState?.().then((next) => {
|
||||
if (!active || receivedPush) return;
|
||||
setState(next ?? EMPTY_STATE);
|
||||
}).catch(() => {
|
||||
if (!active || receivedPush) return;
|
||||
setState(EMPTY_STATE);
|
||||
});
|
||||
return () => {
|
||||
active = false;
|
||||
unsubscribeState?.();
|
||||
};
|
||||
}, [enabled]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!enabled || !onCommand) return;
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.onPluginAiSidebarCommand) return;
|
||||
return bridge.onPluginAiSidebarCommand((command) => {
|
||||
if (!command || command.pluginId !== pluginId) return;
|
||||
if (command.viewId && command.viewId !== viewId) return;
|
||||
onCommand(command);
|
||||
});
|
||||
}, [enabled, onCommand, pluginId, viewId]);
|
||||
|
||||
const contextSnapshot: PluginAISidebarContextSnapshot | null = useMemo(() => {
|
||||
const match = state.contexts.find(
|
||||
(entry) => entry.pluginId === pluginId && entry.viewId === viewId,
|
||||
);
|
||||
return match ?? null;
|
||||
}, [pluginId, state.contexts, viewId]);
|
||||
|
||||
const tools: readonly PluginAISidebarToolSpec[] = useMemo(() => (
|
||||
state.tools.filter(
|
||||
(tool) => tool.pluginId === pluginId && (!tool.viewId || tool.viewId === viewId),
|
||||
)
|
||||
), [pluginId, state.tools, viewId]);
|
||||
|
||||
const turnContext: PluginAISidebarTurnContext | null = useMemo(() => {
|
||||
if (!contextSnapshot && tools.length === 0) return null;
|
||||
return {
|
||||
pluginId,
|
||||
pluginName: contextSnapshot?.pluginName || pluginName,
|
||||
viewId,
|
||||
...(contextSnapshot?.title ? { title: contextSnapshot.title } : {}),
|
||||
...(contextSnapshot?.subtitle ? { subtitle: contextSnapshot.subtitle } : {}),
|
||||
...(contextSnapshot?.summary ? { summary: contextSnapshot.summary } : {}),
|
||||
tools,
|
||||
};
|
||||
}, [contextSnapshot, pluginId, pluginName, tools, viewId]);
|
||||
|
||||
const suggestedPrompts = contextSnapshot?.suggestedPrompts;
|
||||
|
||||
const createPendingPrompt = useCallback(
|
||||
(prompt: string, autoSend?: boolean): PendingPluginSidebarPrompt => ({
|
||||
id: nextPromptSeq++,
|
||||
prompt,
|
||||
autoSend,
|
||||
}),
|
||||
[],
|
||||
);
|
||||
|
||||
return {
|
||||
contextSnapshot,
|
||||
tools,
|
||||
turnContext,
|
||||
suggestedPrompts,
|
||||
createPendingPrompt,
|
||||
};
|
||||
}
|
||||
@@ -6,8 +6,6 @@ import { getAppHandlers } from '../app/appHandlersBridge';
|
||||
import { getAppAppLockRuntime, getAppVaultRuntime, getAppSettingsRuntime } from './appRuntimeBridge';
|
||||
import { PluginHostActionResources } from './pluginHostActionResources';
|
||||
import { executePluginHostAction, type PluginHostAction } from './pluginHostActionExecution';
|
||||
import { handlePluginVaultDataRequest } from './pluginVaultDataHandlers';
|
||||
import { requestOpenDualPaneSftp } from './sftp/sftpDualPaneOpenStore';
|
||||
import { pluginHostRunsSavedScripts, type PluginHostDraftFields } from '../../domain/pluginHostActions';
|
||||
import type { Host, GroupConfig, ManagedSource, Snippet } from '../../domain/models';
|
||||
|
||||
@@ -122,27 +120,6 @@ export function usePluginHostActions() {
|
||||
});
|
||||
return;
|
||||
}
|
||||
const openHostSession = (host: Host) => {
|
||||
const mode = request.kind === 'vault.requestConnect' ? (request.mode ?? 'terminal') : 'terminal';
|
||||
if (mode === 'sftp') {
|
||||
requestOpenDualPaneSftp(host.id);
|
||||
return;
|
||||
}
|
||||
const connect = getAppHandlers()?.handleConnectToHost;
|
||||
if (typeof connect !== 'function') throw new Error('Host connection flow unavailable');
|
||||
return connect(host);
|
||||
};
|
||||
if (request.kind === 'vault.requestConnect' && entry.prompt.durableHostId && entry.host) {
|
||||
assertCurrent(entry);
|
||||
const receipt = await bridge.respondPluginInteraction!({ requestId: entry.prompt.requestId, actionToken: entry.prompt.actionToken, action: 'commit' });
|
||||
if (!receipt || typeof receipt !== 'object' || !receipt.completionToken) throw new Error('Host action was revoked');
|
||||
entry.completionToken = receipt.completionToken;
|
||||
entry.claimed = true;
|
||||
assertCurrent(entry);
|
||||
await openHostSession(entry.host);
|
||||
await bridge.respondPluginInteraction({ requestId: entry.prompt.requestId, actionToken: entry.completionToken!, action: 'complete' });
|
||||
return;
|
||||
}
|
||||
let action: PluginHostAction;
|
||||
if (request.kind === 'vault.requestConnect' && target) action = { kind: 'connect', target };
|
||||
else if (request.kind === 'vault.requestHostDraft' && entry.prompt.reviewedDraft) {
|
||||
@@ -159,7 +136,11 @@ export function usePluginHostActions() {
|
||||
entry.claimed = true;
|
||||
assertCurrent(entry);
|
||||
},
|
||||
connect: openHostSession,
|
||||
connect: (host) => {
|
||||
const connect = getAppHandlers()?.handleConnectToHost;
|
||||
if (typeof connect !== 'function') throw new Error('Host connection flow unavailable');
|
||||
return connect(host);
|
||||
},
|
||||
});
|
||||
await bridge.respondPluginInteraction({ requestId: entry.prompt.requestId, actionToken: entry.completionToken!, action: 'complete' });
|
||||
} catch { await fail(entry); }
|
||||
@@ -210,12 +191,7 @@ export function usePluginHostActions() {
|
||||
}
|
||||
const vault = getVault();
|
||||
const candidates = [...vault.hosts];
|
||||
const host = prompt.durableHostId
|
||||
? vault.hosts.find((candidate) => candidate.id === prompt.durableHostId)
|
||||
: prompt.vaultTarget
|
||||
? resources.current.resolve(prompt.vaultTarget.resourceId, prompt.vaultTarget.revision)
|
||||
: undefined;
|
||||
if (prompt.durableHostId && !host) throw new Error('Saved SSH host no longer exists');
|
||||
const host = prompt.vaultTarget ? resources.current.resolve(prompt.vaultTarget.resourceId, prompt.vaultTarget.revision) : undefined;
|
||||
const entry: Review = {
|
||||
prompt, candidates, candidateRevisions: new Map(candidates.map((candidate) => [candidate.id, resources.current.metadata(candidate.id).revision])),
|
||||
customGroups: vault.customGroups, host, groups: vault.groupConfigs, snippets: vault.snippets,
|
||||
@@ -244,39 +220,6 @@ export function usePluginHostActions() {
|
||||
};
|
||||
}, [execute, fail, getVault]);
|
||||
|
||||
useEffect(() => {
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.onPluginVaultDataRequest || !bridge.respondPluginVaultData || !bridge.setPluginVaultDataReady) return;
|
||||
const unsubscribe = bridge.onPluginVaultDataRequest((request) => {
|
||||
void (async () => {
|
||||
try {
|
||||
const data = await handlePluginVaultDataRequest(request.kind, request.payload ?? {}, {
|
||||
getVault,
|
||||
resources: resources.current,
|
||||
});
|
||||
await bridge.respondPluginVaultData!({
|
||||
requestId: request.requestId,
|
||||
actionToken: request.actionToken,
|
||||
ok: true,
|
||||
data,
|
||||
});
|
||||
} catch (err) {
|
||||
await bridge.respondPluginVaultData!({
|
||||
requestId: request.requestId,
|
||||
actionToken: request.actionToken,
|
||||
ok: false,
|
||||
error: err instanceof Error ? err.message : 'Vault data request failed',
|
||||
}).catch(() => {});
|
||||
}
|
||||
})();
|
||||
});
|
||||
void bridge.setPluginVaultDataReady(true).catch(() => {});
|
||||
return () => {
|
||||
unsubscribe();
|
||||
void bridge.setPluginVaultDataReady?.(false).catch(() => {});
|
||||
};
|
||||
}, [getVault]);
|
||||
|
||||
const respond = useCallback(async (action: 'cancel' | 'submit', draft?: PluginHostDraftFields, rememberOverride?: boolean) => {
|
||||
const entry = current.current;
|
||||
if (!entry || responding.current || (action === 'cancel' && entry.claimed)) return;
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { netcattyBridge } from '../../infrastructure/services/netcattyBridge';
|
||||
|
||||
const EMPTY_BADGES: ReadonlyMap<string, NetcattyPluginViewBadge> = new Map();
|
||||
|
||||
function buildBadgeMap(
|
||||
badges: ReadonlyArray<NetcattyPluginViewBadge> | null | undefined,
|
||||
): ReadonlyMap<string, NetcattyPluginViewBadge> {
|
||||
if (!Array.isArray(badges) || badges.length === 0) return EMPTY_BADGES;
|
||||
const map = new Map<string, NetcattyPluginViewBadge>();
|
||||
for (const badge of badges) {
|
||||
if (badge && typeof badge.viewId === 'string' && badge.viewId.length > 0) {
|
||||
map.set(badge.viewId, badge);
|
||||
}
|
||||
}
|
||||
return map.size > 0 ? map : EMPTY_BADGES;
|
||||
}
|
||||
|
||||
export function usePluginViewBadges(enabled = true): ReadonlyMap<string, NetcattyPluginViewBadge> {
|
||||
const [badgesByViewId, setBadgesByViewId] = useState<ReadonlyMap<string, NetcattyPluginViewBadge>>(EMPTY_BADGES);
|
||||
|
||||
useEffect(() => {
|
||||
if (!enabled) {
|
||||
setBadgesByViewId(EMPTY_BADGES);
|
||||
return;
|
||||
}
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.listPluginViewBadges && !bridge?.onPluginViewBadgesChanged) {
|
||||
setBadgesByViewId(EMPTY_BADGES);
|
||||
return;
|
||||
}
|
||||
let active = true;
|
||||
let receivedPush = false;
|
||||
const unsubscribe = bridge.onPluginViewBadgesChanged?.((badges) => {
|
||||
if (!active) return;
|
||||
receivedPush = true;
|
||||
setBadgesByViewId(buildBadgeMap(badges));
|
||||
});
|
||||
void bridge.listPluginViewBadges?.().then((badges) => {
|
||||
if (!active || receivedPush) return;
|
||||
setBadgesByViewId(buildBadgeMap(badges));
|
||||
}).catch(() => {
|
||||
if (!active || receivedPush) return;
|
||||
setBadgesByViewId(EMPTY_BADGES);
|
||||
});
|
||||
return () => {
|
||||
active = false;
|
||||
unsubscribe?.();
|
||||
};
|
||||
}, [enabled]);
|
||||
|
||||
return badgesByViewId;
|
||||
}
|
||||
@@ -1,317 +0,0 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import React, { act } from 'react';
|
||||
import { create, type ReactTestRenderer } from 'react-test-renderer';
|
||||
|
||||
import { normalizeTerminalSettings } from '../../domain/models/terminal.ts';
|
||||
import type { Host, PortForwardingRule } from '../../domain/models.ts';
|
||||
import type { ListeningPortInfo } from '../../domain/systemManager/types.ts';
|
||||
import { STORAGE_KEY_PORT_FORWARDING } from '../../infrastructure/config/storageKeys.ts';
|
||||
import { netcattyBridge } from '../../infrastructure/services/netcattyBridge.ts';
|
||||
import { stopAllPortForwards } from '../../infrastructure/services/portForwardingService.ts';
|
||||
import type { TerminalSession } from '../../types.ts';
|
||||
import { resetPortForwardingStateForTests } from './usePortForwardingState.ts';
|
||||
import {
|
||||
resetEphemeralQuickForwardsForTests,
|
||||
useQuickPortForwarding,
|
||||
type QuickPortForwardingContext,
|
||||
} from './useQuickPortForwarding.ts';
|
||||
|
||||
function installDomGlobals() {
|
||||
const previous = new Map<string, PropertyDescriptor | undefined>();
|
||||
const setGlobal = (key: string, value: unknown) => {
|
||||
previous.set(key, Object.getOwnPropertyDescriptor(globalThis, key));
|
||||
Object.defineProperty(globalThis, key, { configurable: true, writable: true, value });
|
||||
};
|
||||
|
||||
const backing = new Map<string, string>();
|
||||
const storage: Storage = {
|
||||
get length() { return backing.size; },
|
||||
clear() { backing.clear(); },
|
||||
getItem(key) { return backing.get(key) ?? null; },
|
||||
key(index) { return Array.from(backing.keys())[index] ?? null; },
|
||||
removeItem(key) { backing.delete(key); },
|
||||
setItem(key, value) { backing.set(key, value); },
|
||||
};
|
||||
|
||||
setGlobal('IS_REACT_ACT_ENVIRONMENT', true);
|
||||
setGlobal('localStorage', storage);
|
||||
setGlobal('window', {
|
||||
addEventListener() {},
|
||||
removeEventListener() {},
|
||||
dispatchEvent() { return true; },
|
||||
});
|
||||
setGlobal('document', {
|
||||
visibilityState: 'visible',
|
||||
hidden: false,
|
||||
addEventListener() {},
|
||||
removeEventListener() {},
|
||||
});
|
||||
|
||||
return {
|
||||
backing,
|
||||
restore() {
|
||||
for (const [key, desc] of previous.entries()) {
|
||||
if (desc) Object.defineProperty(globalThis, key, desc);
|
||||
else Reflect.deleteProperty(globalThis, key);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const savedHost: Host = {
|
||||
id: 'host-saved',
|
||||
label: 'Prod API',
|
||||
hostname: '10.0.0.10',
|
||||
port: 22,
|
||||
username: 'ubuntu',
|
||||
tags: [],
|
||||
os: 'linux',
|
||||
};
|
||||
|
||||
const sshSession: TerminalSession = {
|
||||
id: 'session-1',
|
||||
hostId: savedHost.id,
|
||||
hostLabel: savedHost.label,
|
||||
username: savedHost.username,
|
||||
hostname: savedHost.hostname,
|
||||
status: 'connected',
|
||||
protocol: 'ssh',
|
||||
};
|
||||
|
||||
const listeningPort: ListeningPortInfo = {
|
||||
id: 'tcp|*|5432|100',
|
||||
protocol: 'tcp',
|
||||
address: '*',
|
||||
port: 5432,
|
||||
pid: 100,
|
||||
processName: 'postgres',
|
||||
};
|
||||
|
||||
function makeContext(overrides: Partial<QuickPortForwardingContext> = {}): QuickPortForwardingContext {
|
||||
return {
|
||||
session: sshSession,
|
||||
sessionHost: savedHost,
|
||||
vaultHosts: [savedHost],
|
||||
effectiveHosts: [savedHost],
|
||||
keys: [],
|
||||
identities: [],
|
||||
knownHosts: [],
|
||||
terminalSettings: normalizeTerminalSettings(),
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
test('useQuickPortForwarding creates, reuses, stops, and rolls back failed new rules for saved hosts', async (t) => {
|
||||
const env = installDomGlobals();
|
||||
resetPortForwardingStateForTests();
|
||||
resetEphemeralQuickForwardsForTests();
|
||||
|
||||
const statusHandlers = new Map<string, (status: PortForwardingRule['status'], error?: string | null) => void>();
|
||||
let failNextStart: string | null = null;
|
||||
const startedPayloads: Array<Record<string, unknown>> = [];
|
||||
const stoppedRuleIds: string[] = [];
|
||||
|
||||
t.mock.method(netcattyBridge, 'get', () => ({
|
||||
getPortForwardSnapshot: async () => ({ epoch: 'e1', revision: 0, records: [] }),
|
||||
subscribePortForwardRuntime: async () => ({ epoch: 'e1', revision: 0, records: [] }),
|
||||
onPortForwardRuntime: () => () => undefined,
|
||||
unsubscribePortForwardRuntime: async () => undefined,
|
||||
onPortForwardStatus: (tunnelId: string, cb: (status: PortForwardingRule['status'], error?: string | null) => void) => {
|
||||
statusHandlers.set(tunnelId, cb);
|
||||
return () => { statusHandlers.delete(tunnelId); };
|
||||
},
|
||||
startPortForward: async (options: Record<string, unknown>) => {
|
||||
startedPayloads.push(options);
|
||||
if (failNextStart) {
|
||||
return { success: false, error: failNextStart };
|
||||
}
|
||||
const tunnelId = String(options.tunnelId);
|
||||
statusHandlers.get(tunnelId)?.('active');
|
||||
return { success: true, tunnelId, localPort: options.localPort };
|
||||
},
|
||||
stopPortForwardByRuleId: async (ruleId: string) => {
|
||||
stoppedRuleIds.push(ruleId);
|
||||
return { stopped: 1, failed: 0, errors: [] };
|
||||
},
|
||||
stopAllPortForwards: async () => ({ success: true }),
|
||||
}));
|
||||
|
||||
let api!: ReturnType<typeof useQuickPortForwarding>;
|
||||
const ctx = makeContext();
|
||||
function Probe() {
|
||||
api = useQuickPortForwarding(ctx);
|
||||
return null;
|
||||
}
|
||||
|
||||
let root: ReactTestRenderer | undefined;
|
||||
try {
|
||||
await act(async () => {
|
||||
root = create(<Probe />);
|
||||
});
|
||||
|
||||
assert.equal(api.canForward, true);
|
||||
|
||||
// 1. Failed start of a brand-new rule rolls it back so Vault stays clean.
|
||||
failNextStart = 'listen EADDRINUSE: address already in use 127.0.0.1:5432';
|
||||
let failedResult!: Awaited<ReturnType<typeof api.startQuickForward>>;
|
||||
await act(async () => {
|
||||
failedResult = await api.startQuickForward({
|
||||
port: listeningPort,
|
||||
localPort: 5432,
|
||||
bindAddress: '127.0.0.1',
|
||||
});
|
||||
});
|
||||
assert.equal(failedResult.success, false);
|
||||
assert.match(failedResult.error ?? '', /EADDRINUSE/);
|
||||
assert.equal(api.allRules.length, 0);
|
||||
|
||||
// 2. Successful start persists a local rule and marks it active.
|
||||
failNextStart = null;
|
||||
let startedResult!: Awaited<ReturnType<typeof api.startQuickForward>>;
|
||||
await act(async () => {
|
||||
startedResult = await api.startQuickForward({
|
||||
port: listeningPort,
|
||||
localPort: 15432,
|
||||
bindAddress: '127.0.0.1',
|
||||
});
|
||||
});
|
||||
assert.equal(startedResult.success, true);
|
||||
assert.equal(api.allRules.length, 1);
|
||||
const createdRuleId = startedResult.rule!.id;
|
||||
assert.equal(api.allRules[0].status, 'active');
|
||||
assert.equal(api.allRules[0].localPort, 15432);
|
||||
assert.equal(api.allRules[0].remoteHost, '127.0.0.1');
|
||||
assert.equal(api.allRules[0].remotePort, 5432);
|
||||
assert.equal(startedPayloads[1]?.reuseTransport, true);
|
||||
assert.ok(env.backing.get(STORAGE_KEY_PORT_FORWARDING)?.includes(createdRuleId));
|
||||
|
||||
// 3. Stop transitions rule back to inactive.
|
||||
await act(async () => {
|
||||
const stopRes = await api.stopQuickForward(api.allRules[0]);
|
||||
assert.equal(stopRes.success, true);
|
||||
});
|
||||
assert.ok(stoppedRuleIds.includes(createdRuleId));
|
||||
assert.equal(api.allRules[0].status, 'inactive');
|
||||
|
||||
// 4. Starting again with the same localPort + bindAddress reuses the rule without duplicates.
|
||||
let restartedResult!: Awaited<ReturnType<typeof api.startQuickForward>>;
|
||||
await act(async () => {
|
||||
restartedResult = await api.startQuickForward({
|
||||
port: listeningPort,
|
||||
localPort: 15432,
|
||||
bindAddress: '127.0.0.1',
|
||||
});
|
||||
});
|
||||
assert.equal(restartedResult.success, true);
|
||||
assert.equal(restartedResult.rule?.id, createdRuleId);
|
||||
assert.equal(api.allRules.length, 1);
|
||||
|
||||
// 5. Failure on a reused pre-existing rule must NOT delete it.
|
||||
await act(async () => {
|
||||
await api.stopQuickForward(api.allRules[0]);
|
||||
});
|
||||
failNextStart = 'listen EADDRINUSE';
|
||||
await act(async () => {
|
||||
const res = await api.startQuickForward({
|
||||
port: listeningPort,
|
||||
localPort: 15432,
|
||||
bindAddress: '127.0.0.1',
|
||||
});
|
||||
assert.equal(res.success, false);
|
||||
});
|
||||
assert.equal(api.allRules.length, 1);
|
||||
assert.equal(api.allRules[0].id, createdRuleId);
|
||||
} finally {
|
||||
await stopAllPortForwards();
|
||||
await act(async () => {
|
||||
root?.unmount();
|
||||
});
|
||||
resetPortForwardingStateForTests();
|
||||
resetEphemeralQuickForwardsForTests();
|
||||
env.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test('useQuickPortForwarding keeps unsaved quick-connect tunnels in memory without polluting localStorage', async (t) => {
|
||||
const env = installDomGlobals();
|
||||
resetPortForwardingStateForTests();
|
||||
resetEphemeralQuickForwardsForTests();
|
||||
|
||||
const statusHandlers = new Map<string, (status: PortForwardingRule['status'], error?: string | null) => void>();
|
||||
t.mock.method(netcattyBridge, 'get', () => ({
|
||||
getPortForwardSnapshot: async () => ({ epoch: 'e1', revision: 0, records: [] }),
|
||||
subscribePortForwardRuntime: async () => ({ epoch: 'e1', revision: 0, records: [] }),
|
||||
onPortForwardRuntime: () => () => undefined,
|
||||
unsubscribePortForwardRuntime: async () => undefined,
|
||||
onPortForwardStatus: (tunnelId: string, cb: (status: PortForwardingRule['status'], error?: string | null) => void) => {
|
||||
statusHandlers.set(tunnelId, cb);
|
||||
return () => { statusHandlers.delete(tunnelId); };
|
||||
},
|
||||
startPortForward: async (options: Record<string, unknown>) => {
|
||||
const tunnelId = String(options.tunnelId);
|
||||
statusHandlers.get(tunnelId)?.('active');
|
||||
return { success: true, tunnelId, localPort: options.localPort };
|
||||
},
|
||||
stopPortForwardByRuleId: async () => ({ stopped: 1, failed: 0, errors: [] }),
|
||||
stopAllPortForwards: async () => ({ success: true }),
|
||||
}));
|
||||
|
||||
const quickHost: Host = {
|
||||
...savedHost,
|
||||
id: 'quick-connect-1',
|
||||
ephemeral: true,
|
||||
};
|
||||
const quickSession: TerminalSession = {
|
||||
...sshSession,
|
||||
hostId: quickHost.id,
|
||||
};
|
||||
|
||||
let api!: ReturnType<typeof useQuickPortForwarding>;
|
||||
const ctx = makeContext({
|
||||
session: quickSession,
|
||||
sessionHost: quickHost,
|
||||
vaultHosts: [],
|
||||
effectiveHosts: [],
|
||||
});
|
||||
function Probe() {
|
||||
api = useQuickPortForwarding(ctx);
|
||||
return null;
|
||||
}
|
||||
|
||||
let root: ReactTestRenderer | undefined;
|
||||
try {
|
||||
await act(async () => {
|
||||
root = create(<Probe />);
|
||||
});
|
||||
|
||||
assert.equal(api.canForward, true);
|
||||
|
||||
await act(async () => {
|
||||
const res = await api.startQuickForward({
|
||||
port: listeningPort,
|
||||
localPort: 25432,
|
||||
bindAddress: '127.0.0.1',
|
||||
});
|
||||
assert.equal(res.success, true);
|
||||
});
|
||||
|
||||
assert.equal(api.allRules.length, 1);
|
||||
assert.equal(api.allRules[0].status, 'active');
|
||||
assert.equal(env.backing.get(STORAGE_KEY_PORT_FORWARDING), undefined);
|
||||
|
||||
await act(async () => {
|
||||
const stopRes = await api.stopQuickForward(api.allRules[0]);
|
||||
assert.equal(stopRes.success, true);
|
||||
});
|
||||
assert.equal(api.allRules.length, 0);
|
||||
} finally {
|
||||
await stopAllPortForwards();
|
||||
await act(async () => {
|
||||
root?.unmount();
|
||||
});
|
||||
resetPortForwardingStateForTests();
|
||||
resetEphemeralQuickForwardsForTests();
|
||||
env.restore();
|
||||
}
|
||||
});
|
||||
@@ -1,303 +0,0 @@
|
||||
import { useCallback, useMemo, useState, useSyncExternalStore } from 'react';
|
||||
import { isSavedVaultHost } from '../../domain/ephemeralHosts';
|
||||
import type {
|
||||
Host,
|
||||
Identity,
|
||||
KnownHost,
|
||||
PortForwardingRule,
|
||||
SSHKey,
|
||||
TerminalSettings,
|
||||
} from '../../domain/models';
|
||||
import { isPortForwardingAutoReconnectEnabled } from '../../domain/portForwardingReconnect';
|
||||
import {
|
||||
buildQuickForwardRuleLabel,
|
||||
canQuickForwardSession,
|
||||
findExactReusableForwardRule,
|
||||
resolveForwardRemoteHost,
|
||||
} from '../../domain/systemManager/portForwardQuick';
|
||||
import type { ListeningPortInfo } from '../../domain/systemManager/types';
|
||||
import {
|
||||
clearReconnectTimer,
|
||||
startPortForward,
|
||||
stopPortForward,
|
||||
} from '../../infrastructure/services/portForwardingService';
|
||||
import type { TerminalSession } from '../../types';
|
||||
import { usePortForwardingState } from './usePortForwardingState';
|
||||
|
||||
export interface QuickPortForwardingContext {
|
||||
session: TerminalSession | null;
|
||||
sessionHost: Host | null;
|
||||
/** Authenticated session host override (e.g. interactive password/user). */
|
||||
authHost?: Host | null;
|
||||
/** Saved vault hosts, used to determine if rules should be persisted to Vault. */
|
||||
vaultHosts: Host[];
|
||||
/** Materialized hosts (group defaults + proxy profiles) for jump-host resolution. */
|
||||
effectiveHosts: Host[];
|
||||
keys: SSHKey[];
|
||||
identities: Identity[];
|
||||
knownHosts: KnownHost[];
|
||||
terminalSettings: TerminalSettings;
|
||||
}
|
||||
|
||||
export interface StartQuickForwardParams {
|
||||
port: ListeningPortInfo;
|
||||
localPort: number;
|
||||
bindAddress: string;
|
||||
}
|
||||
|
||||
export interface StartQuickForwardResult {
|
||||
success: boolean;
|
||||
rule?: PortForwardingRule;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
// In-memory store for quick-forwards launched from unsaved / ephemeral sessions
|
||||
// so they never write dangling hostId references to localStorage or cloud sync.
|
||||
const ephemeralRulesMap = new Map<string, PortForwardingRule>();
|
||||
let ephemeralRulesSnapshot: PortForwardingRule[] = [];
|
||||
const ephemeralListeners = new Set<() => void>();
|
||||
|
||||
function notifyEphemeralListeners(): void {
|
||||
ephemeralRulesSnapshot = Array.from(ephemeralRulesMap.values());
|
||||
ephemeralListeners.forEach((listener) => listener());
|
||||
}
|
||||
|
||||
function subscribeEphemeralRules(listener: () => void): () => void {
|
||||
ephemeralListeners.add(listener);
|
||||
return () => {
|
||||
ephemeralListeners.delete(listener);
|
||||
};
|
||||
}
|
||||
|
||||
function getEphemeralRulesSnapshot(): PortForwardingRule[] {
|
||||
return ephemeralRulesSnapshot;
|
||||
}
|
||||
|
||||
function upsertEphemeralRule(rule: PortForwardingRule): void {
|
||||
ephemeralRulesMap.set(rule.id, rule);
|
||||
notifyEphemeralListeners();
|
||||
}
|
||||
|
||||
function updateEphemeralRuleStatus(
|
||||
ruleId: string,
|
||||
status: PortForwardingRule['status'],
|
||||
error?: string,
|
||||
): void {
|
||||
const existing = ephemeralRulesMap.get(ruleId);
|
||||
if (!existing) return;
|
||||
if (status === 'inactive') {
|
||||
ephemeralRulesMap.delete(ruleId);
|
||||
} else {
|
||||
ephemeralRulesMap.set(ruleId, {
|
||||
...existing,
|
||||
status,
|
||||
error,
|
||||
lastUsedAt: status === 'active' ? Date.now() : existing.lastUsedAt,
|
||||
});
|
||||
}
|
||||
notifyEphemeralListeners();
|
||||
}
|
||||
|
||||
function deleteEphemeralRule(ruleId: string): void {
|
||||
if (!ephemeralRulesMap.delete(ruleId)) return;
|
||||
notifyEphemeralListeners();
|
||||
}
|
||||
|
||||
export function resetEphemeralQuickForwardsForTests(): void {
|
||||
ephemeralRulesMap.clear();
|
||||
ephemeralRulesSnapshot = [];
|
||||
ephemeralListeners.clear();
|
||||
}
|
||||
|
||||
export function useQuickPortForwarding(context?: QuickPortForwardingContext) {
|
||||
const {
|
||||
rules: persistedRules,
|
||||
addRule,
|
||||
deleteRule,
|
||||
startTunnel,
|
||||
stopTunnel,
|
||||
} = usePortForwardingState();
|
||||
const ephemeralRules = useSyncExternalStore(
|
||||
subscribeEphemeralRules,
|
||||
getEphemeralRulesSnapshot,
|
||||
getEphemeralRulesSnapshot,
|
||||
);
|
||||
const [pendingRuleIds, setPendingRuleIds] = useState<ReadonlySet<string>>(() => new Set());
|
||||
|
||||
const targetHost = context?.authHost ?? context?.sessionHost ?? null;
|
||||
const hostId = context?.sessionHost?.id;
|
||||
const canForward = useMemo(
|
||||
() => Boolean(context) && canQuickForwardSession(targetHost, context?.session),
|
||||
[context, targetHost],
|
||||
);
|
||||
|
||||
const canPersistRule = useMemo(() => {
|
||||
if (!context?.sessionHost || !isSavedVaultHost(context.sessionHost)) return false;
|
||||
return context.vaultHosts.some((candidate) => candidate.id === context.sessionHost!.id);
|
||||
}, [context]);
|
||||
|
||||
const allRules = useMemo(
|
||||
() => (ephemeralRules.length > 0 ? [...persistedRules, ...ephemeralRules] : persistedRules),
|
||||
[ephemeralRules, persistedRules],
|
||||
);
|
||||
|
||||
const markPending = useCallback((ruleId: string, pending: boolean) => {
|
||||
setPendingRuleIds((prev) => {
|
||||
const has = prev.has(ruleId);
|
||||
if (pending === has) return prev;
|
||||
const next = new Set(prev);
|
||||
if (pending) next.add(ruleId);
|
||||
else next.delete(ruleId);
|
||||
return next;
|
||||
});
|
||||
}, []);
|
||||
|
||||
const startQuickForward = useCallback(
|
||||
async ({
|
||||
port,
|
||||
localPort,
|
||||
bindAddress,
|
||||
}: StartQuickForwardParams): Promise<StartQuickForwardResult> => {
|
||||
if (!context || !targetHost || !hostId || !canForward) {
|
||||
return { success: false, error: 'Port forwarding is unavailable for this session.' };
|
||||
}
|
||||
|
||||
const remoteHost = resolveForwardRemoteHost(port);
|
||||
const label = buildQuickForwardRuleLabel(
|
||||
context.sessionHost?.label || context.session?.hostLabel || targetHost.hostname,
|
||||
port,
|
||||
localPort,
|
||||
remoteHost,
|
||||
);
|
||||
|
||||
if (canPersistRule) {
|
||||
const reusableRule = findExactReusableForwardRule(persistedRules, {
|
||||
hostId,
|
||||
remoteHost,
|
||||
remotePort: port.port,
|
||||
localPort,
|
||||
bindAddress,
|
||||
});
|
||||
|
||||
const rule = reusableRule ?? addRule({
|
||||
label,
|
||||
type: 'local',
|
||||
localPort,
|
||||
bindAddress,
|
||||
remoteHost,
|
||||
remotePort: port.port,
|
||||
hostId,
|
||||
autoStart: false,
|
||||
});
|
||||
const createdNewRule = !reusableRule;
|
||||
|
||||
markPending(rule.id, true);
|
||||
try {
|
||||
const result = await startTunnel(
|
||||
rule,
|
||||
targetHost,
|
||||
context.effectiveHosts,
|
||||
context.keys,
|
||||
context.identities,
|
||||
undefined,
|
||||
isPortForwardingAutoReconnectEnabled(rule),
|
||||
context.terminalSettings,
|
||||
context.knownHosts,
|
||||
);
|
||||
if (!result.success) {
|
||||
if (createdNewRule) {
|
||||
deleteRule(rule.id);
|
||||
}
|
||||
return { success: false, error: result.error };
|
||||
}
|
||||
return { success: true, rule };
|
||||
} finally {
|
||||
markPending(rule.id, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Ephemeral / unsaved quick-connect session: run tunnel in-memory without
|
||||
// persisting a dangling hostId into Vault or cloud sync.
|
||||
const ephemeralRule: PortForwardingRule = {
|
||||
id: crypto.randomUUID(),
|
||||
label,
|
||||
type: 'local',
|
||||
localPort,
|
||||
bindAddress,
|
||||
remoteHost,
|
||||
remotePort: port.port,
|
||||
hostId,
|
||||
autoStart: false,
|
||||
status: 'connecting',
|
||||
createdAt: Date.now(),
|
||||
};
|
||||
upsertEphemeralRule(ephemeralRule);
|
||||
markPending(ephemeralRule.id, true);
|
||||
try {
|
||||
const result = await startPortForward(
|
||||
ephemeralRule,
|
||||
targetHost,
|
||||
context.effectiveHosts,
|
||||
context.keys,
|
||||
context.identities,
|
||||
(status, error) => {
|
||||
updateEphemeralRuleStatus(ephemeralRule.id, status, error);
|
||||
},
|
||||
false,
|
||||
context.terminalSettings,
|
||||
context.knownHosts,
|
||||
);
|
||||
if (!result.success) {
|
||||
deleteEphemeralRule(ephemeralRule.id);
|
||||
return { success: false, error: result.error };
|
||||
}
|
||||
return { success: true, rule: ephemeralRule };
|
||||
} finally {
|
||||
markPending(ephemeralRule.id, false);
|
||||
}
|
||||
},
|
||||
[
|
||||
addRule,
|
||||
canForward,
|
||||
canPersistRule,
|
||||
context,
|
||||
deleteRule,
|
||||
hostId,
|
||||
markPending,
|
||||
persistedRules,
|
||||
startTunnel,
|
||||
targetHost,
|
||||
],
|
||||
);
|
||||
|
||||
const stopQuickForward = useCallback(
|
||||
async (rule: PortForwardingRule): Promise<{ success: boolean; error?: string }> => {
|
||||
markPending(rule.id, true);
|
||||
try {
|
||||
if (ephemeralRulesMap.has(rule.id)) {
|
||||
clearReconnectTimer(rule.id);
|
||||
const result = await stopPortForward(rule.id, (status, error) => {
|
||||
updateEphemeralRuleStatus(rule.id, status, error);
|
||||
});
|
||||
if (result.success) {
|
||||
deleteEphemeralRule(rule.id);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return await stopTunnel(rule.id);
|
||||
} finally {
|
||||
markPending(rule.id, false);
|
||||
}
|
||||
},
|
||||
[markPending, stopTunnel],
|
||||
);
|
||||
|
||||
return {
|
||||
canForward,
|
||||
hostId,
|
||||
allRules,
|
||||
pendingRuleIds,
|
||||
startQuickForward,
|
||||
stopQuickForward,
|
||||
};
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
createSessionHistorySearch,
|
||||
type SessionHistorySearchScan,
|
||||
} from './sessionHistorySearch';
|
||||
import { usePinyinMatcherVersion } from './usePinyinMatcherVersion';
|
||||
|
||||
/** Search outside rendering, yielding between bounded slices for input/paint. */
|
||||
export function useSessionHistorySearch<T extends SessionHistorySearchTarget>(
|
||||
@@ -13,12 +12,10 @@ export function useSessionHistorySearch<T extends SessionHistorySearchTarget>(
|
||||
untitledLabel: string,
|
||||
): { filteredSessions: readonly T[]; isSearching: boolean } {
|
||||
const search = useMemo(() => createSessionHistorySearch(), []);
|
||||
const pinyinMatcherVersion = usePinyinMatcherVersion();
|
||||
const latest = useRef({ sessions, query, untitledLabel });
|
||||
const work = useRef<{
|
||||
query: string;
|
||||
untitledLabel: string;
|
||||
pinyinMatcherVersion: number;
|
||||
scan: SessionHistorySearchScan<T>;
|
||||
} | null>(null);
|
||||
const timer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
@@ -47,21 +44,9 @@ export function useSessionHistorySearch<T extends SessionHistorySearchTarget>(
|
||||
search.filterSessionHistory(sessions, '');
|
||||
return;
|
||||
}
|
||||
if (
|
||||
work.current?.query !== query
|
||||
|| work.current.untitledLabel !== untitledLabel
|
||||
|| work.current.pinyinMatcherVersion !== pinyinMatcherVersion
|
||||
) {
|
||||
if (work.current && work.current.pinyinMatcherVersion !== pinyinMatcherVersion) {
|
||||
search.clearSessionHistorySearchCache();
|
||||
}
|
||||
if (work.current?.query !== query || work.current.untitledLabel !== untitledLabel) {
|
||||
cancel();
|
||||
work.current = {
|
||||
query,
|
||||
untitledLabel,
|
||||
pinyinMatcherVersion,
|
||||
scan: search.createScan<T>(query, { untitledLabel }),
|
||||
};
|
||||
work.current = { query, untitledLabel, scan: search.createScan<T>(query, { untitledLabel }) };
|
||||
}
|
||||
if (timer.current !== null) return;
|
||||
const job = work.current;
|
||||
@@ -80,7 +65,7 @@ export function useSessionHistorySearch<T extends SessionHistorySearchTarget>(
|
||||
// Session updates reuse the in-flight query's match decisions, so one
|
||||
// streaming session cannot restart and starve a large history search.
|
||||
timer.current = setTimeout(run, 0);
|
||||
}, [sessions, query, untitledLabel, search, pinyinMatcherVersion]);
|
||||
}, [sessions, query, untitledLabel, search]);
|
||||
|
||||
useEffect(() => () => {
|
||||
if (timer.current !== null) clearTimeout(timer.current);
|
||||
|
||||
@@ -5,15 +5,10 @@ import { addLogView, getLogViewTabId, removeLogView, type LogView } from './logV
|
||||
import {
|
||||
createHostTerminalSession,
|
||||
createLocalTerminalSession,
|
||||
createRemoteDesktopSession,
|
||||
createSerialTerminalSession,
|
||||
createWorkspaceHostTerminalSession,
|
||||
type LocalTerminalOptions,
|
||||
} from './sessionFactories';
|
||||
import {
|
||||
isRemoteDesktopProtocol,
|
||||
type RemoteDesktopProtocol,
|
||||
} from '../../domain/remoteDesktop';
|
||||
import { isScriptSnippet } from '../../domain/snippetScript.ts';
|
||||
import {
|
||||
appendPaneToWorkspaceRoot,
|
||||
@@ -62,40 +57,7 @@ import {
|
||||
LOCAL_STORAGE_ADAPTER_CHANGED_EVENT,
|
||||
localStorageAdapter,
|
||||
} from '../../infrastructure/persistence/localStorageAdapter';
|
||||
import {
|
||||
netcattyBridge,
|
||||
type RemoteDesktopBridgeApi,
|
||||
type RemoteDesktopCertDecisionValue,
|
||||
type RemoteDesktopCertVerifyEvent,
|
||||
type RemoteDesktopLocalDisplay,
|
||||
type RemoteDesktopOpenSystemClientOptions,
|
||||
type RemoteDesktopRdpdrDriveConfig,
|
||||
type RemoteDesktopRdpdrPickFolderResult,
|
||||
type RemoteDesktopRdpdrRegisterDrivesResult,
|
||||
type RemoteDesktopRdpdrRequest,
|
||||
type RemoteDesktopRdpdrResponse,
|
||||
type RemoteDesktopStartOptions,
|
||||
type RemoteDesktopStatsEvent,
|
||||
} from '../../infrastructure/services/netcattyBridge';
|
||||
|
||||
export type {
|
||||
RemoteDesktopBridgeApi,
|
||||
RemoteDesktopCertDecisionValue,
|
||||
RemoteDesktopCertVerifyEvent,
|
||||
RemoteDesktopLocalDisplay,
|
||||
RemoteDesktopOpenSystemClientOptions,
|
||||
RemoteDesktopRdpdrDriveConfig,
|
||||
RemoteDesktopRdpdrPickFolderResult,
|
||||
RemoteDesktopRdpdrRegisterDrivesResult,
|
||||
RemoteDesktopRdpdrRequest,
|
||||
RemoteDesktopRdpdrResponse,
|
||||
RemoteDesktopStartOptions,
|
||||
RemoteDesktopStatsEvent,
|
||||
};
|
||||
|
||||
export function getRemoteDesktopBridge(): RemoteDesktopBridgeApi | undefined {
|
||||
return netcattyBridge.get()?.remoteDesktop;
|
||||
}
|
||||
import { netcattyBridge } from '../../infrastructure/services/netcattyBridge';
|
||||
import { sessionRestoreStorage } from './sessionRestoreStorage';
|
||||
import {
|
||||
buildAndWriteSessionRestorePayload,
|
||||
@@ -605,12 +567,8 @@ export const useSessionState = ({
|
||||
publishSessionDynamicTitle(sessionId, nextTitle);
|
||||
}, []);
|
||||
|
||||
const updateSessionPromptHost = useCallback((
|
||||
sessionId: string,
|
||||
hostname: string | null,
|
||||
options?: { fromJumpServer?: boolean },
|
||||
) => {
|
||||
publishSessionPromptHost(sessionId, hostname?.trim() || null, options);
|
||||
const updateSessionPromptHost = useCallback((sessionId: string, hostname: string | null) => {
|
||||
publishSessionPromptHost(sessionId, hostname?.trim() || null);
|
||||
}, []);
|
||||
|
||||
const updateSessionCodingCliProvider = useCallback((
|
||||
@@ -638,88 +596,13 @@ export const useSessionState = ({
|
||||
|
||||
const connectToHost = useCallback((host: Host, options?: { hidden?: boolean }) => {
|
||||
const hidden = options?.hidden === true;
|
||||
const isSshHost = !host.protocol || host.protocol === "ssh" || host.protocol === "mosh" || host.protocol === "et";
|
||||
const defaultCompanionProto: RemoteDesktopProtocol | null = isSshHost
|
||||
? host.rdpConfig?.enabled && host.rdpConfig?.defaultConnect
|
||||
? "rdp"
|
||||
: host.vncConfig?.enabled && host.vncConfig?.defaultConnect
|
||||
? "vnc"
|
||||
: null
|
||||
: null;
|
||||
const newSession = defaultCompanionProto
|
||||
? createRemoteDesktopSession(crypto.randomUUID(), host, defaultCompanionProto)
|
||||
: createHostTerminalSession(crypto.randomUUID(), host);
|
||||
const newSession = createHostTerminalSession(crypto.randomUUID(), host);
|
||||
const sessionToAdd = hidden ? { ...newSession, hiddenFromTabs: true } : newSession;
|
||||
setSessions(prev => [...prev, sessionToAdd]);
|
||||
if (!hidden) setActiveTabId(newSession.id);
|
||||
return newSession.id;
|
||||
}, [setActiveTabId]);
|
||||
|
||||
const connectToHostRemoteDesktop = useCallback((
|
||||
host: Host,
|
||||
protocol: RemoteDesktopProtocol,
|
||||
options?: { splitFromSessionId?: string; direction?: SplitDirection },
|
||||
) => {
|
||||
const newSessionId = crypto.randomUUID();
|
||||
const splitFromId = options?.splitFromSessionId;
|
||||
if (splitFromId) {
|
||||
const sourceSession = sessionsRef.current.find((s) => s.id === splitFromId);
|
||||
if (sourceSession) {
|
||||
const direction: SplitDirection = options?.direction ?? 'vertical';
|
||||
const position = direction === 'horizontal' ? 'bottom' : 'right';
|
||||
if (sourceSession.workspaceId) {
|
||||
const wsId = sourceSession.workspaceId;
|
||||
const newSession = createRemoteDesktopSession(newSessionId, host, protocol, {
|
||||
workspaceId: wsId,
|
||||
});
|
||||
setSessions((prev) => addTerminalSessionIfMissing(prev, newSession));
|
||||
setWorkspaces((prev) =>
|
||||
insertWorkspacePaneIfMissing(prev, wsId, newSessionId, {
|
||||
direction,
|
||||
position,
|
||||
targetSessionId: splitFromId,
|
||||
}),
|
||||
);
|
||||
setActiveTabId(wsId);
|
||||
return newSessionId;
|
||||
}
|
||||
const standaloneHint: SplitHint = { direction, position };
|
||||
const createdWs = createWorkspaceEntity(splitFromId, newSessionId, standaloneHint);
|
||||
const newSession = createRemoteDesktopSession(newSessionId, host, protocol, {
|
||||
workspaceId: createdWs.id,
|
||||
});
|
||||
const mergedTitle = buildMergedWorkspaceTitle(
|
||||
getSessionConnectionLabel(sourceSession),
|
||||
getSessionConnectionLabel(newSession),
|
||||
);
|
||||
const newWorkspace = mergedTitle
|
||||
? { ...createdWs, title: mergedTitle, autoTitle: false, generatedTitle: true }
|
||||
: createdWs;
|
||||
setSessions((prev) => {
|
||||
const withUpdatedSource = prev.map((s) =>
|
||||
s.id === splitFromId ? { ...s, workspaceId: newWorkspace.id } : s,
|
||||
);
|
||||
return addTerminalSessionIfMissing(withUpdatedSource, newSession);
|
||||
});
|
||||
setWorkspaces((prev) => addWorkspaceIfMissing(prev, newWorkspace));
|
||||
setTabOrder((prev) => {
|
||||
const idx = prev.indexOf(splitFromId);
|
||||
if (idx === -1) return prev;
|
||||
const next = [...prev];
|
||||
next[idx] = newWorkspace.id;
|
||||
return next;
|
||||
});
|
||||
setActiveTabId(newWorkspace.id);
|
||||
return newSessionId;
|
||||
}
|
||||
}
|
||||
|
||||
const newSession = createRemoteDesktopSession(newSessionId, host, protocol);
|
||||
setSessions((prev) => [...prev, newSession]);
|
||||
setActiveTabId(newSessionId);
|
||||
return newSessionId;
|
||||
}, [setActiveTabId]);
|
||||
|
||||
const setSessionPoppedOut = useCallback((sessionId: string, poppedOut: boolean) => {
|
||||
setSessions(prev => prev.map((s) => {
|
||||
if (s.id !== sessionId) return s;
|
||||
@@ -1477,7 +1360,7 @@ export const useSessionState = ({
|
||||
// orphanSessions changes with every session status update.
|
||||
const orphanSessionsRef = useRef(orphanSessions);
|
||||
orphanSessionsRef.current = orphanSessions;
|
||||
const canUseGlobalBroadcast = orphanSessions.filter((s) => !isRemoteDesktopProtocol(s.protocol)).length >= 2;
|
||||
const canUseGlobalBroadcast = orphanSessions.length >= 2;
|
||||
|
||||
// Losing the group must disarm broadcast before another tab can join it.
|
||||
// Compose-bar send target follows the toolbar switch back to active-only.
|
||||
@@ -1780,7 +1663,6 @@ export const useSessionState = ({
|
||||
createLocalTerminal,
|
||||
createSerialSession,
|
||||
connectToHost,
|
||||
connectToHostRemoteDesktop,
|
||||
closeSession,
|
||||
closeSessions,
|
||||
closeWorkspace,
|
||||
|
||||
@@ -62,11 +62,6 @@ import {
|
||||
STORAGE_KEY_SESSION_LOGS_DIR,
|
||||
STORAGE_KEY_SESSION_LOGS_FORMAT,
|
||||
STORAGE_KEY_SESSION_LOGS_TIMESTAMPS_ENABLED,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_AUTO_RECORD,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_FPS,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_MAX_MB,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS,
|
||||
STORAGE_KEY_SSH_DEBUG_LOGS_ENABLED,
|
||||
STORAGE_KEY_SSH_DEEP_LINK_ENABLED,
|
||||
STORAGE_KEY_JMS_DEEP_LINK_ENABLED,
|
||||
@@ -177,33 +172,7 @@ import {
|
||||
} from '../../domain/startupLanding';
|
||||
import { resolveRestorePreviousSessionSetting, resolveRestoreTerminalCwdSetting } from './sessionRestoreSettings';
|
||||
import { sessionRestoreStorage } from './sessionRestoreStorage';
|
||||
import {
|
||||
DEFAULT_JUMPSERVER_RDP_LAUNCH_MODE,
|
||||
DEFAULT_REMOTE_DESKTOP_AUTO_RECORD,
|
||||
DEFAULT_REMOTE_DESKTOP_RECORDING_FPS,
|
||||
DEFAULT_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO,
|
||||
DEFAULT_REMOTE_DESKTOP_RECORDING_MAX_MB,
|
||||
DEFAULT_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS,
|
||||
isJumpServerRdpLaunchMode,
|
||||
normalizeRemoteDesktopRecordingFps,
|
||||
normalizeRemoteDesktopRecordingMaxMb,
|
||||
normalizeRemoteDesktopRecordingRetentionDays,
|
||||
STORAGE_KEY_JUMPSERVER_RDP_LAUNCH_MODE,
|
||||
useSettingsStorageSync,
|
||||
type JumpServerRdpLaunchMode,
|
||||
type RemoteDesktopRecordingFps,
|
||||
} from './settingsStorageSync';
|
||||
export {
|
||||
DEFAULT_JUMPSERVER_RDP_LAUNCH_MODE,
|
||||
DEFAULT_REMOTE_DESKTOP_AUTO_RECORD,
|
||||
DEFAULT_REMOTE_DESKTOP_RECORDING_FPS,
|
||||
DEFAULT_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO,
|
||||
DEFAULT_REMOTE_DESKTOP_RECORDING_MAX_MB,
|
||||
DEFAULT_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS,
|
||||
STORAGE_KEY_JUMPSERVER_RDP_LAUNCH_MODE,
|
||||
type JumpServerRdpLaunchMode,
|
||||
type RemoteDesktopRecordingFps,
|
||||
};
|
||||
import { useSettingsStorageSync } from './settingsStorageSync';
|
||||
import { useSettingsIpcSync } from './settingsIpcSync';
|
||||
import { TERMINAL_THEME_AUTO } from '../../domain/terminalAppearance';
|
||||
import { customThemeStore, useCustomThemes } from '../state/customThemeStore';
|
||||
@@ -564,35 +533,6 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
const stored = readStoredString(STORAGE_KEY_SESSION_LOGS_TIMESTAMPS_ENABLED);
|
||||
return stored === 'true' ? true : DEFAULT_SESSION_LOGS_TIMESTAMPS_ENABLED;
|
||||
});
|
||||
// Remote Desktop Session Recordings Settings (device-local)
|
||||
const [remoteDesktopAutoRecord, setRemoteDesktopAutoRecordState] = useState<boolean>(() => {
|
||||
const stored = readStoredString(STORAGE_KEY_REMOTE_DESKTOP_AUTO_RECORD);
|
||||
if (stored === null) return DEFAULT_REMOTE_DESKTOP_AUTO_RECORD;
|
||||
return stored === 'true';
|
||||
});
|
||||
const [remoteDesktopRecordingFps, setRemoteDesktopRecordingFpsState] = useState<RemoteDesktopRecordingFps>(() => {
|
||||
const stored = readStoredString(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_FPS);
|
||||
return stored === null
|
||||
? DEFAULT_REMOTE_DESKTOP_RECORDING_FPS
|
||||
: normalizeRemoteDesktopRecordingFps(stored);
|
||||
});
|
||||
const [remoteDesktopRecordingIncludeAudio, setRemoteDesktopRecordingIncludeAudioState] = useState<boolean>(() => {
|
||||
const stored = readStoredString(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO);
|
||||
if (stored === null) return DEFAULT_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO;
|
||||
return stored === 'true';
|
||||
});
|
||||
const [remoteDesktopRecordingMaxMb, setRemoteDesktopRecordingMaxMbState] = useState<number>(() => {
|
||||
const stored = readStoredString(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_MAX_MB);
|
||||
return stored === null
|
||||
? DEFAULT_REMOTE_DESKTOP_RECORDING_MAX_MB
|
||||
: normalizeRemoteDesktopRecordingMaxMb(stored);
|
||||
});
|
||||
const [remoteDesktopRecordingRetentionDays, setRemoteDesktopRecordingRetentionDaysState] = useState<number>(() => {
|
||||
const stored = readStoredString(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS);
|
||||
return stored === null
|
||||
? DEFAULT_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS
|
||||
: normalizeRemoteDesktopRecordingRetentionDays(stored);
|
||||
});
|
||||
const [sshDebugLogsEnabled, setSshDebugLogsEnabled] = useState<boolean>(() => {
|
||||
const stored = readStoredString(STORAGE_KEY_SSH_DEBUG_LOGS_ENABLED);
|
||||
return stored === 'true' ? true : DEFAULT_SSH_DEBUG_LOGS_ENABLED;
|
||||
@@ -605,10 +545,6 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
const stored = localStorageAdapter.readBoolean(STORAGE_KEY_JMS_DEEP_LINK_ENABLED);
|
||||
return stored ?? DEFAULT_JMS_DEEP_LINK_ENABLED;
|
||||
});
|
||||
const [jumpServerRdpLaunchMode, setJumpServerRdpLaunchModeState] = useState<JumpServerRdpLaunchMode>(() => {
|
||||
const stored = readStoredString(STORAGE_KEY_JUMPSERVER_RDP_LAUNCH_MODE);
|
||||
return isJumpServerRdpLaunchMode(stored) ? stored : DEFAULT_JUMPSERVER_RDP_LAUNCH_MODE;
|
||||
});
|
||||
const [explorerContextMenuEnabled, setExplorerContextMenuEnabledState] = useState<boolean>(() => {
|
||||
const stored = localStorageAdapter.readBoolean(STORAGE_KEY_EXPLORER_CONTEXT_MENU_ENABLED);
|
||||
return stored ?? DEFAULT_EXPLORER_CONTEXT_MENU_ENABLED;
|
||||
@@ -1120,38 +1056,10 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
if (storedSshDebugLogsEnabled === 'true' || storedSshDebugLogsEnabled === 'false') {
|
||||
setSshDebugLogsEnabled(storedSshDebugLogsEnabled === 'true');
|
||||
}
|
||||
const storedRdAutoRecord = readStoredString(STORAGE_KEY_REMOTE_DESKTOP_AUTO_RECORD);
|
||||
setRemoteDesktopAutoRecordState(
|
||||
storedRdAutoRecord === null ? DEFAULT_REMOTE_DESKTOP_AUTO_RECORD : storedRdAutoRecord === 'true',
|
||||
);
|
||||
const storedRdFps = readStoredString(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_FPS);
|
||||
setRemoteDesktopRecordingFpsState(
|
||||
storedRdFps === null ? DEFAULT_REMOTE_DESKTOP_RECORDING_FPS : normalizeRemoteDesktopRecordingFps(storedRdFps),
|
||||
);
|
||||
const storedRdAudio = readStoredString(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO);
|
||||
setRemoteDesktopRecordingIncludeAudioState(
|
||||
storedRdAudio === null ? DEFAULT_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO : storedRdAudio === 'true',
|
||||
);
|
||||
const storedRdMaxMb = readStoredString(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_MAX_MB);
|
||||
setRemoteDesktopRecordingMaxMbState(
|
||||
storedRdMaxMb === null ? DEFAULT_REMOTE_DESKTOP_RECORDING_MAX_MB : normalizeRemoteDesktopRecordingMaxMb(storedRdMaxMb),
|
||||
);
|
||||
const storedRdRetention = readStoredString(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS);
|
||||
setRemoteDesktopRecordingRetentionDaysState(
|
||||
storedRdRetention === null
|
||||
? DEFAULT_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS
|
||||
: normalizeRemoteDesktopRecordingRetentionDays(storedRdRetention),
|
||||
);
|
||||
const storedSshDeepLinkEnabled = localStorageAdapter.readBoolean(STORAGE_KEY_SSH_DEEP_LINK_ENABLED);
|
||||
applyIncomingSshDeepLinkEnabled(storedSshDeepLinkEnabled ?? DEFAULT_SSH_DEEP_LINK_ENABLED);
|
||||
const storedJmsDeepLinkEnabled = localStorageAdapter.readBoolean(STORAGE_KEY_JMS_DEEP_LINK_ENABLED);
|
||||
applyIncomingJmsDeepLinkEnabled(storedJmsDeepLinkEnabled ?? DEFAULT_JMS_DEEP_LINK_ENABLED);
|
||||
const storedJumpServerRdpLaunchMode = readStoredString(STORAGE_KEY_JUMPSERVER_RDP_LAUNCH_MODE);
|
||||
setJumpServerRdpLaunchModeState(
|
||||
isJumpServerRdpLaunchMode(storedJumpServerRdpLaunchMode)
|
||||
? storedJumpServerRdpLaunchMode
|
||||
: DEFAULT_JUMPSERVER_RDP_LAUNCH_MODE,
|
||||
);
|
||||
const storedExplorerContextMenuEnabled = localStorageAdapter.readBoolean(STORAGE_KEY_EXPLORER_CONTEXT_MENU_ENABLED);
|
||||
applyIncomingExplorerContextMenuEnabled(storedExplorerContextMenuEnabled ?? DEFAULT_EXPLORER_CONTEXT_MENU_ENABLED);
|
||||
|
||||
@@ -1376,7 +1284,6 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
setSshDebugLogsEnabled,
|
||||
setSshDeepLinkEnabledState: applyIncomingSshDeepLinkEnabled,
|
||||
setJmsDeepLinkEnabledState: applyIncomingJmsDeepLinkEnabled,
|
||||
setJumpServerRdpLaunchModeState,
|
||||
setExplorerContextMenuEnabledState: applyIncomingExplorerContextMenuEnabled,
|
||||
setHotkeyScheme,
|
||||
applyIncomingCustomKeyBindings,
|
||||
@@ -1490,9 +1397,7 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
sftpDoubleClickBehavior, sftpAutoSync, sftpShowHiddenFiles,
|
||||
sftpUseCompressedUpload, sftpSkipUnchanged, sftpAutoOpenSidebar, sftpFollowTerminalCwd, sftpDefaultViewMode,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, localShellSidePanelAutoOpen, localShellSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd, startupLanding,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled,
|
||||
remoteDesktopAutoRecord, remoteDesktopRecordingFps, remoteDesktopRecordingIncludeAudio, remoteDesktopRecordingMaxMb, remoteDesktopRecordingRetentionDays,
|
||||
sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, jumpServerRdpLaunchMode, explorerContextMenuEnabled,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled, sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, explorerContextMenuEnabled,
|
||||
globalHotkeyEnabled, autoUpdateEnabled, windowOpacity, windowBackgroundBlur, appIconVariant,
|
||||
setTheme, setLightUiThemeId, setDarkUiThemeId, setAccentMode,
|
||||
applyIncomingCustomAccent,
|
||||
@@ -1502,9 +1407,7 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
setSftpDoubleClickBehavior, setSftpAutoSync, setSftpShowHiddenFiles,
|
||||
setSftpUseCompressedUpload, setSftpSkipUnchanged, setSftpAutoOpenSidebar, setSftpFollowTerminalCwd, setSftpDefaultViewMode,
|
||||
setShowRecentHostsState, setHostClickBehaviorState, setShowOnlyUngroupedHostsInRootState, setShowSftpTabState, setShowHostTreeSidebarState, setTerminalSidePanelAutoOpenState, setTerminalSidePanelAutoOpenTabState, setLocalShellSidePanelAutoOpenState, setLocalShellSidePanelAutoOpenTabState, setShellOnlyTabNumberShortcutsState, setShowTabNumberBadgesState, setDisableTerminalFontZoomState, setRestorePreviousSessionState, setRestoreTerminalCwdState, setStartupLandingState,
|
||||
setEditorWordWrapState, setSessionLogsEnabled, setSessionLogsDir, setSessionLogsFormat, setSessionLogsTimestampsEnabled,
|
||||
setRemoteDesktopAutoRecordState, setRemoteDesktopRecordingFpsState, setRemoteDesktopRecordingIncludeAudioState, setRemoteDesktopRecordingMaxMbState, setRemoteDesktopRecordingRetentionDaysState,
|
||||
setSshDebugLogsEnabled, setSshDeepLinkEnabledState: applyIncomingSshDeepLinkEnabled, setJmsDeepLinkEnabledState: applyIncomingJmsDeepLinkEnabled, setJumpServerRdpLaunchModeState, setExplorerContextMenuEnabledState: applyIncomingExplorerContextMenuEnabled,
|
||||
setEditorWordWrapState, setSessionLogsEnabled, setSessionLogsDir, setSessionLogsFormat, setSessionLogsTimestampsEnabled, setSshDebugLogsEnabled, setSshDeepLinkEnabledState: applyIncomingSshDeepLinkEnabled, setJmsDeepLinkEnabledState: applyIncomingJmsDeepLinkEnabled, setExplorerContextMenuEnabledState: applyIncomingExplorerContextMenuEnabled,
|
||||
setGlobalHotkeyEnabled, setWindowOpacity: applyIncomingWindowOpacity, setWindowBackgroundBlur, setAppIconVariant, setAutoUpdateEnabled, setWorkspaceFocusStyleState,
|
||||
setSftpTransferConcurrencyState, setSshTransportIdleTtlMsState,
|
||||
applyIncomingCustomKeyBindings, mergeIncomingTerminalSettings,
|
||||
@@ -1811,59 +1714,6 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
notifySettingsChanged(STORAGE_KEY_SESSION_LOGS_TIMESTAMPS_ENABLED, sessionLogsTimestampsEnabled);
|
||||
}, [sessionLogsTimestampsEnabled, notifySettingsChanged]);
|
||||
|
||||
// Persist Remote Desktop Recordings settings (device-local)
|
||||
const setRemoteDesktopAutoRecord = useCallback((enabled: boolean) => {
|
||||
setRemoteDesktopAutoRecordState(Boolean(enabled));
|
||||
}, []);
|
||||
const setRemoteDesktopRecordingFps = useCallback((fps: RemoteDesktopRecordingFps) => {
|
||||
setRemoteDesktopRecordingFpsState(normalizeRemoteDesktopRecordingFps(fps));
|
||||
}, []);
|
||||
const setRemoteDesktopRecordingIncludeAudio = useCallback((enabled: boolean) => {
|
||||
setRemoteDesktopRecordingIncludeAudioState(Boolean(enabled));
|
||||
}, []);
|
||||
const setRemoteDesktopRecordingMaxMb = useCallback((maxMb: number) => {
|
||||
setRemoteDesktopRecordingMaxMbState(normalizeRemoteDesktopRecordingMaxMb(maxMb));
|
||||
}, []);
|
||||
const setRemoteDesktopRecordingRetentionDays = useCallback((days: number) => {
|
||||
setRemoteDesktopRecordingRetentionDaysState(normalizeRemoteDesktopRecordingRetentionDays(days));
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
localStorageAdapter.writeString(STORAGE_KEY_REMOTE_DESKTOP_AUTO_RECORD, remoteDesktopAutoRecord ? 'true' : 'false');
|
||||
if (!persistMountedRef.current) return;
|
||||
notifySettingsChanged(STORAGE_KEY_REMOTE_DESKTOP_AUTO_RECORD, remoteDesktopAutoRecord);
|
||||
}, [remoteDesktopAutoRecord, notifySettingsChanged]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorageAdapter.writeString(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_FPS, String(remoteDesktopRecordingFps));
|
||||
if (!persistMountedRef.current) return;
|
||||
notifySettingsChanged(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_FPS, remoteDesktopRecordingFps);
|
||||
}, [remoteDesktopRecordingFps, notifySettingsChanged]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorageAdapter.writeString(
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO,
|
||||
remoteDesktopRecordingIncludeAudio ? 'true' : 'false',
|
||||
);
|
||||
if (!persistMountedRef.current) return;
|
||||
notifySettingsChanged(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_INCLUDE_AUDIO, remoteDesktopRecordingIncludeAudio);
|
||||
}, [remoteDesktopRecordingIncludeAudio, notifySettingsChanged]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorageAdapter.writeString(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_MAX_MB, String(remoteDesktopRecordingMaxMb));
|
||||
if (!persistMountedRef.current) return;
|
||||
notifySettingsChanged(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_MAX_MB, remoteDesktopRecordingMaxMb);
|
||||
}, [remoteDesktopRecordingMaxMb, notifySettingsChanged]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorageAdapter.writeString(
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS,
|
||||
String(remoteDesktopRecordingRetentionDays),
|
||||
);
|
||||
if (!persistMountedRef.current) return;
|
||||
notifySettingsChanged(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS, remoteDesktopRecordingRetentionDays);
|
||||
}, [remoteDesktopRecordingRetentionDays, notifySettingsChanged]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorageAdapter.writeString(STORAGE_KEY_SSH_DEBUG_LOGS_ENABLED, sshDebugLogsEnabled ? 'true' : 'false');
|
||||
if (!persistMountedRef.current) return;
|
||||
@@ -1990,17 +1840,6 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
notifySettingsChanged(STORAGE_KEY_JMS_DEEP_LINK_ENABLED, jmsDeepLinkEnabled);
|
||||
}, [jmsDeepLinkEnabled, notifySettingsChanged]);
|
||||
|
||||
const setJumpServerRdpLaunchMode = useCallback((mode: JumpServerRdpLaunchMode) => {
|
||||
if (!isJumpServerRdpLaunchMode(mode)) return;
|
||||
setJumpServerRdpLaunchModeState(mode);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
localStorageAdapter.writeString(STORAGE_KEY_JUMPSERVER_RDP_LAUNCH_MODE, jumpServerRdpLaunchMode);
|
||||
if (!persistMountedRef.current) return;
|
||||
notifySettingsChanged(STORAGE_KEY_JUMPSERVER_RDP_LAUNCH_MODE, jumpServerRdpLaunchMode);
|
||||
}, [jumpServerRdpLaunchMode, notifySettingsChanged]);
|
||||
|
||||
useEffect(() => {
|
||||
explorerContextMenuEnabledRef.current = explorerContextMenuEnabled;
|
||||
}, [explorerContextMenuEnabled]);
|
||||
@@ -2421,25 +2260,12 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
setSessionLogsFormat,
|
||||
sessionLogsTimestampsEnabled,
|
||||
setSessionLogsTimestampsEnabled,
|
||||
// Remote Desktop Recordings
|
||||
remoteDesktopAutoRecord,
|
||||
setRemoteDesktopAutoRecord,
|
||||
remoteDesktopRecordingFps,
|
||||
setRemoteDesktopRecordingFps,
|
||||
remoteDesktopRecordingIncludeAudio,
|
||||
setRemoteDesktopRecordingIncludeAudio,
|
||||
remoteDesktopRecordingMaxMb,
|
||||
setRemoteDesktopRecordingMaxMb,
|
||||
remoteDesktopRecordingRetentionDays,
|
||||
setRemoteDesktopRecordingRetentionDays,
|
||||
sshDebugLogsEnabled,
|
||||
setSshDebugLogsEnabled,
|
||||
sshDeepLinkEnabled,
|
||||
setSshDeepLinkEnabled,
|
||||
jmsDeepLinkEnabled,
|
||||
setJmsDeepLinkEnabled,
|
||||
jumpServerRdpLaunchMode,
|
||||
setJumpServerRdpLaunchMode,
|
||||
explorerContextMenuEnabled,
|
||||
setExplorerContextMenuEnabled,
|
||||
explorerContextMenuSupported,
|
||||
@@ -2482,7 +2308,7 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
customKeyBindings, editorWordWrap,
|
||||
sftpDoubleClickBehavior, sftpAutoSync, sftpShowHiddenFiles, sftpUseCompressedUpload, sftpSkipUnchanged, sftpAutoOpenSidebar, sftpFollowTerminalCwd, sftpDefaultViewMode,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, localShellSidePanelAutoOpen, localShellSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, globalDefaultProxyProfileId,
|
||||
customThemes, workspaceFocusStyle, sessionLogsTimestampsEnabled, sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, jumpServerRdpLaunchMode, explorerContextMenuEnabled,
|
||||
customThemes, workspaceFocusStyle, sessionLogsTimestampsEnabled, sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, explorerContextMenuEnabled,
|
||||
]),
|
||||
};
|
||||
};
|
||||
@@ -1,9 +1,5 @@
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { netcattyBridge } from "../../infrastructure/services/netcattyBridge";
|
||||
import type {
|
||||
RemoteDesktopProbeResult,
|
||||
RemoteDesktopTestOptions,
|
||||
} from "../../domain/hostConnectionTest";
|
||||
import type { TerminalSessionExitEvent } from "./resolveTerminalSessionExitIntent";
|
||||
|
||||
type PluginConnectionStartOptions = NetcattyPluginConnectionStartRequest & {
|
||||
@@ -149,37 +145,6 @@ export const useTerminalBackend = () => {
|
||||
return bridge.cancelTestConnection(sessionId);
|
||||
}, []);
|
||||
|
||||
const testRemoteDesktopConnection = useCallback(
|
||||
async (options: RemoteDesktopTestOptions): Promise<RemoteDesktopProbeResult> => {
|
||||
const bridge = netcattyBridge.get() as
|
||||
| (NetcattyBridge & {
|
||||
remoteDesktop?: {
|
||||
testConnection?: (opts: RemoteDesktopTestOptions) => Promise<RemoteDesktopProbeResult>;
|
||||
};
|
||||
})
|
||||
| undefined;
|
||||
if (!bridge?.remoteDesktop?.testConnection) {
|
||||
throw new Error("remoteDesktop.testConnection unavailable");
|
||||
}
|
||||
return bridge.remoteDesktop.testConnection(options);
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
const cancelRemoteDesktopTestConnection = useCallback(async (sessionId: string) => {
|
||||
const bridge = netcattyBridge.get() as
|
||||
| (NetcattyBridge & {
|
||||
remoteDesktop?: {
|
||||
cancelTestConnection?: (id: string) => Promise<{ ok: boolean }>;
|
||||
};
|
||||
})
|
||||
| undefined;
|
||||
if (!bridge?.remoteDesktop?.cancelTestConnection) {
|
||||
return { ok: false };
|
||||
}
|
||||
return bridge.remoteDesktop.cancelTestConnection(sessionId);
|
||||
}, []);
|
||||
|
||||
const startTelnetSession = useCallback(async (options: Parameters<NonNullable<NetcattyBridge["startTelnetSession"]>>[0]) => {
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.startTelnetSession) throw new Error("startTelnetSession unavailable");
|
||||
@@ -645,8 +610,6 @@ export const useTerminalBackend = () => {
|
||||
startSSHSession,
|
||||
testConnection,
|
||||
cancelTestConnection,
|
||||
testRemoteDesktopConnection,
|
||||
cancelRemoteDesktopTestConnection,
|
||||
startTelnetSession,
|
||||
startMoshSession,
|
||||
startEtSession,
|
||||
@@ -734,8 +697,6 @@ export const useTerminalBackend = () => {
|
||||
startSSHSession,
|
||||
testConnection,
|
||||
cancelTestConnection,
|
||||
testRemoteDesktopConnection,
|
||||
cancelRemoteDesktopTestConnection,
|
||||
startTelnetSession,
|
||||
startMoshSession,
|
||||
startEtSession,
|
||||
|
||||
@@ -7,7 +7,7 @@ import { createTerminalDirectoryController } from './terminalDirectoryController
|
||||
import { registerTerminalDirectory } from './terminalDirectoryRegistry';
|
||||
import { directoryChangeCommand, COMPLETE_DIRECTORY_CAPABILITIES, type WindowsDirectoryShell } from '../../domain/directoryPicker';
|
||||
import type { DirectoryPathFlavor } from '../../domain/directoryPath';
|
||||
import { isDiscoveredGitBash } from '../../lib/localShell';
|
||||
import { isDiscoveredGitBash } from '../../lib/localShell.cjs';
|
||||
|
||||
export function useTerminalDirectorySession(options: {
|
||||
sessionId: string;
|
||||
|
||||
@@ -2,8 +2,12 @@ import { useEffect, useRef } from 'react';
|
||||
import { applyGroupDefaults, resolveGroupDefaults } from '../../domain/groupConfig';
|
||||
import type { GroupConfig, Host, Identity, KnownHost, ManagedSource, PortForwardingRule, ProxyProfile, Snippet, SSHKey, TerminalSession, TerminalSettings, VaultNote } from '../../domain/models';
|
||||
import { materializeHostProxyProfile } from '../../domain/proxyProfiles';
|
||||
import type { VaultAgentApiDeps } from '../../infrastructure/ai/vaultAgentBridgeClient';
|
||||
import { netcattyBridge } from '../../infrastructure/services/netcattyBridge';
|
||||
import {
|
||||
handleVaultAgentOp,
|
||||
registerVaultAgentHandler,
|
||||
setupVaultAgentBridge,
|
||||
type VaultAgentApiDeps,
|
||||
} from '../../infrastructure/ai/vaultAgentBridgeClient';
|
||||
import {
|
||||
clearRememberedKeyPassphrases,
|
||||
readRememberedKeyPassphrases,
|
||||
@@ -151,169 +155,143 @@ export function useVaultAgentBridge(input: UseVaultAgentBridgeInput): void {
|
||||
}, [input.notes]);
|
||||
|
||||
useEffect(() => {
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.onVaultAgentRequest || !bridge.respondVaultAgent) {
|
||||
return;
|
||||
}
|
||||
let disposed = false;
|
||||
let clientPromise: Promise<typeof import('../../infrastructure/ai/vaultAgentBridgeClient')> | null = null;
|
||||
const ensureClient = () => {
|
||||
if (!clientPromise) {
|
||||
clientPromise = import('../../infrastructure/ai/vaultAgentBridgeClient').then((client) => {
|
||||
if (!disposed) {
|
||||
client.registerVaultAgentHandler(async (op, params) => {
|
||||
const current = inputRef.current;
|
||||
const applyUpdateNotes = current.updateNotes
|
||||
?? getNotesActions()?.updateNotes
|
||||
?? ((notes: VaultNote[]) => {
|
||||
console.warn('[useVaultAgentBridge] updateNotes unavailable');
|
||||
void notes;
|
||||
return false;
|
||||
});
|
||||
return client.handleVaultAgentOp(op, params, {
|
||||
getHosts: () => vaultSnapshotRef.current.hosts,
|
||||
getNotes: () => resolveVaultAgentNotes(
|
||||
current.notes,
|
||||
vaultSnapshotRef.current.notes,
|
||||
),
|
||||
getCustomGroups: () => vaultSnapshotRef.current.customGroups,
|
||||
getGroupConfigs: () => vaultSnapshotRef.current.groupConfigs,
|
||||
getPortForwardingRules: () => vaultSnapshotRef.current.portForwardingRules,
|
||||
getManagedSources: () => vaultSnapshotRef.current.managedSources,
|
||||
snippets: vaultSnapshotRef.current.snippets,
|
||||
keys: vaultSnapshotRef.current.keys,
|
||||
identities: current.identities,
|
||||
knownHosts: current.knownHosts,
|
||||
proxyProfiles: current.proxyProfiles,
|
||||
terminalSettings: current.terminalSettings,
|
||||
resolveEffectiveHost: (host) => resolveVaultAgentEffectiveHost(
|
||||
host,
|
||||
vaultSnapshotRef.current.groupConfigs,
|
||||
current.proxyProfiles,
|
||||
),
|
||||
updateHostNotes: (hostId, notes) => {
|
||||
const nextHosts = vaultSnapshotRef.current.hosts.map((host) => (
|
||||
host.id === hostId ? { ...host, notes } : host
|
||||
));
|
||||
vaultSnapshotRef.current.hosts = nextHosts;
|
||||
current.updateHosts(nextHosts);
|
||||
},
|
||||
updateCustomGroups: (groups) => {
|
||||
vaultSnapshotRef.current.customGroups = groups;
|
||||
current.updateCustomGroups(groups);
|
||||
},
|
||||
updateGroupConfigs: (configs) => {
|
||||
vaultSnapshotRef.current.groupConfigs = configs;
|
||||
current.updateGroupConfigs(configs);
|
||||
},
|
||||
updatePortForwardingRules: (rules) => {
|
||||
vaultSnapshotRef.current.portForwardingRules = rules;
|
||||
current.updatePortForwardingRules(rules);
|
||||
},
|
||||
updateManagedSources: (sources) => {
|
||||
vaultSnapshotRef.current.managedSources = sources;
|
||||
current.updateManagedSources(sources);
|
||||
},
|
||||
updateHosts: (hosts) => {
|
||||
vaultSnapshotRef.current.hosts = hosts;
|
||||
current.updateHosts(hosts);
|
||||
},
|
||||
commitVaultGroupMutation: async (mutate) => {
|
||||
const result = await current.commitVaultGroupMutation(mutate);
|
||||
if (result.ok) {
|
||||
vaultSnapshotRef.current.customGroups = result.state.groups;
|
||||
vaultSnapshotRef.current.groupConfigs = result.state.configs;
|
||||
vaultSnapshotRef.current.hosts = result.state.hosts;
|
||||
vaultSnapshotRef.current.managedSources = result.state.managedSources;
|
||||
vaultSnapshotRef.current.snippets = result.state.snippets;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
saveKeyPassphrase: (keyPath, passphrase) => rememberKeyPassphrase({
|
||||
keyPath,
|
||||
passphrase,
|
||||
keys: vaultSnapshotRef.current.keys,
|
||||
getKeys: () => vaultSnapshotRef.current.keys,
|
||||
updateKeys: current.updateKeys,
|
||||
setCurrentKeys: (keys) => {
|
||||
vaultSnapshotRef.current.keys = keys;
|
||||
},
|
||||
}),
|
||||
saveImportedKeyPassphrase: (keyPath, passphrase) => rememberImportedKeyPassphrase({
|
||||
keyPath,
|
||||
passphrase,
|
||||
keys: vaultSnapshotRef.current.keys,
|
||||
getKeys: () => vaultSnapshotRef.current.keys,
|
||||
updateKeys: current.updateKeys,
|
||||
setCurrentKeys: (keys) => {
|
||||
vaultSnapshotRef.current.keys = keys;
|
||||
},
|
||||
}),
|
||||
resolveKeyPassphraseAliases: resolveDefaultKeyPassphraseAliases,
|
||||
readKeyPassphrases: (keyPath) => readRememberedKeyPassphrases(
|
||||
keyPath,
|
||||
vaultSnapshotRef.current.keys,
|
||||
),
|
||||
removeKeyPassphrases: (keyPaths) => clearRememberedKeyPassphrases({
|
||||
keyPaths,
|
||||
getKeys: () => vaultSnapshotRef.current.keys,
|
||||
setCurrentKeys: (keys) => {
|
||||
vaultSnapshotRef.current.keys = keys;
|
||||
},
|
||||
updateKeys: current.updateKeys,
|
||||
}),
|
||||
updateNotes: (notes) => {
|
||||
const previousNotes = vaultSnapshotRef.current.notes;
|
||||
const saved = applyAgentNotesUpdate(notes, previousNotes, applyUpdateNotes);
|
||||
vaultSnapshotRef.current.notes = saved === false ? previousNotes : notes;
|
||||
return saved;
|
||||
},
|
||||
updateSnippets: (snippetUpdate) => {
|
||||
vaultSnapshotRef.current.snippets = typeof snippetUpdate === 'function'
|
||||
? snippetUpdate(vaultSnapshotRef.current.snippets)
|
||||
: snippetUpdate;
|
||||
current.updateSnippets(snippetUpdate);
|
||||
},
|
||||
startTunnel: current.startTunnel,
|
||||
stopTunnel: current.stopTunnel,
|
||||
stopRuleTunnels: current.stopRuleTunnels,
|
||||
openHost: current.openHost
|
||||
? (host, isExternalMcpCall, options) => current.openHost!(host, isExternalMcpCall, options)
|
||||
: undefined,
|
||||
findExistingSessionForHost: current.findExistingSessionForHost,
|
||||
reconnectSession: current.reconnectSession,
|
||||
inspectSessionRecovery: current.inspectSessionRecovery,
|
||||
closeSession: current.closeSession
|
||||
? (sessionId) => current.closeSession!(sessionId)
|
||||
: undefined,
|
||||
getScriptSessionMeta: (sessionId) => {
|
||||
const session = current.getScriptSessionMeta?.(sessionId);
|
||||
if (!session) return undefined;
|
||||
return {
|
||||
connected: session.status === 'connected',
|
||||
name: session.customName || session.hostLabel,
|
||||
hostname: session.hostname,
|
||||
username: session.username,
|
||||
};
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
return client;
|
||||
registerVaultAgentHandler(async (op, params) => {
|
||||
const current = inputRef.current;
|
||||
const applyUpdateNotes = current.updateNotes
|
||||
?? getNotesActions()?.updateNotes
|
||||
?? ((notes: VaultNote[]) => {
|
||||
console.warn('[useVaultAgentBridge] updateNotes unavailable');
|
||||
void notes;
|
||||
return false;
|
||||
});
|
||||
}
|
||||
return clientPromise;
|
||||
};
|
||||
|
||||
const unsubscribe = bridge.onVaultAgentRequest((payload) => {
|
||||
void ensureClient().then((client) => client.dispatchVaultAgentBridgeRequest(payload));
|
||||
return handleVaultAgentOp(op, params, {
|
||||
getHosts: () => vaultSnapshotRef.current.hosts,
|
||||
getNotes: () => resolveVaultAgentNotes(
|
||||
current.notes,
|
||||
vaultSnapshotRef.current.notes,
|
||||
),
|
||||
getCustomGroups: () => vaultSnapshotRef.current.customGroups,
|
||||
getGroupConfigs: () => vaultSnapshotRef.current.groupConfigs,
|
||||
getPortForwardingRules: () => vaultSnapshotRef.current.portForwardingRules,
|
||||
getManagedSources: () => vaultSnapshotRef.current.managedSources,
|
||||
snippets: vaultSnapshotRef.current.snippets,
|
||||
keys: vaultSnapshotRef.current.keys,
|
||||
identities: current.identities,
|
||||
knownHosts: current.knownHosts,
|
||||
proxyProfiles: current.proxyProfiles,
|
||||
terminalSettings: current.terminalSettings,
|
||||
resolveEffectiveHost: (host) => resolveVaultAgentEffectiveHost(
|
||||
host,
|
||||
vaultSnapshotRef.current.groupConfigs,
|
||||
current.proxyProfiles,
|
||||
),
|
||||
updateHostNotes: (hostId, notes) => {
|
||||
const nextHosts = vaultSnapshotRef.current.hosts.map((host) => (
|
||||
host.id === hostId ? { ...host, notes } : host
|
||||
));
|
||||
vaultSnapshotRef.current.hosts = nextHosts;
|
||||
current.updateHosts(nextHosts);
|
||||
},
|
||||
updateCustomGroups: (groups) => {
|
||||
vaultSnapshotRef.current.customGroups = groups;
|
||||
current.updateCustomGroups(groups);
|
||||
},
|
||||
updateGroupConfigs: (configs) => {
|
||||
vaultSnapshotRef.current.groupConfigs = configs;
|
||||
current.updateGroupConfigs(configs);
|
||||
},
|
||||
updatePortForwardingRules: (rules) => {
|
||||
vaultSnapshotRef.current.portForwardingRules = rules;
|
||||
current.updatePortForwardingRules(rules);
|
||||
},
|
||||
updateManagedSources: (sources) => {
|
||||
vaultSnapshotRef.current.managedSources = sources;
|
||||
current.updateManagedSources(sources);
|
||||
},
|
||||
updateHosts: (hosts) => {
|
||||
vaultSnapshotRef.current.hosts = hosts;
|
||||
current.updateHosts(hosts);
|
||||
},
|
||||
commitVaultGroupMutation: async (mutate) => {
|
||||
const result = await current.commitVaultGroupMutation(mutate);
|
||||
if (result.ok) {
|
||||
vaultSnapshotRef.current.customGroups = result.state.groups;
|
||||
vaultSnapshotRef.current.groupConfigs = result.state.configs;
|
||||
vaultSnapshotRef.current.hosts = result.state.hosts;
|
||||
vaultSnapshotRef.current.managedSources = result.state.managedSources;
|
||||
vaultSnapshotRef.current.snippets = result.state.snippets;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
saveKeyPassphrase: (keyPath, passphrase) => rememberKeyPassphrase({
|
||||
keyPath,
|
||||
passphrase,
|
||||
keys: vaultSnapshotRef.current.keys,
|
||||
getKeys: () => vaultSnapshotRef.current.keys,
|
||||
updateKeys: current.updateKeys,
|
||||
setCurrentKeys: (keys) => {
|
||||
vaultSnapshotRef.current.keys = keys;
|
||||
},
|
||||
}),
|
||||
saveImportedKeyPassphrase: (keyPath, passphrase) => rememberImportedKeyPassphrase({
|
||||
keyPath,
|
||||
passphrase,
|
||||
keys: vaultSnapshotRef.current.keys,
|
||||
getKeys: () => vaultSnapshotRef.current.keys,
|
||||
updateKeys: current.updateKeys,
|
||||
setCurrentKeys: (keys) => {
|
||||
vaultSnapshotRef.current.keys = keys;
|
||||
},
|
||||
}),
|
||||
resolveKeyPassphraseAliases: resolveDefaultKeyPassphraseAliases,
|
||||
readKeyPassphrases: (keyPath) => readRememberedKeyPassphrases(
|
||||
keyPath,
|
||||
vaultSnapshotRef.current.keys,
|
||||
),
|
||||
removeKeyPassphrases: (keyPaths) => clearRememberedKeyPassphrases({
|
||||
keyPaths,
|
||||
getKeys: () => vaultSnapshotRef.current.keys,
|
||||
setCurrentKeys: (keys) => {
|
||||
vaultSnapshotRef.current.keys = keys;
|
||||
},
|
||||
updateKeys: current.updateKeys,
|
||||
}),
|
||||
updateNotes: (notes) => {
|
||||
const previousNotes = vaultSnapshotRef.current.notes;
|
||||
const saved = applyAgentNotesUpdate(notes, previousNotes, applyUpdateNotes);
|
||||
vaultSnapshotRef.current.notes = saved === false ? previousNotes : notes;
|
||||
return saved;
|
||||
},
|
||||
updateSnippets: (snippetUpdate) => {
|
||||
vaultSnapshotRef.current.snippets = typeof snippetUpdate === 'function'
|
||||
? snippetUpdate(vaultSnapshotRef.current.snippets)
|
||||
: snippetUpdate;
|
||||
current.updateSnippets(snippetUpdate);
|
||||
},
|
||||
startTunnel: current.startTunnel,
|
||||
stopTunnel: current.stopTunnel,
|
||||
stopRuleTunnels: current.stopRuleTunnels,
|
||||
openHost: current.openHost
|
||||
? (host, isExternalMcpCall, options) => current.openHost!(host, isExternalMcpCall, options)
|
||||
: undefined,
|
||||
findExistingSessionForHost: current.findExistingSessionForHost,
|
||||
reconnectSession: current.reconnectSession,
|
||||
inspectSessionRecovery: current.inspectSessionRecovery,
|
||||
closeSession: current.closeSession
|
||||
? (sessionId) => current.closeSession!(sessionId)
|
||||
: undefined,
|
||||
getScriptSessionMeta: (sessionId) => {
|
||||
const session = current.getScriptSessionMeta?.(sessionId);
|
||||
if (!session) return undefined;
|
||||
return {
|
||||
connected: session.status === 'connected',
|
||||
name: session.customName || session.hostLabel,
|
||||
hostname: session.hostname,
|
||||
username: session.username,
|
||||
};
|
||||
},
|
||||
});
|
||||
});
|
||||
return () => {
|
||||
disposed = true;
|
||||
unsubscribe();
|
||||
if (clientPromise) {
|
||||
void clientPromise.then((client) => client.registerVaultAgentHandler(null));
|
||||
}
|
||||
};
|
||||
return setupVaultAgentBridge();
|
||||
}, []);
|
||||
}
|
||||
@@ -25,7 +25,17 @@ import {
|
||||
/** Exit the import lock so a concurrent host save can finish, then retry. */
|
||||
const RETRY_VAULT_IMPORT_AFTER_CONCURRENT_EDIT = Symbol("retry-vault-import-after-concurrent-edit");
|
||||
import { sanitizeHost } from "../../domain/host";
|
||||
import type { VaultImportFormat } from "../../domain/vaultImport";
|
||||
import {
|
||||
applyVaultImportDestination,
|
||||
applyVaultHostImport,
|
||||
buildVaultHostEndpointKey,
|
||||
buildVaultHostMergeKey,
|
||||
filterVaultImportKeyPassphrasesAgainstExisting,
|
||||
mergeVaultImportIssues,
|
||||
resolveVaultImportKeyPassphraseConflicts,
|
||||
toVaultImportExistingHostRef,
|
||||
type VaultImportFormat,
|
||||
} from "../../domain/vaultImport";
|
||||
import type { GroupConfig, Host, ManagedSource, SSHKey } from "../../types";
|
||||
import type { VaultImportNotifier, VaultImportOptions } from "./vaultImportOptions";
|
||||
|
||||
@@ -135,9 +145,7 @@ export function useVaultImportHandlers({
|
||||
? "SecureCRT"
|
||||
: format === "finalshell"
|
||||
? "FinalShell"
|
||||
: format === "rdp"
|
||||
? "RDP"
|
||||
: "ssh_config";
|
||||
: "ssh_config";
|
||||
const updateProgress = (next: Partial<VaultImportProgress>) => {
|
||||
setImportProgress((current) => ({
|
||||
status: "running",
|
||||
@@ -163,16 +171,6 @@ export function useVaultImportHandlers({
|
||||
});
|
||||
|
||||
try {
|
||||
const {
|
||||
applyVaultImportDestination,
|
||||
applyVaultHostImport,
|
||||
buildVaultHostEndpointKey,
|
||||
buildVaultHostMergeKey,
|
||||
filterVaultImportKeyPassphrasesAgainstExisting,
|
||||
mergeVaultImportIssues,
|
||||
resolveVaultImportKeyPassphraseConflicts,
|
||||
toVaultImportExistingHostRef,
|
||||
} = await import("../../domain/vaultImport");
|
||||
let result = await importVaultHostsInWorker({
|
||||
format,
|
||||
files,
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { JSDOM } from 'jsdom';
|
||||
|
||||
const DB_PLUGIN = 'plugin-vault:com.binaricat.netcatty-database.main' as const;
|
||||
const MONITOR_PLUGIN = 'plugin-vault:com.binaricat.netcatty-monitor.main' as const;
|
||||
|
||||
test('useVaultNavConfig persists order & visibility, survives cold-start loading, prunes uninstalled plugins, and resets cleanly', async () => {
|
||||
const dom = new JSDOM('<!doctype html><div id="root"></div>', { url: 'http://localhost' });
|
||||
const previous = new Map<string, PropertyDescriptor | undefined>();
|
||||
for (const key of ['window', 'document', 'navigator', 'localStorage', 'StorageEvent', 'CustomEvent', 'Event']) {
|
||||
previous.set(key, Object.getOwnPropertyDescriptor(globalThis, key));
|
||||
Object.defineProperty(globalThis, key, {
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: key === 'window' ? dom.window : dom.window[key as keyof typeof dom.window],
|
||||
});
|
||||
}
|
||||
Object.defineProperty(globalThis, 'IS_REACT_ACT_ENVIRONMENT', {
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: true,
|
||||
});
|
||||
|
||||
const { default: React, act } = await import('react');
|
||||
const { createRoot } = await import('react-dom/client');
|
||||
const { useVaultNavConfig } = await import('./useVaultNavConfig');
|
||||
const { STORAGE_KEY_VAULT_NAV_CONFIG } = await import('../../infrastructure/config/storageKeys');
|
||||
|
||||
let model!: ReturnType<typeof useVaultNavConfig>;
|
||||
let activePluginIds: (typeof DB_PLUGIN | typeof MONITOR_PLUGIN)[] = [DB_PLUGIN, MONITOR_PLUGIN];
|
||||
let pluginsLoading = false;
|
||||
|
||||
function Fixture() {
|
||||
model = useVaultNavConfig({ activePluginIds, pluginsLoading });
|
||||
return <div />;
|
||||
}
|
||||
|
||||
const root = createRoot(document.getElementById('root')!);
|
||||
const render = async () => {
|
||||
await act(async () => {
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<Fixture />
|
||||
</React.StrictMode>,
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
try {
|
||||
await render();
|
||||
assert.equal(model.isCustomized, false);
|
||||
assert.ok(model.visibleIds.includes(DB_PLUGIN));
|
||||
assert.ok(model.visibleIds.includes(MONITOR_PLUGIN));
|
||||
|
||||
// Back-to-back mutations in the same act batch under StrictMode return fresh
|
||||
// synchronous configs and preserve both mutations without updater side effects.
|
||||
let afterReorder!: ReturnType<typeof model.reorder>;
|
||||
let afterHide!: ReturnType<typeof model.setVisible>;
|
||||
await act(async () => {
|
||||
afterReorder = model.reorder(MONITOR_PLUGIN, 'hosts', 'after');
|
||||
afterHide = model.setVisible('logs', false);
|
||||
});
|
||||
assert.equal(afterReorder.order[1], MONITOR_PLUGIN);
|
||||
assert.equal(afterHide.order[1], MONITOR_PLUGIN);
|
||||
assert.deepEqual(afterHide.hidden, ['logs']);
|
||||
|
||||
assert.equal(model.visibleIds[1], MONITOR_PLUGIN);
|
||||
assert.equal(model.isHidden('logs'), true);
|
||||
assert.equal(model.visibleIds.includes('logs'), false);
|
||||
assert.equal(model.isCustomized, true);
|
||||
|
||||
// Locked 'hosts' cannot be hidden.
|
||||
await act(async () => {
|
||||
model.setVisible('hosts', false);
|
||||
});
|
||||
assert.equal(model.isHidden('hosts'), false);
|
||||
|
||||
// Simulate cold start: unmount, remount with pluginsLoading = true & activePluginIds = [].
|
||||
await act(async () => {
|
||||
root.unmount();
|
||||
});
|
||||
const coldRoot = createRoot(document.getElementById('root')!);
|
||||
activePluginIds = [];
|
||||
pluginsLoading = true;
|
||||
await act(async () => {
|
||||
coldRoot.render(<Fixture />);
|
||||
});
|
||||
// Plugin preferences stay preserved in config while loading, but don't show in visibleIds yet.
|
||||
assert.equal(model.visibleIds.includes(MONITOR_PLUGIN), false);
|
||||
assert.ok(model.config.order.includes(MONITOR_PLUGIN));
|
||||
|
||||
// Plugins finish loading, but DB_PLUGIN was uninstalled.
|
||||
activePluginIds = [MONITOR_PLUGIN];
|
||||
pluginsLoading = false;
|
||||
await act(async () => {
|
||||
coldRoot.render(<Fixture />);
|
||||
});
|
||||
assert.equal(model.visibleIds[1], MONITOR_PLUGIN, 'custom slot of remaining plugin survives cold start');
|
||||
assert.equal(model.config.order.includes(DB_PLUGIN), false, 'uninstalled plugin is pruned cleanly');
|
||||
const persisted = JSON.parse(dom.window.localStorage.getItem(STORAGE_KEY_VAULT_NAV_CONFIG) ?? '{}');
|
||||
assert.equal(persisted.order.includes(DB_PLUGIN), false, 'pruned plugin is also removed from storage');
|
||||
assert.deepEqual(persisted.hidden, ['logs']);
|
||||
|
||||
// Reset restores defaults.
|
||||
await act(async () => {
|
||||
model.reset();
|
||||
});
|
||||
assert.equal(model.isCustomized, false);
|
||||
assert.equal(model.isHidden('logs'), false);
|
||||
assert.equal(model.visibleIds.at(-1), MONITOR_PLUGIN);
|
||||
|
||||
await act(async () => {
|
||||
coldRoot.unmount();
|
||||
});
|
||||
} finally {
|
||||
for (const [key, descriptor] of previous) {
|
||||
if (descriptor) Object.defineProperty(globalThis, key, descriptor);
|
||||
else Reflect.deleteProperty(globalThis, key);
|
||||
}
|
||||
Reflect.deleteProperty(globalThis, 'IS_REACT_ACT_ENVIRONMENT');
|
||||
dom.window.close();
|
||||
}
|
||||
});
|
||||
@@ -1,254 +0,0 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import {
|
||||
areVaultNavConfigsEqual,
|
||||
canHideVaultNavItem,
|
||||
getManageableVaultNavIds,
|
||||
getVisibleVaultNavIds,
|
||||
isCustomVaultNavConfig,
|
||||
moveVaultNavItem,
|
||||
normalizeVaultNavConfig,
|
||||
reconcileVaultNavConfig,
|
||||
reorderVaultNavItems,
|
||||
resetVaultNavConfig,
|
||||
setVaultNavItemVisibility,
|
||||
toggleVaultNavItemVisibility,
|
||||
type PluginVaultNavId,
|
||||
type VaultNavConfig,
|
||||
type VaultNavDropPosition,
|
||||
type VaultNavItemId,
|
||||
} from '../../domain/vaultNavConfig';
|
||||
import { STORAGE_KEY_VAULT_NAV_CONFIG } from '../../infrastructure/config/storageKeys';
|
||||
import {
|
||||
LOCAL_STORAGE_ADAPTER_CHANGED_EVENT,
|
||||
localStorageAdapter,
|
||||
} from '../../infrastructure/persistence/localStorageAdapter';
|
||||
|
||||
export interface UseVaultNavConfigOptions {
|
||||
activePluginIds: readonly PluginVaultNavId[];
|
||||
/** Pass true while plugin contributions are still loading on cold start. */
|
||||
pluginsLoading?: boolean;
|
||||
}
|
||||
|
||||
export interface UseVaultNavConfigResult {
|
||||
config: VaultNavConfig;
|
||||
visibleIds: VaultNavItemId[];
|
||||
manageableIds: VaultNavItemId[];
|
||||
hiddenSet: ReadonlySet<VaultNavItemId>;
|
||||
isCustomized: boolean;
|
||||
isHidden: (id: VaultNavItemId) => boolean;
|
||||
canHide: (id: VaultNavItemId) => boolean;
|
||||
setVisible: (id: VaultNavItemId, visible: boolean) => VaultNavConfig;
|
||||
toggleVisible: (id: VaultNavItemId) => VaultNavConfig;
|
||||
reorder: (
|
||||
draggedId: VaultNavItemId,
|
||||
targetId: VaultNavItemId,
|
||||
position?: VaultNavDropPosition,
|
||||
) => VaultNavConfig;
|
||||
move: (
|
||||
id: VaultNavItemId,
|
||||
direction: 'up' | 'down',
|
||||
scopeIds?: readonly VaultNavItemId[],
|
||||
) => VaultNavConfig;
|
||||
reset: () => VaultNavConfig;
|
||||
}
|
||||
|
||||
function readStoredVaultNavConfig(
|
||||
activePluginIds: readonly PluginVaultNavId[],
|
||||
pruneMissingPlugins: boolean,
|
||||
): VaultNavConfig {
|
||||
try {
|
||||
const raw = localStorageAdapter.read(STORAGE_KEY_VAULT_NAV_CONFIG);
|
||||
return normalizeVaultNavConfig(raw, activePluginIds, { pruneMissingPlugins });
|
||||
} catch {
|
||||
return resetVaultNavConfig(activePluginIds);
|
||||
}
|
||||
}
|
||||
|
||||
function writeStoredVaultNavConfig(config: VaultNavConfig): void {
|
||||
try {
|
||||
localStorageAdapter.write(STORAGE_KEY_VAULT_NAV_CONFIG, config);
|
||||
} catch {
|
||||
// Best effort; in-memory state still applies for the current session.
|
||||
}
|
||||
}
|
||||
|
||||
export function useVaultNavConfig({
|
||||
activePluginIds,
|
||||
pluginsLoading = false,
|
||||
}: UseVaultNavConfigOptions): UseVaultNavConfigResult {
|
||||
const pluginKey = activePluginIds.join('\0');
|
||||
const stablePluginIds = useMemo<PluginVaultNavId[]>(
|
||||
() => (pluginKey ? (pluginKey.split('\0') as PluginVaultNavId[]) : []),
|
||||
[pluginKey],
|
||||
);
|
||||
const pruneMissingPlugins = !pluginsLoading;
|
||||
|
||||
const [config, setConfig] = useState<VaultNavConfig>(() =>
|
||||
readStoredVaultNavConfig(stablePluginIds, pruneMissingPlugins),
|
||||
);
|
||||
const configRef = useRef<VaultNavConfig>(config);
|
||||
configRef.current = config;
|
||||
|
||||
// Reconcile when active plugin list changes or cold-start loading finishes.
|
||||
// Kept strictly outside React state updaters so storage writes and sync events
|
||||
// never execute re-entrantly during rendering or StrictMode double-invocations.
|
||||
useEffect(() => {
|
||||
const current = configRef.current;
|
||||
const reconciled = reconcileVaultNavConfig(current, stablePluginIds, {
|
||||
pruneMissingPlugins,
|
||||
});
|
||||
if (!areVaultNavConfigsEqual(current, reconciled)) {
|
||||
configRef.current = reconciled;
|
||||
setConfig(reconciled);
|
||||
}
|
||||
if (pruneMissingPlugins) {
|
||||
try {
|
||||
const rawStored = localStorageAdapter.read(STORAGE_KEY_VAULT_NAV_CONFIG);
|
||||
if (rawStored != null) {
|
||||
const normalizedStored = normalizeVaultNavConfig(rawStored, stablePluginIds, {
|
||||
pruneMissingPlugins: false,
|
||||
});
|
||||
if (!areVaultNavConfigsEqual(normalizedStored, reconciled)) {
|
||||
writeStoredVaultNavConfig(reconciled);
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Ignore storage read errors.
|
||||
}
|
||||
}
|
||||
}, [pruneMissingPlugins, stablePluginIds]);
|
||||
|
||||
// Cross-window and adapter sync.
|
||||
useEffect(() => {
|
||||
const sync = (event: Event) => {
|
||||
if (event instanceof StorageEvent && event.key !== STORAGE_KEY_VAULT_NAV_CONFIG) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
event instanceof CustomEvent
|
||||
&& event.detail?.key !== STORAGE_KEY_VAULT_NAV_CONFIG
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const next = readStoredVaultNavConfig(stablePluginIds, pruneMissingPlugins);
|
||||
if (!areVaultNavConfigsEqual(configRef.current, next)) {
|
||||
configRef.current = next;
|
||||
setConfig(next);
|
||||
}
|
||||
};
|
||||
window.addEventListener('storage', sync);
|
||||
window.addEventListener(LOCAL_STORAGE_ADAPTER_CHANGED_EVENT, sync);
|
||||
return () => {
|
||||
window.removeEventListener('storage', sync);
|
||||
window.removeEventListener(LOCAL_STORAGE_ADAPTER_CHANGED_EVENT, sync);
|
||||
};
|
||||
}, [pruneMissingPlugins, stablePluginIds]);
|
||||
|
||||
const commit = useCallback((next: VaultNavConfig): VaultNavConfig => {
|
||||
if (areVaultNavConfigsEqual(configRef.current, next)) {
|
||||
return configRef.current;
|
||||
}
|
||||
configRef.current = next;
|
||||
setConfig(next);
|
||||
writeStoredVaultNavConfig(next);
|
||||
return next;
|
||||
}, []);
|
||||
|
||||
const setVisible = useCallback(
|
||||
(id: VaultNavItemId, visible: boolean): VaultNavConfig =>
|
||||
commit(setVaultNavItemVisibility(configRef.current, id, visible, stablePluginIds)),
|
||||
[commit, stablePluginIds],
|
||||
);
|
||||
|
||||
const toggleVisible = useCallback(
|
||||
(id: VaultNavItemId): VaultNavConfig =>
|
||||
commit(toggleVaultNavItemVisibility(configRef.current, id, stablePluginIds)),
|
||||
[commit, stablePluginIds],
|
||||
);
|
||||
|
||||
const reorder = useCallback(
|
||||
(
|
||||
draggedId: VaultNavItemId,
|
||||
targetId: VaultNavItemId,
|
||||
position: VaultNavDropPosition = 'before',
|
||||
): VaultNavConfig =>
|
||||
commit(reorderVaultNavItems(configRef.current, draggedId, targetId, position)),
|
||||
[commit],
|
||||
);
|
||||
|
||||
const move = useCallback(
|
||||
(
|
||||
id: VaultNavItemId,
|
||||
direction: 'up' | 'down',
|
||||
scopeIds?: readonly VaultNavItemId[],
|
||||
): VaultNavConfig =>
|
||||
commit(moveVaultNavItem(configRef.current, id, direction, scopeIds)),
|
||||
[commit],
|
||||
);
|
||||
|
||||
const reset = useCallback((): VaultNavConfig => {
|
||||
const next = resetVaultNavConfig(stablePluginIds);
|
||||
configRef.current = next;
|
||||
setConfig(next);
|
||||
writeStoredVaultNavConfig(next);
|
||||
return next;
|
||||
}, [stablePluginIds]);
|
||||
|
||||
const visibleIds = useMemo(
|
||||
() => getVisibleVaultNavIds(config, stablePluginIds),
|
||||
[config, stablePluginIds],
|
||||
);
|
||||
const manageableIds = useMemo(
|
||||
() => getManageableVaultNavIds(config, stablePluginIds),
|
||||
[config, stablePluginIds],
|
||||
);
|
||||
const hiddenSet = useMemo(
|
||||
() => new Set<VaultNavItemId>(config.hidden),
|
||||
[config.hidden],
|
||||
);
|
||||
const isCustomized = useMemo(
|
||||
() => isCustomVaultNavConfig(config, stablePluginIds),
|
||||
[config, stablePluginIds],
|
||||
);
|
||||
|
||||
const isHidden = useCallback(
|
||||
(id: VaultNavItemId) => hiddenSet.has(id),
|
||||
[hiddenSet],
|
||||
);
|
||||
const canHide = useCallback(
|
||||
(id: VaultNavItemId) => canHideVaultNavItem(config, id, stablePluginIds),
|
||||
[config, stablePluginIds],
|
||||
);
|
||||
|
||||
return useMemo(
|
||||
() => ({
|
||||
config,
|
||||
visibleIds,
|
||||
manageableIds,
|
||||
hiddenSet,
|
||||
isCustomized,
|
||||
isHidden,
|
||||
canHide,
|
||||
setVisible,
|
||||
toggleVisible,
|
||||
reorder,
|
||||
move,
|
||||
reset,
|
||||
}),
|
||||
[
|
||||
canHide,
|
||||
config,
|
||||
hiddenSet,
|
||||
isCustomized,
|
||||
isHidden,
|
||||
manageableIds,
|
||||
move,
|
||||
reorder,
|
||||
reset,
|
||||
setVisible,
|
||||
toggleVisible,
|
||||
visibleIds,
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -53,11 +53,8 @@ import {
|
||||
STORAGE_KEY_SNIPPET_PACKAGES,
|
||||
STORAGE_KEY_SNIPPETS,
|
||||
STORAGE_KEY_TERM_SETTINGS,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_MAX_MB,
|
||||
STORAGE_KEY_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS,
|
||||
} from "../../infrastructure/config/storageKeys";
|
||||
import { localStorageAdapter, LOCAL_STORAGE_ADAPTER_CHANGED_EVENT } from "../../infrastructure/persistence/localStorageAdapter";
|
||||
import { netcattyBridge } from "../../infrastructure/services/netcattyBridge";
|
||||
import {
|
||||
mergeGlobalHistoryOnAppend,
|
||||
removeGlobalHistoryEntry,
|
||||
@@ -632,27 +629,6 @@ export const useVaultState = (options?: UseVaultStateOptions) => {
|
||||
connectionLogPendingRef.current.set(log.id, { generation, log: null });
|
||||
}
|
||||
}
|
||||
const remainingRecordingIds = new Set<string>();
|
||||
for (const log of next) {
|
||||
if (log.recordingId) remainingRecordingIds.add(log.recordingId);
|
||||
}
|
||||
const removedRecordingIds: string[] = [];
|
||||
for (const log of prev) {
|
||||
if (
|
||||
!nextIds.has(log.id)
|
||||
&& log.recordingId
|
||||
&& !remainingRecordingIds.has(log.recordingId)
|
||||
) {
|
||||
removedRecordingIds.push(log.recordingId);
|
||||
}
|
||||
}
|
||||
if (removedRecordingIds.length > 0) {
|
||||
void netcattyBridge
|
||||
.get()
|
||||
?.remoteDesktopRecordings
|
||||
?.deleteMany?.({ recordingIds: removedRecordingIds })
|
||||
?.catch(() => {});
|
||||
}
|
||||
connectionLogsRef.current = next;
|
||||
setConnectionLogs(next);
|
||||
return enqueueTerminalDataTask(() => withVaultImportLock("connection-logs", async () => {
|
||||
@@ -1584,35 +1560,6 @@ export const useVaultState = (options?: UseVaultStateOptions) => {
|
||||
publishConnectionLogsSnapshot({ connectionLogs });
|
||||
}, [connectionLogs]);
|
||||
|
||||
// One-time startup GC to sweep orphaned / expired / over-quota remote desktop recordings
|
||||
// while preserving all bookmarked/saved connection log recordings.
|
||||
const hasRunRecordingStartupGcRef = useRef(false);
|
||||
useEffect(() => {
|
||||
if (!syncConnectionLogTerminalData || hasRunRecordingStartupGcRef.current) return;
|
||||
hasRunRecordingStartupGcRef.current = true;
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.remoteDesktopRecordings?.runGc) return;
|
||||
const logs = connectionLogsRef.current;
|
||||
const referencedIds = logs
|
||||
.map((log) => log.recordingId)
|
||||
.filter((id): id is string => typeof id === "string" && id.length > 0);
|
||||
const protectedIds = logs
|
||||
.filter((log) => log.saved && typeof log.recordingId === "string" && log.recordingId.length > 0)
|
||||
.map((log) => log.recordingId as string);
|
||||
const storedMaxMb = localStorageAdapter.readNumber(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_MAX_MB);
|
||||
const maxMb = storedMaxMb != null && storedMaxMb >= 64 ? storedMaxMb : 1024;
|
||||
const storedRetention = localStorageAdapter.readNumber(STORAGE_KEY_REMOTE_DESKTOP_RECORDING_RETENTION_DAYS);
|
||||
const retentionDays = storedRetention != null && storedRetention >= 0 ? storedRetention : 30;
|
||||
void bridge.remoteDesktopRecordings
|
||||
.runGc({
|
||||
maxBytes: maxMb * 1024 * 1024,
|
||||
retentionDays,
|
||||
referencedIds,
|
||||
protectedIds,
|
||||
})
|
||||
.catch(() => {});
|
||||
}, [syncConnectionLogTerminalData]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
registerConnectionLogsActions({
|
||||
updateConnectionLog,
|
||||
|
||||
@@ -12,12 +12,6 @@ export function getVaultImportPickerMode(
|
||||
directory: boolean;
|
||||
multiple: boolean;
|
||||
} {
|
||||
if (format === "rdp") {
|
||||
return {
|
||||
directory: false,
|
||||
multiple: true,
|
||||
};
|
||||
}
|
||||
const isBatchFolder = (format === "securecrt" || format === "finalshell")
|
||||
&& source === "folder";
|
||||
return {
|
||||
@@ -31,7 +25,7 @@ export function selectVaultImportFiles(
|
||||
files: ArrayLike<File>,
|
||||
): File[] {
|
||||
const selected = Array.from(files);
|
||||
return format === "securecrt" || format === "finalshell" || format === "rdp"
|
||||
return format === "securecrt" || format === "finalshell"
|
||||
? selected
|
||||
: selected.slice(0, 1);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import React, { useState, type Dispatch, type SetStateAction } from 'react';
|
||||
import { History, Plus, Sparkles, Undo2, Wrench, X } from 'lucide-react';
|
||||
import React, { type Dispatch, type SetStateAction } from 'react';
|
||||
import { History, Plus, Undo2, X } from 'lucide-react';
|
||||
import type { AIPermissionMode, AISession, ChatMessage, DiscoveredAgent, ExternalAgentConfig, AgentModelPreset, ProviderConfig, UploadedFile } from '../infrastructure/ai/types';
|
||||
import type {
|
||||
PluginAISidebarPrompt,
|
||||
PluginAISidebarTurnContext,
|
||||
} from '../infrastructure/ai/pluginAiSidebarTypes';
|
||||
import type { Host, VaultNote } from '../types';
|
||||
import type { UserSkillOption } from './ai/userSkillsState';
|
||||
import type { AIQuickMessage } from '../infrastructure/ai/quickMessages';
|
||||
@@ -30,7 +26,6 @@ type TerminalSessionSummary = {
|
||||
hostname: string;
|
||||
label: string;
|
||||
connected: boolean;
|
||||
protocol?: string;
|
||||
};
|
||||
|
||||
interface AIChatPanelContentProps {
|
||||
@@ -61,7 +56,6 @@ interface AIChatPanelContentProps {
|
||||
inputValue: string;
|
||||
setInputValue: (value: string) => void;
|
||||
handleSend: (textOverride?: string) => void;
|
||||
handleSendQuickPrompt?: (promptText: string) => void;
|
||||
handleCompact: () => void;
|
||||
/** Rename a chat by id (history drawer edit affordance). Panel action, never agent content. */
|
||||
onRenameSession?: (sessionId: string, title: string) => void;
|
||||
@@ -139,11 +133,6 @@ interface AIChatPanelContentProps {
|
||||
parked?: boolean;
|
||||
/** Disable header transitions while send preflight is in flight. */
|
||||
sending?: boolean;
|
||||
/** Contextual plugin view metadata & registered tools injected into Catty Agent. */
|
||||
pluginContext?: PluginAISidebarTurnContext | null;
|
||||
pluginSuggestedPrompts?: readonly PluginAISidebarPrompt[];
|
||||
onClosePanel?: () => void;
|
||||
borderlessChrome?: boolean;
|
||||
}
|
||||
|
||||
export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
@@ -173,7 +162,6 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
inputValue,
|
||||
setInputValue,
|
||||
handleSend,
|
||||
handleSendQuickPrompt,
|
||||
handleCompact,
|
||||
onRenameSession,
|
||||
onRenameActiveChat,
|
||||
@@ -233,12 +221,7 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
onOpenVaultSection,
|
||||
parked = false,
|
||||
sending = false,
|
||||
pluginContext = null,
|
||||
pluginSuggestedPrompts,
|
||||
onClosePanel,
|
||||
borderlessChrome = false,
|
||||
}) => {
|
||||
const [showPluginTools, setShowPluginTools] = useState(false);
|
||||
const handleContinue = React.useCallback(() => handleSend(t('ai.chat.continue')), [handleSend, t]);
|
||||
const mentionHosts = React.useMemo(
|
||||
() => terminalSessions.map((session) => ({
|
||||
@@ -246,7 +229,6 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
hostname: session.hostname,
|
||||
label: session.label,
|
||||
connected: session.connected,
|
||||
protocol: session.protocol,
|
||||
})),
|
||||
[terminalSessions],
|
||||
);
|
||||
@@ -283,9 +265,7 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
<React.Profiler {...getAIPanelProfilerProps('AIChatPanel.Header')}>
|
||||
<div className={cn(
|
||||
TERMINAL_SIDE_PANEL_INNER_HEADER_CLASS,
|
||||
borderlessChrome
|
||||
? 'px-2.5 flex items-center justify-between'
|
||||
: 'px-2 flex items-center justify-between border-b border-border/50',
|
||||
'px-2 flex items-center justify-between border-b border-border/50',
|
||||
)}>
|
||||
<AgentSelector
|
||||
currentAgentId={currentAgentId}
|
||||
@@ -350,79 +330,11 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{t('ai.chat.newChat')}</TooltipContent>
|
||||
</Tooltip>
|
||||
{onClosePanel && (
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-6 w-6 rounded-md text-muted-foreground/62 hover:bg-white/[0.05] hover:text-foreground"
|
||||
aria-label={t('common.close')}
|
||||
onClick={onClosePanel}
|
||||
>
|
||||
<X size={13} />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{t('common.close')}</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</React.Profiler>
|
||||
)}
|
||||
|
||||
{/* ── Borderless Plugin Context Strip ── */}
|
||||
{!parked && pluginContext && !showHistory && (
|
||||
<div
|
||||
data-section="plugin-ai-context-strip"
|
||||
className="shrink-0 px-3 pt-2 pb-1"
|
||||
>
|
||||
<div className="rounded-xl bg-muted/30 dark:bg-white/[0.035] px-2.5 py-2">
|
||||
<div className="flex items-center justify-between gap-2 min-w-0">
|
||||
<div className="flex items-center gap-1.5 min-w-0">
|
||||
<Sparkles size={12} className="shrink-0 text-primary/80" />
|
||||
<span className="truncate text-[12px] font-medium text-foreground/90">
|
||||
{pluginContext.title || pluginContext.pluginName}
|
||||
</span>
|
||||
</div>
|
||||
{pluginContext.tools.length > 0 && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowPluginTools((prev) => !prev)}
|
||||
className={cn(
|
||||
'inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-[10.5px] font-medium transition-colors cursor-pointer',
|
||||
showPluginTools
|
||||
? 'bg-primary/15 text-primary'
|
||||
: 'bg-background/60 text-muted-foreground hover:bg-background hover:text-foreground',
|
||||
)}
|
||||
>
|
||||
<Wrench size={10} />
|
||||
<span>{pluginContext.tools.length} tools</span>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
{pluginContext.subtitle && (
|
||||
<p className="mt-0.5 truncate text-[11px] text-muted-foreground/75">
|
||||
{pluginContext.subtitle}
|
||||
</p>
|
||||
)}
|
||||
{showPluginTools && pluginContext.tools.length > 0 && (
|
||||
<div className="mt-2 flex flex-wrap gap-1 pt-1.5 border-t border-border/20">
|
||||
{pluginContext.tools.map((tool) => (
|
||||
<span
|
||||
key={tool.qualifiedName}
|
||||
title={tool.description}
|
||||
className="inline-flex items-center gap-1 rounded-md bg-background/65 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground"
|
||||
>
|
||||
<span>{tool.name}</span>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* ── Main content ── */}
|
||||
{!parked && showHistory && !hideHistory ? (
|
||||
<React.Profiler {...getAIPanelProfilerProps('AIChatPanel.History')}>
|
||||
@@ -460,28 +372,6 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
</React.Profiler>
|
||||
)}
|
||||
|
||||
{/* Borderless Plugin Starter Prompt Chips (when chat is empty) */}
|
||||
{!parked && messages.length === 0 && pluginSuggestedPrompts && pluginSuggestedPrompts.length > 0 && (
|
||||
<div
|
||||
data-section="plugin-ai-suggested-prompts"
|
||||
className="shrink-0 px-3 pb-2"
|
||||
>
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{pluginSuggestedPrompts.map((item, idx) => (
|
||||
<button
|
||||
key={`${item.label}-${idx}`}
|
||||
type="button"
|
||||
disabled={sending || isStreaming || !canSendCurrentAgent}
|
||||
onClick={() => handleSend(item.prompt)}
|
||||
className="rounded-lg bg-muted/35 dark:bg-white/[0.045] hover:bg-muted/65 dark:hover:bg-white/[0.09] px-2.5 py-1.5 text-left text-[11.5px] leading-snug text-foreground/80 hover:text-foreground transition-colors cursor-pointer disabled:pointer-events-none disabled:opacity-45"
|
||||
>
|
||||
{item.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Recent sessions (Zed-style, shown when no messages) */}
|
||||
{!parked && messages.length === 0 && historySessions.length > 0 && !hideRecent && (
|
||||
<React.Profiler {...getAIPanelProfilerProps('AIChatPanel.Recent')}>
|
||||
@@ -570,7 +460,6 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
value={inputValue}
|
||||
onChange={setInputValue}
|
||||
onSend={handleSend}
|
||||
onSendQuickPrompt={handleSendQuickPrompt}
|
||||
onCompact={handleCompact}
|
||||
onRenameSession={onRenameActiveChat}
|
||||
onListChats={onListChats}
|
||||
|
||||
@@ -16,7 +16,6 @@ import type {
|
||||
import type { VaultNote } from '../domain/models';
|
||||
import type { ExecutorContext } from '../infrastructure/ai/cattyAgent/executor';
|
||||
import {
|
||||
DEFAULT_MAX_ITERATIONS,
|
||||
filterAgentModelPresetsForCliVersion,
|
||||
getAgentModelPresets,
|
||||
resolveAgentCliVersion,
|
||||
@@ -322,7 +321,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
commandBlocklist,
|
||||
commandTimeout,
|
||||
responseIdleTimeout,
|
||||
maxIterations = DEFAULT_MAX_ITERATIONS,
|
||||
maxIterations = 20,
|
||||
toolOutputMaxChars,
|
||||
webSearchConfig,
|
||||
quickMessages = [],
|
||||
@@ -346,12 +345,6 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
onOpenVaultHost,
|
||||
onOpenVaultSnippet,
|
||||
onOpenVaultSection,
|
||||
pluginContext = null,
|
||||
pluginSuggestedPrompts,
|
||||
pendingPluginPrompt = null,
|
||||
onPendingPluginPromptConsumed,
|
||||
onClosePanel,
|
||||
borderlessChrome = false,
|
||||
}) => {
|
||||
const { t } = useI18n();
|
||||
const scopeKey = `${scopeType}:${scopeTargetId ?? ''}`;
|
||||
@@ -628,7 +621,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
const liveTargets = new Set(liveScopeTargetIds ?? workspaceMemberTerminalIds ?? []);
|
||||
for (const workspace of workspaces) liveTargets.add(workspace.id);
|
||||
liveTargets.add(scopeTargetId);
|
||||
if (canRebindChat(session, liveTargets) && (scopeType === 'terminal' || scopeType === 'workspace')) {
|
||||
if (canRebindChat(session, liveTargets)) {
|
||||
// Same race as the manager rebind: stop any in-flight turn first so the
|
||||
// scope rewrite never happens under a live stream.
|
||||
await stopActiveTurnBeforeScopeRebind(target.sessionId, {
|
||||
@@ -1693,7 +1686,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
}, [updateSessionTitle]);
|
||||
|
||||
const buildExecutorContextForScope = useCallback((scope: {
|
||||
type: 'terminal' | 'workspace' | 'global';
|
||||
type: 'terminal' | 'workspace';
|
||||
targetId?: string;
|
||||
label?: string;
|
||||
}): ExecutorContext => {
|
||||
@@ -1740,18 +1733,14 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
}, [currentAgentId, enterScopeDraftMode, updateScopeDraft]);
|
||||
|
||||
|
||||
const handleSend = useCallback(async (
|
||||
textOverride?: string,
|
||||
options?: { includeDraftAttachments?: boolean },
|
||||
) => {
|
||||
const handleSend = useCallback(async (textOverride?: string) => {
|
||||
const draft = currentDraftRef.current;
|
||||
const currentPanelView = panelViewRef.current;
|
||||
const currentSessionView = activeSessionRef.current;
|
||||
const useDraftAttachments = textOverride === undefined || options?.includeDraftAttachments === true;
|
||||
if (useDraftAttachments && !validateNoteMentions(draft?.attachments ?? [])) return;
|
||||
if (textOverride === undefined && !validateNoteMentions(draft?.attachments ?? [])) return;
|
||||
const trimmed = (textOverride ?? draft?.text ?? '').trim();
|
||||
const sendScopeKey = scopeKey;
|
||||
const attachments = (useDraftAttachments ? draft?.attachments ?? [] : []).map((file) => ({
|
||||
const attachments = (textOverride === undefined ? draft?.attachments ?? [] : []).map((file) => ({
|
||||
base64Data: file.base64Data,
|
||||
mediaType: file.mediaType,
|
||||
filename: file.filename,
|
||||
@@ -1763,35 +1752,30 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
lineCount: file.lineCount,
|
||||
}));
|
||||
const hasInlineTextAttachments = attachments.some(isInlineTextAttachment);
|
||||
const hasImageAttachments = attachments.some((attachment) => attachment.mediaType.startsWith('image/'));
|
||||
if ((!trimmed && !hasInlineTextAttachments && !hasImageAttachments) || isStreaming) return;
|
||||
if ((!trimmed && !hasInlineTextAttachments) || isStreaming) return;
|
||||
// While undo-last-turn is creating the branch, the target is still the source; a
|
||||
// turn submitted now would run in the soon-hidden source session, so
|
||||
// block it until the branch settles.
|
||||
if (isUndoingLastTurn) return;
|
||||
// Note-only / image-only sends (empty text + attachment) still need a usable
|
||||
// session title: fall back to the note title or image filename so these
|
||||
// Note-only sends (empty text + a mentioned note) still need a usable
|
||||
// session title: fall back to the first mentioned note's title so these
|
||||
// conversations don't all show up as "Untitled" in history.
|
||||
const noteOnlyTitle = attachments.find(
|
||||
(attachment) => isVaultNoteAttachment(attachment) && attachment.vaultNoteTitle,
|
||||
)?.vaultNoteTitle ?? '';
|
||||
const imageOnlyTitle = attachments.find(
|
||||
(attachment) => attachment.mediaType.startsWith('image/') && attachment.filename,
|
||||
)?.filename ?? '';
|
||||
const titleText = trimmed || noteOnlyTitle.trim() || imageOnlyTitle.trim();
|
||||
const titleText = trimmed || noteOnlyTitle.trim();
|
||||
const sendAgentId = currentSessionView?.agentId ?? draft?.agentId ?? currentAgentId;
|
||||
const agentConfig = sendAgentId !== 'catty' ? findEnabledExternalAgent(externalAgents, sendAgentId) : undefined;
|
||||
if (sendAgentId !== 'catty' && !agentConfig) return;
|
||||
|
||||
const selectedSkillSlugs = useDraftAttachments ? draft?.selectedUserSkillSlugs ?? [] : [];
|
||||
const selectedSkillSlugs = textOverride === undefined ? draft?.selectedUserSkillSlugs ?? [] : [];
|
||||
const modelPrompt = buildPromptWithTerminalSelectionAttachments(trimmed, attachments);
|
||||
const modelAttachments = attachments.filter((attachment) => !isInlineTextAttachment(attachment));
|
||||
const isDraftMode = currentPanelView.mode === 'draft';
|
||||
|
||||
if (useDraftAttachments) flushDraftText();
|
||||
if (textOverride === undefined) flushDraftText();
|
||||
const submittedText = draft?.text ?? '';
|
||||
const keepPendingAfterSend = () => {
|
||||
if (options?.includeDraftAttachments) return false;
|
||||
const pending = pendingComposerTextRef.current;
|
||||
return pending != null && pending !== submittedText;
|
||||
};
|
||||
@@ -1878,7 +1862,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
const createdSession = createSession(scope, sendAgentId);
|
||||
sessionId = createdSession.id;
|
||||
currentSession = createdSession;
|
||||
if (useDraftAttachments) clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
if (textOverride === undefined) clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
showScopeSessionView(createdSession.id);
|
||||
setActiveSessionId(createdSession.id);
|
||||
sessionSendGateKey = sessionId;
|
||||
@@ -1909,7 +1893,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
});
|
||||
addMessageToSession(sessionId, { id: generateId(), role: 'assistant', content: t('ai.chat.noProvider'), timestamp: Date.now() });
|
||||
if (currentPanelView.mode === 'session') {
|
||||
if (useDraftAttachments) clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
if (textOverride === undefined) clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
showScopeSessionView(sessionId);
|
||||
}
|
||||
return;
|
||||
@@ -1924,7 +1908,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
});
|
||||
addMessageToSession(sessionId, { id: generateId(), role: 'assistant', content: t('ai.chat.noProviderModel'), timestamp: Date.now() });
|
||||
if (currentPanelView.mode === 'session') {
|
||||
if (useDraftAttachments) clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
if (textOverride === undefined) clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
showScopeSessionView(sessionId);
|
||||
}
|
||||
return;
|
||||
@@ -1937,7 +1921,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
...(selectedSkillSlugs.length > 0 ? { selectedUserSkillSlugs: selectedSkillSlugs } : {}),
|
||||
timestamp: Date.now(),
|
||||
});
|
||||
if (useDraftAttachments) clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
if (textOverride === undefined) clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
showScopeSessionView(sessionId);
|
||||
setActiveSessionId(sessionId);
|
||||
setStreamingForScope(sessionId, true);
|
||||
@@ -2008,7 +1992,6 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
autoTitleSession,
|
||||
selectedUserSkillSlugs: selectedSkillSlugs,
|
||||
titleText,
|
||||
pluginContext,
|
||||
}, modelAttachments.length > 0 ? modelAttachments : undefined);
|
||||
}
|
||||
} finally {
|
||||
@@ -2031,7 +2014,6 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
clearScopeDraft, showScopeSessionView, setActiveSessionId,
|
||||
flushDraftText, currentAgentConfig, buildExternalAgentRuntimeModelTarget,
|
||||
loadSdkRuntimeModelCatalog, applySdkRuntimeModelCatalog, collectCustomModelIds,
|
||||
pluginContext,
|
||||
]);
|
||||
|
||||
const handleCompact = useCallback(async () => {
|
||||
@@ -2082,7 +2064,6 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
autoTitleSession: () => {},
|
||||
selectedUserSkillSlugs: [],
|
||||
forceCompaction: true,
|
||||
pluginContext,
|
||||
},
|
||||
);
|
||||
} finally {
|
||||
@@ -2105,7 +2086,6 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
selectedCattyThinking,
|
||||
globalPermissionMode,
|
||||
isStreaming,
|
||||
pluginContext,
|
||||
scopeKey,
|
||||
scopeLabel,
|
||||
scopeTargetId,
|
||||
@@ -2177,10 +2157,6 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
return registerGrantPersister((rule) => { addGrant(rule); });
|
||||
}, [addGrant]);
|
||||
|
||||
const handleSendQuickPrompt = useCallback((promptText: string) => {
|
||||
void handleSend(promptText, { includeDraftAttachments: true });
|
||||
}, [handleSend]);
|
||||
|
||||
const handleStop = useCallback(() => {
|
||||
if (!activeSessionId) return;
|
||||
setSteeringSessionId(current => current === activeSessionId ? null : current);
|
||||
@@ -2328,7 +2304,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
&& session.scope.type === scopeType
|
||||
&& session.scope.targetId === scopeTargetId,
|
||||
);
|
||||
if (isAlreadyInScope || !scopeTargetId || !rebindSessionScope || scopeType === 'global') {
|
||||
if (isAlreadyInScope || !scopeTargetId || !rebindSessionScope) {
|
||||
handleSelectSession(sessionId);
|
||||
return;
|
||||
}
|
||||
@@ -2445,28 +2421,24 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
}, [exportSessionsBackup, t]);
|
||||
|
||||
const globalManagerNode = useMemo(() => (
|
||||
scopeType === 'global'
|
||||
? undefined
|
||||
: (
|
||||
<GlobalAIChatSessionManager
|
||||
sessions={sessions}
|
||||
activeSessionIdMap={activeSessionIdMap}
|
||||
currentScopeType={scopeType}
|
||||
currentScopeTargetId={scopeTargetId}
|
||||
currentScopeHostIds={scopeHostIds}
|
||||
workspaces={workspaces}
|
||||
terminalInfos={managerTerminalInfos}
|
||||
hosts={hosts}
|
||||
externalAgents={externalAgents}
|
||||
rebindTargets={managerRebindTargets}
|
||||
onSelect={(sessionId) => { void handleManagerActivate(sessionId); }}
|
||||
onFocusScope={onFocusAIScopeTarget ? handleManagerFocusScope : undefined}
|
||||
onRebind={handleManagerRebind}
|
||||
onRename={handleRenameSession}
|
||||
onDelete={(sessionId) => { void handleManagerDelete(sessionId); }}
|
||||
onExport={handleManagerExport}
|
||||
/>
|
||||
)
|
||||
<GlobalAIChatSessionManager
|
||||
sessions={sessions}
|
||||
activeSessionIdMap={activeSessionIdMap}
|
||||
currentScopeType={scopeType}
|
||||
currentScopeTargetId={scopeTargetId}
|
||||
currentScopeHostIds={scopeHostIds}
|
||||
workspaces={workspaces}
|
||||
terminalInfos={managerTerminalInfos}
|
||||
hosts={hosts}
|
||||
externalAgents={externalAgents}
|
||||
rebindTargets={managerRebindTargets}
|
||||
onSelect={(sessionId) => { void handleManagerActivate(sessionId); }}
|
||||
onFocusScope={onFocusAIScopeTarget ? handleManagerFocusScope : undefined}
|
||||
onRebind={handleManagerRebind}
|
||||
onRename={handleRenameSession}
|
||||
onDelete={(sessionId) => { void handleManagerDelete(sessionId); }}
|
||||
onExport={handleManagerExport}
|
||||
/>
|
||||
), [
|
||||
sessions,
|
||||
activeSessionIdMap,
|
||||
@@ -2500,22 +2472,6 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
setShowHistory(false);
|
||||
}, [ensureScopeDraft, showScopeDraftView, updateScopeDraft]);
|
||||
|
||||
const consumedPluginPromptIdRef = useRef<number | null>(null);
|
||||
useEffect(() => {
|
||||
if (!pendingPluginPrompt) return;
|
||||
if (consumedPluginPromptIdRef.current === pendingPluginPrompt.id) return;
|
||||
consumedPluginPromptIdRef.current = pendingPluginPrompt.id;
|
||||
onPendingPluginPromptConsumed?.(pendingPluginPrompt.id);
|
||||
const trimmedPrompt = pendingPluginPrompt.prompt.trim();
|
||||
if (!trimmedPrompt) return;
|
||||
setShowHistory(false);
|
||||
if (pendingPluginPrompt.autoSend && !isStreaming) {
|
||||
void handleSend(trimmedPrompt);
|
||||
} else {
|
||||
setInputValue(trimmedPrompt);
|
||||
}
|
||||
}, [handleSend, isStreaming, onPendingPluginPromptConsumed, pendingPluginPrompt, setInputValue]);
|
||||
|
||||
// Hidden retained panels keep the composer mounted (parent is `hidden` +
|
||||
// inert) so reopen does not remount ChatInput. Skip the message list.
|
||||
return (
|
||||
@@ -2558,7 +2514,6 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
inputValue={inputValue}
|
||||
setInputValue={setInputValue}
|
||||
handleSend={handleSend}
|
||||
handleSendQuickPrompt={handleSendQuickPrompt}
|
||||
handleCompact={handleCompact}
|
||||
onRenameSession={handleRenameSession}
|
||||
onRenameActiveChat={handleRenameSlashCommand}
|
||||
@@ -2639,10 +2594,6 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
onOpenVaultHost={onOpenVaultHost}
|
||||
onOpenVaultSnippet={onOpenVaultSnippet}
|
||||
onOpenVaultSection={onOpenVaultSection}
|
||||
pluginContext={pluginContext}
|
||||
pluginSuggestedPrompts={pluginSuggestedPrompts}
|
||||
onClosePanel={onClosePanel}
|
||||
borderlessChrome={borderlessChrome}
|
||||
/>
|
||||
</div>
|
||||
</React.Profiler>
|
||||
@@ -2732,12 +2683,6 @@ export function aiChatSidePanelPropsAreEqual(
|
||||
if (prev.onOpenVaultSnippet !== next.onOpenVaultSnippet) return false;
|
||||
if (prev.onOpenVaultSection !== next.onOpenVaultSection) return false;
|
||||
if (prev.onFocusAIScopeTarget !== next.onFocusAIScopeTarget) return false;
|
||||
if (prev.pluginContext !== next.pluginContext) return false;
|
||||
if (prev.pluginSuggestedPrompts !== next.pluginSuggestedPrompts) return false;
|
||||
if (prev.pendingPluginPrompt !== next.pendingPluginPrompt) return false;
|
||||
if (prev.onPendingPluginPromptConsumed !== next.onPendingPluginPromptConsumed) return false;
|
||||
if (prev.onClosePanel !== next.onClosePanel) return false;
|
||||
if (prev.borderlessChrome !== next.borderlessChrome) return false;
|
||||
|
||||
const scopeKey = `${prev.scopeType}:${prev.scopeTargetId ?? ''}`;
|
||||
if (
|
||||
|
||||
@@ -104,7 +104,7 @@ export interface AIChatSidePanelProps {
|
||||
quickMessages?: AIQuickMessage[];
|
||||
|
||||
// Context
|
||||
scopeType: 'terminal' | 'workspace' | 'global';
|
||||
scopeType: 'terminal' | 'workspace';
|
||||
scopeTargetId?: string;
|
||||
scopeHostIds?: string[];
|
||||
scopeLabel?: string;
|
||||
@@ -143,7 +143,7 @@ export interface AIChatSidePanelProps {
|
||||
connected: boolean;
|
||||
}>;
|
||||
resolveExecutorContext?: (scope: {
|
||||
type: 'terminal' | 'workspace' | 'global';
|
||||
type: 'terminal' | 'workspace';
|
||||
targetId?: string;
|
||||
label?: string;
|
||||
}) => ExecutorContext;
|
||||
@@ -151,14 +151,6 @@ export interface AIChatSidePanelProps {
|
||||
// Visibility
|
||||
isVisible?: boolean;
|
||||
|
||||
// Plugin contextual sidebar integration (native Catty Agent + plugin tools)
|
||||
pluginContext?: import('../infrastructure/ai/pluginAiSidebarTypes').PluginAISidebarTurnContext | null;
|
||||
pluginSuggestedPrompts?: readonly import('../infrastructure/ai/pluginAiSidebarTypes').PluginAISidebarPrompt[];
|
||||
pendingPluginPrompt?: { id: number; prompt: string; autoSend?: boolean } | null;
|
||||
onPendingPluginPromptConsumed?: (id: number) => void;
|
||||
onClosePanel?: () => void;
|
||||
borderlessChrome?: boolean;
|
||||
|
||||
// Vault artifact navigation (from AI chat tool results)
|
||||
notes?: VaultNote[];
|
||||
hosts?: Host[];
|
||||
|
||||
@@ -1,84 +1,64 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import React from "react";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
|
||||
import { I18nProvider } from "../application/i18n/I18nProvider.tsx";
|
||||
import type { ConnectionLog } from "../domain/models/history.ts";
|
||||
import type { ConnectionLog } from "../types.ts";
|
||||
import ConnectionLogsManager from "./ConnectionLogsManager.tsx";
|
||||
import { TooltipProvider } from "./ui/tooltip.tsx";
|
||||
import ConnectionLogsManager, {
|
||||
formatRecordingBytes,
|
||||
formatRecordingDuration,
|
||||
} from "./ConnectionLogsManager.tsx";
|
||||
|
||||
const renderWithI18n = (node: React.ReactElement) =>
|
||||
const baseLog: ConnectionLog = {
|
||||
id: "log-1",
|
||||
hostId: "host-1",
|
||||
hostLabel: "Database",
|
||||
hostname: "db.example.com",
|
||||
username: "root",
|
||||
protocol: "ssh",
|
||||
hostOs: "linux",
|
||||
hostDistro: "ubuntu",
|
||||
startTime: 1_700_000_000_000,
|
||||
localUsername: "alice",
|
||||
localHostname: "workstation",
|
||||
saved: false,
|
||||
};
|
||||
|
||||
const renderLogs = (log: ConnectionLog) =>
|
||||
renderToStaticMarkup(
|
||||
<I18nProvider locale="en">
|
||||
<TooltipProvider>{node}</TooltipProvider>
|
||||
<TooltipProvider>
|
||||
<ConnectionLogsManager
|
||||
logs={[log]}
|
||||
hosts={[]}
|
||||
onToggleSaved={() => {}}
|
||||
onDelete={() => {}}
|
||||
onClearUnsaved={() => {}}
|
||||
onOpenLogView={() => {}}
|
||||
/>
|
||||
</TooltipProvider>
|
||||
</I18nProvider>,
|
||||
);
|
||||
|
||||
test("formatRecordingDuration and formatRecordingBytes format human-readable pills", () => {
|
||||
assert.equal(formatRecordingDuration(0), "00:00");
|
||||
assert.equal(formatRecordingDuration(134_000), "02:14");
|
||||
assert.equal(formatRecordingDuration(3_661_000), "1:01:01");
|
||||
test("ConnectionLogsManager renders saved custom host icon snapshots", () => {
|
||||
const markup = renderLogs({
|
||||
...baseLog,
|
||||
hostIconMode: "custom",
|
||||
hostIconId: "database",
|
||||
hostIconColor: "blue",
|
||||
});
|
||||
|
||||
assert.equal(formatRecordingBytes(0), "");
|
||||
assert.equal(formatRecordingBytes(512), "512 B");
|
||||
assert.equal(formatRecordingBytes(4_404_019), "4.2 MB");
|
||||
assert.match(markup, /background-color:#2563EB/i);
|
||||
assert.doesNotMatch(markup, /bg-\[#E95420\]/);
|
||||
});
|
||||
|
||||
test("ConnectionLogsManager renders RDP/VNC icons and compact recording pill when recordingId is present", () => {
|
||||
const logs: ConnectionLog[] = [
|
||||
{
|
||||
id: "log-rdp-rec",
|
||||
hostId: "h-1",
|
||||
hostLabel: "Windows Prod",
|
||||
hostname: "10.0.0.10",
|
||||
username: "Administrator",
|
||||
protocol: "rdp",
|
||||
startTime: 1_700_000_000_000,
|
||||
endTime: 1_700_000_134_000,
|
||||
localUsername: "alice",
|
||||
localHostname: "macbook",
|
||||
saved: true,
|
||||
recordingId: "123e4567-e89b-12d3-a456-426614174000",
|
||||
recordingMimeType: "video/webm;codecs=vp9,opus",
|
||||
recordingDurationMs: 134_000,
|
||||
recordingBytes: 4_404_019,
|
||||
recordingHasAudio: true,
|
||||
},
|
||||
{
|
||||
id: "log-vnc-plain",
|
||||
hostId: "h-2",
|
||||
hostLabel: "Linux Desktop",
|
||||
hostname: "10.0.0.20",
|
||||
username: "",
|
||||
protocol: "vnc",
|
||||
startTime: 1_699_999_000_000,
|
||||
endTime: 1_699_999_060_000,
|
||||
localUsername: "alice",
|
||||
localHostname: "macbook",
|
||||
saved: false,
|
||||
},
|
||||
];
|
||||
test("ConnectionLogsManager renders saved distro icon snapshots with custom colors", () => {
|
||||
const markup = renderLogs({
|
||||
...baseLog,
|
||||
hostIconMode: "auto",
|
||||
hostIconColor: "violet",
|
||||
});
|
||||
|
||||
const markup = renderWithI18n(
|
||||
React.createElement(ConnectionLogsManager, {
|
||||
logs,
|
||||
hosts: [],
|
||||
onToggleSaved: () => {},
|
||||
onDelete: () => {},
|
||||
onClearUnsaved: () => {},
|
||||
onOpenLogView: () => {},
|
||||
}),
|
||||
);
|
||||
|
||||
assert.match(markup, /Windows Prod/);
|
||||
assert.match(markup, /Linux Desktop/);
|
||||
assert.match(markup, /data-recording-badge="123e4567-e89b-12d3-a456-426614174000"/);
|
||||
assert.match(markup, /02:14 · 4\.2 MB/);
|
||||
assert.match(markup, /vnc, 10\.0\.0\.20/);
|
||||
assert.match(markup, /bg-blue-500\/15 text-blue-600/);
|
||||
assert.match(markup, /bg-teal-500\/15 text-teal-600/);
|
||||
assert.match(markup, /background-color:#7C3AED/i);
|
||||
assert.match(markup, /src="\/distro\/ubuntu.svg"/);
|
||||
assert.doesNotMatch(markup, /bg-\[#E95420\]/);
|
||||
});
|
||||
@@ -6,16 +6,13 @@ import {
|
||||
Terminal,
|
||||
Trash2,
|
||||
Usb,
|
||||
Video,
|
||||
} from "lucide-react";
|
||||
import React, { memo, useCallback, useMemo, useState } from "react";
|
||||
import { useI18n } from "../application/i18n/I18nProvider";
|
||||
import { resolveHostIconAppearance } from "../domain/hostIcon";
|
||||
import { isRdpProtocol, isVncProtocol } from "../domain/remoteDesktop";
|
||||
import { cn } from "../lib/utils";
|
||||
import { ConnectionLog, Host } from "../types";
|
||||
import { DistroAvatar } from "./DistroAvatar";
|
||||
import { RdpProtocolIcon, VncProtocolIcon } from "./icons/RemoteDesktopIcons";
|
||||
import { ScrollArea } from "./ui/scroll-area";
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
|
||||
|
||||
@@ -28,34 +25,6 @@ interface ConnectionLogsManagerProps {
|
||||
onOpenLogView: (log: ConnectionLog) => void;
|
||||
}
|
||||
|
||||
export function formatRecordingDuration(durationMs?: number): string {
|
||||
if (!durationMs || !Number.isFinite(durationMs) || durationMs <= 0) {
|
||||
return "00:00";
|
||||
}
|
||||
const totalSeconds = Math.max(0, Math.round(durationMs / 1000));
|
||||
const hours = Math.floor(totalSeconds / 3600);
|
||||
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
||||
const seconds = totalSeconds % 60;
|
||||
const mm = String(minutes).padStart(2, "0");
|
||||
const ss = String(seconds).padStart(2, "0");
|
||||
return hours > 0 ? `${hours}:${mm}:${ss}` : `${mm}:${ss}`;
|
||||
}
|
||||
|
||||
export function formatRecordingBytes(bytes?: number): string {
|
||||
if (!bytes || !Number.isFinite(bytes) || bytes <= 0) return "";
|
||||
const units = ["B", "KB", "MB", "GB"];
|
||||
let size = bytes;
|
||||
let unitIdx = 0;
|
||||
while (size >= 1024 && unitIdx < units.length - 1) {
|
||||
size /= 1024;
|
||||
unitIdx += 1;
|
||||
}
|
||||
const formatted = unitIdx === 0
|
||||
? String(Math.round(size))
|
||||
: String(parseFloat(size.toFixed(size >= 10 ? 1 : 2)));
|
||||
return `${formatted} ${units[unitIdx]}`;
|
||||
}
|
||||
|
||||
// Format date for display
|
||||
const formatDate = (timestamp: number, locale: string) => {
|
||||
const date = new Date(timestamp);
|
||||
@@ -99,9 +68,6 @@ const LogItem = memo<LogItemProps>(({ log, onToggleSaved, onDelete, onClick }) =
|
||||
const { t, resolvedLocale } = useI18n();
|
||||
const isLocal = log.protocol === "local" || log.hostname === "localhost";
|
||||
const isSerial = log.protocol === "serial";
|
||||
const isRdp = isRdpProtocol(log.protocol);
|
||||
const isVnc = isVncProtocol(log.protocol);
|
||||
const isRemoteDesktop = isRdp || isVnc;
|
||||
const customHostIcon = resolveHostIconAppearance({
|
||||
iconMode: log.hostIconMode,
|
||||
iconId: log.hostIconId,
|
||||
@@ -109,9 +75,7 @@ const LogItem = memo<LogItemProps>(({ log, onToggleSaved, onDelete, onClick }) =
|
||||
iconColor: log.hostIconColor,
|
||||
iconColorCustom: log.hostIconColorCustom,
|
||||
});
|
||||
const hasPersistedHostIcon = !isLocal && !isSerial && !isRemoteDesktop && (!!log.hostDistro || !!customHostIcon);
|
||||
const recordingSizeText = formatRecordingBytes(log.recordingBytes);
|
||||
const recordingDurationText = formatRecordingDuration(log.recordingDurationMs);
|
||||
const hasPersistedHostIcon = !isLocal && !isSerial && (!!log.hostDistro || !!customHostIcon);
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -157,55 +121,19 @@ const LogItem = memo<LogItemProps>(({ log, onToggleSaved, onDelete, onClick }) =
|
||||
) : (
|
||||
<div className={cn(
|
||||
"h-9 w-9 rounded-xl flex items-center justify-center shrink-0",
|
||||
isRdp
|
||||
? "bg-blue-500/15 text-blue-600 dark:text-blue-400"
|
||||
: isVnc
|
||||
? "bg-teal-500/15 text-teal-600 dark:text-teal-400"
|
||||
: isSerial
|
||||
? "bg-amber-600 text-white dark:bg-amber-400 dark:text-slate-950"
|
||||
: isLocal
|
||||
? "bg-slate-600 text-white dark:bg-slate-300 dark:text-slate-950"
|
||||
: "bg-primary text-primary-foreground"
|
||||
isSerial
|
||||
? "bg-amber-600 text-white dark:bg-amber-400 dark:text-slate-950"
|
||||
: isLocal
|
||||
? "bg-slate-600 text-white dark:bg-slate-300 dark:text-slate-950"
|
||||
: "bg-primary text-primary-foreground"
|
||||
)}>
|
||||
{isRdp ? (
|
||||
<RdpProtocolIcon size={17} />
|
||||
) : isVnc ? (
|
||||
<VncProtocolIcon size={17} />
|
||||
) : isSerial ? (
|
||||
<Usb size={17} />
|
||||
) : isLocal ? (
|
||||
<Terminal size={17} />
|
||||
) : (
|
||||
<Server size={17} />
|
||||
)}
|
||||
{isSerial ? <Usb size={17} /> : isLocal ? <Terminal size={17} /> : <Server size={17} />}
|
||||
</div>
|
||||
)}
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<div className="text-sm font-medium truncate">
|
||||
{isLocal ? t("logs.localTerminal") : log.hostLabel}
|
||||
</div>
|
||||
{log.recordingId && (
|
||||
<span
|
||||
data-recording-badge={log.recordingId}
|
||||
className="inline-flex items-center gap-1 rounded-md border border-primary/25 bg-primary/10 px-1.5 py-0.5 text-[11px] font-medium tabular-nums text-primary shrink-0"
|
||||
>
|
||||
<Video size={12} />
|
||||
<span>
|
||||
{recordingDurationText}
|
||||
{recordingSizeText ? ` · ${recordingSizeText}` : ""}
|
||||
</span>
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="min-w-0">
|
||||
<div className="text-sm font-medium truncate">{isLocal ? t("logs.localTerminal") : log.hostLabel}</div>
|
||||
<div className="text-xs text-muted-foreground truncate">
|
||||
{isLocal
|
||||
? "local"
|
||||
: isSerial
|
||||
? `serial, ${log.hostname}`
|
||||
: log.username
|
||||
? `${log.protocol}, ${log.username}`
|
||||
: `${log.protocol}, ${log.hostname}`}
|
||||
{isLocal ? "local" : isSerial ? `serial, ${log.hostname}` : `${log.protocol}, ${log.username}`}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Search } from 'lucide-react';
|
||||
import React, { useMemo, useState, useEffect, useCallback } from 'react';
|
||||
import { useI18n } from '../application/i18n/I18nProvider';
|
||||
import { usePinyinMatcherVersion } from '../application/state/usePinyinMatcherVersion';
|
||||
import { matchesWorkspaceHostPickerQuery } from '../domain/searchMatcher';
|
||||
import { Host } from '../types';
|
||||
import { DistroAvatar } from './DistroAvatar';
|
||||
@@ -30,14 +29,12 @@ export const CreateWorkspaceDialog: React.FC<CreateWorkspaceDialogProps> = ({
|
||||
const [name, setName] = useState('');
|
||||
const [search, setSearch] = useState('');
|
||||
const [selectedHostIds, setSelectedHostIds] = useState<Set<string>>(new Set());
|
||||
const pinyinMatcherVersion = usePinyinMatcherVersion();
|
||||
|
||||
const filteredHosts = useMemo(() => {
|
||||
void pinyinMatcherVersion;
|
||||
const term = search.trim();
|
||||
if (!term) return hosts;
|
||||
return hosts.filter((host) => matchesWorkspaceHostPickerQuery(term, host));
|
||||
}, [hosts, search, pinyinMatcherVersion]);
|
||||
}, [hosts, search]);
|
||||
|
||||
const toggleHost = useCallback((hostId: string) => {
|
||||
setSelectedHostIds(prev => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { getHostOsSelection, HOST_OS_SELECTIONS, resolveHostOs } from '../domain/host';
|
||||
import { applyGroupDefaults } from "../domain/groupConfig";
|
||||
import { isRemoteDesktopProtocol } from "../domain/remoteDesktop";
|
||||
import React from "react";
|
||||
import { AlertTriangle, ChevronDown, Forward, Globe, HeartPulse, KeyRound, Link2, Palette, Plus, Router, ShieldAlert, TerminalSquare, Timer, Wifi, X, Variable } from "lucide-react";
|
||||
import { customThemeStore } from "../application/state/customThemeStore";
|
||||
@@ -41,11 +40,7 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
form,
|
||||
setForm,
|
||||
update,
|
||||
activeProtocolTab,
|
||||
isCurrentTabEnabled = true,
|
||||
effectiveThemeId,
|
||||
effectiveTelnetThemeId,
|
||||
onOpenTelnetThemeSelect,
|
||||
hasEffectiveThemeOverride,
|
||||
effectiveFontSize,
|
||||
hasEffectiveFontSizeOverride,
|
||||
@@ -106,57 +101,34 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
&& !effectiveConnectionHost.moshEnabled
|
||||
&& !effectiveConnectionHost.etEnabled;
|
||||
const effectiveX11Forwarding = !!effectiveConnectionHost.x11Forwarding;
|
||||
const viewedProtocol: "ssh" | "rdp" | "vnc" | "telnet" =
|
||||
activeProtocolTab
|
||||
?? (isRemoteDesktopProtocol(form.protocol)
|
||||
? form.protocol
|
||||
: form.protocol === "telnet"
|
||||
? "telnet"
|
||||
: "ssh");
|
||||
const showTabSections = isCurrentTabEnabled !== false;
|
||||
const isSshView = showTabSections && viewedProtocol === "ssh";
|
||||
const isTelnetView = showTabSections && viewedProtocol === "telnet";
|
||||
const isRemoteDesktopView = showTabSections && (viewedProtocol === "rdp" || viewedProtocol === "vnc");
|
||||
const isCompanionTelnetTheme = isTelnetView && form.protocol !== "telnet" && Boolean(onOpenTelnetThemeSelect);
|
||||
const displayedThemeId = isCompanionTelnetTheme && effectiveTelnetThemeId
|
||||
? effectiveTelnetThemeId
|
||||
: effectiveThemeId;
|
||||
|
||||
return (
|
||||
<>
|
||||
{(isSshView || isTelnetView) && (
|
||||
<>
|
||||
<HostDetailsSection
|
||||
icon={<Palette size={14} className="text-muted-foreground" />}
|
||||
title={t("hostDetails.section.appearance")}
|
||||
>
|
||||
|
||||
{/* Terminal Theme Selection (SSH or Telnet) */}
|
||||
{/* SSH Theme Selection */}
|
||||
<div className="flex w-full items-center gap-1 rounded-lg bg-secondary/50 p-2 transition-colors hover:bg-secondary">
|
||||
<button
|
||||
type="button"
|
||||
className="flex min-w-0 flex-1 items-center gap-3 text-left"
|
||||
onClick={() => {
|
||||
if (isCompanionTelnetTheme && onOpenTelnetThemeSelect) {
|
||||
onOpenTelnetThemeSelect();
|
||||
} else {
|
||||
setActiveSubPanel("theme-select");
|
||||
}
|
||||
}}
|
||||
onClick={() => setActiveSubPanel("theme-select")}
|
||||
>
|
||||
<div
|
||||
className="w-12 h-8 rounded-md border border-border/60 flex items-center justify-center text-[6px] font-mono overflow-hidden shrink-0"
|
||||
style={{
|
||||
backgroundColor:
|
||||
customThemeStore.getThemeById(displayedThemeId)?.colors.background || "#100F0F",
|
||||
customThemeStore.getThemeById(effectiveThemeId)?.colors.background || "#100F0F",
|
||||
color:
|
||||
customThemeStore.getThemeById(displayedThemeId)?.colors.foreground || "#CECDC3",
|
||||
customThemeStore.getThemeById(effectiveThemeId)?.colors.foreground || "#CECDC3",
|
||||
}}
|
||||
>
|
||||
<div className="p-0.5">
|
||||
<div
|
||||
style={{
|
||||
color: customThemeStore.getThemeById(displayedThemeId)?.colors.green,
|
||||
color: customThemeStore.getThemeById(effectiveThemeId)?.colors.green,
|
||||
}}
|
||||
>
|
||||
$
|
||||
@@ -164,10 +136,10 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-sm flex-1 truncate">
|
||||
{customThemeStore.getThemeById(displayedThemeId)?.name || "Flexoki Dark"}
|
||||
{customThemeStore.getThemeById(effectiveThemeId)?.name || "Flexoki Dark"}
|
||||
</span>
|
||||
</button>
|
||||
{!isCompanionTelnetTheme && hasEffectiveThemeOverride && (
|
||||
{hasEffectiveThemeOverride && (
|
||||
<HostDetailsOverrideReset
|
||||
label={t("common.useGlobal")}
|
||||
onClick={(event) => {
|
||||
@@ -246,8 +218,6 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
</HostDetailsSettingRow>
|
||||
</HostDetailsSection>
|
||||
|
||||
{isSshView && (
|
||||
<>
|
||||
<HostDetailsSection
|
||||
icon={<Wifi size={14} className="text-muted-foreground" />}
|
||||
title={t("hostDetails.section.mosh")}
|
||||
@@ -420,15 +390,13 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
/>
|
||||
</HostDetailsSection>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
{(isSshView || isTelnetView) && (
|
||||
{(!form.protocol || ['ssh', 'telnet', 'mosh', 'et'].includes(form.protocol)) && (
|
||||
<HostDetailsSection
|
||||
icon={<Router size={14} className="text-muted-foreground" />}
|
||||
title={t("hostDetails.section.deviceType")}
|
||||
>
|
||||
{isSshView && !effectiveMoshEnabled && !effectiveEtEnabled && (<>
|
||||
{(!form.protocol || form.protocol === 'ssh') && !effectiveMoshEnabled && !effectiveEtEnabled && (<>
|
||||
<ToggleRow
|
||||
label={t("hostDetails.deviceType")}
|
||||
hint={t("hostDetails.deviceType.desc")}
|
||||
@@ -481,7 +449,6 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
)}
|
||||
|
||||
{/* SSH Algorithms */}
|
||||
{isSshView && (
|
||||
<HostDetailsSection
|
||||
icon={<ShieldAlert size={14} className="text-muted-foreground" />}
|
||||
title={t("hostDetails.section.sshAlgorithms")}
|
||||
@@ -536,7 +503,6 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
t={t}
|
||||
/>
|
||||
</HostDetailsSection>
|
||||
)}
|
||||
|
||||
{/* Terminal Behavior — input/output key mappings (backspace, etc.) */}
|
||||
<HostDetailsSection
|
||||
@@ -549,7 +515,7 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
enabled={!!form.showLineTimestamps}
|
||||
onToggle={() => update("showLineTimestamps", !form.showLineTimestamps)}
|
||||
/>
|
||||
{isSshView && !effectiveMoshEnabled && !effectiveEtEnabled && (
|
||||
{(form.protocol === undefined || form.protocol === "ssh") && !effectiveMoshEnabled && !effectiveEtEnabled && (
|
||||
<>
|
||||
<ToggleRow
|
||||
label={t("hostDetails.sshInputCompatibility")}
|
||||
@@ -583,8 +549,6 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
</HostDetailsSection>
|
||||
|
||||
{/* Per-host keepalive override */}
|
||||
{isSshView && (
|
||||
<>
|
||||
<HostDetailsSection
|
||||
icon={<HeartPulse size={14} className="text-muted-foreground" />}
|
||||
title={t("hostDetails.section.keepalive")}
|
||||
@@ -686,13 +650,8 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
/>
|
||||
</HostDetailsSettingRow>
|
||||
</HostDetailsSection>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Proxy via Hosts (Jump Hosts / ProxyJump) */}
|
||||
{(isSshView || isRemoteDesktopView) && (
|
||||
<HostDetailsSection
|
||||
icon={<Link2 size={14} className="text-muted-foreground" />}
|
||||
title={t("hostDetails.jumpHosts")}
|
||||
@@ -775,10 +734,8 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
</Button>
|
||||
)}
|
||||
</HostDetailsSection>
|
||||
)}
|
||||
|
||||
{/* Proxy Configuration */}
|
||||
{showTabSections && (
|
||||
<HostDetailsSection
|
||||
icon={<Globe size={14} className="text-muted-foreground" />}
|
||||
title={t("hostDetails.proxy")}
|
||||
@@ -857,12 +814,8 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
</Button>
|
||||
)}
|
||||
</HostDetailsSection>
|
||||
)}
|
||||
|
||||
{/* Environment Variables */}
|
||||
{(isSshView || isTelnetView) && (
|
||||
<>
|
||||
{isSshView && (
|
||||
<HostDetailsSection
|
||||
icon={<Variable size={14} className="text-muted-foreground" />}
|
||||
title={t("hostDetails.envVars")}
|
||||
@@ -899,7 +852,6 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
</Button>
|
||||
)}
|
||||
</HostDetailsSection>
|
||||
)}
|
||||
|
||||
{/* Startup Command */}
|
||||
<HostDetailsSection
|
||||
@@ -935,8 +887,6 @@ export const HostDetailsAdvancedSections: React.FC<HostDetailsAdvancedSectionsPr
|
||||
</Select>
|
||||
</HostDetailsSettingRow>
|
||||
</HostDetailsSection>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -138,7 +138,7 @@ test("host credentials expose automatic and password-only choices", () => {
|
||||
// Login method uses the same option-style setting row as other host form controls.
|
||||
assert.match(
|
||||
markup,
|
||||
/hostDetails\.auth\.method[\s\S]*?role="combobox"[\s\S]*?hostDetails\.auth\.auto[\s\S]*?<\/div>\s*<div class="flex h-10 items-center justify-between gap-3 bg-transparent px-1">[\s\S]*hostDetails\.auth\.mfaFirst/,
|
||||
/hostDetails\.auth\.method[\s\S]*?role="combobox"[\s\S]*?hostDetails\.auth\.auto[\s\S]*?<\/div>\s*<div class="flex h-12 items-center justify-between gap-3 rounded-lg border border-border\/60 bg-secondary\/40 px-3">[\s\S]*hostDetails\.auth\.mfaFirst/,
|
||||
);
|
||||
assert.match(markup, /class="[^"]*h-8 w-32[^"]*"/);
|
||||
assert.match(
|
||||
|
||||
@@ -1,26 +1,11 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Building2, ChevronDown, Eye, EyeOff, FileKey, FolderLock, Key, KeyRound, MapPin, Plug, Plus, Shapes, Shield, Terminal, Trash2, User, UserCheck, X } from "lucide-react";
|
||||
import type { Host, Identity } from "../types";
|
||||
import React from "react";
|
||||
import { ChevronDown, Eye, EyeOff, FileKey, FolderLock, Key, KeyRound, MapPin, Shapes, Shield, Trash2, User, X } from "lucide-react";
|
||||
import type { Host } from "../types";
|
||||
import { applyHostAuthMethodSelection } from "../domain/sshAuth";
|
||||
import {
|
||||
DEFAULT_RDP_PORT,
|
||||
DEFAULT_VNC_PORT,
|
||||
formatVncDisplayNumber,
|
||||
isRdpProtocol,
|
||||
isRemoteDesktopProtocol,
|
||||
isVncProtocol,
|
||||
parseVncPortOrDisplay,
|
||||
} from "../domain/remoteDesktop";
|
||||
import { cn } from "../lib/utils";
|
||||
import { RdpProtocolIcon, VncProtocolIcon } from "./icons/RemoteDesktopIcons";
|
||||
import { HostTotpFields } from "./HostTotpFields";
|
||||
import { HostIconPicker } from "./HostIconPicker";
|
||||
import { parseOptionalPortInput } from "./HostDetailsPanel.helpers";
|
||||
import { TerminalEncodingSelect } from "./TerminalEncodingSelect";
|
||||
import { Button } from "./ui/button";
|
||||
import { HostDetailsSection, HostDetailsSettingRow } from "./host-details";
|
||||
import { CompanionRemoteDesktopInlineFields } from "./host-details/CompanionRemoteDesktopSections";
|
||||
import { IdentitySuggestInput } from "./host-details/IdentitySuggestInput";
|
||||
import { Input } from "./ui/input";
|
||||
import { Popover, PopoverAnchor, PopoverContent } from "./ui/popover";
|
||||
import { ScrollArea } from "./ui/scroll-area";
|
||||
@@ -118,106 +103,7 @@ export const HostDetailsConnectionSections: React.FC<HostDetailsConnectionSectio
|
||||
effectiveFormDistro,
|
||||
getDistroOptionLabel,
|
||||
totpFlushRef,
|
||||
onSelectPrimaryProtocol,
|
||||
activeProtocolTab,
|
||||
enabledProtocols,
|
||||
defaultConnectProtocol,
|
||||
effectiveConnectBehavior,
|
||||
onSelectProtocolTab,
|
||||
onEnableSecondaryProtocol,
|
||||
onSwitchOnlyProtocol,
|
||||
onSetDefaultProtocol,
|
||||
onSetConnectBehavior,
|
||||
onRemoveProtocol,
|
||||
onCreateIdentity,
|
||||
companionCredentialDrafts,
|
||||
onCompanionCredentialDraftChange,
|
||||
resolutionDraft,
|
||||
onResolutionDraftChange,
|
||||
effectiveTelnetPort,
|
||||
effectiveTelnetUsername,
|
||||
effectiveTelnetPassword,
|
||||
selectedTelnetIdentity,
|
||||
updateTelnetIdentity,
|
||||
showTelnetPassword = false,
|
||||
setShowTelnetPassword,
|
||||
}) => {
|
||||
const fallbackPrimary: "ssh" | "rdp" | "vnc" | "telnet" =
|
||||
form.protocol === "rdp" || form.protocol === "vnc" || form.protocol === "telnet"
|
||||
? form.protocol
|
||||
: "ssh";
|
||||
const resolvedEnabledProtocols: Record<"ssh" | "rdp" | "vnc" | "telnet", boolean> =
|
||||
enabledProtocols ?? {
|
||||
ssh:
|
||||
!form.protocol
|
||||
|| form.protocol === "ssh"
|
||||
|| form.protocol === "mosh"
|
||||
|| form.protocol === "et"
|
||||
|| Boolean(form.protocols?.some((p: { protocol?: string; enabled?: boolean }) => p.protocol === "ssh" && p.enabled)),
|
||||
rdp: form.protocol === "rdp" || form.rdpConfig?.enabled === true,
|
||||
vnc: form.protocol === "vnc" || form.vncConfig?.enabled === true,
|
||||
telnet: form.protocol === "telnet" || form.telnetEnabled === true,
|
||||
};
|
||||
const resolvedDefaultProtocol: "ssh" | "rdp" | "vnc" | "telnet" =
|
||||
defaultConnectProtocol ?? fallbackPrimary;
|
||||
const resolvedConnectBehavior: "ask" | "ssh" | "rdp" | "vnc" | "telnet" =
|
||||
effectiveConnectBehavior ?? resolvedDefaultProtocol;
|
||||
const currentTab: "ssh" | "rdp" | "vnc" | "telnet" =
|
||||
activeProtocolTab ?? fallbackPrimary;
|
||||
const enabledProtocolList = (["ssh", "rdp", "vnc", "telnet"] as const).filter(
|
||||
(proto) => resolvedEnabledProtocols[proto],
|
||||
);
|
||||
const enabledCount = enabledProtocolList.length;
|
||||
const isCurrentTabEnabled = resolvedEnabledProtocols[currentTab];
|
||||
const isRdpPrimary = isRdpProtocol(form.protocol);
|
||||
const isVncPrimary = isVncProtocol(form.protocol);
|
||||
const isRemoteDesktopPrimary = isRemoteDesktopProtocol(form.protocol);
|
||||
const isCompanionRdpTab = currentTab === "rdp" && resolvedEnabledProtocols.ssh && isCurrentTabEnabled;
|
||||
const isCompanionVncTab = currentTab === "vnc" && resolvedEnabledProtocols.ssh && isCurrentTabEnabled;
|
||||
const isStandaloneRdpTab = currentTab === "rdp" && !resolvedEnabledProtocols.ssh && isCurrentTabEnabled;
|
||||
const isStandaloneVncTab = currentTab === "vnc" && !resolvedEnabledProtocols.ssh && isCurrentTabEnabled;
|
||||
const isTelnetTab = currentTab === "telnet" && isCurrentTabEnabled;
|
||||
const protocolLabels: Record<"ssh" | "rdp" | "vnc" | "telnet", string> = {
|
||||
ssh: "SSH",
|
||||
rdp: "RDP",
|
||||
vnc: "VNC",
|
||||
telnet: "Telnet",
|
||||
};
|
||||
const canAddCurrentAsSecondary =
|
||||
!isCurrentTabEnabled
|
||||
&& Boolean(onEnableSecondaryProtocol)
|
||||
&& (
|
||||
(resolvedEnabledProtocols.ssh && (currentTab === "rdp" || currentTab === "vnc" || currentTab === "telnet"))
|
||||
|| (!resolvedEnabledProtocols.ssh && currentTab === "ssh" && (resolvedEnabledProtocols.rdp || resolvedEnabledProtocols.vnc || resolvedEnabledProtocols.telnet))
|
||||
);
|
||||
|
||||
const [vncPortText, setVncPortText] = useState<string>(() =>
|
||||
String(form.port ?? DEFAULT_VNC_PORT),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (isVncPrimary) {
|
||||
setVncPortText(String(form.port ?? DEFAULT_VNC_PORT));
|
||||
}
|
||||
}, [form.id, form.port, isVncPrimary]);
|
||||
|
||||
const handleTabClick = (next: "ssh" | "rdp" | "vnc" | "telnet") => {
|
||||
if (onSelectProtocolTab) {
|
||||
onSelectProtocolTab(next);
|
||||
} else if (onSelectPrimaryProtocol) {
|
||||
onSelectPrimaryProtocol(next);
|
||||
} else {
|
||||
update("protocol", next);
|
||||
}
|
||||
};
|
||||
|
||||
const passwordCompatibleIdentities: Identity[] = (identities || []).filter(
|
||||
(identity: Identity) => identity.authMethod === "password" || Boolean(identity.password),
|
||||
);
|
||||
const vncDisplayLabel = isVncPrimary
|
||||
? formatVncDisplayNumber(form.port ?? DEFAULT_VNC_PORT)
|
||||
: null;
|
||||
|
||||
const selectAuthMethod = (authMethod: "auto" | "password" | "key" | "certificate") => {
|
||||
setForm((previous: Host) => applyEffectiveHostAuthMethodSelection(
|
||||
previous,
|
||||
@@ -263,425 +149,9 @@ export const HostDetailsConnectionSections: React.FC<HostDetailsConnectionSectio
|
||||
title={t("hostDetails.section.portCredentials")}
|
||||
className="overflow-hidden"
|
||||
>
|
||||
{/* Primary protocol selector: minimalist flat segmented control */}
|
||||
<div
|
||||
className="grid grid-cols-4 gap-1 rounded-lg bg-secondary/60 p-1"
|
||||
role="radiogroup"
|
||||
aria-label={t("hostDetails.protocol.label")}
|
||||
>
|
||||
{(
|
||||
[
|
||||
{
|
||||
id: "ssh",
|
||||
label: "SSH",
|
||||
icon: <Shield size={13} />,
|
||||
activeIcon: "text-sky-500",
|
||||
},
|
||||
{
|
||||
id: "rdp",
|
||||
label: "RDP",
|
||||
icon: <RdpProtocolIcon size={13} />,
|
||||
activeIcon: "text-blue-500",
|
||||
},
|
||||
{
|
||||
id: "vnc",
|
||||
label: "VNC",
|
||||
icon: <VncProtocolIcon size={13} />,
|
||||
activeIcon: "text-teal-500",
|
||||
},
|
||||
{
|
||||
id: "telnet",
|
||||
label: "Telnet",
|
||||
icon: <Terminal size={13} />,
|
||||
activeIcon: "text-amber-500",
|
||||
},
|
||||
] as const
|
||||
).map((item) => {
|
||||
const active = currentTab === item.id;
|
||||
const isEnabled = resolvedEnabledProtocols[item.id];
|
||||
const isDefault = resolvedDefaultProtocol === item.id;
|
||||
return (
|
||||
<button
|
||||
key={item.id}
|
||||
type="button"
|
||||
role="radio"
|
||||
aria-checked={active}
|
||||
data-primary-protocol={item.id}
|
||||
onClick={() => handleTabClick(item.id)}
|
||||
className={cn(
|
||||
"relative flex h-8 items-center justify-center gap-1.5 rounded-md px-2 text-xs font-medium transition-colors",
|
||||
active
|
||||
? "bg-background text-foreground"
|
||||
: "text-muted-foreground hover:text-foreground",
|
||||
)}
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
"shrink-0 transition-colors",
|
||||
active || isEnabled ? item.activeIcon : "opacity-60",
|
||||
)}
|
||||
>
|
||||
{item.icon}
|
||||
</span>
|
||||
<span className="truncate leading-none">{item.label}</span>
|
||||
{enabledCount >= 2 && isEnabled && (
|
||||
<span
|
||||
className={cn(
|
||||
"h-1.5 w-1.5 rounded-full shrink-0",
|
||||
resolvedConnectBehavior !== "ask" && isDefault
|
||||
? "bg-primary"
|
||||
: "bg-muted-foreground/45",
|
||||
)}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{!isCurrentTabEnabled ? (
|
||||
<div className="rounded-lg border border-dashed border-border/60 bg-transparent px-3 py-5 text-center space-y-3">
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t("hostDetails.protocol.notEnabledDesc", { protocol: protocolLabels[currentTab] })}
|
||||
</p>
|
||||
<div className="flex flex-wrap items-center justify-center gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="h-9 gap-1.5 px-4 text-xs font-medium"
|
||||
onClick={() => {
|
||||
if (canAddCurrentAsSecondary && onEnableSecondaryProtocol) {
|
||||
onEnableSecondaryProtocol(currentTab);
|
||||
} else {
|
||||
onSwitchOnlyProtocol?.(currentTab);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Plus size={14} />
|
||||
{canAddCurrentAsSecondary
|
||||
? t("hostDetails.protocol.addProtocol", { protocol: protocolLabels[currentTab] })
|
||||
: t("hostDetails.protocol.switchOnly", { protocol: protocolLabels[currentTab] })}
|
||||
</Button>
|
||||
{canAddCurrentAsSecondary && onSwitchOnlyProtocol ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-9 px-3 text-xs font-medium text-muted-foreground hover:text-foreground"
|
||||
onClick={() => onSwitchOnlyProtocol(currentTab)}
|
||||
>
|
||||
{t("hostDetails.protocol.switchOnly", { protocol: protocolLabels[currentTab] })}
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
) : isCompanionVncTab ? (
|
||||
<CompanionRemoteDesktopInlineFields
|
||||
protocol="vnc"
|
||||
form={form}
|
||||
setForm={setForm}
|
||||
identities={identities}
|
||||
availableKeys={availableKeys}
|
||||
onCreateIdentity={onCreateIdentity}
|
||||
credentialDraft={companionCredentialDrafts?.vnc}
|
||||
onCredentialDraftChange={(draft) => onCompanionCredentialDraftChange?.("vnc", draft)}
|
||||
t={t}
|
||||
/>
|
||||
) : isCompanionRdpTab ? (
|
||||
<CompanionRemoteDesktopInlineFields
|
||||
protocol="rdp"
|
||||
form={form}
|
||||
setForm={setForm}
|
||||
identities={identities}
|
||||
availableKeys={availableKeys}
|
||||
onCreateIdentity={onCreateIdentity}
|
||||
resolutionDraft={resolutionDraft}
|
||||
onResolutionDraftChange={onResolutionDraftChange}
|
||||
credentialDraft={companionCredentialDrafts?.rdp}
|
||||
onCredentialDraftChange={(draft) => onCompanionCredentialDraftChange?.("rdp", draft)}
|
||||
t={t}
|
||||
/>
|
||||
) : (isStandaloneRdpTab || isStandaloneVncTab) ? (
|
||||
<div className="space-y-2">
|
||||
<HostDetailsSettingRow
|
||||
icon={<Plug />}
|
||||
label={isRdpPrimary ? t("hostDetails.rdp.portLabel") : t("hostDetails.vnc.portLabel")}
|
||||
>
|
||||
{isVncPrimary ? (
|
||||
<div className="flex items-center gap-1.5 w-44">
|
||||
<Input
|
||||
value={vncPortText}
|
||||
onChange={(e) => {
|
||||
const raw = e.target.value;
|
||||
setVncPortText(raw);
|
||||
const parsed = parseVncPortOrDisplay(raw);
|
||||
if (parsed !== null) {
|
||||
update("port", parsed);
|
||||
}
|
||||
}}
|
||||
onBlur={() => {
|
||||
const parsed = parseVncPortOrDisplay(vncPortText);
|
||||
const resolved = parsed ?? DEFAULT_VNC_PORT;
|
||||
setVncPortText(String(resolved));
|
||||
update("port", resolved);
|
||||
}}
|
||||
placeholder={t("hostDetails.vnc.displayPlaceholder")}
|
||||
className="h-8 flex-1 min-w-0 text-center font-mono text-sm"
|
||||
/>
|
||||
{vncDisplayLabel ? (
|
||||
<span className="rounded border border-border/60 bg-background px-1.5 py-0.5 text-xs font-mono text-muted-foreground shrink-0">
|
||||
{vncDisplayLabel}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
) : (
|
||||
<Input
|
||||
type="number"
|
||||
value={form.port ?? ""}
|
||||
onChange={(e) =>
|
||||
update("port", e.target.value ? Number(e.target.value) : undefined)
|
||||
}
|
||||
placeholder={String(DEFAULT_RDP_PORT)}
|
||||
className="h-8 w-44 text-center font-mono text-sm"
|
||||
/>
|
||||
)}
|
||||
</HostDetailsSettingRow>
|
||||
|
||||
<div className="grid gap-2">
|
||||
{selectedIdentity ? (
|
||||
<div className="flex items-center gap-2 h-10 px-3 rounded-lg border border-border/60 bg-transparent">
|
||||
<UserCheck size={14} className="text-muted-foreground shrink-0" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="text-sm font-medium truncate">
|
||||
{selectedIdentity.label}
|
||||
</div>
|
||||
</div>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 shrink-0"
|
||||
onClick={clearIdentity}
|
||||
>
|
||||
<X size={14} />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{t("common.clear")}</TooltipContent>
|
||||
</Tooltip>
|
||||
</div>
|
||||
) : effectiveIdentityId ? (
|
||||
<div className="flex items-center gap-2 h-10 px-3 rounded-lg border border-border/60 bg-transparent">
|
||||
<User size={16} className="text-muted-foreground" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="text-sm font-medium truncate">
|
||||
{t("hostDetails.identity.missing")}
|
||||
</div>
|
||||
</div>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 shrink-0"
|
||||
onClick={clearIdentity}
|
||||
>
|
||||
<X size={14} />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{t("common.clear")}</TooltipContent>
|
||||
</Tooltip>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<IdentitySuggestInput
|
||||
value={form.username ?? ""}
|
||||
onChange={(next) => update("username", next)}
|
||||
placeholder={
|
||||
isRdpPrimary
|
||||
? t("hostDetails.rdp.usernamePlaceholder")
|
||||
: t("hostDetails.vnc.usernamePlaceholder")
|
||||
}
|
||||
identities={passwordCompatibleIdentities}
|
||||
availableKeys={availableKeys}
|
||||
onSelectIdentity={(identity) => {
|
||||
applyIdentity(identity);
|
||||
if (isRdpPrimary && identity.domain) {
|
||||
setForm((prev: Host) => ({
|
||||
...prev,
|
||||
rdpConfig: {
|
||||
...(prev.rdpConfig ?? {}),
|
||||
domain: identity.domain,
|
||||
},
|
||||
}));
|
||||
}
|
||||
}}
|
||||
t={t}
|
||||
/>
|
||||
|
||||
<div className="relative">
|
||||
<Input
|
||||
placeholder={t("hostDetails.password.placeholder")}
|
||||
type={showPassword ? "text" : "password"}
|
||||
value={form.password || ""}
|
||||
onChange={(e) => update("password", e.target.value)}
|
||||
className="h-10 rounded-lg pr-10"
|
||||
/>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
className="absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors"
|
||||
>
|
||||
{showPassword ? <EyeOff size={16} /> : <Eye size={16} />}
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
{showPassword ? t("hostDetails.password.hide") : t("hostDetails.password.show")}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
{form.password && (
|
||||
<div className="flex items-center justify-between py-1">
|
||||
<span className="text-xs text-muted-foreground">
|
||||
{t("hostDetails.password.save")}
|
||||
</span>
|
||||
<Switch
|
||||
checked={form.savePassword ?? true}
|
||||
onCheckedChange={(val) => update("savePassword" as keyof Host, val)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isRdpPrimary ? (
|
||||
<HostDetailsSettingRow
|
||||
icon={<Building2 />}
|
||||
label={t("hostDetails.rdp.domainLabel")}
|
||||
>
|
||||
<Input
|
||||
placeholder={t("hostDetails.rdp.domainPlaceholder")}
|
||||
value={form.rdpConfig?.domain ?? ""}
|
||||
onChange={(e) =>
|
||||
setForm((prev: Host) => ({
|
||||
...prev,
|
||||
rdpConfig: {
|
||||
...(prev.rdpConfig ?? {}),
|
||||
domain: e.target.value || undefined,
|
||||
},
|
||||
}))
|
||||
}
|
||||
className="h-8 w-44 text-sm"
|
||||
/>
|
||||
</HostDetailsSettingRow>
|
||||
) : null}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : isTelnetTab ? (
|
||||
<>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1 min-w-0 h-10 flex items-center gap-2 bg-transparent px-1">
|
||||
<Plug size={14} className="text-muted-foreground shrink-0" />
|
||||
<span className="text-sm font-medium text-foreground">{t("hostDetails.telnetOn")}</span>
|
||||
<div className="ml-auto w-1/2 min-w-0 flex items-center gap-2 justify-end">
|
||||
<Input
|
||||
type="number"
|
||||
value={effectiveTelnetPort ?? form.telnetPort ?? form.port ?? 23}
|
||||
onChange={(e) => {
|
||||
const parsed = parseOptionalPortInput(e.target.value);
|
||||
setForm((prev: Host) => ({
|
||||
...prev,
|
||||
...(resolvedEnabledProtocols.ssh ? {} : { port: parsed }),
|
||||
telnetPort: parsed,
|
||||
}));
|
||||
}}
|
||||
placeholder="23"
|
||||
className="h-8 flex-1 min-w-0 text-center font-mono text-sm"
|
||||
/>
|
||||
<span className="text-xs text-muted-foreground shrink-0">
|
||||
{t("hostDetails.port")}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-2">
|
||||
{form.telnetIdentityId ? (
|
||||
<div className="flex items-center gap-2 h-10 px-3 rounded-lg border border-border/60 bg-transparent">
|
||||
<UserCheck size={14} className="text-muted-foreground shrink-0" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="text-sm font-medium truncate">
|
||||
{selectedTelnetIdentity
|
||||
? `${selectedTelnetIdentity.username} - ${selectedTelnetIdentity.label}`
|
||||
: t("hostDetails.identity.missing")}
|
||||
</div>
|
||||
</div>
|
||||
{updateTelnetIdentity && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 shrink-0"
|
||||
onClick={() => updateTelnetIdentity("")}
|
||||
>
|
||||
<X size={14} />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<IdentitySuggestInput
|
||||
value={effectiveTelnetUsername ?? form.telnetUsername ?? ""}
|
||||
onChange={(next) =>
|
||||
update("telnetUsername" as keyof Host, next)
|
||||
}
|
||||
placeholder={t("hostDetails.telnet.username")}
|
||||
identities={updateTelnetIdentity ? passwordCompatibleIdentities : []}
|
||||
availableKeys={availableKeys}
|
||||
onSelectIdentity={(identity) => updateTelnetIdentity?.(identity.id)}
|
||||
t={t}
|
||||
/>
|
||||
<div className="relative">
|
||||
<Input
|
||||
placeholder={t("hostDetails.telnet.password")}
|
||||
type={showTelnetPassword ? "text" : "password"}
|
||||
value={effectiveTelnetPassword ?? form.telnetPassword ?? ""}
|
||||
onChange={(e) =>
|
||||
update("telnetPassword" as keyof Host, e.target.value)
|
||||
}
|
||||
className="h-10 rounded-lg pr-10"
|
||||
/>
|
||||
{setShowTelnetPassword && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowTelnetPassword(!showTelnetPassword)}
|
||||
className="absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors"
|
||||
>
|
||||
{showTelnetPassword ? <EyeOff size={16} /> : <Eye size={16} />}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
<TerminalEncodingSelect
|
||||
value={form.charset}
|
||||
inheritedValue={groupDefaults?.charset}
|
||||
onValueChange={(value) => update("charset", value)}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1 min-w-0 h-10 flex items-center gap-2 bg-transparent px-1">
|
||||
<Plug size={14} className="text-muted-foreground shrink-0" />
|
||||
<span className="text-sm font-medium text-foreground">SSH on</span>
|
||||
<div className="flex-1 min-w-0 h-10 flex items-center gap-2 bg-secondary/70 border border-border/70 rounded-md px-3">
|
||||
<span className="text-xs text-muted-foreground">SSH on</span>
|
||||
<div className="ml-auto w-1/2 min-w-0 flex items-center gap-2 justify-end">
|
||||
<Input
|
||||
type="number"
|
||||
@@ -1111,68 +581,8 @@ export const HostDetailsConnectionSections: React.FC<HostDetailsConnectionSectio
|
||||
flushRef={totpFlushRef}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{enabledCount >= 2 && isCurrentTabEnabled && onRemoveProtocol && (
|
||||
<div className="flex items-center justify-end border-t border-border/40 pt-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-7 gap-1.5 px-2 text-xs text-muted-foreground hover:text-destructive"
|
||||
onClick={() => onRemoveProtocol(currentTab)}
|
||||
>
|
||||
<Trash2 size={12} />
|
||||
{t("hostDetails.protocol.removeProtocol", {
|
||||
protocol: protocolLabels[currentTab],
|
||||
})}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</HostDetailsSection>
|
||||
|
||||
{enabledCount >= 2 && (
|
||||
<HostDetailsSection
|
||||
icon={<Plug size={14} className="text-muted-foreground" />}
|
||||
title={t("hostDetails.section.connectBehavior")}
|
||||
>
|
||||
<HostDetailsSettingRow label={t("hostDetails.protocol.doubleClick")}>
|
||||
<Select
|
||||
value={resolvedConnectBehavior}
|
||||
onValueChange={(value) => {
|
||||
const next = value as "ask" | "ssh" | "rdp" | "vnc" | "telnet";
|
||||
if (onSetConnectBehavior) {
|
||||
onSetConnectBehavior(next);
|
||||
} else if (next !== "ask" && onSetDefaultProtocol) {
|
||||
onSetDefaultProtocol(next);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<SelectTrigger
|
||||
className="h-8 w-44 text-sm"
|
||||
aria-label={t("hostDetails.protocol.doubleClick")}
|
||||
>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{enabledProtocolList.map((proto) => (
|
||||
<SelectItem key={proto} value={proto}>
|
||||
{t("hostDetails.protocol.connectOptionDefault", {
|
||||
protocol: protocolLabels[proto],
|
||||
})}
|
||||
</SelectItem>
|
||||
))}
|
||||
<SelectItem value="ask">
|
||||
{t("hostDetails.protocol.connectOptionAsk")}
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</HostDetailsSettingRow>
|
||||
</HostDetailsSection>
|
||||
)}
|
||||
|
||||
{isCurrentTabEnabled && currentTab === "ssh" && (
|
||||
<HostDetailsSection
|
||||
icon={<FolderLock size={14} className="text-muted-foreground" />}
|
||||
title={t("hostDetails.section.sftp")}
|
||||
@@ -1236,7 +646,6 @@ export const HostDetailsConnectionSections: React.FC<HostDetailsConnectionSectio
|
||||
</Select>
|
||||
</HostDetailsSettingRow>
|
||||
</HostDetailsSection>
|
||||
)}
|
||||
|
||||
<HostDetailsSection
|
||||
icon={<Shapes size={14} className="text-muted-foreground" />}
|
||||
@@ -1245,7 +654,6 @@ export const HostDetailsConnectionSections: React.FC<HostDetailsConnectionSectio
|
||||
>
|
||||
<HostIconPicker
|
||||
previewHost={form as Host}
|
||||
hideAutoDistro={isRemoteDesktopPrimary && !resolvedEnabledProtocols.ssh}
|
||||
distroMode={form.distroMode}
|
||||
manualDistro={form.manualDistro}
|
||||
effectiveDistro={effectiveFormDistro}
|
||||
|
||||
@@ -20,32 +20,19 @@ export const parseOptionalPortInput = (value: string): number | undefined =>
|
||||
|
||||
export const resolvePrimaryProtocolSwitchPort = (
|
||||
currentPort: number | undefined,
|
||||
nextProtocol: "ssh" | "telnet" | "rdp" | "vnc",
|
||||
nextProtocol: "ssh" | "telnet",
|
||||
hasGroupTelnetPortDefault: boolean,
|
||||
hasGroupSshPortDefault: boolean,
|
||||
): number | undefined => {
|
||||
const isKnownDefaultPort =
|
||||
currentPort === undefined ||
|
||||
currentPort === 22 ||
|
||||
currentPort === 23 ||
|
||||
currentPort === 3389 ||
|
||||
currentPort === 5900;
|
||||
|
||||
if (nextProtocol === "rdp") {
|
||||
return isKnownDefaultPort ? 3389 : currentPort;
|
||||
}
|
||||
if (nextProtocol === "vnc") {
|
||||
return isKnownDefaultPort ? 5900 : currentPort;
|
||||
}
|
||||
if (nextProtocol === "telnet") {
|
||||
// Don't override if group provides a Telnet default
|
||||
if (hasGroupTelnetPortDefault || hasGroupSshPortDefault) return currentPort;
|
||||
if (isKnownDefaultPort) return 23;
|
||||
if (currentPort === 22 || currentPort === undefined) return 23;
|
||||
return currentPort;
|
||||
}
|
||||
if (nextProtocol === "ssh") {
|
||||
if (hasGroupSshPortDefault) return currentPort;
|
||||
if (isKnownDefaultPort) return 22;
|
||||
if (currentPort === 23 || currentPort === undefined) return 22;
|
||||
return currentPort;
|
||||
}
|
||||
return currentPort;
|
||||
@@ -57,12 +44,6 @@ export const resolvePrimaryProtocolSavePort = (
|
||||
hasGroupSshPortDefault: boolean,
|
||||
hasGroupTelnetPortDefault: boolean,
|
||||
): number | undefined => {
|
||||
if (protocol === "rdp") {
|
||||
return currentPort ?? 3389;
|
||||
}
|
||||
if (protocol === "vnc") {
|
||||
return currentPort ?? 5900;
|
||||
}
|
||||
if (protocol === "telnet") {
|
||||
if (currentPort !== undefined) return currentPort;
|
||||
if (hasGroupTelnetPortDefault || hasGroupSshPortDefault) return undefined;
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
mapProxySaveErrorKey,
|
||||
prepareProxyConfigForSave,
|
||||
prepareTelnetCredentialsForSave,
|
||||
resolveDetailsTelnetPort,
|
||||
resolvePrimaryProtocolSavePort,
|
||||
resolvePrimaryProtocolSwitchPort,
|
||||
validateProxyConfigForSave,
|
||||
@@ -311,27 +310,9 @@ test("HostDetailsPanel uses group telnet port instead of ssh port for optional t
|
||||
),
|
||||
);
|
||||
|
||||
const telnetTabMarkup = markup.match(/data-primary-protocol="telnet"[\s\S]*?<\/button>/);
|
||||
assert.ok(telnetTabMarkup);
|
||||
// Multi-protocol SSH + Telnet host shows enabled dot on the unified Telnet tab
|
||||
assert.match(telnetTabMarkup[0], /rounded-full/);
|
||||
// No duplicate bottom Additional Protocols section
|
||||
assert.doesNotMatch(markup, /Additional Protocols/);
|
||||
// Resolved telnet port still prefers group telnetPort (2325) over host SSH port (2222)
|
||||
assert.equal(
|
||||
resolveDetailsTelnetPort(
|
||||
{
|
||||
...hostWithMissingProxyProfile,
|
||||
protocol: "ssh",
|
||||
telnetEnabled: true,
|
||||
telnetPort: undefined,
|
||||
port: 2222,
|
||||
group: "network",
|
||||
},
|
||||
{ telnetPort: 2325 },
|
||||
),
|
||||
2325,
|
||||
);
|
||||
const telnetMarkup = markup.slice(markup.indexOf("Telnet on"));
|
||||
assert.match(findInputByValue(telnetMarkup, "2325"), /type="number"/);
|
||||
assert.doesNotMatch(telnetMarkup, /value="2222"/);
|
||||
});
|
||||
|
||||
test("HostDetailsPanel displays inherited telnet credentials", () => {
|
||||
@@ -546,11 +527,10 @@ test("HostDetailsPanel does not offer to disable telnet when telnet is the prima
|
||||
telnetPort: 23,
|
||||
proxyProfileId: undefined,
|
||||
});
|
||||
const telnetHeader = markup.match(/Telnet on[\s\S]*?Telnet Username/);
|
||||
const telnetHeader = markup.match(/Telnet on[\s\S]*?Credentials/);
|
||||
|
||||
assert.ok(telnetHeader);
|
||||
assert.doesNotMatch(telnetHeader[0], /hover:text-destructive/);
|
||||
assert.doesNotMatch(markup, /Additional Protocols/);
|
||||
});
|
||||
|
||||
test("HostDetailsPanel shows color and icon controls in the connection settings", () => {
|
||||
|
||||
Loaded 100 of 596 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user