mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
release-2.9.0 (#1532)
* fix(macos): skip single-instance lock in Mac App Store builds (#1454)
fix(macos): skip single-instance lock in Mac App Store builds
* Fix/backend optional sharp (#1455)
Fix/backend optional sharp
* feat: issue #1218 (#1218)
https://github.com/Termix-SSH/Support/issues/1218
* feat: Add option to use saved global custom theme under Connection Defaults (#1209)
https://github.com/Termix-SSH/Support/issues/1209
* feat: Add Fleet Sharing functionality to the UI (#1228)
https://github.com/Termix-SSH/Support/issues/1228
* feat: Add a list view to the Docker management page (#1237)
https://github.com/Termix-SSH/Support/issues/1237
* feat: issue #1264 (#1264)
https://github.com/Termix-SSH/Support/issues/1264
* feat: 2FA With FortiToken (#1288)
https://github.com/Termix-SSH/Support/issues/1288
* feat: Allow to disable showing paths to folders (#1274)
https://github.com/Termix-SSH/Support/issues/1274
* feat: Sync Network Graph between Desktop and Remote Server (#1245)
https://github.com/Termix-SSH/Support/issues/1245
* feat: Version Number on offline servers (#1291)
https://github.com/Termix-SSH/Support/issues/1291
* feat: Support OrbStack Docker socket path on macOS / Fix "Docker is not installed" on mac... (#1302)
https://github.com/Termix-SSH/Support/issues/1302
* feat: Sidebar host click should focus existing tab instead of opening a new connection (#1289)
https://github.com/Termix-SSH/Support/issues/1289
* fix: Search in side bar shows overlapping hosts when grouped by tags (#1303)
https://github.com/Termix-SSH/Support/issues/1303
* fix: I can't send a file on its own. (#1304)
https://github.com/Termix-SSH/Support/issues/1304
* fix: sudo password not autofilling (#1248)
https://github.com/Termix-SSH/Support/issues/1248
* fix: node-MainThread (#1300)
https://github.com/Termix-SSH/Support/issues/1300
* fix: Tunnel authentication with shared credentials (#1295)
https://github.com/Termix-SSH/Support/issues/1295
* fix: host key updates not syncing, metrics 404 race on first connect
Host key writes never bumped updatedAt so sync never picked them up.
Also retry the first metrics fetch briefly instead of failing right away.
* chore: increment ver
* feat: add category and icon fields to plugin manifest schema
* ci(deps): bump the github-actions group with 2 updates (#1458)
Bumps the github-actions group with 2 updates: [crowdin/github-action](https://github.com/crowdin/github-action) and [actions/github-script](https://github.com/actions/github-script).
Updates `crowdin/github-action` from 2 to 3
- [Release notes](https://github.com/crowdin/github-action/releases)
- [Commits](https://github.com/crowdin/github-action/compare/v2...v3)
Updates `actions/github-script` from 7 to 9
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v7...v9)
---
updated-dependencies:
- dependency-name: crowdin/github-action
dependency-version: '3'
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
- dependency-name: actions/github-script
dependency-version: '9'
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps-dev): bump the dev-patch-updates group with 13 updates (#1459)
Bumps the dev-patch-updates group with 13 updates:
| Package | From | To |
| --- | --- | --- |
| [@codemirror/commands](https://github.com/codemirror/commands) | `6.11.0` | `6.11.1` |
| [@codemirror/search](https://github.com/codemirror/search) | `6.7.1` | `6.7.2` |
| [@codemirror/view](https://github.com/codemirror/view) | `6.43.9` | `6.43.12` |
| [@testing-library/dom](https://github.com/testing-library/dom-testing-library) | `10.4.1` | `10.4.2` |
| [@testing-library/react](https://github.com/testing-library/react-testing-library) | `16.3.2` | `16.3.3` |
| [@testing-library/user-event](https://github.com/testing-library/user-event) | `14.6.5` | `14.6.7` |
| [@types/ssh2](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ssh2) | `1.15.5` | `1.15.6` |
| [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) | `6.1.0` | `6.1.1` |
| [cytoscape](https://github.com/cytoscape/cytoscape.js) | `3.34.1` | `3.34.3` |
| [eslint-plugin-react-refresh](https://github.com/ArnaudBarre/eslint-plugin-react-refresh) | `0.5.4` | `0.5.7` |
| [i18next](https://github.com/i18next/i18next) | `26.4.0` | `26.4.2` |
| [prettier](https://github.com/prettier/prettier) | `3.9.6` | `3.9.8` |
| [react-i18next](https://github.com/i18next/react-i18next) | `17.0.12` | `17.0.14` |
Updates `@codemirror/commands` from 6.11.0 to 6.11.1
- [Changelog](https://github.com/codemirror/commands/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/commands/commits)
Updates `@codemirror/search` from 6.7.1 to 6.7.2
- [Changelog](https://github.com/codemirror/search/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/search/commits)
Updates `@codemirror/view` from 6.43.9 to 6.43.12
- [Changelog](https://github.com/codemirror/view/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/view/commits)
Updates `@testing-library/dom` from 10.4.1 to 10.4.2
- [Release notes](https://github.com/testing-library/dom-testing-library/releases)
- [Changelog](https://github.com/testing-library/dom-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/dom-testing-library/compare/v10.4.1...v10.4.2)
Updates `@testing-library/react` from 16.3.2 to 16.3.3
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v16.3.2...v16.3.3)
Updates `@testing-library/user-event` from 14.6.5 to 14.6.7
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v14.6.5...v14.6.7)
Updates `@types/ssh2` from 1.15.5 to 1.15.6
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ssh2)
Updates `@vitejs/plugin-react` from 6.1.0 to 6.1.1
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/plugin-react@6.1.1/packages/plugin-react)
Updates `cytoscape` from 3.34.1 to 3.34.3
- [Release notes](https://github.com/cytoscape/cytoscape.js/releases)
- [Commits](https://github.com/cytoscape/cytoscape.js/compare/v3.34.1...v3.34.3)
Updates `eslint-plugin-react-refresh` from 0.5.4 to 0.5.7
- [Release notes](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/releases)
- [Changelog](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.5.4...v0.5.7)
Updates `i18next` from 26.4.0 to 26.4.2
- [Release notes](https://github.com/i18next/i18next/releases)
- [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next/compare/v26.4.0...v26.4.2)
Updates `prettier` from 3.9.6 to 3.9.8
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.9.6...3.9.8)
Updates `react-i18next` from 17.0.12 to 17.0.14
- [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/react-i18next/compare/v17.0.12...v17.0.14)
---
updated-dependencies:
- dependency-name: "@codemirror/commands"
dependency-version: 6.11.1
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: "@codemirror/search"
dependency-version: 6.7.2
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: "@codemirror/view"
dependency-version: 6.43.12
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: "@testing-library/dom"
dependency-version: 10.4.2
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: "@testing-library/react"
dependency-version: 16.3.3
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: "@testing-library/user-event"
dependency-version: 14.6.7
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: "@types/ssh2"
dependency-version: 1.15.6
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: "@vitejs/plugin-react"
dependency-version: 6.1.1
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: cytoscape
dependency-version: 3.34.3
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: eslint-plugin-react-refresh
dependency-version: 0.5.7
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: i18next
dependency-version: 26.4.2
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: prettier
dependency-version: 3.9.8
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
- dependency-name: react-i18next
dependency-version: 17.0.14
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: dev-patch-updates
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps): bump the prod-patch-updates group with 6 updates (#1461)
Bumps the prod-patch-updates group with 6 updates:
| Package | From | To |
| --- | --- | --- |
| [@tanstack/react-virtual](https://github.com/TanStack/virtual/tree/HEAD/packages/react-virtual) | `3.14.10` | `3.14.13` |
| [compression](https://github.com/expressjs/compression) | `1.8.1` | `1.8.2` |
| [jose](https://github.com/panva/jose) | `6.2.9` | `6.2.12` |
| [jszip](https://github.com/Stuk/jszip) | `3.10.1` | `3.10.2` |
| [socks](https://github.com/JoshGlazebrook/socks) | `2.8.9` | `2.8.10` |
| [undici](https://github.com/nodejs/undici) | `8.10.0` | `8.10.2` |
Updates `@tanstack/react-virtual` from 3.14.10 to 3.14.13
- [Release notes](https://github.com/TanStack/virtual/releases)
- [Changelog](https://github.com/TanStack/virtual/blob/main/packages/react-virtual/CHANGELOG.md)
- [Commits](https://github.com/TanStack/virtual/commits/@tanstack/react-virtual@3.14.13/packages/react-virtual)
Updates `compression` from 1.8.1 to 1.8.2
- [Release notes](https://github.com/expressjs/compression/releases)
- [Changelog](https://github.com/expressjs/compression/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/compression/compare/v1.8.1...v1.8.2)
Updates `jose` from 6.2.9 to 6.2.12
- [Release notes](https://github.com/panva/jose/releases)
- [Changelog](https://github.com/panva/jose/blob/main/CHANGELOG.md)
- [Commits](https://github.com/panva/jose/compare/v6.2.9...v6.2.12)
Updates `jszip` from 3.10.1 to 3.10.2
- [Changelog](https://github.com/Stuk/jszip/blob/main/CHANGES.md)
- [Commits](https://github.com/Stuk/jszip/compare/v3.10.1...v3.10.2)
Updates `socks` from 2.8.9 to 2.8.10
- [Release notes](https://github.com/JoshGlazebrook/socks/releases)
- [Commits](https://github.com/JoshGlazebrook/socks/compare/2.8.9...2.8.10)
Updates `undici` from 8.10.0 to 8.10.2
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v8.10.0...v8.10.2)
---
updated-dependencies:
- dependency-name: "@tanstack/react-virtual"
dependency-version: 3.14.13
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: prod-patch-updates
- dependency-name: compression
dependency-version: 1.8.2
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: prod-patch-updates
- dependency-name: jose
dependency-version: 6.2.12
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: prod-patch-updates
- dependency-name: jszip
dependency-version: 3.10.2
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: prod-patch-updates
- dependency-name: socks
dependency-version: 2.8.10
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: prod-patch-updates
- dependency-name: undici
dependency-version: 8.10.2
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: prod-patch-updates
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat: add plugin worker protocol, bootstrap and plugin_storage table
Worker-side ctx proxy plus the message envelope it talks over, and the
per-plugin key/value table behind ctx.storage with migrations for all
three dialects. Rows cascade with the plugin so uninstalling leaves
nothing behind.
* feat: add allowlisted host view for plugins
An allowlist rather than a list of fields to strip. A blocklist rots:
the moment a new secret-bearing column lands on SSHHost it starts
leaking silently. With an allowlist a new field stays invisible to
plugins until someone adds it here on purpose.
* feat: add plugin loader with manifest validation and crash restart
Validates an unpacked plugin, spawns a worker_threads worker and manages
activate/deactivate/crash-restart with backoff, disabling after three
tries.
The crash counter clears only after a plugin stays up past a stability
window, not on activation. Clearing it on activation let a plugin that
activates cleanly and then dies restart forever, because every attempt
looked like the first.
loader.ts documents what the worker boundary does and does not buy you.
Node's permission model is process-wide, not per-worker, so it cannot be
enabled for plugin workers alone and is not claimed here.
* feat: route internal events through a shared plugin event bus
Formalises three ad-hoc publish paths that already existed:
automation-events.ts, metrics/automation-bridge.ts and the
hostSessionStatus singleton, now the host.session.status topic.
Both invariants the old code relied on are preserved. Publishing stays
fire-and-forget, so a failing subscriber cannot disturb a metrics poll or
a host delete. The automations engine subscribes to the bus at scheduler
start instead of being imported ad hoc, which keeps the edge
one-directional: automations may import repositories, hosts modules must
not import automations.
* feat: add plugin ctx broker with permission gate and audit
Every ctx call a plugin makes is checked against its granted
capabilities, performed by the main thread, then audited. A capability
must be both declared in the manifest and granted in the database, so
widening a plugin's reach always needs a new manifest the user can see,
never just a database row.
Audit attribution is set by the broker, not the plugin. The plugin
supplies only the details, so it cannot forge the actor.
fix: stop plugin workers seeing plaintext credentials in error messages
A failing ctx.ssh.connect handed the worker the raw error from deep in
the SSH stack, which embeds the connect config. The worker received, in
full:
Authentication failed for root using password <SECRET>
where <SECRET> was the host's real plaintext password. Any plugin with
ssh.exec could read it by catching the error, defeating the whole point
of the handle-based ssh API.
Errors crossing the boundary are now sanitised. Only PluginFacingError
and PluginPermissionError, both authored here, reach a plugin verbatim;
anything else becomes a generic message and the real one goes to the
log. This uses a marker class rather than matching on message text,
because matching would start leaking again the moment an upstream error
happened to contain a familiar phrase.
Covered by credential-isolation.test.ts, which plants a sentinel in
every secret-bearing field and asserts it appears in no message the
worker ever receives.
* feat: dispatch plugin HTTP routes and wire the runtime into startup
ctx.http.route now registers a real router on the /plugin-api/:pluginId
dispatcher, replacing its stub 404. A plugin never touches the Express
req/res: it gets a plain summary and returns a plain object, so sockets
and session cookies stay on this side of the boundary. Authorization and
cookie headers are not forwarded.
Plugins load last in the start-up sequence, after the server is fully
wired, and are terminated before the database on shutdown so none can
outlive it. A plugin that fails to load cannot stop the backend.
fix: correct the nginx plugin-api location regex
The pattern was ^/plugin-api/(/.*)?$, which needs a double slash and so
never matched /plugin-api/<id>/<route>. Every other block in the file
uses ^/prefix(/.*)?$. Left alone, plugin routes would work in dev and
404 only behind Docker.
* fix: update stale SFTP transfer test for single file destination paths
The test still asserted transferToHost was called with the destination
directory "/srv". Commit 7727fa09 (#1304) deliberately changed a single
file transfer to send the full destination path including the filename,
so the correct expectation is "/srv/remote-1.txt". The code was right
and the test was left behind.
* feat: ship the ssh terminal as a first-party in-process plugin
Adds a hardcoded process:transport-owner tier so the terminal can own its
WebSocket server and ssh2 clients, which cannot cross the worker boundary.
* feat: ship docker as a first-party in-process plugin
Moves docker backend and frontend into plugins/docker/, alongside
ssh-terminal. Adds a host editor tab seam, a dashboard card registry,
and a build step to compile plugin backends into dist.
* feat: ship host metrics as a first-party in-process plugin
* fix: harden plugin auth and add per-request identity for ctx calls
Require auth on /plugin-api, gate plugin enable/grant/revoke routes
behind admin.plugins.manage, and thread the calling user through
worker ctx.hosts/ctx.ssh calls instead of always using the install
owner. Also adds the plugin permissions grant/revoke UI.
* feat: ship the AI assistant as a first-party in-process plugin
Moves src/backend/ai and its routes into plugins/ai, mounted through a
small /ai dispatcher instead of its own port. Moves the ai-enabled and
ai-private-endpoints settings routes out of user-settings-routes.ts
into the plugin too, so it has no leftover core dependents.
* fix: remove compiled plugin JS left behind in plugins/ after build
copy-bundled-plugins.cjs compiled and rewrote plugin backend TS in
place, copied it to dist/plugins, but never deleted the .js it had
just emitted next to the .ts sources. Those files shadowed the real
source for vitest/tsx and had import paths rewritten for the dist
layout, so tests failed with "Cannot find module" once a local build
had run. Affects docker, host-metrics and ai, not just this one.
* feat: add a permission-gated backend service registry for plugins
* feat: add a permission-gated UI action registry and action slots for plugins
Moves the terminal toolbar's hardwired AI button into a slot the ssh-terminal
plugin offers and the ai plugin fills, gated on ai.services.use.
* feat: add cross-plugin secret references gated by the provider's RBAC permission
* feat: move proxmox discovery/import/sync into a first-party plugin
* feat: move remote desktop (RDP/VNC/Telnet) into a first-party plugin
Relocates guacamole backend/frontend source and tests into
plugins/remote-desktop, following the ssh-terminal/docker pattern.
* feat: wire remote-desktop plugin into core and rename i18n keys
Repoints core consumers (dispatcher, collab, session-sharing, tab
utils) at the plugin, adds isTabTypeAvailable gating for rdp/vnc/
telnet, widens hostCapability to accept an array, and renames the
guacamole i18n namespace to remoteDesktop.
* feat: move fleets into a first-party plugin
* feat: move automations into a first-party plugin
* feat: remove legacy alert rules, superseded by automations
Alert rules already auto-migrate into automations on boot and the old
engine stands down after. Deletes the rule/firing tables, routes, UI,
and AI tools; keeps notification channels since automations still use
them. Also fixes automations' notify step, which still called the
deleted repository.
* feat: move network topology into a first-party plugin
* feat: move tailscale device discovery and settings into a plugin
Adds plugins/tailscale/ with a devices sidebar tab, admin settings
section, and re-auth dialog. Host Metrics tailscale manager card and
SSH re-auth banner parsing stay in core.
* feat: move workspaces into a first-party plugin
* feat: move web endpoint into a first-party plugin
* feat: collapse plugin runtime to one tier behind a plugin SDK
* feat: make each plugin an npm workspace built by a termix-plugin CLI
* feat: give plugins their own tables, migrations and sync entities
* feat: serve plugin http and websockets from one mount instead of ports
* feat: namespace plugin permissions and keep them valid when a plugin is off
* feat: give plugins their own settings and one settings screen
* feat: load plugin frontends at runtime and remove plugin ids from the shell
* fix: mock the ai status fetch in its activate test
* feat: add auth extension points and one ssh connect pipeline
* feat: rebuild workspaces as the reference plugin
* fix: gate second factors after SSO/LDAP behind an admin setting
* feat: convert network-topology to a full plugin (B1)
* feat: move snippets backend and tables into a plugin (B2)
* feat: point core frontend snippets pickers at the plugin (B2)
* feat: add the snippets plugin (B2)
* feat: wire ai, automations, fleets and ssh-terminal to snippets (B2)
* feat: finish the tailscale plugin, including SSH auth (B3)
* feat: finish the fleets plugin, add ctx.hosts and host-commands SDK (B4)
* chore: update proxmox and host-metrics locale files for B5
* chore: regenerate drizzle migration journals for B5
* feat: add ctx.hosts create/update to the SDK, host-metrics drops proxmox
* feat: move proxmox node stats and collectors into the proxmox plugin
* feat: drop proxmox host columns, use plugin settings instead
* feat: finish the fleets plugin, add ctx.hosts and host-commands SDK (B4)
* feat: convert file manager into a plugin
* feat: convert ssh tunnels into a plugin
* feat: finish the web-endpoint plugin, add ctx.desktop (B8)
* feat: move the terminal fully into the ssh-terminal plugin (B9)
* feat: convert tmux monitoring into a plugin (B10)
* feat: convert serial console into the serial plugin
* feat: move session sharing and collab rooms into a plugin (B12)
* feat: turn session recording into a plugin (B13)
* feat: finish the remote-desktop plugin (B14)
* feat: finish the host-metrics plugin, move host status into core (B16)
* feat: finish the docker plugin (B15)
* feat: finish the automations plugin (B17)
* feat: finish the ai plugin (B18)
* feat: finish the homepage plugin, move service links and canvas out of core (B19)
* feat: convert wake-on-lan into a plugin (B20)
* feat: convert secret-sources into a plugin (B20)
* feat: move totp and passkeys into plugins (C1)
* feat: move sso and ldap logins into plugins (C2)
* feat: move opkssh and warpgate into plugins (C3)
* feat: move step-ca into a plugin (C4)
* feat: move vault ssh signing into a plugin (C5)
* feat: move termix identity into a plugin (C6)
* feat: move acme certificate automation into a plugin (C7)
* fix: finish 2.9.0 plugin moves and get every check green
* chore: lock the plugin boundary and remove 2.9.0 leftovers
* fix: harden the plugin runtime after the 2.9.0 security review
* feat: add plugin packing, signing, pinned trust and tmxplug bundling
* test: prove 2.8 to 2.9.0 upgrade is lossless and fix what it caught
* fix: give bundled plugin backends a real require for CJS deps
* feat: improve UI loading time and jitter
* feat: show credential sharing inline in the sidebar like host sharing
* feat: tailscale add host and copy ip, fix outbound fetch hang and plugin ESM warning
* feat: unify alerts into one plugin, channels, rules and inbox
* feat: rebuild desktop sync as linked server accounts, fix packaged plugin bundles and UI scaling
* fix: set blacksmith builder cache-key to stop broken gha cache fallback
* fix: link plugin-sdk workspace before npm ci in docker deps stage
* fix: link every plugin workspace before npm ci in docker deps stage
* fix(host-metrics): exclude image and firmware filesystems (#1469)
* fix(host-metrics): exclude image and firmware filesystems
* fix(ci): build plugin SDK before dependent checks
* fix(mysql): keep plugin settings scope indexes within limits
* test(mysql): refresh reviewed plugin upgrade SQL
* fix(hosts): normalize imported jump host references (#1470)
* fix(hosts): normalize imported jump host references
* fix(ci): build plugin SDK before dependent checks
* fix(mysql): keep plugin settings scope indexes within limits
* test(mysql): refresh reviewed plugin upgrade SQL
* fix(ci): build plugin SDK and repair MySQL settings migration (#1471)
* fix(ci): build plugin SDK before dependent checks
* fix(mysql): keep plugin settings scope indexes within limits
* test(mysql): refresh reviewed plugin upgrade SQL
* fix(file-manager): keep inline rename consistent (#1476)
* fix(ci): build plugin SDK before dependent checks
* fix(mysql): keep plugin settings scope indexes within limits
* test(mysql): refresh reviewed plugin upgrade SQL
* fix(file-manager): keep inline rename consistent
* fix(dashboard): reuse translated host status labels (#1475)
* fix(ci): build plugin SDK before dependent checks
* fix(mysql): keep plugin settings scope indexes within limits
* test(mysql): refresh reviewed plugin upgrade SQL
* fix(dashboard): reuse translated host status labels
* docs(api): clarify local and remote version fields (#1474)
* fix(ci): build plugin SDK before dependent checks
* fix(mysql): keep plugin settings scope indexes within limits
* test(mysql): refresh reviewed plugin upgrade SQL
* docs(api): clarify local and remote version fields
* fix(file-manager): preserve selected backgrounds on hover (#1473)
* fix(ci): build plugin SDK before dependent checks
* fix(mysql): keep plugin settings scope indexes within limits
* test(mysql): refresh reviewed plugin upgrade SQL
* fix(file-manager): preserve selection feedback on hover
* test(ui): await dialog focus cleanup before teardown
* fix(file-manager): restore Ctrl/Cmd+F file search (#1472)
* fix(ci): build plugin SDK before dependent checks
* fix(mysql): keep plugin settings scope indexes within limits
* test(mysql): refresh reviewed plugin upgrade SQL
* fix(file-manager): focus file search with Ctrl or Cmd F
* fix: keep rounded-full circular in production builds
* fix(file-manager): cancel uploads and stop remote writes (#1477)
* fix(file-manager): cancel uploads and stop remote writes
* test(css): exercise the configured PostCSS plugin chain
* fix(file-manager): apply compact density to directory tree (#1478)
* fix(file-manager): apply compact density to directory tree
* test(css): exercise the configured PostCSS plugin chain
* fix(file-manager): preserve font sizes in compact mode (#1480)
* fix(file-manager): preserve font sizes in compact mode
* test(css): exercise the configured PostCSS plugin chain
* fix(file-manager): prioritize file names in narrow lists (#1483)
* fix(file-manager): prioritize file names in narrow lists
* test(css): exercise the configured PostCSS plugin chain
* test(identity): preserve full Ed25519 public keys in fixtures
* test(remote-desktop): always mutate ciphertext in tamper test
* fix(remote-desktop): probe the saved host guacd endpoint (#1481)
* fix(remote-desktop): probe the saved host guacd endpoint
* test(css): exercise the configured PostCSS plugin chain
* test(identity): preserve full Ed25519 public keys in fixtures
* fix(homepage): check allowlisted private service reachability (#1479)
* fix(homepage): check allowlisted private service reachability
* test(css): exercise the configured PostCSS plugin chain
* fix(remote-desktop): stop unsolicited clipboard read prompts (#1482)
* fix(remote-desktop): read clipboard only on explicit paste
* test(css): exercise the configured PostCSS plugin chain
* test(identity): preserve full Ed25519 public keys in fixtures
* test(remote-desktop): always mutate ciphertext in tamper test
* chore: simplify plugin readmes, changelogs and manifest descriptions
* fix: keep plugins loaded after signing in from the login screen
* fix(file-manager): accept OS file drops over existing rows (#1484)
* fix(file-manager): accept OS file drops over existing rows
* test(file-manager): target the file label in drop tests
* test(css): exercise the configured PostCSS plugin chain
* test(identity): preserve full Ed25519 public keys in fixtures
* test(remote-desktop): always mutate ciphertext in tamper test
* fix(file-manager): pipeline SFTP download reads (#1485)
* feat: add plugin sdk build to beta release
* fix: make link-store secret check immune to random base64 matches
* fix(ldap): preserve the directory-provided bind DN (#1486)
* fix: compute beta changes across dev branches and move the beta tag
* chore: untrack plugin sdk ARCHITECTURE.md
* chore: remove references to plugin sdk ARCHITECTURE.md
* feat: merge host editor terminal tabs into one owned by ssh-terminal
* feat: add descriptions to plugin host enable toggles
* fix(file-manager): show download progress in file viewers (#1487)
* fix(electron): signal backend readiness over IPC (#1488)
* fix(split-screen): allow layout creation without randomUUID (#1490)
* fix(split-screen): allow layout creation without randomUUID
* test(credentials): avoid flaky Ed25519 key generation
* fix(sidebar): remeasure visible rows after density changes (#1489)
* fix(sidebar): remeasure visible rows after density changes
* test(credentials): avoid flaky Ed25519 key generation
* feat(split-screen): redesign split screen with free-form panes and pane picker
* feat(sidebar): add host click behavior setting, default to always opening a new tab
* feat(snippets): redesign panel to match the host list
* fix(session-recording): stop session logs panel from refetching in a loop
* feat(snippets): bring back sharing, target hosts and drag reorder
* feat(ssh-terminal): add toolbar position, start state, display and fade host settings
* feat(ssh-terminal): add host setting to turn off password prompt auto-fill
* fix(ai): stop streams getting cut off and keep tool steps across messages
* feat: improve quick connect system using plugin api
* fix: proxmox guest sync, startup snippet sync, drop dead cloudflare ssh transport
* feat: move terminal settings, look and ssh tools into ssh-terminal plugin
* feat: move snippets, keybinding actions and macros out of core into plugins
* feat: store rdp, vnc and telnet logins in a generic per-protocol table
* feat: type the plugin host record, move plugin strings out of core and add lint checks
* feat: replace core homepage widget registry with generic extension points
* feat: plugins only see their own host settings in the browser
* feat: harden plugin api for separate repos, signed updates and generic external login
* fix: keep plugin css below core utilities and version plugin assets by their css
* fix: load and save plugin host settings in the editor and tighten settings row spacing
* feat: redesign user host defaults system
* fix(remote-desktop): release held keys on focus loss (#1498)
* fix(session-sharing): replace local presentation after takeover (#1500)
* fix(file-manager): refresh disk usage with directory listing (#1503)
* fix(ssh-terminal): preserve input order during local echo reconciliation (#1505)
* feat(remote-desktop): expose display zoom controls for RDP (#1514)
* fix(file-manager): restore text selection and copying in Markdown previews (#1518)
* fix(sidebar): keep compact host addresses visible (#1524)
* fix(hosts): preserve plugin settings when reopening the editor (#1499)
* fix(ssh-terminal): close owner sockets when presentations unmount (#1501)
* fix(session-sharing): synchronize shared SSH terminal dimensions (#1502)
* fix(session-sharing): show participant presence in member terminals (#1504)
* fix(ai): sync provider configuration and keys across linked devices (#1506)
* feat(ssh-terminal): add a duplicate tab action (#1510)
* feat(file-manager): allow disabling move-to-trash confirmation (#1511)
* feat(file-manager): default to the remote login directory (#1512)
* feat(homepage): synchronize canvas layouts across devices (#1515)
* fix(shortcuts): prevent accidental double-Shift palette activation (#1519)
* feat(tmux-monitor): add a unified multi-host view (#1520)
* fix(electron): allow explicit quit with active connections (#1522)
* feat: reconnect all disconnected terminal tabs (#1523)
* fix(hosts): preserve recording and sharing settings in the dev editor (#1509)
* fix(database): preserve RDP domain during startup backfill (#1497)
* feat(sidebar): add keyboard type-ahead search for hosts (#1516)
* feat(automations): add per-host maintenance mode and recurring schedules (#1521)
* feat(tmux): add a per-host mouse toggle and preserve remote configuration (#1513)
* fix(session-sharing): use the linked server for desktop meetings and links (#1507)
* fix(tunnels): support TOTP for client tunnels and jump hosts (#1508)
* fix: type errors and lint failures from merged plugin prs
* feat(installer): make the Windows desktop shortcut optional (#1517)
* fix: ship the plugin sdk and serialport in desktop builds
* fix: prefer ipv4 when resolving ssh host names (#1365)
* fix: readable terminal selection with the light theme (#1319)
* fix: build desktop session share links on the linked server (#1350)
* fix: show meeting guests to members and hide the roster from guests (#1353)
* fix: reliable file manager saves with sudo prompt and no base64 guessing (#1335)
* fix: show disk usage for the mount being browsed (#1347)
* fix: load the linux tray icon reliably and log tray failures (#1332)
* fix: cover the gnome close path in the desktop quit test (#1332)
* fix: prompt for jump host TOTP in terminal, file manager and metrics (#1312)
* feat: optional auto reconnect for dropped ssh sessions (#1321)
* feat: tighter compact host rows with inline tags (#1325)
* feat: bring back the alert feed homepage widget
* feat: pick target terminals for snippets again
* feat: share button on connection tabs again
* feat: recent servers list when linking the desktop app
* feat: list the fixed app shortcuts in keyboard shortcuts
* fix: translate hardcoded toasts and drop em dashes from ui text
* fix: translate leftover hardcoded ui text
* fix: toolbar files button opens at the shell directory again
* fix: show the remote desktop note under connection origin again
* chore: openapi docs for host metrics manager routes
* chore: openapi docs for undocumented routes and fix two broken doc blocks
* fix: declare terminal.listSessions use for snippet targets
* revert: drop the alert feed widget, the notification center replaces it
* feat: restore the alert feed homepage widget
* fix: quick connect fills the host address from plugin auth editors like tailscale
* fix: docker container logs use the base background color
* chore: fix dependabot alerts and apply safe npm upgrades
* fix: proxmox stats tab reads its switch from plugin host settings
* fix: count plugin ssh logins toward host status and stop showing reachable as a warning
* fix: hide the built-in source pill in the host editor
* fix: host status shows online when the port answers and only warns on a failed login
* fix: drop the top border on the split layout menu
* fix: host defaults tabs sit where the host editor puts them and skip plugins with nothing to default
* fix: remote desktop auth method labels and notes for vnc and telnet
* fix: add description to the web endpoint enable switch
* fix: crowdin sync and pretranslate for plugin locales, run plugin tests on release
* feat: move telemetry out of core into a usage statistics plugin
* fix: recent activity card no longer cuts off host names early
* fix: remove duplicate top border on split screen menu
* fix: redesign session log player controls, fix tooltip overlap and drop dot separators
* fix: file manager and sftp text showing raw i18n keys
* fix: onboarding rerunning for existing users after upgrading
* fix: fleet detail buttons overflowing the sidebar
* fix: session log player scrolling off screen horizontally
* fix: network graph lag when adding hosts and on every render
* fix: maintenance index name, shared host read only view and badge polling
* fix: meeting tabs, workspace tab merging, rail panels as tabs and general ui lag
* chore: update release notes
* fix: remote desktop tabs reconnecting on every tab switch
* fix: build plugin sdk before linting in release workflow
* chore: lint, format, and bump version to 2.9.0
* chore: skip crowdin pre-translate in release for now
* chore: sync Crowdin translations for 2.9.0
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Koi <38512047+datlt4@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ZacharyZcR <zacharyzcr1984@gmail.com>
This commit is contained in:
4405 files changed
+1341026
-289722
No files matched your search
@@ -0,0 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
## 1.0.0
|
||||
|
||||
First release, bundled with Termix 2.9.0.
|
||||
|
||||
Records SSH terminal sessions so you can play them back, copy their text or download them. Old recordings are removed after a set number of days.
|
||||
@@ -0,0 +1,39 @@
|
||||
# Session Recording
|
||||
|
||||
Record terminal sessions and play them back or download them later.
|
||||
|
||||
## Features
|
||||
|
||||
- Records SSH terminal sessions as they happen.
|
||||
- Play a recording back, skip through it and copy its text.
|
||||
- Download a recording as a file or as plain text.
|
||||
- Removes recordings older than a set number of days.
|
||||
- Keeps recordings when a user is deleted, with the user's name removed.
|
||||
|
||||
## Settings
|
||||
|
||||
### Admin
|
||||
|
||||
- Retention (days): remove recordings older than this. Checked at startup and once a day.
|
||||
|
||||
### Host
|
||||
|
||||
- Enable session recording: record sessions on this host.
|
||||
|
||||
## Permissions
|
||||
|
||||
- `session-recording.view`: View and download session recordings. Admins and users have it by default.
|
||||
|
||||
## Services
|
||||
|
||||
Provides to other plugins:
|
||||
|
||||
- `recordings.writer`: start a recording and add to it as a session runs, or save a recording that is already finished.
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
npm run build # build into dist/
|
||||
npm run test # run this plugin's tests
|
||||
npm run typecheck # type-check this plugin
|
||||
```
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Session Logs"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Session Recording",
|
||||
"enableSessionRecordingDesc": "Record terminal session output for later review"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Session Logs",
|
||||
"noLogs": "No session logs yet",
|
||||
"noLogsDesc": "Enable session logging on a host to start recording",
|
||||
"duration": "Duration",
|
||||
"viewLog": "View log",
|
||||
"downloadLog": "Download",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Delete",
|
||||
"confirmDelete": "Delete this session log?",
|
||||
"confirmDeleteDesc": "This action cannot be undone.",
|
||||
"copyContent": "Copy",
|
||||
"copied": "Copied!",
|
||||
"loadError": "Failed to load session logs",
|
||||
"deleteError": "Failed to delete session log",
|
||||
"filterByHost": "Filter by host...",
|
||||
"back": "Back",
|
||||
"empty": "(empty)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Sessielogboeke"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Sessie-opname",
|
||||
"enableSessionRecordingDesc": "Neem terminaalsessie-uitvoer op vir latere hersiening"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Bekyk sessie-opnames",
|
||||
"description": "Sien en speel jou eie sessie-opnames terug."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Behoud (dae)",
|
||||
"description": "Hoe lank 'n sessie-opname gehou word voordat dit outomaties uitgevee word."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Aktiveer sessie-opname",
|
||||
"description": "Neem terminaaluitvoer vir hierdie gasheer op sodat jy dit later kan terugspeel of aflaai."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Opname"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Sessielogboeke",
|
||||
"noLogs": "Geen sessielogboeke nog nie",
|
||||
"noLogsDesc": "Aktiveer sessie-aanmelding op 'n gasheer om opname te begin",
|
||||
"duration": "Duur",
|
||||
"viewLog": "Bekyk logboek",
|
||||
"downloadLog": "Laai af",
|
||||
"downloadAsText": "Laai af as teks",
|
||||
"deleteLog": "Vee uit",
|
||||
"confirmDelete": "Vee hierdie sessielog uit?",
|
||||
"confirmDeleteDesc": "Hierdie aksie kan nie ongedaan gemaak word nie.",
|
||||
"copyContent": "Kopieer",
|
||||
"copied": "Gekopieer!",
|
||||
"loadError": "Kon nie sessielogboeke laai nie",
|
||||
"deleteError": "Kon nie sessielogboek uitvee nie",
|
||||
"filterByHost": "Filtreer volgens gasheer...",
|
||||
"back": "Terug",
|
||||
"empty": "(leeg)",
|
||||
"noResults": "Geen resultate vir \"{{query}}\"",
|
||||
"hostFallback": "Gasheer {{id}}",
|
||||
"sessionFallback": "Sessie {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Opnametydlyn",
|
||||
"speed": "Terugspeelspoed",
|
||||
"play": "Speel opname",
|
||||
"pause": "Onderbreek opname"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "سجلات الجلسات"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "تسجيل الجلسة",
|
||||
"enableSessionRecordingDesc": "تسجيل مخرجات الجلسة الطرفية للمراجعة لاحقاً"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "عرض تسجيلات الجلسات",
|
||||
"description": "شاهد واستمع إلى تسجيلات جلساتك الخاصة."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "مدة الاحتفاظ (بالأيام)",
|
||||
"description": "ما هي المدة التي يتم فيها الاحتفاظ بتسجيل الجلسة قبل حذفه تلقائيًا؟"
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "تفعيل تسجيل الجلسة",
|
||||
"description": "سجل مخرجات الطرفية لهذا المضيف حتى تتمكن من تشغيلها أو تنزيلها لاحقًا."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "تسجيل"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "سجلات الجلسات",
|
||||
"noLogs": "لا توجد سجلات جلسات بعد",
|
||||
"noLogsDesc": "فعّل تسجيل الجلسات على مضيف لبدء التسجيل",
|
||||
"duration": "المدة",
|
||||
"viewLog": "عرض السجل",
|
||||
"downloadLog": "تنزيل",
|
||||
"downloadAsText": "تنزيل كنص",
|
||||
"deleteLog": "حذف",
|
||||
"confirmDelete": "حذف سجل الجلسة هذا؟",
|
||||
"confirmDeleteDesc": "لا يمكن التراجع عن هذا الإجراء.",
|
||||
"copyContent": "نسخ",
|
||||
"copied": "تم النسخ!",
|
||||
"loadError": "فشل في تحميل سجلات الجلسات",
|
||||
"deleteError": "فشل في حذف سجل الجلسة",
|
||||
"filterByHost": "تصفية حسب المضيف...",
|
||||
"back": "رجوع",
|
||||
"empty": "(فارغ)",
|
||||
"noResults": "لا توجد نتائج للبحث عن \"{{query}}\"",
|
||||
"hostFallback": "المضيف {{id}}",
|
||||
"sessionFallback": "الجلسة {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "الجدول الزمني للتسجيل",
|
||||
"speed": "سرعة التشغيل",
|
||||
"play": "تشغيل التسجيل",
|
||||
"pause": "إيقاف التسجيل مؤقتًا"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Дневници на сесии"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Запис на сесия",
|
||||
"enableSessionRecordingDesc": "Записване на изхода от терминалната сесия за по-късен преглед"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Преглед на записите от сесиите",
|
||||
"description": "Вижте и възпроизведете собствените си записи от сесиите."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Задържане (дни)",
|
||||
"description": "Колко дълго се съхранява записът на сесия, преди да бъде изтрит автоматично."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Активиране на запис на сесия",
|
||||
"description": "Запишете изхода от терминала за този хост, за да можете да го възпроизведете или изтеглите по-късно."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Запис"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Дневници на сесии",
|
||||
"noLogs": "Все още няма логове на сесии",
|
||||
"noLogsDesc": "Активирайте регистрирането на сесията на хост, за да започнете записа",
|
||||
"duration": "Продължителност",
|
||||
"viewLog": "Преглед на дневника",
|
||||
"downloadLog": "Изтегляне",
|
||||
"downloadAsText": "Изтегляне като текст",
|
||||
"deleteLog": "Изтриване",
|
||||
"confirmDelete": "Да се изтрие ли този дневник на сесията?",
|
||||
"confirmDeleteDesc": "Това действие не може да бъде отменено.",
|
||||
"copyContent": "Копиране",
|
||||
"copied": "Копирано!",
|
||||
"loadError": "Зареждането на лог файловете на сесията не бе успешно",
|
||||
"deleteError": "Неуспешно изтриване на дневника на сесията",
|
||||
"filterByHost": "Филтриране по хост...",
|
||||
"back": "Обратно",
|
||||
"empty": "(празно)",
|
||||
"noResults": "Няма резултати за „{{query}}“",
|
||||
"hostFallback": "Домакин {{id}}",
|
||||
"sessionFallback": "Сесия {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Хронология на записа",
|
||||
"speed": "Скорост на възпроизвеждане",
|
||||
"play": "Пускане на запис",
|
||||
"pause": "Пауза на записа"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Session Logs"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Session Recording",
|
||||
"enableSessionRecordingDesc": "Record terminal session output for later review"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Session Logs",
|
||||
"noLogs": "No session logs yet",
|
||||
"noLogsDesc": "Enable session logging on a host to start recording",
|
||||
"duration": "Duration",
|
||||
"viewLog": "View log",
|
||||
"downloadLog": "Download",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Delete",
|
||||
"confirmDelete": "Delete this session log?",
|
||||
"confirmDeleteDesc": "This action cannot be undone.",
|
||||
"copyContent": "Copy",
|
||||
"copied": "Copied!",
|
||||
"loadError": "Failed to load session logs",
|
||||
"deleteError": "Failed to delete session log",
|
||||
"filterByHost": "Filter by host...",
|
||||
"back": "Back",
|
||||
"empty": "(empty)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Registres de sessió"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Gravació de sessions",
|
||||
"enableSessionRecordingDesc": "Enregistra la sortida de la sessió de terminal per a una revisió posterior"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Veure enregistraments de sessions",
|
||||
"description": "Veure i reproduir els enregistraments de les teves pròpies sessions."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retenció (dies)",
|
||||
"description": "Quant de temps es conserva una gravació de sessió abans que s'elimini automàticament."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Activa l'enregistrament de la sessió",
|
||||
"description": "Enregistra la sortida del terminal per a aquest host per poder reproduir-la o descarregar-la més tard."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Enregistrament"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Registres de sessió",
|
||||
"noLogs": "Encara no hi ha registres de sessió",
|
||||
"noLogsDesc": "Habilita el registre de sessions en un amfitrió per iniciar l'enregistrament",
|
||||
"duration": "Durada",
|
||||
"viewLog": "Veure registre",
|
||||
"downloadLog": "Descarrega",
|
||||
"downloadAsText": "Descarrega com a text",
|
||||
"deleteLog": "Suprimeix",
|
||||
"confirmDelete": "Voleu suprimir aquest registre de sessió?",
|
||||
"confirmDeleteDesc": "Aquesta acció no es pot desfer.",
|
||||
"copyContent": "Còpia",
|
||||
"copied": "Copiat!",
|
||||
"loadError": "No s'han pogut carregar els registres de sessió",
|
||||
"deleteError": "No s'ha pogut suprimir el registre de sessió",
|
||||
"filterByHost": "Filtra per amfitrió...",
|
||||
"back": "Enrere",
|
||||
"empty": "(buit)",
|
||||
"noResults": "No hi ha resultats per a \"{{query}}\"",
|
||||
"hostFallback": "Amfitrió {{id}}",
|
||||
"sessionFallback": "Sessió {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Cronologia de gravació",
|
||||
"speed": "Velocitat de reproducció",
|
||||
"play": "Reprodueix la gravació",
|
||||
"pause": "Pausa l'enregistrament"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Protokoly relací"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Nahrávání relace",
|
||||
"enableSessionRecordingDesc": "Zaznamenejte výstup terminálové relace pro pozdější kontrolu"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Zobrazit záznamy relací",
|
||||
"description": "Prohlížejte a přehrávejte si vlastní nahrávky z relací."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retenční doba (dny)",
|
||||
"description": "Jak dlouho je záznam relace uchováván, než je automaticky smazán."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Povolit nahrávání relace",
|
||||
"description": "Nahrajte výstup terminálu pro tento hostitel, abyste si ho mohli později přehrát nebo stáhnout."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Záznam"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Protokoly relací",
|
||||
"noLogs": "Zatím žádné protokoly relací",
|
||||
"noLogsDesc": "Povolte protokolování relace na hostiteli pro zahájení nahrávání",
|
||||
"duration": "Trvání",
|
||||
"viewLog": "Zobrazit protokol",
|
||||
"downloadLog": "Stáhnout",
|
||||
"downloadAsText": "Stáhnout jako text",
|
||||
"deleteLog": "Vymazat",
|
||||
"confirmDelete": "Smazat tento protokol relace?",
|
||||
"confirmDeleteDesc": "Tuto akci nelze vrátit zpět.",
|
||||
"copyContent": "Kopie",
|
||||
"copied": "Zkopírováno!",
|
||||
"loadError": "Nepodařilo se načíst protokoly relací",
|
||||
"deleteError": "Nepodařilo se smazat protokol relace",
|
||||
"filterByHost": "Filtrovat podle hostitele...",
|
||||
"back": "Zadní",
|
||||
"empty": "(prázdný)",
|
||||
"noResults": "Žádné výsledky pro výraz „{{query}}“",
|
||||
"hostFallback": "Hostitel {{id}}",
|
||||
"sessionFallback": "Relace {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Časová osa nahrávání",
|
||||
"speed": "Rychlost přehrávání",
|
||||
"play": "Přehrát nahrávku",
|
||||
"pause": "Pozastavit nahrávání"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Sessionslogfiler"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Sessionsoptagelse",
|
||||
"enableSessionRecordingDesc": "Optag output fra terminalsessionen til senere gennemgang"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Se sessionsoptagelser",
|
||||
"description": "Se og afspil dine egne sessionsoptagelser."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Opbevaring (dage)",
|
||||
"description": "Hvor længe en sessionsoptagelse gemmes, før den slettes automatisk."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Aktivér sessionsoptagelse",
|
||||
"description": "Optag terminaloutput for denne vært, så du kan afspille det eller downloade det senere."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Indspilning"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Sessionslogfiler",
|
||||
"noLogs": "Ingen sessionslogfiler endnu",
|
||||
"noLogsDesc": "Aktivér sessionslogning på en vært for at starte optagelse",
|
||||
"duration": "Varighed",
|
||||
"viewLog": "Se log",
|
||||
"downloadLog": "Download",
|
||||
"downloadAsText": "Download som tekst",
|
||||
"deleteLog": "Slet",
|
||||
"confirmDelete": "Slet denne sessionslog?",
|
||||
"confirmDeleteDesc": "Denne handling kan ikke fortrydes.",
|
||||
"copyContent": "Kopi",
|
||||
"copied": "Kopieret!",
|
||||
"loadError": "Kunne ikke indlæse sessionslogfiler",
|
||||
"deleteError": "Kunne ikke slette sessionsloggen",
|
||||
"filterByHost": "Filtrer efter vært...",
|
||||
"back": "Tilbage",
|
||||
"empty": "(tom)",
|
||||
"noResults": "Ingen resultater for \"{{query}}\"",
|
||||
"hostFallback": "Vært {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Optagelsestidslinje",
|
||||
"speed": "Afspilningshastighed",
|
||||
"play": "Afspil optagelse",
|
||||
"pause": "Pause optagelse"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Sitzungsprotokolle"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Sitzungsaufzeichnung",
|
||||
"enableSessionRecordingDesc": "Terminal-Sitzungsausgabe zur späteren Überprüfung aufzeichnen"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Sitzungsaufzeichnungen ansehen",
|
||||
"description": "Sehen und spielen Sie Ihre eigenen Session-Aufnahmen ab."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Aufbewahrungsdauer (Tage)",
|
||||
"description": "Wie lange eine Sitzungsaufzeichnung aufbewahrt wird, bevor sie automatisch gelöscht wird."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Sitzungsaufzeichnung aktivieren",
|
||||
"description": "Zeichnen Sie die Terminalausgabe dieses Hosts auf, damit Sie sie später wiedergeben oder herunterladen können."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Aufnahme"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Sitzungsprotokolle",
|
||||
"noLogs": "Noch keine Sitzungsprotokolle",
|
||||
"noLogsDesc": "Aktivieren Sie die Sitzungsprotokollierung auf einem Host, um die Aufzeichnung zu starten",
|
||||
"duration": "Dauer",
|
||||
"viewLog": "Protokoll anzeigen",
|
||||
"downloadLog": "Herunterladen",
|
||||
"downloadAsText": "Als Text herunterladen",
|
||||
"deleteLog": "Löschen",
|
||||
"confirmDelete": "Dieses Sitzungsprotokoll löschen?",
|
||||
"confirmDeleteDesc": "Diese Aktion kann nicht rückgängig gemacht werden.",
|
||||
"copyContent": "Kopieren",
|
||||
"copied": "Kopiert!",
|
||||
"loadError": "Fehler beim Laden der Sitzungsprotokolle",
|
||||
"deleteError": "Fehler beim Löschen des Sitzungsprotokolls",
|
||||
"filterByHost": "Nach Host filtern...",
|
||||
"back": "Zurück",
|
||||
"empty": "(leer)",
|
||||
"noResults": "Keine Ergebnisse für \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Sitzung {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Aufnahmezeitplan",
|
||||
"speed": "Wiedergabegeschwindigkeit",
|
||||
"play": "Wiedergabe",
|
||||
"pause": "Aufnahme pausieren"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Αρχεία καταγραφής συνεδρίας"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Ηχογράφηση συνεδρίας",
|
||||
"enableSessionRecordingDesc": "Καταγραφή εξόδου συνεδρίας τερματικού για μελλοντική αναθεώρηση"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Δείτε τις ηχογραφήσεις της συνεδρίας",
|
||||
"description": "Δείτε και αναπαράγετε τις δικές σας ηχογραφήσεις συνεδρίας."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Διατήρηση (ημέρες)",
|
||||
"description": "Για πόσο χρονικό διάστημα διατηρείται μια εγγραφή συνεδρίας πριν διαγραφεί αυτόματα."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Ενεργοποίηση εγγραφής συνεδρίας",
|
||||
"description": "Εγγράψτε την έξοδο του τερματικού για αυτόν τον κεντρικό υπολογιστή, ώστε να μπορείτε να την αναπαράγετε ή να την κατεβάσετε αργότερα."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Εγγραφή"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Αρχεία καταγραφής συνεδρίας",
|
||||
"noLogs": "Δεν υπάρχουν ακόμη αρχεία καταγραφής συνεδρίας",
|
||||
"noLogsDesc": "Ενεργοποίηση καταγραφής περιόδου λειτουργίας σε έναν κεντρικό υπολογιστή για έναρξη εγγραφής",
|
||||
"duration": "Διάρκεια",
|
||||
"viewLog": "Προβολή αρχείου καταγραφής",
|
||||
"downloadLog": "Λήψη",
|
||||
"downloadAsText": "Λήψη ως κείμενο",
|
||||
"deleteLog": "Διαγράφω",
|
||||
"confirmDelete": "Διαγραφή αυτού του αρχείου καταγραφής περιόδου σύνδεσης;",
|
||||
"confirmDeleteDesc": "Αυτή η ενέργεια δεν μπορεί να αναιρεθεί.",
|
||||
"copyContent": "Αντίγραφο",
|
||||
"copied": "Αντιγράφηκε!",
|
||||
"loadError": "Αποτυχία φόρτωσης αρχείων καταγραφής περιόδου λειτουργίας",
|
||||
"deleteError": "Η διαγραφή του αρχείου καταγραφής περιόδου λειτουργίας απέτυχε",
|
||||
"filterByHost": "Φιλτράρισμα κατά κεντρικό υπολογιστή...",
|
||||
"back": "Πίσω",
|
||||
"empty": "(αδειάζω)",
|
||||
"noResults": "Δεν υπάρχουν αποτελέσματα για \"{{query}}\"",
|
||||
"hostFallback": "Κεντρικός υπολογιστής {{id}}",
|
||||
"sessionFallback": "Συνεδρία {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Χρονολόγιο καταγραφής",
|
||||
"speed": "Ταχύτητα αναπαραγωγής",
|
||||
"play": "Αναπαραγωγή ηχογράφησης",
|
||||
"pause": "Παύση εγγραφής"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Registros de sesión"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Grabación de sesión",
|
||||
"enableSessionRecordingDesc": "Registrar la salida de la sesión de terminal para su revisión posterior"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Ver las grabaciones de las sesiones",
|
||||
"description": "Visualiza y reproduce las grabaciones de tus propias sesiones."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retención (días)",
|
||||
"description": "Cuánto tiempo se conserva la grabación de una sesión antes de que se elimine automáticamente."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Habilitar la grabación de la sesión",
|
||||
"description": "Graba la salida de la terminal de este host para que puedas reproducirla o descargarla más tarde."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Grabación"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Registros de sesión",
|
||||
"noLogs": "Aún no hay registros de sesión",
|
||||
"noLogsDesc": "Activa el registro de sesiones en un host para empezar a grabar",
|
||||
"duration": "Duración",
|
||||
"viewLog": "Ver registro",
|
||||
"downloadLog": "Descargar",
|
||||
"downloadAsText": "Descargar como texto",
|
||||
"deleteLog": "Eliminar",
|
||||
"confirmDelete": "¿Eliminar este registro de sesión?",
|
||||
"confirmDeleteDesc": "Esta acción no se puede deshacer.",
|
||||
"copyContent": "Copiar",
|
||||
"copied": "¡Copiado!",
|
||||
"loadError": "Error al cargar los registros de sesión",
|
||||
"deleteError": "Error al eliminar el registro de sesión",
|
||||
"filterByHost": "Filtrar por host...",
|
||||
"back": "Volver",
|
||||
"empty": "(vacío)",
|
||||
"noResults": "No se encontraron resultados para \"{{query}}\"",
|
||||
"hostFallback": "Anfitrión {{id}}",
|
||||
"sessionFallback": "Sesión {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Cronología de la grabación",
|
||||
"speed": "Velocidad de reproducción",
|
||||
"play": "Reproducir grabación",
|
||||
"pause": "Pausar la grabación"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Istuntolokit"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Istunnon tallennus",
|
||||
"enableSessionRecordingDesc": "Tallenna pääteistunnon tuloste myöhempää tarkastelua varten"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Näytä istuntotallenteet",
|
||||
"description": "Katsele ja toista omia istuntotallenteitasi."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Säilytys (päivää)",
|
||||
"description": "Kuinka kauan istuntotallennetta säilytetään ennen kuin se poistetaan automaattisesti."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Ota istunnon tallennus käyttöön",
|
||||
"description": "Tallenna tämän isännän päätelaitteen lähtö, jotta voit toistaa sen tai ladata sen myöhemmin."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Äänitys"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Istuntolokit",
|
||||
"noLogs": "Ei vielä istuntolokeja",
|
||||
"noLogsDesc": "Ota istunnon lokikirjaus käyttöön isännässä aloittaaksesi tallennuksen",
|
||||
"duration": "Kesto",
|
||||
"viewLog": "Näytä loki",
|
||||
"downloadLog": "Lataa",
|
||||
"downloadAsText": "Lataa tekstinä",
|
||||
"deleteLog": "Poistaa",
|
||||
"confirmDelete": "Poistetaanko tämä istuntoloki?",
|
||||
"confirmDeleteDesc": "Tätä toimintoa ei voi perua.",
|
||||
"copyContent": "Kopioida",
|
||||
"copied": "Kopioitu!",
|
||||
"loadError": "Istuntolokien lataaminen epäonnistui",
|
||||
"deleteError": "Istuntolokitietojen poistaminen epäonnistui",
|
||||
"filterByHost": "Suodata isännän mukaan...",
|
||||
"back": "Takaisin",
|
||||
"empty": "(tyhjä)",
|
||||
"noResults": "Ei tuloksia haulle \"{{query}}\"",
|
||||
"hostFallback": "Isäntä {{id}}",
|
||||
"sessionFallback": "Istunto {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Tallennusaikajana",
|
||||
"speed": "Toistonopeus",
|
||||
"play": "Toista tallenne",
|
||||
"pause": "Keskeytä tallennus"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Journaux de session"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Enregistrement de session",
|
||||
"enableSessionRecordingDesc": "Enregistrer la sortie de la session terminal pour une consultation ultérieure"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Consulter les enregistrements des sessions",
|
||||
"description": "Consultez et relisez vos propres enregistrements de session."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Rétention (jours)",
|
||||
"description": "Durée de conservation d'un enregistrement de session avant sa suppression automatique."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Activer l'enregistrement de session",
|
||||
"description": "Enregistrez la sortie du terminal pour cet hôte afin de pouvoir la relire ou la télécharger ultérieurement."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Enregistrement"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Journaux de session",
|
||||
"noLogs": "Aucun journal de session pour l’instant",
|
||||
"noLogsDesc": "Activez la journalisation des sessions sur un hôte pour démarrer l’enregistrement",
|
||||
"duration": "Durée",
|
||||
"viewLog": "Afficher le journal",
|
||||
"downloadLog": "Télécharger",
|
||||
"downloadAsText": "Télécharger au format texte",
|
||||
"deleteLog": "Supprimer",
|
||||
"confirmDelete": "Supprimer ce journal de session ?",
|
||||
"confirmDeleteDesc": "Cette action est irréversible.",
|
||||
"copyContent": "Copier",
|
||||
"copied": "Copié !",
|
||||
"loadError": "Échec du chargement des journaux de session",
|
||||
"deleteError": "Échec de la suppression du journal de session",
|
||||
"filterByHost": "Filtrer par hôte...",
|
||||
"back": "Retour",
|
||||
"empty": "(vide)",
|
||||
"noResults": "Aucun résultat pour «{{query}}»",
|
||||
"hostFallback": "Hôte {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Chronologie de l'enregistrement",
|
||||
"speed": "Vitesse de lecture",
|
||||
"play": "Lire l'enregistrement",
|
||||
"pause": "Mettre en pause l'enregistrement"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "יומני סשן"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "הקלטת סשן",
|
||||
"enableSessionRecordingDesc": "הקלט את פלט הפעלת הטרמינל לצורך סקירה מאוחרת יותר"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "צפה בהקלטות של הפגישה",
|
||||
"description": "צפה והפעל את הקלטות ההקלטה שלך."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "שמירה (ימים)",
|
||||
"description": "כמה זמן נשמרת הקלטת סשן לפני שהיא נמחקת אוטומטית."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "הפעל הקלטת סשן",
|
||||
"description": "הקלט את פלט הטרמינל עבור מארח זה כדי שתוכל להשמיע אותו או להוריד אותו מאוחר יותר."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "הַקלָטָה"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "יומני סשן",
|
||||
"noLogs": "אין עדיין יומני סשן",
|
||||
"noLogsDesc": "הפעל רישום סשן במארח כדי להתחיל להקליט",
|
||||
"duration": "מֶשֶׁך",
|
||||
"viewLog": "הצג יומן",
|
||||
"downloadLog": "הורדה",
|
||||
"downloadAsText": "הורד כטקסט",
|
||||
"deleteLog": "לִמְחוֹק",
|
||||
"confirmDelete": "למחוק את יומן הפעילויות הזה?",
|
||||
"confirmDeleteDesc": "לא ניתן לבטל פעולה זו.",
|
||||
"copyContent": "לְהַעְתִיק",
|
||||
"copied": "מוּעֲתָק!",
|
||||
"loadError": "טעינת יומני הסשן נכשלה",
|
||||
"deleteError": "נכשלה מחיקת יומן ההפעלה",
|
||||
"filterByHost": "סנן לפי מארח...",
|
||||
"back": "בְּחֲזָרָה",
|
||||
"empty": "(רֵיק)",
|
||||
"noResults": "אין תוצאות עבור \"{{query}}\"",
|
||||
"hostFallback": "מארח {{id}}",
|
||||
"sessionFallback": "סשן {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "ציר זמן של הקלטה",
|
||||
"speed": "מהירות השמעה",
|
||||
"play": "הפעלת הקלטה",
|
||||
"pause": "השהיית ההקלטה"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "सत्र लॉग्स"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "सत्र रिकॉर्डिंग",
|
||||
"enableSessionRecordingDesc": "बाद में समीक्षा के लिए टर्मिनल सत्र का आउटपुट रिकॉर्ड करें"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "सेशन लॉग्स",
|
||||
"noLogs": "अभी तक कोई सेशन लॉग नहीं",
|
||||
"noLogsDesc": "रिकॉर्डिंग शुरू करने के लिए किसी होस्ट पर सेशन लॉगिंग सक्षम करें",
|
||||
"duration": "अवधि",
|
||||
"viewLog": "लॉग देखें",
|
||||
"downloadLog": "डाउनलोड करें",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "हटाएं",
|
||||
"confirmDelete": "क्या इस सेशन लॉग को हटाएं?",
|
||||
"confirmDeleteDesc": "यह क्रिया वापस नहीं ली जा सकती।",
|
||||
"copyContent": "कॉपी करें",
|
||||
"copied": "कॉपी हो गया!",
|
||||
"loadError": "सेशन लॉग लोड करने में विफल",
|
||||
"deleteError": "सेशन लॉग हटाने में विफल",
|
||||
"filterByHost": "होस्ट द्वारा फ़िल्टर करें...",
|
||||
"back": "वापस",
|
||||
"empty": "(empty)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Munkamenet-naplók"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Munkamenet-felvétel",
|
||||
"enableSessionRecordingDesc": "Terminál munkamenet kimenetének rögzítése későbbi áttekintés céljából"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Munkamenet-felvételek megtekintése",
|
||||
"description": "Tekintse meg és játssza le saját felvételeit."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Megtartás (nap)",
|
||||
"description": "Mennyi ideig tárolják a munkamenet-felvételt, mielőtt automatikusan törlődne."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Munkamenet-rögzítés engedélyezése",
|
||||
"description": "Rögzítse a terminál kimenetét ehhez a gazdagéphez, hogy később lejátszhassa vagy letölthesse."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Felvétel"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Munkamenet-naplók",
|
||||
"noLogs": "Még nincsenek munkamenet-naplók",
|
||||
"noLogsDesc": "A felvétel megkezdéséhez engedélyezze a munkamenet-naplózást egy gazdagépen",
|
||||
"duration": "Időtartam",
|
||||
"viewLog": "Napló megtekintése",
|
||||
"downloadLog": "Letöltés",
|
||||
"downloadAsText": "Letöltés szövegként",
|
||||
"deleteLog": "Töröl",
|
||||
"confirmDelete": "Törli ezt a munkamenet-naplót?",
|
||||
"confirmDeleteDesc": "Ez a művelet nem vonható vissza.",
|
||||
"copyContent": "Másolat",
|
||||
"copied": "Másolva!",
|
||||
"loadError": "Nem sikerült betölteni a munkamenet-naplókat",
|
||||
"deleteError": "Nem sikerült törölni a munkamenet-naplót",
|
||||
"filterByHost": "Szűrés hoszt szerint...",
|
||||
"back": "Vissza",
|
||||
"empty": "(üres)",
|
||||
"noResults": "Nincs találat a(z) „{{query}} ” kifejezésre",
|
||||
"hostFallback": "Gazdagép {{id}}",
|
||||
"sessionFallback": "Munkamenet {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Felvételi idővonal",
|
||||
"speed": "Lejátszási sebesség",
|
||||
"play": "Felvétel lejátszása",
|
||||
"pause": "Felvétel szüneteltetése"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Session Logs"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Session Recording",
|
||||
"enableSessionRecordingDesc": "Record terminal session output for later review"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Session Logs",
|
||||
"noLogs": "No session logs yet",
|
||||
"noLogsDesc": "Enable session logging on a host to start recording",
|
||||
"duration": "Duration",
|
||||
"viewLog": "View log",
|
||||
"downloadLog": "Download",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Delete",
|
||||
"confirmDelete": "Delete this session log?",
|
||||
"confirmDeleteDesc": "This action cannot be undone.",
|
||||
"copyContent": "Copy",
|
||||
"copied": "Copied!",
|
||||
"loadError": "Failed to load session logs",
|
||||
"deleteError": "Failed to delete session log",
|
||||
"filterByHost": "Filter by host...",
|
||||
"back": "Back",
|
||||
"empty": "(empty)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Log di sessione"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Registrazione sessione",
|
||||
"enableSessionRecordingDesc": "Registra l'output della sessione del terminale per la revisione successiva"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Visualizza le registrazioni delle sessioni",
|
||||
"description": "Visualizza e riproduci le registrazioni delle tue sessioni."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Tempo di ritenzione (giorni)",
|
||||
"description": "Per quanto tempo viene conservata la registrazione di una sessione prima di essere eliminata automaticamente."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Abilita la registrazione della sessione",
|
||||
"description": "Registra l'output del terminale per questo host in modo da poterlo riprodurre o scaricare in seguito."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Registrazione"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Registri di sessione",
|
||||
"noLogs": "Ancora nessun registro di sessione",
|
||||
"noLogsDesc": "Abilita la registrazione delle sessioni su un host per iniziare a registrare",
|
||||
"duration": "Durata",
|
||||
"viewLog": "Visualizza registro",
|
||||
"downloadLog": "Scarica",
|
||||
"downloadAsText": "Scarica come testo",
|
||||
"deleteLog": "Elimina",
|
||||
"confirmDelete": "Eliminare questo registro di sessione?",
|
||||
"confirmDeleteDesc": "Questa azione non può essere annullata.",
|
||||
"copyContent": "Copia",
|
||||
"copied": "Copiato!",
|
||||
"loadError": "Impossibile caricare i registri di sessione",
|
||||
"deleteError": "Impossibile eliminare il registro di sessione",
|
||||
"filterByHost": "Filtra per host...",
|
||||
"back": "Indietro",
|
||||
"empty": "(vuoto)",
|
||||
"noResults": "Nessun risultato per \"{{query}}\"",
|
||||
"hostFallback": "Ospite {{id}}",
|
||||
"sessionFallback": "Sessione {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Cronologia delle registrazioni",
|
||||
"speed": "Velocità di riproduzione",
|
||||
"play": "Riproduci la registrazione",
|
||||
"pause": "Metti in pausa la registrazione"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "セッションログ"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "セッション記録",
|
||||
"enableSessionRecordingDesc": "後で確認できるようにターミナルセッションの出力を記録します"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "セッションの録画を見る",
|
||||
"description": "自分のセッション録音を視聴・再生できます。"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "保持期間(日数)",
|
||||
"description": "セッション記録が自動的に削除されるまでの保存期間。"
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "セッション記録を有効にする",
|
||||
"description": "このホストの端末出力を記録しておけば、後で再生したりダウンロードしたりできます。"
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "録音"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "セッションログ",
|
||||
"noLogs": "セッションログはまだありません",
|
||||
"noLogsDesc": "ホストでセッションログを有効にして記録を開始してください",
|
||||
"duration": "所要時間",
|
||||
"viewLog": "ログを表示",
|
||||
"downloadLog": "ダウンロード",
|
||||
"downloadAsText": "テキストとしてダウンロード",
|
||||
"deleteLog": "削除",
|
||||
"confirmDelete": "このセッションログを削除しますか?",
|
||||
"confirmDeleteDesc": "この操作は元に戻せません。",
|
||||
"copyContent": "コピー",
|
||||
"copied": "コピーしました!",
|
||||
"loadError": "セッションログの読み込みに失敗しました",
|
||||
"deleteError": "セッションログの削除に失敗しました",
|
||||
"filterByHost": "ホストでフィルター...",
|
||||
"back": "戻る",
|
||||
"empty": "(空)",
|
||||
"noResults": "「{{query}}」の検索結果はありません",
|
||||
"hostFallback": "ホスト {{id}}",
|
||||
"sessionFallback": "セッション {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "録音タイムライン",
|
||||
"speed": "再生速度",
|
||||
"play": "録音を再生する",
|
||||
"pause": "録画を一時停止"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "세션 로그"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "세션 녹화",
|
||||
"enableSessionRecordingDesc": "나중에 검토할 수 있도록 터미널 세션 출력을 기록합니다"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "세션 녹화 영상을 시청하세요",
|
||||
"description": "자신이 녹음한 세션 내용을 보고 재생해 보세요."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "보유 기간(일)",
|
||||
"description": "세션 녹화 파일이 자동으로 삭제되기 전까지 보관되는 기간은 얼마인가요?"
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "세션 녹화를 활성화합니다.",
|
||||
"description": "이 호스트의 터미널 출력을 기록하여 나중에 재생하거나 다운로드할 수 있도록 합니다."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "녹음"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "세션 로그",
|
||||
"noLogs": "아직 세션 로그 없음",
|
||||
"noLogsDesc": "호스트에서 세션 로깅을 활성화하여 기록 시작",
|
||||
"duration": "지속 시간",
|
||||
"viewLog": "로그 보기",
|
||||
"downloadLog": "다운로드",
|
||||
"downloadAsText": "텍스트 파일로 다운로드",
|
||||
"deleteLog": "삭제",
|
||||
"confirmDelete": "이 세션 로그를 삭제하시겠습니까?",
|
||||
"confirmDeleteDesc": "이 작업은 취소할 수 없습니다.",
|
||||
"copyContent": "복사",
|
||||
"copied": "복사됨!",
|
||||
"loadError": "세션 로그 로드 실패",
|
||||
"deleteError": "세션 로그 삭제 실패",
|
||||
"filterByHost": "호스트로 필터링...",
|
||||
"back": "뒤로",
|
||||
"empty": "(비어 있음)",
|
||||
"noResults": "\"{{query}} \"에 대한 검색 결과가 없습니다.",
|
||||
"hostFallback": "호스트 {{id}}",
|
||||
"sessionFallback": "세션 {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "녹음 타임라인",
|
||||
"speed": "재생 속도",
|
||||
"play": "재생 녹음",
|
||||
"pause": "녹화 일시 중지"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Sessielogboeken"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Sessieopname",
|
||||
"enableSessionRecordingDesc": "Sla de uitvoer van de terminalsessie op voor latere beoordeling."
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Bekijk sessieopnames",
|
||||
"description": "Bekijk en speel je eigen sessieopnames af."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retentie (dagen)",
|
||||
"description": "Hoe lang een sessieopname wordt bewaard voordat deze automatisch wordt verwijderd."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Sessieopname inschakelen",
|
||||
"description": "Neem de terminaluitvoer van deze host op, zodat u deze later kunt afspelen of downloaden."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Opname"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Sessielogboeken",
|
||||
"noLogs": "Nog geen sessielogboeken",
|
||||
"noLogsDesc": "Schakel sessielogging in op een host om te beginnen met opnemen.",
|
||||
"duration": "Duur",
|
||||
"viewLog": "Logboek bekijken",
|
||||
"downloadLog": "Download",
|
||||
"downloadAsText": "Downloaden als tekst",
|
||||
"deleteLog": "Verwijderen",
|
||||
"confirmDelete": "Dit sessielogboek verwijderen?",
|
||||
"confirmDeleteDesc": "Deze actie kan niet ongedaan gemaakt worden.",
|
||||
"copyContent": "Kopiëren",
|
||||
"copied": "Gekopieerd!",
|
||||
"loadError": "Het laden van de sessielogboeken is mislukt.",
|
||||
"deleteError": "Het verwijderen van het sessielogboek is mislukt.",
|
||||
"filterByHost": "Filteren op host...",
|
||||
"back": "Rug",
|
||||
"empty": "(leeg)",
|
||||
"noResults": "Geen resultaten voor \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Sessie {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Opnametijdlijn",
|
||||
"speed": "Afspeelsnelheid",
|
||||
"play": "Speel opname af",
|
||||
"pause": "Opname pauzeren"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Session Logs"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Session Recording",
|
||||
"enableSessionRecordingDesc": "Record terminal session output for later review"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Session Logs",
|
||||
"noLogs": "No session logs yet",
|
||||
"noLogsDesc": "Enable session logging on a host to start recording",
|
||||
"duration": "Duration",
|
||||
"viewLog": "View log",
|
||||
"downloadLog": "Last ned",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Slett",
|
||||
"confirmDelete": "Delete this session log?",
|
||||
"confirmDeleteDesc": "Denne handlingen kan ikke angres.",
|
||||
"copyContent": "Kopier",
|
||||
"copied": "Copied!",
|
||||
"loadError": "Failed to load session logs",
|
||||
"deleteError": "Failed to delete session log",
|
||||
"filterByHost": "Filter by host...",
|
||||
"back": "Tilbake",
|
||||
"empty": "(empty)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Logi sesji"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Nagrywanie sesji",
|
||||
"enableSessionRecordingDesc": "Zapisuj wyjście sesji terminala do późniejszego przejrzenia"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Logi sesji",
|
||||
"noLogs": "Brak logów sesji",
|
||||
"noLogsDesc": "Włącz rejestrowanie sesji na hoście, aby rozpocząć nagrywanie",
|
||||
"duration": "Czas trwania",
|
||||
"viewLog": "Wyświetl log",
|
||||
"downloadLog": "Pobierz",
|
||||
"downloadAsText": "Pobierz jako tekst",
|
||||
"deleteLog": "Usuń",
|
||||
"confirmDelete": "Usunąć ten log sesji?",
|
||||
"confirmDeleteDesc": "Tej czynności nie można cofnąć.",
|
||||
"copyContent": "Kopiuj",
|
||||
"copied": "Skopiowano!",
|
||||
"loadError": "Nie udało się załadować logów sesji",
|
||||
"deleteError": "Nie udało się usunąć logu sesji",
|
||||
"filterByHost": "Filtruj według hosta...",
|
||||
"back": "Wstecz",
|
||||
"empty": "(pusty)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Logs de sessão"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Session Recording",
|
||||
"enableSessionRecordingDesc": "Record terminal session output for later review"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Logs de sessão",
|
||||
"noLogs": "No session logs yet",
|
||||
"noLogsDesc": "Enable session logging on a host to start recording",
|
||||
"duration": "Duration",
|
||||
"viewLog": "View log",
|
||||
"downloadLog": "Download",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Apagar",
|
||||
"confirmDelete": "Delete this session log?",
|
||||
"confirmDeleteDesc": "This action cannot be undone.",
|
||||
"copyContent": "Copiar",
|
||||
"copied": "Copiado!",
|
||||
"loadError": "Failed to load session logs",
|
||||
"deleteError": "Failed to delete session log",
|
||||
"filterByHost": "Filter by host...",
|
||||
"back": "Voltar",
|
||||
"empty": "(empty)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Registos de Sessão"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Gravação de Sessão",
|
||||
"enableSessionRecordingDesc": "Gravar a saída da sessão de terminal para revisão posterior"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Registos de Sessão",
|
||||
"noLogs": "Ainda sem registos de sessão",
|
||||
"noLogsDesc": "Ative o registo de sessão num host para começar a gravar",
|
||||
"duration": "Duração",
|
||||
"viewLog": "Ver registo",
|
||||
"downloadLog": "Transferir",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Eliminar",
|
||||
"confirmDelete": "Eliminar este registo de sessão?",
|
||||
"confirmDeleteDesc": "Esta ação não pode ser desfeita.",
|
||||
"copyContent": "Copiar",
|
||||
"copied": "Copiado!",
|
||||
"loadError": "Falha ao carregar registos de sessão",
|
||||
"deleteError": "Falha ao eliminar registo de sessão",
|
||||
"filterByHost": "Filtrar por host...",
|
||||
"back": "Voltar",
|
||||
"empty": "(vazio)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Jurnalele de sesiune"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Înregistrarea sesiunii",
|
||||
"enableSessionRecordingDesc": "Înregistrați ieșirea sesiunii terminale pentru o revizuire ulterioară"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "Vizualizați înregistrările sesiunilor",
|
||||
"description": "Vizualizați și redați propriile înregistrări ale sesiunilor."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retenție (zile)",
|
||||
"description": "Cât timp este păstrată o înregistrare a sesiunii înainte de a fi ștearsă automat."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Activează înregistrarea sesiunii",
|
||||
"description": "Înregistrați ieșirea terminalului pentru această gazdă, astfel încât să o puteți reda sau descărca mai târziu."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Înregistrare"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Jurnalele de sesiune",
|
||||
"noLogs": "Încă nu există jurnale de sesiune",
|
||||
"noLogsDesc": "Activați înregistrarea în jurnal pe o gazdă pentru a începe înregistrarea",
|
||||
"duration": "Durată",
|
||||
"viewLog": "Vizualizare jurnal",
|
||||
"downloadLog": "Descărcare",
|
||||
"downloadAsText": "Descărcați ca text",
|
||||
"deleteLog": "Şterge",
|
||||
"confirmDelete": "Ștergeți acest jurnal de sesiune?",
|
||||
"confirmDeleteDesc": "Această acțiune nu poate fi anulată.",
|
||||
"copyContent": "Copie",
|
||||
"copied": "Copiat!",
|
||||
"loadError": "Nu s-au putut încărca jurnalele de sesiune",
|
||||
"deleteError": "Nu s-a putut șterge jurnalul sesiunii",
|
||||
"filterByHost": "Filtrare după gazdă...",
|
||||
"back": "Spate",
|
||||
"empty": "(gol)",
|
||||
"noResults": "Niciun rezultat pentru „{{query}}”",
|
||||
"hostFallback": "Gazdă {{id}}",
|
||||
"sessionFallback": "Sesiune {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Cronologia înregistrării",
|
||||
"speed": "Viteză de redare",
|
||||
"play": "Redă înregistrarea",
|
||||
"pause": "Întrerupe înregistrarea"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Журналы сессий"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Запись сессии",
|
||||
"enableSessionRecordingDesc": "Записывать вывод терминальной сессии для последующего просмотра"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Журналы сеансов",
|
||||
"noLogs": "Пока нет журналов сеансов",
|
||||
"noLogsDesc": "Включите ведение журнала сеансов на хосте, чтобы начать запись",
|
||||
"duration": "Продолжительность",
|
||||
"viewLog": "Просмотреть журнал",
|
||||
"downloadLog": "Скачать",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Удалить",
|
||||
"confirmDelete": "Удалить этот журнал сеансов?",
|
||||
"confirmDeleteDesc": "Это действие нельзя отменить.",
|
||||
"copyContent": "Копировать",
|
||||
"copied": "Скопировано!",
|
||||
"loadError": "Не удалось загрузить журналы сеансов",
|
||||
"deleteError": "Не удалось удалить журнал сеанса",
|
||||
"filterByHost": "Фильтровать по хосту...",
|
||||
"back": "Назад",
|
||||
"empty": "(пусто)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Session Logs"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Session Recording",
|
||||
"enableSessionRecordingDesc": "Record terminal session output for later review"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Session Logs",
|
||||
"noLogs": "No session logs yet",
|
||||
"noLogsDesc": "Enable session logging on a host to start recording",
|
||||
"duration": "Duration",
|
||||
"viewLog": "View log",
|
||||
"downloadLog": "Download",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Delete",
|
||||
"confirmDelete": "Delete this session log?",
|
||||
"confirmDeleteDesc": "This action cannot be undone.",
|
||||
"copyContent": "Copy",
|
||||
"copied": "Copied!",
|
||||
"loadError": "Failed to load session logs",
|
||||
"deleteError": "Failed to delete session log",
|
||||
"filterByHost": "Filter by host...",
|
||||
"back": "Back",
|
||||
"empty": "(empty)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Session Logs"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Session Recording",
|
||||
"enableSessionRecordingDesc": "Record terminal session output for later review"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Session Logs",
|
||||
"noLogs": "No session logs yet",
|
||||
"noLogsDesc": "Enable session logging on a host to start recording",
|
||||
"duration": "Duration",
|
||||
"viewLog": "View log",
|
||||
"downloadLog": "Download",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Delete",
|
||||
"confirmDelete": "Delete this session log?",
|
||||
"confirmDeleteDesc": "This action cannot be undone.",
|
||||
"copyContent": "Copy",
|
||||
"copied": "Copied!",
|
||||
"loadError": "Failed to load session logs",
|
||||
"deleteError": "Failed to delete session log",
|
||||
"filterByHost": "Filter by host...",
|
||||
"back": "Back",
|
||||
"empty": "(empty)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Session Logs"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Session Recording",
|
||||
"enableSessionRecordingDesc": "Record terminal session output for later review"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Session Logs",
|
||||
"noLogs": "No session logs yet",
|
||||
"noLogsDesc": "Enable session logging on a host to start recording",
|
||||
"duration": "Duration",
|
||||
"viewLog": "View log",
|
||||
"downloadLog": "Download",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Delete",
|
||||
"confirmDelete": "Delete this session log?",
|
||||
"confirmDeleteDesc": "This action cannot be undone.",
|
||||
"copyContent": "Copy",
|
||||
"copied": "Copied!",
|
||||
"loadError": "Failed to load session logs",
|
||||
"deleteError": "Failed to delete session log",
|
||||
"filterByHost": "Filter by host...",
|
||||
"back": "Back",
|
||||
"empty": "(empty)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Oturum Kayıtları"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Oturum kaydı",
|
||||
"enableSessionRecordingDesc": "Daha sonra gözden geçirmek için terminal oturumu çıktısını kaydet"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Oturum Günlükleri",
|
||||
"noLogs": "Henüz oturum günlüğü yok",
|
||||
"noLogsDesc": "Kayda başlamak için bir sunucuda oturum günlüğünü etkinleştirin",
|
||||
"duration": "Süre",
|
||||
"viewLog": "Günlüğü görüntüle",
|
||||
"downloadLog": "İndir",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Sil",
|
||||
"confirmDelete": "Bu oturum günlüğü silinsin mi?",
|
||||
"confirmDeleteDesc": "Bu işlem geri alınamaz.",
|
||||
"copyContent": "Kopyala",
|
||||
"copied": "Kopyalandı!",
|
||||
"loadError": "Oturum günlükleri yüklenemedi",
|
||||
"deleteError": "Oturum günlüğü silinemedi",
|
||||
"filterByHost": "Sunucuya göre filtrele...",
|
||||
"back": "Geri",
|
||||
"empty": "(boş)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Session Logs"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Session Recording",
|
||||
"enableSessionRecordingDesc": "Record terminal session output for later review"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Session Logs",
|
||||
"noLogs": "No session logs yet",
|
||||
"noLogsDesc": "Enable session logging on a host to start recording",
|
||||
"duration": "Duration",
|
||||
"viewLog": "View log",
|
||||
"downloadLog": "Download",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Delete",
|
||||
"confirmDelete": "Delete this session log?",
|
||||
"confirmDeleteDesc": "This action cannot be undone.",
|
||||
"copyContent": "Copy",
|
||||
"copied": "Copied!",
|
||||
"loadError": "Failed to load session logs",
|
||||
"deleteError": "Failed to delete session log",
|
||||
"filterByHost": "Filter by host...",
|
||||
"back": "Back",
|
||||
"empty": "(empty)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "Nhật ký phiên"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "Ghi phiên",
|
||||
"enableSessionRecordingDesc": "Ghi lại đầu ra phiên terminal để xem lại sau"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "Nhật ký phiên",
|
||||
"noLogs": "Chưa có nhật ký phiên nào",
|
||||
"noLogsDesc": "Bật ghi nhật ký phiên trên máy chủ để bắt đầu ghi",
|
||||
"duration": "Thời lượng",
|
||||
"viewLog": "Xem nhật ký",
|
||||
"downloadLog": "Tải xuống",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "Xóa",
|
||||
"confirmDelete": "Xóa nhật ký phiên này?",
|
||||
"confirmDeleteDesc": "Hành động này không thể hoàn tác.",
|
||||
"copyContent": "Sao chép",
|
||||
"copied": "Đã sao chép!",
|
||||
"loadError": "Tải nhật ký phiên thất bại",
|
||||
"deleteError": "Xóa nhật ký phiên thất bại",
|
||||
"filterByHost": "Lọc theo máy chủ...",
|
||||
"back": "Quay lại",
|
||||
"empty": "(trống)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "会话日志"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "会话录制",
|
||||
"enableSessionRecordingDesc": "记录终端会话输出以供日后查看"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "会话日志",
|
||||
"noLogs": "暂无会话日志",
|
||||
"noLogsDesc": "在主机上启用会话日志以开始记录",
|
||||
"duration": "持续时间",
|
||||
"viewLog": "查看日志",
|
||||
"downloadLog": "下载",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "删除",
|
||||
"confirmDelete": "删除此会话日志?",
|
||||
"confirmDeleteDesc": "此操作无法撤消。",
|
||||
"copyContent": "复制",
|
||||
"copied": "已复制!",
|
||||
"loadError": "加载会话日志失败",
|
||||
"deleteError": "删除会话日志失败",
|
||||
"filterByHost": "按主机筛选...",
|
||||
"back": "返回",
|
||||
"empty": "(空)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"nav": {
|
||||
"sessionLogs": "工作階段記錄"
|
||||
},
|
||||
"hosts": {
|
||||
"enableSessionRecording": "工作階段錄製",
|
||||
"enableSessionRecordingDesc": "記錄終端機工作階段輸出以供日後檢視"
|
||||
},
|
||||
"permissions": {
|
||||
"view": {
|
||||
"title": "View session recordings",
|
||||
"description": "See and play back your own session recordings."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"admin": {
|
||||
"retentionDays": {
|
||||
"label": "Retention (days)",
|
||||
"description": "How long a session recording is kept before it is deleted automatically."
|
||||
}
|
||||
},
|
||||
"host": {
|
||||
"enable": {
|
||||
"label": "Enable session recording",
|
||||
"description": "Record terminal output for this host so you can play it back or download it later."
|
||||
}
|
||||
}
|
||||
},
|
||||
"terminalStatus": {
|
||||
"recording": "Recording"
|
||||
},
|
||||
"sessionLogs": {
|
||||
"title": "工作階段記錄",
|
||||
"noLogs": "尚無任何工作階段記錄",
|
||||
"noLogsDesc": "在主機上啟用工作階段記錄以開始錄製",
|
||||
"duration": "持續時間",
|
||||
"viewLog": "檢視記錄",
|
||||
"downloadLog": "下載",
|
||||
"downloadAsText": "Download as text",
|
||||
"deleteLog": "刪除",
|
||||
"confirmDelete": "刪除此工作階段記錄?",
|
||||
"confirmDeleteDesc": "此動作無法復原。",
|
||||
"copyContent": "複製",
|
||||
"copied": "已複製!",
|
||||
"loadError": "載入工作階段記錄失敗",
|
||||
"deleteError": "刪除工作階段記錄失敗",
|
||||
"filterByHost": "依主機篩選...",
|
||||
"back": "返回",
|
||||
"empty": "(空的)",
|
||||
"noResults": "No results for \"{{query}}\"",
|
||||
"hostFallback": "Host {{id}}",
|
||||
"sessionFallback": "Session {{id}}"
|
||||
},
|
||||
"player": {
|
||||
"timeline": "Recording timeline",
|
||||
"speed": "Playback speed",
|
||||
"play": "Play recording",
|
||||
"pause": "Pause recording"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"id": "session-recording",
|
||||
"name": "Session Recording",
|
||||
"version": "1.0.0",
|
||||
"description": "Record terminal sessions and play them back or download them later.",
|
||||
"author": {
|
||||
"name": "Termix"
|
||||
},
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/Termix-SSH/Termix",
|
||||
"category": "Terminal",
|
||||
"icon": "ScrollText",
|
||||
"engine": {
|
||||
"termix": ">=2.9.0",
|
||||
"api": "1"
|
||||
},
|
||||
"capabilities": [
|
||||
"hosts:read",
|
||||
"db:own",
|
||||
"files:own",
|
||||
"network:serve",
|
||||
"ui:surface",
|
||||
"events:core",
|
||||
"db:core-refs"
|
||||
],
|
||||
"provides": [
|
||||
{
|
||||
"service": "recordings.writer",
|
||||
"version": "1.1.0",
|
||||
"permission": "session-recording.view"
|
||||
}
|
||||
],
|
||||
"contributes": {
|
||||
"tabs": [
|
||||
{
|
||||
"id": "session-logs",
|
||||
"titleKey": "nav.sessionLogs",
|
||||
"icon": "ScrollText",
|
||||
"openFrom": ["rail"]
|
||||
}
|
||||
],
|
||||
"permissions": [
|
||||
{
|
||||
"name": "view",
|
||||
"titleKey": "permissions.view.title",
|
||||
"descriptionKey": "permissions.view.description",
|
||||
"defaultRoles": ["admin", "user"]
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"admin": [
|
||||
{
|
||||
"key": "retentionDays",
|
||||
"type": "number",
|
||||
"labelKey": "settings.admin.retentionDays.label",
|
||||
"descriptionKey": "settings.admin.retentionDays.description",
|
||||
"min": 1,
|
||||
"max": 3650,
|
||||
"default": 30
|
||||
}
|
||||
],
|
||||
"host": {
|
||||
"editorGroup": "ssh",
|
||||
"editorOrder": 85,
|
||||
"enableKey": "enableSessionRecording",
|
||||
"enableLabelKey": "settings.host.enable.label",
|
||||
"enableDescriptionKey": "settings.host.enable.description",
|
||||
"fields": []
|
||||
}
|
||||
},
|
||||
"hostCapability": {
|
||||
"key": "enableSessionRecording",
|
||||
"labelKey": "hosts.enableSessionRecording",
|
||||
"editorTab": "general"
|
||||
},
|
||||
"uses": ["terminal.toolbarStatus"]
|
||||
},
|
||||
"locales": "locales",
|
||||
"platforms": ["linux", "win32", "darwin"]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
-- session-recording 0001: adopt_session_recordings
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `session_recordings` (
|
||||
`id` int AUTO_INCREMENT PRIMARY KEY,
|
||||
`host_id` int NOT NULL,
|
||||
`user_id` varchar(255),
|
||||
`username` text,
|
||||
`access_id` int,
|
||||
`started_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
`ended_at` text,
|
||||
`duration` int,
|
||||
`commands` text,
|
||||
`dangerous_actions` text,
|
||||
`recording_path` text,
|
||||
`protocol` text NOT NULL DEFAULT ('ssh'),
|
||||
`format` text NOT NULL DEFAULT ('text'),
|
||||
`terminated_by_owner` boolean DEFAULT false,
|
||||
`termination_reason` text,
|
||||
FOREIGN KEY (`host_id`) REFERENCES `ssh_data` (`id`) ON DELETE CASCADE
|
||||
);
|
||||
RENAME TABLE `session_recordings` TO `p_session_recording_session_recordings`;
|
||||
@@ -0,0 +1,24 @@
|
||||
-- session-recording 0001: adopt_session_recordings
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "session_recordings" (
|
||||
"id" serial PRIMARY KEY,
|
||||
"host_id" integer NOT NULL,
|
||||
"user_id" varchar(255),
|
||||
"username" text,
|
||||
"access_id" integer,
|
||||
"started_at" varchar(255) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"ended_at" text,
|
||||
"duration" integer,
|
||||
"commands" text,
|
||||
"dangerous_actions" text,
|
||||
"recording_path" text,
|
||||
"protocol" text NOT NULL DEFAULT 'ssh',
|
||||
"format" text NOT NULL DEFAULT 'text',
|
||||
"terminated_by_owner" boolean DEFAULT false,
|
||||
"termination_reason" text,
|
||||
FOREIGN KEY ("host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_session_recordings_user_started" ON "session_recordings" ("user_id", "started_at");
|
||||
CREATE INDEX IF NOT EXISTS "idx_session_recordings_host" ON "session_recordings" ("host_id");
|
||||
ALTER TABLE "session_recordings" RENAME TO "p_session_recording_session_recordings";
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"version": 1,
|
||||
"tables": {
|
||||
"session_recordings": {
|
||||
"columns": {
|
||||
"id": {
|
||||
"type": "id",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"hostId": {
|
||||
"type": "refHost",
|
||||
"notNull": true
|
||||
},
|
||||
"userId": {
|
||||
"type": "varchar",
|
||||
"length": 255
|
||||
},
|
||||
"username": {
|
||||
"type": "text"
|
||||
},
|
||||
"accessId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"startedAt": {
|
||||
"type": "timestamp",
|
||||
"notNull": true,
|
||||
"defaultNow": true
|
||||
},
|
||||
"endedAt": {
|
||||
"type": "timestamp"
|
||||
},
|
||||
"duration": {
|
||||
"type": "integer"
|
||||
},
|
||||
"commands": {
|
||||
"type": "text"
|
||||
},
|
||||
"dangerousActions": {
|
||||
"type": "text"
|
||||
},
|
||||
"recordingPath": {
|
||||
"type": "text"
|
||||
},
|
||||
"protocol": {
|
||||
"type": "text",
|
||||
"notNull": true,
|
||||
"defaultValue": "ssh"
|
||||
},
|
||||
"format": {
|
||||
"type": "text",
|
||||
"notNull": true,
|
||||
"defaultValue": "text"
|
||||
},
|
||||
"terminatedByOwner": {
|
||||
"type": "boolean",
|
||||
"defaultValue": false
|
||||
},
|
||||
"terminationReason": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_session_recordings_user_started",
|
||||
"columns": ["userId", "startedAt"]
|
||||
},
|
||||
{
|
||||
"name": "idx_session_recordings_host",
|
||||
"columns": ["hostId"]
|
||||
}
|
||||
],
|
||||
"adopts": "session_recordings"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
-- session-recording 0001: adopt_session_recordings
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "session_recordings" (
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT,
|
||||
"host_id" integer NOT NULL,
|
||||
"user_id" text,
|
||||
"username" text,
|
||||
"access_id" integer,
|
||||
"started_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"ended_at" text,
|
||||
"duration" integer,
|
||||
"commands" text,
|
||||
"dangerous_actions" text,
|
||||
"recording_path" text,
|
||||
"protocol" text NOT NULL DEFAULT 'ssh',
|
||||
"format" text NOT NULL DEFAULT 'text',
|
||||
"terminated_by_owner" integer DEFAULT 0,
|
||||
"termination_reason" text,
|
||||
FOREIGN KEY ("host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_session_recordings_user_started" ON "session_recordings" ("user_id", "started_at");
|
||||
CREATE INDEX IF NOT EXISTS "idx_session_recordings_host" ON "session_recordings" ("host_id");
|
||||
ALTER TABLE "session_recordings" RENAME TO "p_session_recording_session_recordings";
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "@termix-plugin/session-recording",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "termix-plugin build",
|
||||
"test": "termix-plugin test",
|
||||
"typecheck": "tsc -p .",
|
||||
"validate": "termix-plugin validate"
|
||||
},
|
||||
"dependencies": {
|
||||
"@xterm/addon-fit": "^0.11.0",
|
||||
"@xterm/xterm": "^6.0.0",
|
||||
"guacamole-common-js": "^1.5.0",
|
||||
"lucide-react": "^1.33.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@termix/plugin-sdk": "^1.0.0",
|
||||
"@types/node": "^26.2.0",
|
||||
"@types/react": "^19.2.18",
|
||||
"@types/react-dom": "^19.2.4",
|
||||
"better-sqlite3": "^13.0.3",
|
||||
"jsdom": "^30.0.1",
|
||||
"vitest": "^4.1.11"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@termix/plugin-sdk": "^1.0.0",
|
||||
"drizzle-orm": "^0.45.2",
|
||||
"express": "^5.2.1",
|
||||
"react": "^19.2.8"
|
||||
},
|
||||
"termix": {
|
||||
"patches": [
|
||||
"xterm-android-ime",
|
||||
"guacamole-common-js-flush"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
export function isInside(file: string, dir: string): boolean {
|
||||
return path.resolve(file).startsWith(`${path.resolve(dir)}${path.sep}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves a finished recording someone else wrote (guacd's, in remote
|
||||
* desktop's recordings folder) under this plugin's data folder, which is the
|
||||
* only place playback and retention read from. Returns where it ended up;
|
||||
* a file that is not there is left alone.
|
||||
*/
|
||||
export async function adoptRecordingFile(
|
||||
source: string,
|
||||
dataDir: string,
|
||||
): Promise<string> {
|
||||
if (isInside(source, dataDir)) return source;
|
||||
const target = path.join(
|
||||
dataDir,
|
||||
"session_recordings",
|
||||
path.basename(path.dirname(source)),
|
||||
path.basename(source),
|
||||
);
|
||||
try {
|
||||
await fs.access(source);
|
||||
} catch {
|
||||
return source;
|
||||
}
|
||||
await fs.mkdir(path.dirname(target), { recursive: true });
|
||||
try {
|
||||
await fs.rename(source, target);
|
||||
} catch (error) {
|
||||
if ((error as NodeJS.ErrnoException).code !== "EXDEV") throw error;
|
||||
await fs.copyFile(source, target);
|
||||
await fs.unlink(source);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import type { Router } from "express";
|
||||
import type { PluginContext } from "@termix/plugin-sdk/backend";
|
||||
import { sessionRecordings } from "./tables.js";
|
||||
import { createSessionRecordingRepository } from "./repository.js";
|
||||
import { createRecordingsWriter, type RecordingsWriterV1 } from "./service.js";
|
||||
import { registerSessionRecordingRoutes } from "./routes.js";
|
||||
import { startRetentionSweep } from "./retention.js";
|
||||
|
||||
export type { RecordingsWriterV1, RecordingSink } from "./service.js";
|
||||
|
||||
export async function activate(ctx: PluginContext) {
|
||||
const table = await ctx.db.define(sessionRecordings);
|
||||
const repository = createSessionRecordingRepository(ctx.db, table, ctx.hosts);
|
||||
|
||||
ctx.http
|
||||
.router<Router>()
|
||||
.use(
|
||||
registerSessionRecordingRoutes(ctx, repository, () =>
|
||||
ctx.files.dataDir(),
|
||||
),
|
||||
);
|
||||
|
||||
ctx.services.provide<RecordingsWriterV1>(
|
||||
"recordings.writer",
|
||||
createRecordingsWriter(ctx, repository),
|
||||
);
|
||||
|
||||
// A recording is evidence about the host as much as the person, so it
|
||||
// outlives the account: the row's userId is cleared rather than cascading.
|
||||
ctx.events.on("user.deleted", (payload) => {
|
||||
const { userId } = payload as { userId: string };
|
||||
void repository.anonymizeByUserId(userId);
|
||||
});
|
||||
|
||||
startRetentionSweep(ctx, repository, () => ctx.files.dataDir());
|
||||
|
||||
ctx.log.info(
|
||||
"Session Recording routes mounted at /plugin-api/session-recording",
|
||||
);
|
||||
}
|
||||
|
||||
export async function deactivate() {}
|
||||
@@ -0,0 +1,240 @@
|
||||
import { and, desc, eq, inArray, lt } from "drizzle-orm";
|
||||
import type { PluginDatabase, PluginHosts } from "@termix/plugin-sdk/backend";
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
// The table comes from ctx.db.define, which the SDK hands back untyped, and
|
||||
// the drizzle handle is the server's own. Typed at this module's edge instead.
|
||||
type Table = any;
|
||||
type Drizzle = any;
|
||||
/* eslint-enable @typescript-eslint/no-explicit-any */
|
||||
|
||||
export interface SessionRecordingRecord {
|
||||
id: number;
|
||||
hostId: number;
|
||||
userId: string | null;
|
||||
username: string | null;
|
||||
startedAt: string;
|
||||
endedAt: string | null;
|
||||
duration: number | null;
|
||||
recordingPath: string | null;
|
||||
protocol: string;
|
||||
format: string | null;
|
||||
terminatedByOwner: boolean | null;
|
||||
terminationReason: string | null;
|
||||
}
|
||||
|
||||
export interface SessionRecordingListRecord {
|
||||
id: number;
|
||||
hostId: number;
|
||||
userId: string | null;
|
||||
startedAt: string;
|
||||
endedAt: string | null;
|
||||
duration: number | null;
|
||||
recordingPath: string | null;
|
||||
protocol: string;
|
||||
format: string | null;
|
||||
username: string | null;
|
||||
hostName: string | null;
|
||||
hostIp: string | null;
|
||||
}
|
||||
|
||||
export interface SessionRecordingCreateInput {
|
||||
hostId: number;
|
||||
userId: string;
|
||||
username?: string | null;
|
||||
startedAt: string;
|
||||
endedAt?: string | null;
|
||||
duration?: number | null;
|
||||
recordingPath?: string | null;
|
||||
protocol?: string | null;
|
||||
format?: string | null;
|
||||
terminatedByOwner?: boolean | null;
|
||||
terminationReason?: string | null;
|
||||
}
|
||||
|
||||
export type SessionRecordingRepository = ReturnType<
|
||||
typeof createSessionRecordingRepository
|
||||
>;
|
||||
|
||||
/**
|
||||
* Written without RETURNING so it runs the same on all three engines: an
|
||||
* insert is read back by a marker key it was given, an update by its id.
|
||||
*/
|
||||
export function createSessionRecordingRepository(
|
||||
db: PluginDatabase,
|
||||
table: Table,
|
||||
hosts: PluginHosts,
|
||||
) {
|
||||
const client = () => db.client<Drizzle>();
|
||||
|
||||
async function usernameFor(userId: string): Promise<string | null> {
|
||||
const { users } = await db.refs<{ users: Table }>();
|
||||
const drizzle = await client();
|
||||
const rows = await drizzle
|
||||
.select({ username: users.username })
|
||||
.from(users)
|
||||
.where(eq(users.id, userId));
|
||||
return rows[0]?.username ?? null;
|
||||
}
|
||||
|
||||
async function withHostNames(
|
||||
rows: SessionRecordingListRecord[],
|
||||
): Promise<SessionRecordingListRecord[]> {
|
||||
const list = await hosts.list();
|
||||
const byId = new Map(list.map((host) => [host.id, host]));
|
||||
return rows.map((row) => {
|
||||
const host = byId.get(row.hostId);
|
||||
return { ...row, hostName: host?.name ?? null, hostIp: host?.ip ?? null };
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
usernameFor,
|
||||
|
||||
/**
|
||||
* Inserts a row and returns it. recordingPath is the caller's read-back
|
||||
* key: every caller sets it to something unique (the file path or a
|
||||
* session id) before insert, since MySQL has no RETURNING to read a new
|
||||
* id back with.
|
||||
*/
|
||||
async create(
|
||||
input: SessionRecordingCreateInput & { recordingPath: string },
|
||||
): Promise<SessionRecordingRecord> {
|
||||
const drizzle = await client();
|
||||
await drizzle.insert(table).values(input);
|
||||
const rows = await drizzle
|
||||
.select()
|
||||
.from(table)
|
||||
.where(eq(table.recordingPath, input.recordingPath))
|
||||
.orderBy(desc(table.id))
|
||||
.limit(1);
|
||||
await db.persist();
|
||||
return rows[0];
|
||||
},
|
||||
|
||||
async updateEnded(
|
||||
id: number,
|
||||
input: {
|
||||
endedAt: string;
|
||||
duration: number | null;
|
||||
terminatedByOwner?: boolean;
|
||||
terminationReason?: string | null;
|
||||
},
|
||||
): Promise<void> {
|
||||
const drizzle = await client();
|
||||
await drizzle.update(table).set(input).where(eq(table.id, id));
|
||||
await db.persist();
|
||||
},
|
||||
|
||||
async findByIdForUser(
|
||||
userId: string,
|
||||
id: number,
|
||||
): Promise<SessionRecordingRecord | null> {
|
||||
const drizzle = await client();
|
||||
const rows = await drizzle
|
||||
.select()
|
||||
.from(table)
|
||||
.where(and(eq(table.id, id), eq(table.userId, userId)))
|
||||
.limit(1);
|
||||
return rows[0] ?? null;
|
||||
},
|
||||
|
||||
async findPathByIdForUser(
|
||||
userId: string,
|
||||
id: number,
|
||||
): Promise<{
|
||||
id: number;
|
||||
recordingPath: string | null;
|
||||
format: string | null;
|
||||
} | null> {
|
||||
const drizzle = await client();
|
||||
const rows = await drizzle
|
||||
.select({
|
||||
id: table.id,
|
||||
recordingPath: table.recordingPath,
|
||||
format: table.format,
|
||||
})
|
||||
.from(table)
|
||||
.where(and(eq(table.id, id), eq(table.userId, userId)))
|
||||
.limit(1);
|
||||
return rows[0] ?? null;
|
||||
},
|
||||
|
||||
async listByUserIdWithHost(
|
||||
userId: string,
|
||||
): Promise<SessionRecordingListRecord[]> {
|
||||
const drizzle = await client();
|
||||
const rows = (await drizzle
|
||||
.select()
|
||||
.from(table)
|
||||
.where(eq(table.userId, userId))
|
||||
.orderBy(desc(table.startedAt))) as SessionRecordingListRecord[];
|
||||
return withHostNames(rows);
|
||||
},
|
||||
|
||||
async listPathsOlderThan(
|
||||
cutoff: string,
|
||||
): Promise<Array<{ id: number; recordingPath: string | null }>> {
|
||||
const drizzle = await client();
|
||||
return drizzle
|
||||
.select({ id: table.id, recordingPath: table.recordingPath })
|
||||
.from(table)
|
||||
.where(lt(table.startedAt, cutoff));
|
||||
},
|
||||
|
||||
async deleteForUser(userId: string, id: number): Promise<boolean> {
|
||||
const drizzle = await client();
|
||||
const existing = await drizzle
|
||||
.select({ id: table.id })
|
||||
.from(table)
|
||||
.where(and(eq(table.id, id), eq(table.userId, userId)))
|
||||
.limit(1);
|
||||
if (existing.length === 0) return false;
|
||||
await drizzle
|
||||
.delete(table)
|
||||
.where(and(eq(table.id, id), eq(table.userId, userId)));
|
||||
await db.persist();
|
||||
return true;
|
||||
},
|
||||
|
||||
async deleteById(id: number): Promise<boolean> {
|
||||
const drizzle = await client();
|
||||
const existing = await drizzle
|
||||
.select({ id: table.id })
|
||||
.from(table)
|
||||
.where(eq(table.id, id))
|
||||
.limit(1);
|
||||
if (existing.length === 0) return false;
|
||||
await drizzle.delete(table).where(eq(table.id, id));
|
||||
await db.persist();
|
||||
return true;
|
||||
},
|
||||
|
||||
async deleteByHostId(hostId: number): Promise<void> {
|
||||
const drizzle = await client();
|
||||
await drizzle.delete(table).where(eq(table.hostId, hostId));
|
||||
await db.persist();
|
||||
},
|
||||
|
||||
async deleteByHostIds(hostIds: number[]): Promise<void> {
|
||||
if (hostIds.length === 0) return;
|
||||
const drizzle = await client();
|
||||
await drizzle.delete(table).where(inArray(table.hostId, hostIds));
|
||||
await db.persist();
|
||||
},
|
||||
|
||||
/**
|
||||
* Detaches recordings from a user being deleted instead of removing them.
|
||||
* A recording is evidence about the host as much as about the person, and
|
||||
* the file stays on disk regardless of the row.
|
||||
*/
|
||||
async anonymizeByUserId(userId: string): Promise<void> {
|
||||
const drizzle = await client();
|
||||
await drizzle
|
||||
.update(table)
|
||||
.set({ userId: null })
|
||||
.where(eq(table.userId, userId));
|
||||
await db.persist();
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import type { PluginContext } from "@termix/plugin-sdk/backend";
|
||||
import type { SessionRecordingRepository } from "./repository.js";
|
||||
|
||||
const DEFAULT_RETENTION_DAYS = 30;
|
||||
const PRUNE_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
||||
|
||||
async function getRetentionDays(ctx: PluginContext): Promise<number> {
|
||||
const configured = await ctx.settings.get<number>("retentionDays");
|
||||
if (typeof configured === "number" && configured >= 1 && configured <= 3650) {
|
||||
return configured;
|
||||
}
|
||||
return DEFAULT_RETENTION_DAYS;
|
||||
}
|
||||
|
||||
async function pruneOldRecordings(
|
||||
ctx: PluginContext,
|
||||
repository: SessionRecordingRepository,
|
||||
dataDir: () => Promise<string>,
|
||||
): Promise<void> {
|
||||
try {
|
||||
const retentionDays = await getRetentionDays(ctx);
|
||||
const cutoff = new Date(
|
||||
Date.now() - retentionDays * 24 * 60 * 60 * 1000,
|
||||
).toISOString();
|
||||
const old = await repository.listPathsOlderThan(cutoff);
|
||||
if (old.length === 0) return;
|
||||
|
||||
const base = `${path.resolve(await dataDir())}${path.sep}`;
|
||||
for (const row of old) {
|
||||
if (row.recordingPath) {
|
||||
const resolved = path.resolve(row.recordingPath);
|
||||
if (resolved.startsWith(base)) {
|
||||
await fs.unlink(resolved).catch(() => {});
|
||||
}
|
||||
}
|
||||
await repository.deleteById(row.id);
|
||||
}
|
||||
|
||||
ctx.log.info(`Pruned ${old.length} old session recording(s)`);
|
||||
} catch (error) {
|
||||
ctx.log.warn(
|
||||
`Failed to prune old session recordings: ${
|
||||
error instanceof Error ? error.message : String(error)
|
||||
}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/** Runs the retention sweep at startup and every 24 hours. */
|
||||
export function startRetentionSweep(
|
||||
ctx: PluginContext,
|
||||
repository: SessionRecordingRepository,
|
||||
dataDir: () => Promise<string>,
|
||||
): void {
|
||||
void pruneOldRecordings(ctx, repository, dataDir);
|
||||
const timer = setInterval(
|
||||
() => void pruneOldRecordings(ctx, repository, dataDir),
|
||||
PRUNE_INTERVAL_MS,
|
||||
);
|
||||
timer.unref?.();
|
||||
ctx.disposables.add(() => clearInterval(timer));
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import express, { type Request, type Response, type Router } from "express";
|
||||
import type { PluginContext } from "@termix/plugin-sdk/backend";
|
||||
import type { SessionRecordingRepository } from "./repository.js";
|
||||
|
||||
function actorId(ctx: PluginContext): string | undefined {
|
||||
return ctx.currentActor();
|
||||
}
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* /plugin-api/session-recording/:
|
||||
* get:
|
||||
* summary: List session recordings
|
||||
* description: Returns every terminal session recording for the authenticated user.
|
||||
* tags:
|
||||
* - Session Recording
|
||||
* responses:
|
||||
* 200:
|
||||
* description: List of session recordings.
|
||||
* 500:
|
||||
* description: Failed to fetch session recordings.
|
||||
*/
|
||||
function registerList(
|
||||
router: Router,
|
||||
ctx: PluginContext,
|
||||
repository: SessionRecordingRepository,
|
||||
): void {
|
||||
router.get("/", async (_req: Request, res: Response) => {
|
||||
const userId = actorId(ctx);
|
||||
if (!userId) return res.status(401).json({ error: "Not authenticated" });
|
||||
try {
|
||||
const rows = await repository.listByUserIdWithHost(userId);
|
||||
const records = rows.map((row) => {
|
||||
let sizeBytes: number | null = null;
|
||||
if (row.recordingPath) {
|
||||
try {
|
||||
sizeBytes = fs.statSync(row.recordingPath).size;
|
||||
} catch {
|
||||
// file may have been removed
|
||||
}
|
||||
}
|
||||
return { ...row, sizeBytes };
|
||||
});
|
||||
res.json({ logs: records });
|
||||
} catch (error) {
|
||||
ctx.log.error(
|
||||
"Failed to fetch session recordings",
|
||||
error instanceof Error ? error : new Error(String(error)),
|
||||
);
|
||||
res.status(500).json({ error: "Failed to fetch session recordings" });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* /plugin-api/session-recording/{id}:
|
||||
* get:
|
||||
* summary: Get session recording metadata
|
||||
* description: Returns metadata for a single session recording.
|
||||
* tags:
|
||||
* - Session Recording
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: id
|
||||
* required: true
|
||||
* schema: { type: integer }
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Session recording metadata.
|
||||
* 404:
|
||||
* description: Session recording not found.
|
||||
* 500:
|
||||
* description: Failed to fetch session recording.
|
||||
*/
|
||||
function registerGet(
|
||||
router: Router,
|
||||
ctx: PluginContext,
|
||||
repository: SessionRecordingRepository,
|
||||
): void {
|
||||
router.get("/:id", async (req: Request, res: Response) => {
|
||||
const userId = actorId(ctx);
|
||||
if (!userId) return res.status(401).json({ error: "Not authenticated" });
|
||||
const rawId = Array.isArray(req.params.id)
|
||||
? req.params.id[0]
|
||||
: req.params.id;
|
||||
const id = parseInt(rawId, 10);
|
||||
if (isNaN(id)) return res.status(400).json({ error: "Invalid id" });
|
||||
|
||||
try {
|
||||
const row = await repository.findByIdForUser(userId, id);
|
||||
if (!row) return res.status(404).json({ error: "Not found" });
|
||||
res.json({ log: row });
|
||||
} catch (error) {
|
||||
ctx.log.error(
|
||||
"Failed to fetch session recording",
|
||||
error instanceof Error ? error : new Error(String(error)),
|
||||
);
|
||||
res.status(500).json({ error: "Failed to fetch session recording" });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* /plugin-api/session-recording/{id}/content:
|
||||
* get:
|
||||
* summary: Get session recording content
|
||||
* description: Returns the raw content of a session recording file.
|
||||
* tags:
|
||||
* - Session Recording
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: id
|
||||
* required: true
|
||||
* schema: { type: integer }
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Raw recording content.
|
||||
* 404:
|
||||
* description: Session recording or file not found.
|
||||
* 500:
|
||||
* description: Failed to read session recording.
|
||||
*/
|
||||
function registerContent(
|
||||
router: Router,
|
||||
ctx: PluginContext,
|
||||
repository: SessionRecordingRepository,
|
||||
dataDir: () => Promise<string>,
|
||||
): void {
|
||||
router.get("/:id/content", async (req: Request, res: Response) => {
|
||||
const userId = actorId(ctx);
|
||||
if (!userId) return res.status(401).json({ error: "Not authenticated" });
|
||||
const rawId = Array.isArray(req.params.id)
|
||||
? req.params.id[0]
|
||||
: req.params.id;
|
||||
const id = parseInt(rawId, 10);
|
||||
if (isNaN(id)) return res.status(400).json({ error: "Invalid id" });
|
||||
|
||||
try {
|
||||
const row = await repository.findPathByIdForUser(userId, id);
|
||||
if (!row) return res.status(404).json({ error: "Not found" });
|
||||
|
||||
const filePath = row.recordingPath;
|
||||
if (!filePath)
|
||||
return res.status(404).json({ error: "No recording file" });
|
||||
|
||||
const resolvedPath = path.resolve(filePath);
|
||||
const base = `${path.resolve(await dataDir())}${path.sep}`;
|
||||
if (!resolvedPath.startsWith(base)) {
|
||||
return res.status(403).json({ error: "Forbidden" });
|
||||
}
|
||||
if (!fs.existsSync(resolvedPath)) {
|
||||
return res.status(404).json({ error: "File not found" });
|
||||
}
|
||||
|
||||
const content = await fs.promises.readFile(resolvedPath);
|
||||
const format =
|
||||
row.format ?? (filePath.endsWith(".cast") ? "asciicast" : "text");
|
||||
const contentType =
|
||||
format === "guacamole"
|
||||
? "application/vnd.apache.guacamole.recording"
|
||||
: format === "asciicast"
|
||||
? "application/x-asciicast"
|
||||
: "text/plain";
|
||||
res.type(contentType).send(content);
|
||||
} catch (error) {
|
||||
ctx.log.error(
|
||||
"Failed to read session recording content",
|
||||
error instanceof Error ? error : new Error(String(error)),
|
||||
);
|
||||
res.status(500).json({ error: "Failed to read session recording" });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* /plugin-api/session-recording/{id}:
|
||||
* delete:
|
||||
* summary: Delete session recording
|
||||
* description: Deletes a session recording and its file.
|
||||
* tags:
|
||||
* - Session Recording
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: id
|
||||
* required: true
|
||||
* schema: { type: integer }
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Session recording deleted.
|
||||
* 404:
|
||||
* description: Session recording not found.
|
||||
* 500:
|
||||
* description: Failed to delete session recording.
|
||||
*/
|
||||
function registerDelete(
|
||||
router: Router,
|
||||
ctx: PluginContext,
|
||||
repository: SessionRecordingRepository,
|
||||
dataDir: () => Promise<string>,
|
||||
): void {
|
||||
router.delete("/:id", async (req: Request, res: Response) => {
|
||||
const userId = actorId(ctx);
|
||||
if (!userId) return res.status(401).json({ error: "Not authenticated" });
|
||||
const rawId = Array.isArray(req.params.id)
|
||||
? req.params.id[0]
|
||||
: req.params.id;
|
||||
const id = parseInt(rawId, 10);
|
||||
if (isNaN(id)) return res.status(400).json({ error: "Invalid id" });
|
||||
|
||||
try {
|
||||
const row = await repository.findPathByIdForUser(userId, id);
|
||||
if (!row) return res.status(404).json({ error: "Not found" });
|
||||
|
||||
const filePath = row.recordingPath;
|
||||
const deleted = await repository.deleteForUser(userId, id);
|
||||
if (!deleted) return res.status(404).json({ error: "Not found" });
|
||||
|
||||
if (filePath) {
|
||||
const resolvedPath = path.resolve(filePath);
|
||||
const base = `${path.resolve(await dataDir())}${path.sep}`;
|
||||
if (resolvedPath.startsWith(base) && fs.existsSync(resolvedPath)) {
|
||||
await fs.promises.unlink(resolvedPath).catch(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
res.json({ success: true });
|
||||
} catch (error) {
|
||||
ctx.log.error(
|
||||
"Failed to delete session recording",
|
||||
error instanceof Error ? error : new Error(String(error)),
|
||||
);
|
||||
res.status(500).json({ error: "Failed to delete session recording" });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function registerSessionRecordingRoutes(
|
||||
ctx: PluginContext,
|
||||
repository: SessionRecordingRepository,
|
||||
dataDir: () => Promise<string>,
|
||||
): Router {
|
||||
const router = express.Router();
|
||||
registerList(router, ctx, repository);
|
||||
registerGet(router, ctx, repository);
|
||||
registerContent(router, ctx, repository, dataDir);
|
||||
registerDelete(router, ctx, repository, dataDir);
|
||||
return router;
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import type { PluginContext } from "@termix/plugin-sdk/backend";
|
||||
import type { SessionRecordingRepository } from "./repository.js";
|
||||
import { adoptRecordingFile } from "./files.js";
|
||||
|
||||
/**
|
||||
* recordings.writer v1, the service ssh-terminal calls to record sessions.
|
||||
* 1.1 added enabledFor, for a caller that records outside this plugin.
|
||||
*
|
||||
* One call per already-batched chunk (ssh-terminal coalesces on a 300ms
|
||||
* trailing edge, issue #1049): mkdir and writeFile on the first append,
|
||||
* appendFile after that, never per chunk.
|
||||
*/
|
||||
export interface RecordingSink {
|
||||
append: (chunk: string) => Promise<void>;
|
||||
persist: (summary: {
|
||||
endedAt: number;
|
||||
durationSeconds: number;
|
||||
terminatedByOwner: boolean;
|
||||
terminationReason: string | null;
|
||||
}) => Promise<void>;
|
||||
discard: () => void;
|
||||
}
|
||||
|
||||
export interface RecordingsWriterV1 {
|
||||
/**
|
||||
* Whether the host's recording switch is on, for a caller that has to set
|
||||
* up recording before a session exists (remote desktop tells guacd).
|
||||
*/
|
||||
enabledFor: (hostId: number) => Promise<boolean>;
|
||||
/** Null when recording is off for this user or host. */
|
||||
open: (meta: {
|
||||
sessionId: string;
|
||||
hostId: number;
|
||||
userId: string;
|
||||
protocol: "ssh";
|
||||
format: "asciicast";
|
||||
startedAt: number;
|
||||
}) => Promise<RecordingSink | null>;
|
||||
/**
|
||||
* Inserts a row for a recording a caller already wrote to disk itself
|
||||
* (remote desktop's guacd recordings), rather than streaming through
|
||||
* open()/append(). The caller already decided to record. The file is
|
||||
* moved under this plugin's data folder, where playback reads it.
|
||||
*/
|
||||
createFinished: (input: {
|
||||
hostId: number;
|
||||
userId: string;
|
||||
startedAt: string;
|
||||
endedAt: string;
|
||||
duration: number | null;
|
||||
recordingPath: string;
|
||||
protocol: string;
|
||||
format: string;
|
||||
}) => Promise<{ id: number }>;
|
||||
}
|
||||
|
||||
export function createRecordingsWriter(
|
||||
ctx: PluginContext,
|
||||
repository: SessionRecordingRepository,
|
||||
): RecordingsWriterV1 {
|
||||
const enabledFor = async (hostId: number) =>
|
||||
(await ctx.settings.getHost<boolean>(hostId, "enableSessionRecording")) !==
|
||||
false;
|
||||
|
||||
return {
|
||||
enabledFor,
|
||||
|
||||
async open(meta) {
|
||||
if (!(await enabledFor(meta.hostId))) return null;
|
||||
|
||||
const dataDir = await ctx.files.dataDir();
|
||||
const dir = path.join(dataDir, "session_logs", meta.userId);
|
||||
const filePath = path.join(dir, `${meta.sessionId}.cast`);
|
||||
let wroteFirst = false;
|
||||
let discarded = false;
|
||||
|
||||
const username = await repository.usernameFor(meta.userId);
|
||||
const row = await repository.create({
|
||||
hostId: meta.hostId,
|
||||
userId: meta.userId,
|
||||
username,
|
||||
startedAt: new Date(meta.startedAt).toISOString(),
|
||||
recordingPath: filePath,
|
||||
protocol: meta.protocol,
|
||||
format: meta.format,
|
||||
});
|
||||
|
||||
return {
|
||||
async append(chunk: string) {
|
||||
if (discarded) return;
|
||||
if (!wroteFirst) {
|
||||
await fs.mkdir(dir, { recursive: true });
|
||||
await fs.writeFile(filePath, chunk);
|
||||
wroteFirst = true;
|
||||
} else {
|
||||
await fs.appendFile(filePath, chunk);
|
||||
}
|
||||
},
|
||||
|
||||
async persist(summary) {
|
||||
if (discarded) return;
|
||||
await repository.updateEnded(row.id, {
|
||||
endedAt: new Date(summary.endedAt).toISOString(),
|
||||
duration: summary.durationSeconds,
|
||||
terminatedByOwner: summary.terminatedByOwner,
|
||||
terminationReason: summary.terminationReason,
|
||||
});
|
||||
},
|
||||
|
||||
discard() {
|
||||
discarded = true;
|
||||
void repository.deleteById(row.id).catch(() => {});
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
async createFinished(input) {
|
||||
const username = await repository.usernameFor(input.userId);
|
||||
const recordingPath = await adoptRecordingFile(
|
||||
input.recordingPath,
|
||||
await ctx.files.dataDir(),
|
||||
).catch(() => input.recordingPath);
|
||||
const row = await repository.create({
|
||||
...input,
|
||||
recordingPath,
|
||||
username,
|
||||
});
|
||||
return { id: row.id };
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import {
|
||||
adoptLegacyTable,
|
||||
boolean,
|
||||
defineTable,
|
||||
id,
|
||||
integer,
|
||||
refHost,
|
||||
text,
|
||||
timestamp,
|
||||
varchar,
|
||||
} from "@termix/plugin-sdk/db";
|
||||
|
||||
/**
|
||||
* userId is a plain column, not refUser(): a recording is evidence about the
|
||||
* host as much as the person, so it outlives the account. The plugin listens
|
||||
* for user.deleted and clears userId itself instead of cascading. username
|
||||
* keeps an anonymized row attributable.
|
||||
*/
|
||||
export const sessionRecordings = adoptLegacyTable(
|
||||
"session_recordings",
|
||||
defineTable(
|
||||
"session_recordings",
|
||||
{
|
||||
id: id(),
|
||||
hostId: refHost(),
|
||||
userId: varchar(),
|
||||
username: text(),
|
||||
accessId: integer(),
|
||||
startedAt: timestamp().notNull().defaultNow(),
|
||||
endedAt: timestamp(),
|
||||
duration: integer(),
|
||||
commands: text(),
|
||||
dangerousActions: text(),
|
||||
recordingPath: text(),
|
||||
protocol: text().notNull().default("ssh"),
|
||||
format: text().notNull().default("text"),
|
||||
terminatedByOwner: boolean().default(false),
|
||||
terminationReason: text(),
|
||||
},
|
||||
{
|
||||
indexes: [
|
||||
{
|
||||
name: "idx_session_recordings_user_started",
|
||||
columns: ["userId", "startedAt"],
|
||||
},
|
||||
{ name: "idx_session_recordings_host", columns: ["hostId"] },
|
||||
],
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
export const tables = [sessionRecordings];
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Circle } from "lucide-react";
|
||||
import { useTranslation } from "@termix/plugin-sdk/frontend";
|
||||
|
||||
/** What ssh-terminal hands a "terminal.toolbarStatus" component. */
|
||||
interface TerminalToolbarStatusProps {
|
||||
host?: { pluginSettings?: Record<string, Record<string, unknown>> };
|
||||
isConnected?: boolean;
|
||||
}
|
||||
|
||||
export function RecordingStatus(props: Record<string, unknown>) {
|
||||
const { isConnected } = props as TerminalToolbarStatusProps;
|
||||
const { t } = useTranslation();
|
||||
if (!isConnected) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-1 px-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground">
|
||||
<Circle className="size-2 fill-red-500 text-red-500" />
|
||||
{t("terminalStatus.recording")}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,632 @@
|
||||
import {
|
||||
useState,
|
||||
useEffect,
|
||||
useCallback,
|
||||
useMemo,
|
||||
useRef,
|
||||
type ReactNode,
|
||||
} from "react";
|
||||
import {
|
||||
useTranslation,
|
||||
useToast,
|
||||
usePluginApi,
|
||||
usePermission,
|
||||
} from "@termix/plugin-sdk/frontend";
|
||||
import {
|
||||
Input,
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipProvider,
|
||||
TooltipTrigger,
|
||||
copyToClipboard,
|
||||
} from "@termix/plugin-sdk/ui";
|
||||
import {
|
||||
ArrowLeft,
|
||||
Check,
|
||||
Copy,
|
||||
Download,
|
||||
Eye,
|
||||
FileText,
|
||||
Loader2,
|
||||
ScrollText,
|
||||
Search,
|
||||
X,
|
||||
} from "lucide-react";
|
||||
import { SessionRecordingPlayer } from "./SessionRecordingPlayer";
|
||||
import { asciicastToPlainText, parseAsciicast } from "./asciicast";
|
||||
import {
|
||||
createSessionRecordingApi,
|
||||
type SessionLogRecord,
|
||||
} from "./session-recording-api";
|
||||
|
||||
function useAdaptivePolling(
|
||||
fn: () => Promise<boolean | void>,
|
||||
options: { minIntervalMs: number; maxIntervalMs: number },
|
||||
enabled: boolean,
|
||||
) {
|
||||
const fnRef = useRef(fn);
|
||||
fnRef.current = fn;
|
||||
|
||||
useEffect(() => {
|
||||
if (!enabled) return;
|
||||
let interval = options.minIntervalMs;
|
||||
let stable = 0;
|
||||
let cancelled = false;
|
||||
let timer: ReturnType<typeof setTimeout>;
|
||||
|
||||
const tick = async () => {
|
||||
if (cancelled) return;
|
||||
try {
|
||||
const changed = await fnRef.current();
|
||||
if (changed) {
|
||||
interval = options.minIntervalMs;
|
||||
stable = 0;
|
||||
} else {
|
||||
stable++;
|
||||
if (stable >= 3) {
|
||||
interval = Math.min(interval * 1.5, options.maxIntervalMs);
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// keep polling
|
||||
}
|
||||
if (!cancelled) timer = setTimeout(tick, interval);
|
||||
};
|
||||
|
||||
timer = setTimeout(tick, interval);
|
||||
return () => {
|
||||
cancelled = true;
|
||||
clearTimeout(timer);
|
||||
};
|
||||
}, [enabled, options.minIntervalMs, options.maxIntervalMs]);
|
||||
}
|
||||
|
||||
function formatDuration(seconds: number | null): string {
|
||||
if (seconds == null) return "--";
|
||||
if (seconds < 60) return `${seconds}s`;
|
||||
const m = Math.floor(seconds / 60);
|
||||
const s = seconds % 60;
|
||||
return s > 0 ? `${m}m ${s}s` : `${m}m`;
|
||||
}
|
||||
|
||||
function formatBytes(bytes: number | null): string {
|
||||
if (bytes == null || bytes === 0) return "--";
|
||||
if (bytes < 1024) return `${bytes} B`;
|
||||
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
||||
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
||||
}
|
||||
|
||||
function formatDate(iso: string): string {
|
||||
const d = new Date(iso);
|
||||
return d.toLocaleString(undefined, {
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
});
|
||||
}
|
||||
|
||||
function buildFilename(log: SessionLogRecord): string {
|
||||
const host = (log.hostName ?? log.hostIp ?? "session")
|
||||
.replace(/[^a-zA-Z0-9._-]/g, "_")
|
||||
.slice(0, 40);
|
||||
const d = new Date(log.startedAt);
|
||||
const y = d.getFullYear();
|
||||
const m = String(d.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(d.getDate()).padStart(2, "0");
|
||||
const h = String(d.getHours()).padStart(2, "0");
|
||||
const min = String(d.getMinutes()).padStart(2, "0");
|
||||
const s = String(d.getSeconds()).padStart(2, "0");
|
||||
const extension =
|
||||
log.format === "guacamole"
|
||||
? "guac"
|
||||
: log.format === "asciicast"
|
||||
? "cast"
|
||||
: "log";
|
||||
return `${host}_${y}-${m}-${day}_${h}-${min}-${s}.${extension}`;
|
||||
}
|
||||
|
||||
function buildTextFilename(log: SessionLogRecord): string {
|
||||
return buildFilename(log).replace(/\.(cast|guac|log)$/, ".txt");
|
||||
}
|
||||
|
||||
async function extractPlainText(
|
||||
log: SessionLogRecord,
|
||||
blob: Blob,
|
||||
): Promise<string | null> {
|
||||
if (log.format === "guacamole") return null;
|
||||
const source = await blob.text();
|
||||
if (log.format === "text") return source;
|
||||
return asciicastToPlainText(parseAsciicast(source));
|
||||
}
|
||||
|
||||
function SectionHeader({ label, count }: { label: string; count: number }) {
|
||||
return (
|
||||
<div className="flex items-center gap-2 px-3 py-2 border-b border-border/60 bg-muted/20">
|
||||
<span className="text-[10px] font-bold uppercase tracking-widest text-muted-foreground/60 flex-1">
|
||||
{label}
|
||||
</span>
|
||||
<span className="text-[10px] font-semibold text-muted-foreground/40 bg-muted/60 px-1.5 py-0.5">
|
||||
{count}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function LogMeta({
|
||||
items,
|
||||
className,
|
||||
}: {
|
||||
items: (string | null | undefined)[];
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<span
|
||||
className={`flex min-w-0 items-center gap-x-2.5 overflow-hidden whitespace-nowrap text-[10px] ${className ?? ""}`}
|
||||
>
|
||||
{items.filter(Boolean).map((item, i) => (
|
||||
<span key={i} className="truncate last:shrink-0">
|
||||
{item}
|
||||
</span>
|
||||
))}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
const ACTION_BUTTON =
|
||||
"size-6 flex items-center justify-center text-muted-foreground/50 hover:text-foreground hover:bg-muted/60 transition-colors";
|
||||
|
||||
function ActionButton({
|
||||
label,
|
||||
onClick,
|
||||
destructive,
|
||||
children,
|
||||
}: {
|
||||
label: string;
|
||||
onClick: () => void;
|
||||
destructive?: boolean;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClick}
|
||||
aria-label={label}
|
||||
className={
|
||||
destructive
|
||||
? "size-6 flex items-center justify-center text-muted-foreground/50 hover:text-destructive hover:bg-destructive/10 transition-colors"
|
||||
: ACTION_BUTTON
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" sideOffset={6}>
|
||||
{label}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
function LogRow({
|
||||
log,
|
||||
onView,
|
||||
onDownload,
|
||||
onDownloadText,
|
||||
onDelete,
|
||||
}: {
|
||||
log: SessionLogRecord;
|
||||
onView: () => void;
|
||||
onDownload: () => void;
|
||||
onDownloadText: () => void;
|
||||
onDelete: () => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const hostLabel =
|
||||
log.hostName ??
|
||||
log.hostIp ??
|
||||
t("sessionLogs.hostFallback", { id: log.hostId });
|
||||
|
||||
return (
|
||||
<div className="group flex items-center gap-2.5 px-3 py-2.5 border-b border-border/40 last:border-b-0 hover:bg-muted/40 transition-colors">
|
||||
<div className="shrink-0 flex items-center justify-center size-7 bg-muted/60 text-muted-foreground">
|
||||
<ScrollText className="size-3.5" />
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col flex-1 min-w-0 gap-0.5">
|
||||
<span className="text-xs font-semibold truncate text-foreground">
|
||||
{hostLabel}
|
||||
</span>
|
||||
<LogMeta
|
||||
className="text-muted-foreground/60"
|
||||
items={[
|
||||
formatDate(log.startedAt),
|
||||
(log.protocol ?? "ssh").toUpperCase(),
|
||||
log.username,
|
||||
formatDuration(log.duration),
|
||||
formatBytes(log.sizeBytes),
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<TooltipProvider disableHoverableContent>
|
||||
<div className="shrink-0 flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity">
|
||||
<ActionButton label={t("sessionLogs.viewLog")} onClick={onView}>
|
||||
<Eye className="size-3" />
|
||||
</ActionButton>
|
||||
{log.format === "asciicast" && (
|
||||
<ActionButton
|
||||
label={t("sessionLogs.downloadAsText")}
|
||||
onClick={onDownloadText}
|
||||
>
|
||||
<FileText className="size-3" />
|
||||
</ActionButton>
|
||||
)}
|
||||
<ActionButton
|
||||
label={t("sessionLogs.downloadLog")}
|
||||
onClick={onDownload}
|
||||
>
|
||||
<Download className="size-3" />
|
||||
</ActionButton>
|
||||
<ActionButton
|
||||
label={t("sessionLogs.deleteLog")}
|
||||
onClick={onDelete}
|
||||
destructive
|
||||
>
|
||||
<X className="size-3" />
|
||||
</ActionButton>
|
||||
</div>
|
||||
</TooltipProvider>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function SessionLogsPanel() {
|
||||
const { t } = useTranslation();
|
||||
const toast = useToast();
|
||||
const pluginApi = usePluginApi();
|
||||
const api = useMemo(() => createSessionRecordingApi(pluginApi), [pluginApi]);
|
||||
const canView = usePermission("view");
|
||||
const [logs, setLogs] = useState<SessionLogRecord[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [filter, setFilter] = useState("");
|
||||
const [viewLog, setViewLog] = useState<SessionLogRecord | null>(null);
|
||||
const [viewContent, setViewContent] = useState<string>("");
|
||||
const [viewBlob, setViewBlob] = useState<Blob | null>(null);
|
||||
const [viewText, setViewText] = useState<string | null>(null);
|
||||
const [viewLoading, setViewLoading] = useState(false);
|
||||
const [deleteTarget, setDeleteTarget] = useState<SessionLogRecord | null>(
|
||||
null,
|
||||
);
|
||||
const [deleting, setDeleting] = useState(false);
|
||||
const [copied, setCopied] = useState(false);
|
||||
const logsRef = useRef(logs);
|
||||
logsRef.current = logs;
|
||||
|
||||
const load = useCallback(
|
||||
async (initial = false) => {
|
||||
if (initial) setLoading(true);
|
||||
try {
|
||||
const fresh = await api.list();
|
||||
const changed =
|
||||
logsRef.current.length !== fresh.length ||
|
||||
logsRef.current.some((log, i) => log.id !== fresh[i]?.id);
|
||||
if (changed) {
|
||||
logsRef.current = fresh;
|
||||
setLogs(fresh);
|
||||
}
|
||||
return changed;
|
||||
} catch (error) {
|
||||
if (initial) {
|
||||
toast.error(t("sessionLogs.loadError"));
|
||||
return false;
|
||||
}
|
||||
throw error;
|
||||
} finally {
|
||||
if (initial) setLoading(false);
|
||||
}
|
||||
},
|
||||
[api, t, toast],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!canView) return;
|
||||
void load(true);
|
||||
}, [canView, load]);
|
||||
|
||||
useAdaptivePolling(
|
||||
() => load(false),
|
||||
{
|
||||
minIntervalMs: 5_000,
|
||||
maxIntervalMs: 30_000,
|
||||
},
|
||||
canView,
|
||||
);
|
||||
|
||||
const q = filter.trim().toLowerCase();
|
||||
const filtered = q
|
||||
? logs.filter((l) =>
|
||||
`${l.hostName ?? ""} ${l.hostIp ?? ""} ${l.username ?? ""} ${l.protocol}`
|
||||
.toLowerCase()
|
||||
.includes(q),
|
||||
)
|
||||
: logs;
|
||||
|
||||
const handleView = async (log: SessionLogRecord) => {
|
||||
setViewLog(log);
|
||||
setViewContent("");
|
||||
setViewBlob(null);
|
||||
setViewText(null);
|
||||
setViewLoading(true);
|
||||
try {
|
||||
if (log.format === "text") {
|
||||
const text = await api.getContent(log.id);
|
||||
setViewContent(text);
|
||||
setViewText(text);
|
||||
} else {
|
||||
const blob = await api.getBlob(log.id);
|
||||
setViewBlob(blob);
|
||||
setViewText(await extractPlainText(log, blob));
|
||||
}
|
||||
} catch {
|
||||
toast.error(t("sessionLogs.loadError"));
|
||||
} finally {
|
||||
setViewLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const downloadBlob = (blob: Blob, filename: string) => {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
};
|
||||
|
||||
const handleDownload = async (log: SessionLogRecord) => {
|
||||
try {
|
||||
downloadBlob(await api.getBlob(log.id), buildFilename(log));
|
||||
} catch {
|
||||
toast.error(t("sessionLogs.loadError"));
|
||||
}
|
||||
};
|
||||
|
||||
const handleDownloadText = async (log: SessionLogRecord) => {
|
||||
try {
|
||||
const text =
|
||||
log.id === viewLog?.id && viewText != null
|
||||
? viewText
|
||||
: await extractPlainText(log, await api.getBlob(log.id));
|
||||
if (text == null) {
|
||||
toast.error(t("sessionLogs.loadError"));
|
||||
return;
|
||||
}
|
||||
downloadBlob(
|
||||
new Blob([text], { type: "text/plain" }),
|
||||
buildTextFilename(log),
|
||||
);
|
||||
} catch {
|
||||
toast.error(t("sessionLogs.loadError"));
|
||||
}
|
||||
};
|
||||
|
||||
const handleDelete = async () => {
|
||||
if (!deleteTarget) return;
|
||||
setDeleting(true);
|
||||
try {
|
||||
await api.delete(deleteTarget.id);
|
||||
setLogs((prev) => prev.filter((l) => l.id !== deleteTarget.id));
|
||||
setDeleteTarget(null);
|
||||
} catch {
|
||||
toast.error(t("sessionLogs.deleteError"));
|
||||
} finally {
|
||||
setDeleting(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleCopy = async () => {
|
||||
if (!viewText) return;
|
||||
const ok = await copyToClipboard(viewText);
|
||||
if (ok) {
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 1500);
|
||||
} else {
|
||||
toast.error(t("common.copyFailed"));
|
||||
}
|
||||
};
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="flex items-center justify-center flex-1 p-8">
|
||||
<Loader2 className="size-5 text-muted-foreground animate-spin" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Inline log viewer
|
||||
if (viewLog) {
|
||||
const hostLabel =
|
||||
viewLog.hostName ??
|
||||
viewLog.hostIp ??
|
||||
t("sessionLogs.hostFallback", { id: viewLog.hostId });
|
||||
return (
|
||||
<div className="flex flex-col flex-1 min-h-0 overflow-hidden">
|
||||
{/* Viewer header */}
|
||||
<div className="flex items-center gap-2 px-2 py-2 border-b border-border/60 bg-muted/20 shrink-0">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setViewLog(null)}
|
||||
aria-label={t("sessionLogs.back")}
|
||||
className={ACTION_BUTTON}
|
||||
>
|
||||
<ArrowLeft className="size-3.5" />
|
||||
</button>
|
||||
<div className="flex flex-col flex-1 min-w-0">
|
||||
<span className="text-xs font-semibold truncate text-foreground">
|
||||
{hostLabel}
|
||||
</span>
|
||||
<LogMeta
|
||||
className="text-muted-foreground/50"
|
||||
items={[
|
||||
formatDate(viewLog.startedAt),
|
||||
viewLog.protocol.toUpperCase(),
|
||||
viewLog.duration != null
|
||||
? formatDuration(viewLog.duration)
|
||||
: null,
|
||||
formatBytes(viewLog.sizeBytes),
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
<TooltipProvider disableHoverableContent>
|
||||
<div className="flex items-center gap-0.5 shrink-0">
|
||||
{viewText != null && (
|
||||
<ActionButton
|
||||
label={
|
||||
copied
|
||||
? t("sessionLogs.copied")
|
||||
: t("sessionLogs.copyContent")
|
||||
}
|
||||
onClick={handleCopy}
|
||||
>
|
||||
{copied ? (
|
||||
<Check className="size-3 text-green-500" />
|
||||
) : (
|
||||
<Copy className="size-3" />
|
||||
)}
|
||||
</ActionButton>
|
||||
)}
|
||||
{viewLog.format === "asciicast" && (
|
||||
<ActionButton
|
||||
label={t("sessionLogs.downloadAsText")}
|
||||
onClick={() => handleDownloadText(viewLog)}
|
||||
>
|
||||
<FileText className="size-3" />
|
||||
</ActionButton>
|
||||
)}
|
||||
<ActionButton
|
||||
label={t("sessionLogs.downloadLog")}
|
||||
onClick={() => handleDownload(viewLog)}
|
||||
>
|
||||
<Download className="size-3" />
|
||||
</ActionButton>
|
||||
</div>
|
||||
</TooltipProvider>
|
||||
</div>
|
||||
|
||||
{/* Log content */}
|
||||
<div
|
||||
className={`flex-1 min-h-0 min-w-0 ${viewBlob ? "overflow-hidden" : "overflow-y-auto overflow-x-hidden"}`}
|
||||
>
|
||||
{viewLoading ? (
|
||||
<div className="flex items-center justify-center py-16">
|
||||
<Loader2 className="size-4 animate-spin text-muted-foreground" />
|
||||
</div>
|
||||
) : viewBlob ? (
|
||||
<SessionRecordingPlayer log={viewLog} blob={viewBlob} />
|
||||
) : (
|
||||
<pre className="p-3 text-[11px] font-mono whitespace-pre-wrap break-all text-foreground/80 leading-relaxed">
|
||||
{viewContent || t("sessionLogs.empty")}
|
||||
</pre>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col flex-1 min-h-0">
|
||||
<div className="flex-1 overflow-y-auto">
|
||||
{logs.length === 0 ? (
|
||||
<div className="flex flex-col items-center justify-center flex-1 gap-3 p-6 text-center py-16">
|
||||
<div className="size-10 bg-muted/40 flex items-center justify-center">
|
||||
<ScrollText className="size-5 text-muted-foreground/30" />
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
<span className="text-sm font-semibold text-muted-foreground/60">
|
||||
{t("sessionLogs.noLogs")}
|
||||
</span>
|
||||
<span className="text-xs text-muted-foreground/40">
|
||||
{t("sessionLogs.noLogsDesc")}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="relative px-3 py-2 border-b border-border/60">
|
||||
<Search className="absolute left-5.5 top-1/2 -translate-y-1/2 size-3.5 text-muted-foreground/50 pointer-events-none" />
|
||||
<Input
|
||||
placeholder={t("sessionLogs.filterByHost")}
|
||||
value={filter}
|
||||
onChange={(e) => setFilter(e.target.value)}
|
||||
className="pl-8 h-7 text-xs"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{filtered.length === 0 ? (
|
||||
<div className="flex flex-col items-center justify-center gap-2 py-10 text-center">
|
||||
<span className="text-xs text-muted-foreground/50">
|
||||
{t("sessionLogs.noResults", { query: filter })}
|
||||
</span>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex flex-col">
|
||||
<SectionHeader
|
||||
label={t("sessionLogs.title")}
|
||||
count={filtered.length}
|
||||
/>
|
||||
{filtered.map((log) => (
|
||||
<LogRow
|
||||
key={log.id}
|
||||
log={log}
|
||||
onView={() => handleView(log)}
|
||||
onDownload={() => handleDownload(log)}
|
||||
onDownloadText={() => handleDownloadText(log)}
|
||||
onDelete={() => setDeleteTarget(log)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Inline delete confirmation - positioned against the relative parent in AppShell */}
|
||||
{deleteTarget && (
|
||||
<div className="absolute inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm p-4">
|
||||
<div className="bg-popover border border-border shadow-xl w-full max-w-xs flex flex-col gap-4 p-4">
|
||||
<p className="text-sm text-foreground">
|
||||
{t("sessionLogs.confirmDelete")}
|
||||
</p>
|
||||
<div className="flex flex-col text-xs text-muted-foreground">
|
||||
<span className="font-medium text-foreground/80">
|
||||
{deleteTarget.hostName ??
|
||||
deleteTarget.hostIp ??
|
||||
t("sessionLogs.sessionFallback", { id: deleteTarget.id })}
|
||||
</span>
|
||||
<span>{formatDate(deleteTarget.startedAt)}</span>
|
||||
</div>
|
||||
<div className="flex justify-end gap-2">
|
||||
<button
|
||||
onClick={() => setDeleteTarget(null)}
|
||||
className="px-3 py-1.5 text-xs border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors"
|
||||
>
|
||||
{t("common.cancel")}
|
||||
</button>
|
||||
<button
|
||||
onClick={handleDelete}
|
||||
disabled={deleting}
|
||||
className="px-3 py-1.5 text-xs bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors flex items-center gap-1.5"
|
||||
>
|
||||
{deleting && <Loader2 className="size-3 animate-spin" />}
|
||||
{t("sessionLogs.deleteLog")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,375 @@
|
||||
import { useTranslation } from "@termix/plugin-sdk/frontend";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { Pause, Play } from "lucide-react";
|
||||
import { Terminal } from "@xterm/xterm";
|
||||
import Guacamole from "guacamole-common-js";
|
||||
import "@xterm/xterm/css/xterm.css";
|
||||
import { parseAsciicast, type Asciicast } from "./asciicast";
|
||||
import type { SessionLogRecord } from "./session-recording-api";
|
||||
|
||||
const SPEEDS = [0.5, 1, 2, 4];
|
||||
|
||||
function formatPosition(seconds: number) {
|
||||
const minutes = Math.floor(seconds / 60);
|
||||
return `${minutes}:${String(Math.floor(seconds % 60)).padStart(2, "0")}`;
|
||||
}
|
||||
|
||||
function getErrorMessage(error: unknown, fallback: string): string {
|
||||
return error instanceof Error ? error.message : fallback;
|
||||
}
|
||||
|
||||
function SeekBar({
|
||||
position,
|
||||
duration,
|
||||
onSeek,
|
||||
}: {
|
||||
position: number;
|
||||
duration: number;
|
||||
onSeek: (position: number) => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const barRef = useRef<HTMLDivElement>(null);
|
||||
const [dragging, setDragging] = useState(false);
|
||||
const progress = duration > 0 ? Math.min(position / duration, 1) : 0;
|
||||
|
||||
const seekFromPointer = (clientX: number) => {
|
||||
const rect = barRef.current?.getBoundingClientRect();
|
||||
if (!rect || rect.width === 0 || duration <= 0) return;
|
||||
const ratio = Math.min(Math.max((clientX - rect.left) / rect.width, 0), 1);
|
||||
onSeek(ratio * duration);
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={barRef}
|
||||
role="slider"
|
||||
tabIndex={0}
|
||||
aria-label={t("player.timeline")}
|
||||
aria-valuemin={0}
|
||||
aria-valuemax={duration}
|
||||
aria-valuenow={position}
|
||||
className="group/seek relative h-3 w-full cursor-pointer touch-none outline-none"
|
||||
onPointerDown={(event) => {
|
||||
event.currentTarget.setPointerCapture(event.pointerId);
|
||||
setDragging(true);
|
||||
seekFromPointer(event.clientX);
|
||||
}}
|
||||
onPointerMove={(event) => {
|
||||
if (dragging) seekFromPointer(event.clientX);
|
||||
}}
|
||||
onPointerUp={(event) => {
|
||||
event.currentTarget.releasePointerCapture(event.pointerId);
|
||||
setDragging(false);
|
||||
}}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "ArrowLeft") onSeek(Math.max(position - 5, 0));
|
||||
if (event.key === "ArrowRight")
|
||||
onSeek(Math.min(position + 5, duration));
|
||||
}}
|
||||
>
|
||||
<div className="absolute inset-x-0 top-1/2 h-0.5 -translate-y-1/2 bg-border transition-[height] group-hover/seek:h-1 group-focus-visible/seek:h-1">
|
||||
<div
|
||||
className="h-full bg-primary"
|
||||
style={{ width: `${progress * 100}%` }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function PlaybackControls({
|
||||
playing,
|
||||
position,
|
||||
duration,
|
||||
speed,
|
||||
onToggle,
|
||||
onSeek,
|
||||
onSpeed,
|
||||
}: {
|
||||
playing: boolean;
|
||||
position: number;
|
||||
duration: number;
|
||||
speed: number;
|
||||
onToggle: () => void;
|
||||
onSeek: (position: number) => void;
|
||||
onSpeed: (speed: number) => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="shrink-0 border-t border-border/60 bg-muted/20">
|
||||
<SeekBar position={position} duration={duration} onSeek={onSeek} />
|
||||
<div className="flex items-center gap-2 px-1 pb-1">
|
||||
<button
|
||||
type="button"
|
||||
onClick={onToggle}
|
||||
className="flex size-6 items-center justify-center text-muted-foreground hover:bg-muted hover:text-foreground"
|
||||
aria-label={playing ? t("player.pause") : t("player.play")}
|
||||
>
|
||||
{playing ? (
|
||||
<Pause className="size-3.5" />
|
||||
) : (
|
||||
<Play className="size-3.5" />
|
||||
)}
|
||||
</button>
|
||||
<span className="flex-1 text-[10px] tabular-nums text-muted-foreground">
|
||||
{formatPosition(Math.min(position, duration))} /{" "}
|
||||
{formatPosition(duration)}
|
||||
</span>
|
||||
<div
|
||||
className="flex items-center"
|
||||
role="group"
|
||||
aria-label={t("player.speed")}
|
||||
>
|
||||
{SPEEDS.map((value) => (
|
||||
<button
|
||||
key={value}
|
||||
type="button"
|
||||
onClick={() => onSpeed(value)}
|
||||
aria-pressed={speed === value}
|
||||
className={
|
||||
speed === value
|
||||
? "h-5 px-1.5 text-[10px] tabular-nums bg-muted text-foreground"
|
||||
: "h-5 px-1.5 text-[10px] tabular-nums text-muted-foreground/60 hover:text-foreground"
|
||||
}
|
||||
>
|
||||
{value}x
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AsciicastPlayer({ blob }: { blob: Blob }) {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const screenRef = useRef<HTMLDivElement>(null);
|
||||
const terminalRef = useRef<Terminal | null>(null);
|
||||
const recordingRef = useRef<Asciicast | null>(null);
|
||||
const positionRef = useRef(0);
|
||||
const eventIndexRef = useRef(0);
|
||||
const [position, setPosition] = useState(0);
|
||||
const [duration, setDuration] = useState(0);
|
||||
const [speed, setSpeed] = useState(1);
|
||||
const [playing, setPlaying] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
|
||||
const renderAt = useCallback((nextPosition: number) => {
|
||||
const terminal = terminalRef.current;
|
||||
const recording = recordingRef.current;
|
||||
if (!terminal || !recording) return;
|
||||
if (nextPosition < positionRef.current) {
|
||||
terminal.reset();
|
||||
terminal.resize(recording.width, recording.height);
|
||||
eventIndexRef.current = 0;
|
||||
}
|
||||
while (eventIndexRef.current < recording.events.length) {
|
||||
const [time, type, data] = recording.events[eventIndexRef.current];
|
||||
if (time > nextPosition) break;
|
||||
if (type === "o") terminal.write(data);
|
||||
if (type === "r") {
|
||||
const [cols, rows] = data.split("x").map(Number);
|
||||
if (cols > 0 && rows > 0) terminal.resize(cols, rows);
|
||||
}
|
||||
eventIndexRef.current++;
|
||||
}
|
||||
positionRef.current = nextPosition;
|
||||
setPosition(nextPosition);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const container = containerRef.current;
|
||||
const screen = screenRef.current;
|
||||
if (!container || !screen) return;
|
||||
const terminal = new Terminal({
|
||||
cursorBlink: false,
|
||||
disableStdin: true,
|
||||
convertEol: false,
|
||||
fontSize: 12,
|
||||
theme: { background: "#09090b" },
|
||||
});
|
||||
terminal.open(screen);
|
||||
terminalRef.current = terminal;
|
||||
// The recording keeps its own size, scaled down to fit the panel.
|
||||
const fit = () => {
|
||||
const width = screen.offsetWidth;
|
||||
const height = screen.offsetHeight;
|
||||
if (!width || !height) return;
|
||||
const scale = Math.min(
|
||||
1,
|
||||
container.clientWidth / width,
|
||||
container.clientHeight / height,
|
||||
);
|
||||
screen.style.transform = `scale(${scale})`;
|
||||
};
|
||||
const observer = new ResizeObserver(fit);
|
||||
observer.observe(container);
|
||||
observer.observe(screen);
|
||||
const resizeListener = terminal.onResize(() => requestAnimationFrame(fit));
|
||||
|
||||
blob
|
||||
.text()
|
||||
.then((source) => {
|
||||
const recording = parseAsciicast(source);
|
||||
recordingRef.current = recording;
|
||||
setDuration(recording.duration);
|
||||
terminal.resize(recording.width, recording.height);
|
||||
renderAt(0);
|
||||
})
|
||||
.catch((reason) => setError(getErrorMessage(reason, String(reason))));
|
||||
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
resizeListener.dispose();
|
||||
terminal.dispose();
|
||||
terminalRef.current = null;
|
||||
};
|
||||
}, [blob, renderAt]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!playing || !recordingRef.current) return;
|
||||
let frame = 0;
|
||||
let previous = performance.now();
|
||||
const tick = (now: number) => {
|
||||
const next = Math.min(
|
||||
duration,
|
||||
positionRef.current + ((now - previous) / 1000) * speed,
|
||||
);
|
||||
previous = now;
|
||||
renderAt(next);
|
||||
if (next >= duration) setPlaying(false);
|
||||
else frame = requestAnimationFrame(tick);
|
||||
};
|
||||
frame = requestAnimationFrame(tick);
|
||||
return () => cancelAnimationFrame(frame);
|
||||
}, [duration, playing, renderAt, speed]);
|
||||
|
||||
if (error) return <div className="p-4 text-xs text-destructive">{error}</div>;
|
||||
return (
|
||||
<div className="flex h-full min-h-0 min-w-0 flex-col overflow-hidden">
|
||||
<div
|
||||
ref={containerRef}
|
||||
className="min-h-0 min-w-0 flex-1 overflow-hidden bg-[#09090b] p-2"
|
||||
>
|
||||
<div ref={screenRef} className="w-max origin-top-left" />
|
||||
</div>
|
||||
<PlaybackControls
|
||||
playing={playing}
|
||||
position={position}
|
||||
duration={duration}
|
||||
speed={speed}
|
||||
onToggle={() => {
|
||||
if (!playing && position >= duration) renderAt(0);
|
||||
setPlaying((value) => !value);
|
||||
}}
|
||||
onSeek={renderAt}
|
||||
onSpeed={setSpeed}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function GuacamolePlayer({ blob }: { blob: Blob }) {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const recordingRef = useRef<Guacamole.SessionRecording | null>(null);
|
||||
const positionRef = useRef(0);
|
||||
const [position, setPosition] = useState(0);
|
||||
const [duration, setDuration] = useState(0);
|
||||
const [speed, setSpeed] = useState(1);
|
||||
const [playing, setPlaying] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
if (!containerRef.current) return;
|
||||
const recording = new Guacamole.SessionRecording(blob, 100);
|
||||
recordingRef.current = recording;
|
||||
const display = recording.getDisplay();
|
||||
const element = display.getElement();
|
||||
containerRef.current.replaceChildren(element);
|
||||
const fit = () => {
|
||||
const width = display.getWidth();
|
||||
if (width && containerRef.current) {
|
||||
display.scale(containerRef.current.clientWidth / width);
|
||||
}
|
||||
};
|
||||
const observer = new ResizeObserver(fit);
|
||||
observer.observe(containerRef.current);
|
||||
recording.onload = () => {
|
||||
setDuration(recording.getDuration() / 1000);
|
||||
fit();
|
||||
};
|
||||
recording.onprogress = (nextDuration) => setDuration(nextDuration / 1000);
|
||||
recording.onseek = (nextPosition) => {
|
||||
positionRef.current = nextPosition / 1000;
|
||||
setPosition(positionRef.current);
|
||||
};
|
||||
recording.onerror = setError;
|
||||
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
recording.abort();
|
||||
recordingRef.current = null;
|
||||
};
|
||||
}, [blob]);
|
||||
|
||||
useEffect(() => {
|
||||
const recording = recordingRef.current;
|
||||
if (!recording || !playing) return;
|
||||
recording.pause();
|
||||
let previous = performance.now();
|
||||
let nextPosition = positionRef.current;
|
||||
const interval = window.setInterval(() => {
|
||||
const now = performance.now();
|
||||
nextPosition = Math.min(
|
||||
duration,
|
||||
nextPosition + ((now - previous) / 1000) * speed,
|
||||
);
|
||||
previous = now;
|
||||
recording.seek(nextPosition * 1000);
|
||||
if (nextPosition >= duration) setPlaying(false);
|
||||
}, 100);
|
||||
return () => clearInterval(interval);
|
||||
}, [duration, playing, speed]);
|
||||
|
||||
if (error) return <div className="p-4 text-xs text-destructive">{error}</div>;
|
||||
return (
|
||||
<div className="flex h-full min-h-0 min-w-0 flex-col overflow-hidden">
|
||||
<div
|
||||
ref={containerRef}
|
||||
className="min-h-0 flex-1 overflow-hidden bg-black"
|
||||
/>
|
||||
<PlaybackControls
|
||||
playing={playing}
|
||||
position={position}
|
||||
duration={duration}
|
||||
speed={speed}
|
||||
onToggle={() => {
|
||||
const recording = recordingRef.current;
|
||||
if (!recording) return;
|
||||
if (!playing && position >= duration) recording.seek(0);
|
||||
setPlaying((value) => !value);
|
||||
}}
|
||||
onSeek={(nextPosition) => {
|
||||
recordingRef.current?.seek(nextPosition * 1000);
|
||||
positionRef.current = nextPosition;
|
||||
setPosition(nextPosition);
|
||||
}}
|
||||
onSpeed={setSpeed}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function SessionRecordingPlayer({
|
||||
log,
|
||||
blob,
|
||||
}: {
|
||||
log: SessionLogRecord;
|
||||
blob: Blob;
|
||||
}) {
|
||||
return log.format === "guacamole" ? (
|
||||
<GuacamolePlayer blob={blob} />
|
||||
) : (
|
||||
<AsciicastPlayer blob={blob} />
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import { Terminal } from "@xterm/xterm";
|
||||
|
||||
export type AsciicastEvent = [
|
||||
time: number,
|
||||
type: "i" | "o" | "r",
|
||||
data: string,
|
||||
];
|
||||
|
||||
export type Asciicast = {
|
||||
width: number;
|
||||
height: number;
|
||||
duration: number;
|
||||
events: AsciicastEvent[];
|
||||
};
|
||||
|
||||
export function parseAsciicast(source: string): Asciicast {
|
||||
const lines = source.trim().split("\n");
|
||||
const header = JSON.parse(lines.shift() || "{}") as {
|
||||
version?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
};
|
||||
if (header.version !== 2) throw new Error("Unsupported asciicast version");
|
||||
|
||||
const events = lines
|
||||
.filter(Boolean)
|
||||
.map((line) => JSON.parse(line) as AsciicastEvent)
|
||||
.filter(
|
||||
([time, type, data]) =>
|
||||
Number.isFinite(time) &&
|
||||
(type === "i" || type === "o" || type === "r") &&
|
||||
typeof data === "string",
|
||||
);
|
||||
|
||||
return {
|
||||
width: header.width || 80,
|
||||
height: header.height || 24,
|
||||
duration: events.at(-1)?.[0] || 0,
|
||||
events,
|
||||
};
|
||||
}
|
||||
|
||||
function writeAsync(terminal: Terminal, data: string): Promise<void> {
|
||||
return new Promise((resolve) => terminal.write(data, resolve));
|
||||
}
|
||||
|
||||
// Replays the recording into an offscreen terminal and reads back its
|
||||
// rendered buffer, so cursor movement/overwrites resolve the same way
|
||||
// they would on screen instead of leaving raw ANSI escapes in the text.
|
||||
export async function asciicastToPlainText(
|
||||
recording: Asciicast,
|
||||
): Promise<string> {
|
||||
const terminal = new Terminal({
|
||||
cols: recording.width,
|
||||
rows: recording.height,
|
||||
allowProposedApi: true,
|
||||
});
|
||||
|
||||
try {
|
||||
for (const [, type, data] of recording.events) {
|
||||
if (type === "o") await writeAsync(terminal, data);
|
||||
if (type === "r") {
|
||||
const [cols, rows] = data.split("x").map(Number);
|
||||
if (cols > 0 && rows > 0) terminal.resize(cols, rows);
|
||||
}
|
||||
}
|
||||
|
||||
const buffer = terminal.buffer.active;
|
||||
const lines: string[] = [];
|
||||
for (let i = 0; i < buffer.length; i++) {
|
||||
lines.push(buffer.getLine(i)?.translateToString(true) ?? "");
|
||||
}
|
||||
while (lines.length > 0 && lines.at(-1) === "") lines.pop();
|
||||
return lines.join("\n");
|
||||
} finally {
|
||||
terminal.dispose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { ScrollText } from "lucide-react";
|
||||
import type { TermixApp } from "@termix/plugin-sdk/frontend";
|
||||
import { SessionLogsPanel } from "./SessionLogsPanel";
|
||||
import { RecordingStatus } from "./RecordingStatus";
|
||||
|
||||
export function activate(app: TermixApp): void {
|
||||
app.registerRailItem({
|
||||
id: "session-logs",
|
||||
icon: ScrollText,
|
||||
titleKey: "nav.sessionLogs",
|
||||
kind: "panel",
|
||||
promotable: true,
|
||||
rightDockable: true,
|
||||
separatorAfter: true,
|
||||
permission: "view",
|
||||
});
|
||||
|
||||
app.registerPanel("session-logs", () => <SessionLogsPanel />);
|
||||
|
||||
app.registerTab("session-logs", () => <SessionLogsPanel />, {
|
||||
icon: ScrollText,
|
||||
titleKey: "nav.sessionLogs",
|
||||
hostless: true,
|
||||
});
|
||||
|
||||
app.registerSlotContribution("terminal.toolbarStatus", {
|
||||
actionId: "session-recording.terminalStatus",
|
||||
titleKey: "nav.sessionLogs",
|
||||
kind: "component",
|
||||
component: RecordingStatus,
|
||||
when: (context) => {
|
||||
const host = context.host as
|
||||
| { pluginSettings?: Record<string, Record<string, unknown>> }
|
||||
| undefined;
|
||||
const enabled =
|
||||
host?.pluginSettings?.["session-recording"]?.enableSessionRecording;
|
||||
return enabled !== false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function deactivate(): void {}
|
||||
@@ -0,0 +1,44 @@
|
||||
import type { PluginApiClient } from "@termix/plugin-sdk/frontend";
|
||||
|
||||
export type SessionLogRecord = {
|
||||
id: number;
|
||||
hostId: number;
|
||||
userId: string | null;
|
||||
startedAt: string;
|
||||
endedAt: string | null;
|
||||
duration: number | null;
|
||||
recordingPath: string | null;
|
||||
hostName: string | null;
|
||||
hostIp: string | null;
|
||||
sizeBytes: number | null;
|
||||
protocol: "ssh" | "rdp" | "vnc" | "telnet";
|
||||
format: "text" | "asciicast" | "guacamole";
|
||||
username: string | null;
|
||||
};
|
||||
|
||||
export function createSessionRecordingApi(api: PluginApiClient) {
|
||||
return {
|
||||
async list(): Promise<SessionLogRecord[]> {
|
||||
const response = await api.get<{ logs: SessionLogRecord[] }>("/");
|
||||
return response.data.logs;
|
||||
},
|
||||
|
||||
async getBlob(id: number): Promise<Blob> {
|
||||
const response = await api.get<Blob>(`/${id}/content`, {
|
||||
responseType: "blob",
|
||||
});
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getContent(id: number): Promise<string> {
|
||||
const response = await api.get<string>(`/${id}/content`, {
|
||||
responseType: "text",
|
||||
});
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async delete(id: number): Promise<void> {
|
||||
await api.delete(`/${id}`);
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
import http from "node:http";
|
||||
import type { AddressInfo } from "node:net";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import express, { type Router } from "express";
|
||||
import {
|
||||
createMockCtx,
|
||||
createTestDb,
|
||||
type MockPluginContext,
|
||||
type TestDb,
|
||||
} from "@termix/plugin-sdk/testing";
|
||||
import type { PluginHostSummary } from "@termix/plugin-sdk/backend";
|
||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
||||
import manifestJson from "../../manifest.json";
|
||||
|
||||
export const pluginDir = fileURLToPath(new URL("../..", import.meta.url));
|
||||
export const manifest = manifestJson as unknown as PluginManifest;
|
||||
|
||||
export function host(
|
||||
overrides: Partial<PluginHostSummary> = {},
|
||||
): PluginHostSummary {
|
||||
return {
|
||||
id: 7,
|
||||
userId: "user-1",
|
||||
name: "web",
|
||||
ip: "10.0.0.5",
|
||||
port: 22,
|
||||
username: "root",
|
||||
tags: null,
|
||||
folder: null,
|
||||
authType: "password",
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
export interface TestServer {
|
||||
db: TestDb;
|
||||
mock: MockPluginContext;
|
||||
request: (
|
||||
method: string,
|
||||
path: string,
|
||||
options?: { user?: string; body?: unknown },
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
) => Promise<{ status: number; body: any }>;
|
||||
requestBinary: (
|
||||
method: string,
|
||||
path: string,
|
||||
options?: { user?: string },
|
||||
) => Promise<{ status: number; body: ArrayBuffer; contentType: string }>;
|
||||
close: () => Promise<void>;
|
||||
}
|
||||
|
||||
export async function startServer(
|
||||
options: {
|
||||
permissions?: string[];
|
||||
users?: string[];
|
||||
hosts?: PluginHostSummary[];
|
||||
} = {},
|
||||
): Promise<TestServer> {
|
||||
const db = await createTestDb(pluginDir);
|
||||
for (const user of options.users ?? ["user-1", "user-2"]) {
|
||||
db.sqlite
|
||||
.prepare("INSERT INTO users (id, username) VALUES (?, ?)")
|
||||
.run(user, user);
|
||||
}
|
||||
for (const h of options.hosts ?? [host()]) {
|
||||
db.sqlite.prepare("INSERT INTO ssh_data (id) VALUES (?)").run(h.id);
|
||||
}
|
||||
|
||||
let router: Router | null = null;
|
||||
const mock = createMockCtx({
|
||||
pluginId: manifest.id,
|
||||
manifest,
|
||||
capabilities: manifest.capabilities,
|
||||
db: db.database,
|
||||
router: () => (router = express.Router()),
|
||||
permissions: options.permissions ?? ["session-recording.view"],
|
||||
hosts: options.hosts ?? [host()],
|
||||
});
|
||||
|
||||
const { activate } = await import("../../src/backend/index.js");
|
||||
await activate(mock.ctx);
|
||||
|
||||
const app = express();
|
||||
app.use(express.json());
|
||||
app.use((req, _res, next) => {
|
||||
mock.setActor(req.header("x-test-user") ?? undefined);
|
||||
next();
|
||||
});
|
||||
app.use((req, res, next) => router!(req, res, next));
|
||||
|
||||
const server = http.createServer(app);
|
||||
await new Promise<void>((resolve) => server.listen(0, resolve));
|
||||
const { port } = server.address() as AddressInfo;
|
||||
|
||||
return {
|
||||
db,
|
||||
mock,
|
||||
async request(method, path, { user = "user-1", body: given } = {}) {
|
||||
const body = method === "GET" ? undefined : given;
|
||||
const response = await fetch(`http://127.0.0.1:${port}${path}`, {
|
||||
method,
|
||||
headers: {
|
||||
"x-test-user": user,
|
||||
...(body !== undefined ? { "content-type": "application/json" } : {}),
|
||||
},
|
||||
body: body !== undefined ? JSON.stringify(body) : undefined,
|
||||
});
|
||||
const text = await response.text();
|
||||
return { status: response.status, body: text ? JSON.parse(text) : null };
|
||||
},
|
||||
async requestBinary(method, path, { user = "user-1" } = {}) {
|
||||
const response = await fetch(`http://127.0.0.1:${port}${path}`, {
|
||||
method,
|
||||
headers: { "x-test-user": user },
|
||||
});
|
||||
return {
|
||||
status: response.status,
|
||||
body: await response.arrayBuffer(),
|
||||
contentType: response.headers.get("content-type") ?? "",
|
||||
};
|
||||
},
|
||||
async close() {
|
||||
for (const dispose of [...mock.disposals].reverse()) await dispose();
|
||||
await new Promise<void>((resolve) => server.close(() => resolve()));
|
||||
db.close();
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { createTestDb, type TestDb } from "@termix/plugin-sdk/testing";
|
||||
import { pluginDir } from "./helpers";
|
||||
|
||||
// session_recordings as core's SQLite bootstrap created it before 2.9.0.
|
||||
const LEGACY_DDL = `
|
||||
CREATE TABLE session_recordings (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
host_id INTEGER NOT NULL,
|
||||
user_id TEXT,
|
||||
username TEXT,
|
||||
access_id INTEGER,
|
||||
started_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
ended_at TEXT,
|
||||
duration INTEGER,
|
||||
commands TEXT,
|
||||
dangerous_actions TEXT,
|
||||
recording_path TEXT,
|
||||
protocol TEXT NOT NULL DEFAULT 'ssh',
|
||||
format TEXT NOT NULL DEFAULT 'text',
|
||||
terminated_by_owner INTEGER DEFAULT 0,
|
||||
termination_reason TEXT,
|
||||
FOREIGN KEY (host_id) REFERENCES ssh_data (id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE SET NULL
|
||||
);
|
||||
`;
|
||||
|
||||
let db: TestDb | null = null;
|
||||
|
||||
afterEach(() => {
|
||||
db?.close();
|
||||
db = null;
|
||||
});
|
||||
|
||||
const tableExists = (name: string) =>
|
||||
!!db!.sqlite
|
||||
.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?")
|
||||
.get(name);
|
||||
|
||||
describe("adopting session_recordings", () => {
|
||||
it("keeps every existing row when the legacy table is there", async () => {
|
||||
db = await createTestDb(pluginDir, {
|
||||
before: (sqlite) => {
|
||||
sqlite.exec("INSERT INTO users (id) VALUES ('user-1')");
|
||||
sqlite.exec("INSERT INTO ssh_data (id) VALUES (7)");
|
||||
sqlite.exec(LEGACY_DDL);
|
||||
sqlite
|
||||
.prepare(
|
||||
"INSERT INTO session_recordings (host_id, user_id, username, recording_path, protocol, format) VALUES (?, ?, ?, ?, ?, ?)",
|
||||
)
|
||||
.run(
|
||||
7,
|
||||
"user-1",
|
||||
"user-1",
|
||||
"/data/session_logs/user-1/a.cast",
|
||||
"ssh",
|
||||
"asciicast",
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
expect(db.applied).toEqual(["0001_adopt_session_recordings"]);
|
||||
expect(tableExists("session_recordings")).toBe(false);
|
||||
expect(tableExists("p_session_recording_session_recordings")).toBe(true);
|
||||
|
||||
expect(
|
||||
db.sqlite
|
||||
.prepare(
|
||||
"SELECT host_id, user_id, recording_path, protocol, format FROM p_session_recording_session_recordings",
|
||||
)
|
||||
.all(),
|
||||
).toEqual([
|
||||
{
|
||||
host_id: 7,
|
||||
user_id: "user-1",
|
||||
recording_path: "/data/session_logs/user-1/a.cast",
|
||||
protocol: "ssh",
|
||||
format: "asciicast",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("creates the table fresh when there is no legacy one", async () => {
|
||||
db = await createTestDb(pluginDir);
|
||||
|
||||
expect(tableExists("session_recordings")).toBe(false);
|
||||
expect(tableExists("p_session_recording_session_recordings")).toBe(true);
|
||||
expect(
|
||||
db.sqlite
|
||||
.prepare("SELECT * FROM p_session_recording_session_recordings")
|
||||
.all(),
|
||||
).toEqual([]);
|
||||
});
|
||||
|
||||
it("cascades on host delete", async () => {
|
||||
db = await createTestDb(pluginDir, {
|
||||
before: (sqlite) => {
|
||||
sqlite.exec("INSERT INTO users (id) VALUES ('user-1')");
|
||||
sqlite.exec("INSERT INTO ssh_data (id) VALUES (7)");
|
||||
},
|
||||
});
|
||||
db.sqlite
|
||||
.prepare(
|
||||
"INSERT INTO p_session_recording_session_recordings (host_id, user_id, protocol, format) VALUES (?, ?, ?, ?)",
|
||||
)
|
||||
.run(7, "user-1", "ssh", "asciicast");
|
||||
|
||||
db.sqlite.exec("DELETE FROM ssh_data WHERE id = 7");
|
||||
|
||||
expect(
|
||||
db.sqlite
|
||||
.prepare("SELECT * FROM p_session_recording_session_recordings")
|
||||
.all(),
|
||||
).toEqual([]);
|
||||
});
|
||||
|
||||
it("keeps a row whose user was deleted, with userId cleared", async () => {
|
||||
db = await createTestDb(pluginDir, {
|
||||
before: (sqlite) => {
|
||||
sqlite.exec("INSERT INTO users (id) VALUES ('user-1')");
|
||||
sqlite.exec("INSERT INTO ssh_data (id) VALUES (7)");
|
||||
},
|
||||
});
|
||||
db.sqlite
|
||||
.prepare(
|
||||
"INSERT INTO p_session_recording_session_recordings (host_id, user_id, protocol, format) VALUES (?, ?, ?, ?)",
|
||||
)
|
||||
.run(7, "user-1", "ssh", "asciicast");
|
||||
|
||||
// userId is a plain column, not refUser(): deleting the user must not
|
||||
// cascade delete the row (the plugin clears userId itself on
|
||||
// user.deleted instead).
|
||||
db.sqlite.exec("DELETE FROM users WHERE id = 'user-1'");
|
||||
|
||||
expect(
|
||||
db.sqlite
|
||||
.prepare("SELECT host_id FROM p_session_recording_session_recordings")
|
||||
.all(),
|
||||
).toEqual([{ host_id: 7 }]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,149 @@
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { createTestDb, type TestDb } from "@termix/plugin-sdk/testing";
|
||||
import { pluginDir } from "./helpers";
|
||||
import { createSessionRecordingRepository } from "../../src/backend/repository";
|
||||
import { sessionRecordings } from "../../src/backend/tables";
|
||||
|
||||
let db: TestDb | null = null;
|
||||
|
||||
afterEach(() => {
|
||||
db?.close();
|
||||
db = null;
|
||||
});
|
||||
|
||||
const fakeHosts = {
|
||||
list: async () => [
|
||||
{
|
||||
id: 7,
|
||||
userId: "user-1",
|
||||
name: "web",
|
||||
ip: "10.0.0.5",
|
||||
port: 22,
|
||||
username: "root",
|
||||
tags: null,
|
||||
folder: null,
|
||||
authType: "password",
|
||||
},
|
||||
],
|
||||
get: async () => null,
|
||||
checkAccess: async () => ({
|
||||
hasAccess: false,
|
||||
isOwner: false,
|
||||
isShared: false,
|
||||
}),
|
||||
create: async () => {
|
||||
throw new Error("not used");
|
||||
},
|
||||
update: async () => null,
|
||||
listOwned: async () => [],
|
||||
share: async () => ({ hostId: 0, shared: false }),
|
||||
listUsers: async () => [],
|
||||
listRoles: async () => [],
|
||||
trackSession: () => () => {},
|
||||
recordActivity: async () => {},
|
||||
};
|
||||
|
||||
async function setup() {
|
||||
db = await createTestDb(pluginDir);
|
||||
db.sqlite
|
||||
.prepare("INSERT INTO users (id, username) VALUES (?, ?)")
|
||||
.run("user-1", "alice");
|
||||
db.sqlite.prepare("INSERT INTO ssh_data (id) VALUES (?)").run(7);
|
||||
const table = await db.database.define(sessionRecordings);
|
||||
return createSessionRecordingRepository(
|
||||
db.database,
|
||||
table,
|
||||
fakeHosts as never,
|
||||
);
|
||||
}
|
||||
|
||||
describe("session recording repository", () => {
|
||||
it("creates a row and reads it back by recordingPath", async () => {
|
||||
const repo = await setup();
|
||||
const row = await repo.create({
|
||||
hostId: 7,
|
||||
userId: "user-1",
|
||||
username: "alice",
|
||||
startedAt: new Date().toISOString(),
|
||||
recordingPath: "/data/session_logs/user-1/a.cast",
|
||||
protocol: "ssh",
|
||||
format: "asciicast",
|
||||
});
|
||||
|
||||
expect(row.id).toBeGreaterThan(0);
|
||||
expect(row.recordingPath).toBe("/data/session_logs/user-1/a.cast");
|
||||
expect(db!.persisted).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it("lists a user's recordings with host name and ip attached", async () => {
|
||||
const repo = await setup();
|
||||
await repo.create({
|
||||
hostId: 7,
|
||||
userId: "user-1",
|
||||
startedAt: new Date().toISOString(),
|
||||
recordingPath: "/data/session_logs/user-1/a.cast",
|
||||
protocol: "ssh",
|
||||
format: "asciicast",
|
||||
});
|
||||
|
||||
const rows = await repo.listByUserIdWithHost("user-1");
|
||||
expect(rows).toHaveLength(1);
|
||||
expect(rows[0].hostName).toBe("web");
|
||||
expect(rows[0].hostIp).toBe("10.0.0.5");
|
||||
});
|
||||
|
||||
it("finds and deletes only the owner's row", async () => {
|
||||
const repo = await setup();
|
||||
const row = await repo.create({
|
||||
hostId: 7,
|
||||
userId: "user-1",
|
||||
startedAt: new Date().toISOString(),
|
||||
recordingPath: "/data/session_logs/user-1/a.cast",
|
||||
protocol: "ssh",
|
||||
format: "asciicast",
|
||||
});
|
||||
|
||||
expect(await repo.findByIdForUser("user-2", row.id)).toBeNull();
|
||||
expect(await repo.deleteForUser("user-2", row.id)).toBe(false);
|
||||
expect(await repo.deleteForUser("user-1", row.id)).toBe(true);
|
||||
expect(await repo.findByIdForUser("user-1", row.id)).toBeNull();
|
||||
});
|
||||
|
||||
it("anonymizes a user's rows instead of deleting them", async () => {
|
||||
const repo = await setup();
|
||||
const row = await repo.create({
|
||||
hostId: 7,
|
||||
userId: "user-1",
|
||||
startedAt: new Date().toISOString(),
|
||||
recordingPath: "/data/session_logs/user-1/a.cast",
|
||||
protocol: "ssh",
|
||||
format: "asciicast",
|
||||
});
|
||||
|
||||
await repo.anonymizeByUserId("user-1");
|
||||
|
||||
const rows = await repo.listPathsOlderThan(
|
||||
new Date(Date.now() + 60_000).toISOString(),
|
||||
);
|
||||
expect(rows.map((r) => r.id)).toContain(row.id);
|
||||
expect(await repo.findByIdForUser("user-1", row.id)).toBeNull();
|
||||
});
|
||||
|
||||
it("lists recordings older than a cutoff for retention pruning", async () => {
|
||||
const repo = await setup();
|
||||
await repo.create({
|
||||
hostId: 7,
|
||||
userId: "user-1",
|
||||
startedAt: "2020-01-01T00:00:00.000Z",
|
||||
recordingPath: "/data/session_logs/user-1/old.cast",
|
||||
protocol: "ssh",
|
||||
format: "asciicast",
|
||||
});
|
||||
|
||||
const old = await repo.listPathsOlderThan("2021-01-01T00:00:00.000Z");
|
||||
expect(old).toHaveLength(1);
|
||||
|
||||
const none = await repo.listPathsOlderThan("2019-01-01T00:00:00.000Z");
|
||||
expect(none).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,179 @@
|
||||
import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import { startServer, type TestServer } from "./helpers";
|
||||
|
||||
let server: TestServer | null = null;
|
||||
let dataDir: string;
|
||||
|
||||
beforeEach(async () => {
|
||||
dataDir = await fs.mkdtemp(
|
||||
path.join(os.tmpdir(), "session-recording-routes-"),
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await server?.close();
|
||||
server = null;
|
||||
await fs.rm(dataDir, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
describe("session recording routes", () => {
|
||||
it("401s without an authenticated actor", async () => {
|
||||
server = await startServer();
|
||||
const res = await server.request("GET", "/", { user: "" });
|
||||
expect(res.status).toBe(401);
|
||||
});
|
||||
|
||||
it("lists only the caller's own recordings", async () => {
|
||||
server = await startServer();
|
||||
|
||||
const table = await server.mock.ctx.db.client<{
|
||||
insert: (t: unknown) => {
|
||||
values: (v: unknown) => Promise<unknown>;
|
||||
};
|
||||
}>();
|
||||
void table;
|
||||
|
||||
// Seed through the repository the way activate() wired it: easiest is a
|
||||
// direct HTTP round trip isn't available for writes (only ssh-terminal
|
||||
// and remote-desktop write through the service), so seed the table
|
||||
// directly.
|
||||
server.db.sqlite
|
||||
.prepare(
|
||||
`INSERT INTO p_session_recording_session_recordings
|
||||
(host_id, user_id, recording_path, protocol, format, started_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?)`,
|
||||
)
|
||||
.run(
|
||||
7,
|
||||
"user-1",
|
||||
"/tmp/a.cast",
|
||||
"ssh",
|
||||
"asciicast",
|
||||
new Date().toISOString(),
|
||||
);
|
||||
server.db.sqlite
|
||||
.prepare(
|
||||
`INSERT INTO p_session_recording_session_recordings
|
||||
(host_id, user_id, recording_path, protocol, format, started_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?)`,
|
||||
)
|
||||
.run(
|
||||
7,
|
||||
"user-2",
|
||||
"/tmp/b.cast",
|
||||
"ssh",
|
||||
"asciicast",
|
||||
new Date().toISOString(),
|
||||
);
|
||||
|
||||
const res = await server.request("GET", "/", { user: "user-1" });
|
||||
expect(res.status).toBe(200);
|
||||
expect(res.body.logs).toHaveLength(1);
|
||||
expect(res.body.logs[0].userId).toBe("user-1");
|
||||
});
|
||||
|
||||
it("404s getting another user's recording", async () => {
|
||||
server = await startServer();
|
||||
server.db.sqlite
|
||||
.prepare(
|
||||
`INSERT INTO p_session_recording_session_recordings
|
||||
(host_id, user_id, recording_path, protocol, format, started_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?)`,
|
||||
)
|
||||
.run(
|
||||
7,
|
||||
"user-2",
|
||||
"/tmp/b.cast",
|
||||
"ssh",
|
||||
"asciicast",
|
||||
new Date().toISOString(),
|
||||
);
|
||||
|
||||
const res = await server.request("GET", "/1", { user: "user-1" });
|
||||
expect(res.status).toBe(404);
|
||||
});
|
||||
|
||||
it("serves file content within the plugin's data directory", async () => {
|
||||
server = await startServer();
|
||||
const filePath = path.join(dataDir, "session_logs", "user-1", "a.cast");
|
||||
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
||||
await fs.writeFile(filePath, '{"version":2}\n[0,"o","hi"]\n');
|
||||
|
||||
server.db.sqlite
|
||||
.prepare(
|
||||
`INSERT INTO p_session_recording_session_recordings
|
||||
(host_id, user_id, recording_path, protocol, format, started_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?)`,
|
||||
)
|
||||
.run(7, "user-1", filePath, "ssh", "asciicast", new Date().toISOString());
|
||||
|
||||
// Point ctx.files.dataDir() at the temp dir for this request.
|
||||
(
|
||||
server.mock.ctx as unknown as {
|
||||
files: { dataDir: () => Promise<string> };
|
||||
}
|
||||
).files = { dataDir: async () => dataDir };
|
||||
|
||||
const res = await server.requestBinary("GET", "/1/content", {
|
||||
user: "user-1",
|
||||
});
|
||||
expect(res.status).toBe(200);
|
||||
expect(res.contentType).toContain("asciicast");
|
||||
});
|
||||
|
||||
it("refuses a path outside the plugin's data directory", async () => {
|
||||
server = await startServer();
|
||||
server.db.sqlite
|
||||
.prepare(
|
||||
`INSERT INTO p_session_recording_session_recordings
|
||||
(host_id, user_id, recording_path, protocol, format, started_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?)`,
|
||||
)
|
||||
.run(
|
||||
7,
|
||||
"user-1",
|
||||
"/etc/passwd",
|
||||
"ssh",
|
||||
"asciicast",
|
||||
new Date().toISOString(),
|
||||
);
|
||||
|
||||
(
|
||||
server.mock.ctx as unknown as {
|
||||
files: { dataDir: () => Promise<string> };
|
||||
}
|
||||
).files = { dataDir: async () => dataDir };
|
||||
|
||||
const res = await server.requestBinary("GET", "/1/content", {
|
||||
user: "user-1",
|
||||
});
|
||||
expect(res.status).toBe(403);
|
||||
});
|
||||
|
||||
it("deletes only the caller's own recording", async () => {
|
||||
server = await startServer();
|
||||
server.db.sqlite
|
||||
.prepare(
|
||||
`INSERT INTO p_session_recording_session_recordings
|
||||
(host_id, user_id, recording_path, protocol, format, started_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?)`,
|
||||
)
|
||||
.run(
|
||||
7,
|
||||
"user-1",
|
||||
"/tmp/a.cast",
|
||||
"ssh",
|
||||
"asciicast",
|
||||
new Date().toISOString(),
|
||||
);
|
||||
|
||||
const denied = await server.request("DELETE", "/1", { user: "user-2" });
|
||||
expect(denied.status).toBe(404);
|
||||
|
||||
const ok = await server.request("DELETE", "/1", { user: "user-1" });
|
||||
expect(ok.status).toBe(200);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,267 @@
|
||||
import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
createMockCtx,
|
||||
createTestDb,
|
||||
type MockPluginContext,
|
||||
type TestDb,
|
||||
} from "@termix/plugin-sdk/testing";
|
||||
import manifestJson from "../../manifest.json";
|
||||
import { pluginDir } from "./helpers";
|
||||
import { createSessionRecordingRepository } from "../../src/backend/repository";
|
||||
import { sessionRecordings } from "../../src/backend/tables";
|
||||
import { createRecordingsWriter } from "../../src/backend/service";
|
||||
|
||||
const manifest =
|
||||
manifestJson as unknown as import("@termix/plugin-sdk/manifest").PluginManifest;
|
||||
|
||||
let db: TestDb | null = null;
|
||||
let dataDir: string;
|
||||
|
||||
beforeEach(async () => {
|
||||
dataDir = await fs.mkdtemp(path.join(os.tmpdir(), "session-recording-"));
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
db?.close();
|
||||
db = null;
|
||||
await fs.rm(dataDir, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
async function setup(): Promise<{
|
||||
mock: MockPluginContext;
|
||||
writer: ReturnType<typeof createRecordingsWriter>;
|
||||
}> {
|
||||
db = await createTestDb(pluginDir);
|
||||
db.sqlite
|
||||
.prepare("INSERT INTO users (id, username) VALUES (?, ?)")
|
||||
.run("user-1", "alice");
|
||||
db.sqlite.prepare("INSERT INTO ssh_data (id) VALUES (?)").run(7);
|
||||
const table = await db.database.define(sessionRecordings);
|
||||
const hosts = {
|
||||
list: async () => [],
|
||||
get: async () => null,
|
||||
checkAccess: async () => ({
|
||||
hasAccess: false,
|
||||
isOwner: false,
|
||||
isShared: false,
|
||||
}),
|
||||
create: async () => {
|
||||
throw new Error("not used");
|
||||
},
|
||||
update: async () => null,
|
||||
listOwned: async () => [],
|
||||
share: async () => ({ hostId: 0, shared: false }),
|
||||
listUsers: async () => [],
|
||||
listRoles: async () => [],
|
||||
trackSession: () => () => {},
|
||||
recordActivity: async () => {},
|
||||
};
|
||||
const repo = createSessionRecordingRepository(
|
||||
db.database,
|
||||
table,
|
||||
hosts as never,
|
||||
);
|
||||
|
||||
const mock = createMockCtx({
|
||||
pluginId: manifest.id,
|
||||
manifest,
|
||||
capabilities: manifest.capabilities,
|
||||
db: db.database,
|
||||
});
|
||||
// Point ctx.files.dataDir() at a real temp dir for this test.
|
||||
(mock.ctx as unknown as { files: { dataDir: () => Promise<string> } }).files =
|
||||
{
|
||||
dataDir: async () => dataDir,
|
||||
};
|
||||
|
||||
const writer = createRecordingsWriter(mock.ctx, repo);
|
||||
return { mock, writer };
|
||||
}
|
||||
|
||||
describe("recordings.writer", () => {
|
||||
it("is null when the host has recording switched off", async () => {
|
||||
const { mock, writer } = await setup();
|
||||
await mock.ctx.settings.setHost(7, "enableSessionRecording", false);
|
||||
|
||||
const sink = await writer.open({
|
||||
sessionId: "s1",
|
||||
hostId: 7,
|
||||
userId: "user-1",
|
||||
protocol: "ssh",
|
||||
format: "asciicast",
|
||||
startedAt: Date.now(),
|
||||
});
|
||||
|
||||
expect(sink).toBeNull();
|
||||
expect(await writer.enabledFor(7)).toBe(false);
|
||||
expect(await fs.readdir(dataDir)).toEqual([]);
|
||||
expect(
|
||||
db!.sqlite
|
||||
.prepare(
|
||||
"SELECT COUNT(*) AS count FROM p_session_recording_session_recordings",
|
||||
)
|
||||
.get(),
|
||||
).toEqual({ count: 0 });
|
||||
});
|
||||
|
||||
it("keeps a saved off switch after recreating the writer without affecting another host", async () => {
|
||||
const { mock } = await setup();
|
||||
db!.sqlite.prepare("INSERT INTO ssh_data (id) VALUES (?)").run(8);
|
||||
await mock.ctx.settings.setHost(7, "enableSessionRecording", false);
|
||||
await mock.ctx.settings.setHost(8, "enableSessionRecording", true);
|
||||
const table = await db!.database.define(sessionRecordings);
|
||||
const repository = createSessionRecordingRepository(
|
||||
db!.database,
|
||||
table,
|
||||
mock.ctx.hosts,
|
||||
);
|
||||
const reopened = createRecordingsWriter(mock.ctx, repository);
|
||||
for (const hostId of [7, 8]) {
|
||||
const sink = await reopened.open({
|
||||
sessionId: `host-${hostId}`,
|
||||
hostId,
|
||||
userId: "user-1",
|
||||
protocol: "ssh",
|
||||
format: "asciicast",
|
||||
startedAt: Date.now(),
|
||||
});
|
||||
if (hostId === 7) expect(sink).toBeNull();
|
||||
else {
|
||||
expect(sink).not.toBeNull();
|
||||
await sink!.append("marker\n");
|
||||
}
|
||||
}
|
||||
expect(
|
||||
await fs.readdir(path.join(dataDir, "session_logs", "user-1")),
|
||||
).toEqual(["host-8.cast"]);
|
||||
expect(
|
||||
db!.sqlite
|
||||
.prepare("SELECT host_id FROM p_session_recording_session_recordings")
|
||||
.all(),
|
||||
).toEqual([{ host_id: 8 }]);
|
||||
});
|
||||
|
||||
it("writes the first append with writeFile and later ones with appendFile", async () => {
|
||||
const { writer } = await setup();
|
||||
const sink = await writer.open({
|
||||
sessionId: "s1",
|
||||
hostId: 7,
|
||||
userId: "user-1",
|
||||
protocol: "ssh",
|
||||
format: "asciicast",
|
||||
startedAt: Date.now(),
|
||||
});
|
||||
expect(sink).not.toBeNull();
|
||||
|
||||
await sink!.append("chunk-one\n");
|
||||
await sink!.append("chunk-two\n");
|
||||
|
||||
const filePath = path.join(dataDir, "session_logs", "user-1", "s1.cast");
|
||||
const content = await fs.readFile(filePath, "utf-8");
|
||||
expect(content).toBe("chunk-one\nchunk-two\n");
|
||||
});
|
||||
|
||||
it("persist writes the summary onto the row", async () => {
|
||||
const { writer } = await setup();
|
||||
const sink = await writer.open({
|
||||
sessionId: "s1",
|
||||
hostId: 7,
|
||||
userId: "user-1",
|
||||
protocol: "ssh",
|
||||
format: "asciicast",
|
||||
startedAt: Date.now(),
|
||||
});
|
||||
await sink!.append("x\n");
|
||||
|
||||
const endedAt = Date.now();
|
||||
await sink!.persist({
|
||||
endedAt,
|
||||
durationSeconds: 42,
|
||||
terminatedByOwner: true,
|
||||
terminationReason: null,
|
||||
});
|
||||
|
||||
// Not thrown means it wrote successfully; deeper row assertions belong
|
||||
// to repository.test.ts.
|
||||
});
|
||||
|
||||
it("discard removes the row and further writes are no-ops", async () => {
|
||||
const { writer } = await setup();
|
||||
const sink = await writer.open({
|
||||
sessionId: "s1",
|
||||
hostId: 7,
|
||||
userId: "user-1",
|
||||
protocol: "ssh",
|
||||
format: "asciicast",
|
||||
startedAt: Date.now(),
|
||||
});
|
||||
|
||||
sink!.discard();
|
||||
await sink!.append("should not write");
|
||||
|
||||
const filePath = path.join(dataDir, "session_logs", "user-1", "s1.cast");
|
||||
await expect(fs.access(filePath)).rejects.toThrow();
|
||||
});
|
||||
|
||||
it("createFinished inserts a row for an already-written recording", async () => {
|
||||
const { writer } = await setup();
|
||||
const row = await writer.createFinished({
|
||||
hostId: 7,
|
||||
userId: "user-1",
|
||||
startedAt: new Date().toISOString(),
|
||||
endedAt: new Date().toISOString(),
|
||||
duration: 10,
|
||||
recordingPath: "/data/session_recordings/guacamole/x.guac",
|
||||
protocol: "rdp",
|
||||
format: "guacamole",
|
||||
});
|
||||
|
||||
expect(row.id).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it("createFinished moves guacd's file under the data folder, where playback reads it", async () => {
|
||||
const { mock, writer } = await setup();
|
||||
const guacdDir = await fs.mkdtemp(path.join(os.tmpdir(), "guacd-"));
|
||||
const source = path.join(guacdDir, "guacamole", "rdp-1.guac");
|
||||
await fs.mkdir(path.dirname(source), { recursive: true });
|
||||
await fs.writeFile(source, "4.size,1.0;");
|
||||
|
||||
const row = await writer.createFinished({
|
||||
hostId: 7,
|
||||
userId: "user-1",
|
||||
startedAt: new Date().toISOString(),
|
||||
endedAt: new Date().toISOString(),
|
||||
duration: 10,
|
||||
recordingPath: source,
|
||||
protocol: "rdp",
|
||||
format: "guacamole",
|
||||
});
|
||||
|
||||
const target = path.join(
|
||||
await mock.ctx.files.dataDir(),
|
||||
"session_recordings",
|
||||
"guacamole",
|
||||
"rdp-1.guac",
|
||||
);
|
||||
await expect(fs.readFile(target, "utf8")).resolves.toBe("4.size,1.0;");
|
||||
await expect(fs.access(source)).rejects.toThrow();
|
||||
const stored = db!.sqlite
|
||||
.prepare(
|
||||
"SELECT recording_path FROM p_session_recording_session_recordings WHERE id = ?",
|
||||
)
|
||||
.get(row.id) as { recording_path: string };
|
||||
expect(stored.recording_path).toBe(target);
|
||||
await fs.rm(guacdDir, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
it("enabledFor follows the host's recording switch", async () => {
|
||||
const { mock, writer } = await setup();
|
||||
await mock.ctx.settings.setHost(7, "enableSessionRecording", true);
|
||||
await expect(writer.enabledFor(7)).resolves.toBe(true);
|
||||
await mock.ctx.settings.setHost(7, "enableSessionRecording", false);
|
||||
await expect(writer.enabledFor(7)).resolves.toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,71 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import type { PluginApiClient } from "@termix/plugin-sdk/frontend";
|
||||
import {
|
||||
renderWithApp,
|
||||
type RenderedPluginApp,
|
||||
} from "@termix/plugin-sdk/testing";
|
||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
||||
import * as plugin from "../../src/frontend/index";
|
||||
import manifestJson from "../../manifest.json";
|
||||
import locales from "../../locales/en.json";
|
||||
|
||||
const manifest = manifestJson as unknown as PluginManifest;
|
||||
|
||||
let rendered: RenderedPluginApp | null = null;
|
||||
|
||||
afterEach(async () => {
|
||||
await rendered?.deactivate();
|
||||
rendered = null;
|
||||
});
|
||||
|
||||
function stubApi(overrides: Partial<PluginApiClient> = {}): PluginApiClient {
|
||||
return {
|
||||
get: vi.fn(async () => ({ data: { logs: [] } })),
|
||||
post: vi.fn(async () => ({ data: {} })),
|
||||
put: vi.fn(async () => ({ data: {} })),
|
||||
patch: vi.fn(async () => ({ data: {} })),
|
||||
delete: vi.fn(async () => ({ data: {} })),
|
||||
...overrides,
|
||||
} as PluginApiClient;
|
||||
}
|
||||
|
||||
describe(`${manifest.id} activate`, () => {
|
||||
it("registers only views its manifest declares", async () => {
|
||||
rendered = await renderWithApp(plugin, {
|
||||
manifest,
|
||||
locales,
|
||||
api: stubApi(),
|
||||
});
|
||||
|
||||
expect(rendered.registered.tabs()).toEqual(["session-logs"]);
|
||||
expect(rendered.registered.panels()).toEqual(["session-logs"]);
|
||||
expect(rendered.registered.railItems()).toEqual([
|
||||
expect.objectContaining({ id: "session-logs" }),
|
||||
]);
|
||||
expect(rendered.registered.slot("terminal.toolbarStatus")).toEqual([
|
||||
"session-recording.terminalStatus",
|
||||
]);
|
||||
});
|
||||
|
||||
it("removes everything it registered on deactivate", async () => {
|
||||
const app = await renderWithApp(plugin, {
|
||||
manifest,
|
||||
locales,
|
||||
api: stubApi(),
|
||||
});
|
||||
await app.deactivate();
|
||||
expect(app.registered.tabs()).toEqual([]);
|
||||
expect(app.registered.panels()).toEqual([]);
|
||||
expect(app.registered.railItems()).toEqual([]);
|
||||
});
|
||||
|
||||
it("renders the panel without crashing", async () => {
|
||||
rendered = await renderWithApp(plugin, {
|
||||
manifest,
|
||||
locales,
|
||||
api: stubApi(),
|
||||
});
|
||||
const element = rendered.renderPanel("session-logs");
|
||||
expect(element).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { parseAsciicast } from "../../src/frontend/asciicast";
|
||||
|
||||
describe("parseAsciicast", () => {
|
||||
it("parses terminal dimensions and timed input/output", () => {
|
||||
const recording = parseAsciicast(
|
||||
'{"version":2,"width":120,"height":30}\n[0.1,"o","hello"]\n[1.5,"i","ls\\r"]\n[2,"r","100x40"]\n',
|
||||
);
|
||||
expect(recording.width).toBe(120);
|
||||
expect(recording.height).toBe(30);
|
||||
expect(recording.duration).toBe(2);
|
||||
expect(recording.events).toHaveLength(3);
|
||||
});
|
||||
|
||||
it("rejects unsupported recording versions", () => {
|
||||
expect(() => parseAsciicast('{"version":1}\n')).toThrow(
|
||||
"Unsupported asciicast version",
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "@termix/plugin-sdk/tsconfig.plugin.json",
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx", "tests/**/*.ts", "tests/**/*.tsx"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { pluginVitestConfig } from "@termix/plugin-sdk/vitest-preset";
|
||||
|
||||
export default pluginVitestConfig(import.meta.url);
|
||||
Reference in new issue
Block a user