Commit Graph
21 Commits
Author SHA1 Message Date
ssongliu 89bd32b6d4 fix(terminal): isolate persistent shortcut sessions (#13810) 2026-09-15 10:05:16 +08:00
ssongliu a15e77d605 fix: harden terminal session lifecycle (#13736) 2026-09-08 09:29:01 +08:00
HynoR 81b72d9b7d feat: Implement server-side SSH session persistence and recovery (#13707)
* feat(terminal): keep ssh sessions alive server-side with reattach

Split the terminal ws handling into a Session (pty + ssh backend) and an
Attachment (one websocket). A session outlives its websocket: a clean close
(1000) ends the pty, any other disconnect keeps it for a 30-minute grace
period and it can be reattached via `?session=<id>`. Output goes through a
fixed 128KB ring buffer so a reattaching client gets the recent tail, with a
truncation marker if it fell behind. Sessions are owner-scoped; a second
attachment kicks the first (4409), unknown ids get 4404.

New endpoints under /hosts/terminal/sessions (search, close) let the
frontend list and recover sessions after a tab or browser is closed.

* feat(terminal): floating terminal dock with session recovery

Terminals now live in a layout-level host and are teleported into whichever
view shows them, so leaving the terminal page no longer kills them. A dock
handle on the right edge opens a non-modal dialog from any page with every
live session, a picker for local shell / ssh hosts, minimize, and
close-all. On page load the store recovers sessions the server still holds,
so an accidentally closed tab or browser can resume within the grace period.
The menu-tab label shows the live session count.

* fix(terminal): page re-claims its slots under a locked menu tab

With the terminal menu tab locked (keep-alive), leaving the page deactivates
it instead of unmounting it, so the slot ref callback never re-runs on
return. After the dock had taken the Terminal over and released it, nobody
claimed it for the page again and it stayed parked in the hidden host.

Claim/release slots explicitly on mount, activated, deactivated and unmount,
the same ownership rule the dock uses, instead of relying on the ref callback.

* fix(terminal): logout closes every kept-alive terminal session

A logged-out panel has nobody watching it, so nothing it left running should
survive: core now tells the local agent to close all terminal sessions when the
user logs out, changes the password, or changes the bind domain. Until now the
teardown relied on the logging-out tab sending close code 1000; a second tab or
a websocket held outside the SPA kept its shell after logout.

Agent: terminal.CloseAll and POST /hosts/terminal/sessions/closeAll.
Core: LogOut / deleteCurrentSession / BindDomain call it via proxy_local,
best effort.

* fix(terminal): pin a local shell to the node it was opened on

The node a local shell connects to was resolved from the current node every
time the websocket was built, so after switching nodes a reconnect carried the
old session id to the new node (4404) and then opened a shell there instead.
Store the operateNode on the entry when it is created; ssh shells keep going to
the master. Shells on a non-master node get the node name in their title so a
restore in another node's view can tell them apart.
2026-09-07 15:01:35 +08:00
王贺 a3f8c30508 fix api annotations (#12915)
* fix api annotations

* complete 1panel api docs

* add operation logs for api docs
2026-06-02 15:11:43 +08:00
ssongliu 2c21bd7286 fix: handle stream auth responses (#12693) 2026-05-21 12:37:33 +08:00
ssongliu a917ca00a1 feat: refactor auth and xpack integration 2026-05-21 12:32:52 +08:00
王贺 394339d7dc feat: support mongodb management (#12486)
#### What this PR does / why we need it?

Refs https://github.com/1Panel-dev/1Panel/issues/7759

#### Summary of your change

#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2026-04-14 10:40:44 +00:00
ssongliu c2f0c8c6ac feat: add ai terminal settings (#12215) 2026-03-19 07:25:19 +00:00
KOMATA e32a11910e fix: adjust WebSocket buffer sizes in terminal and host API (#11094) 2025-11-27 11:22:33 +08:00
ssongliu a33b17d5da feat: Support database terminal operations (#10407)
Refs #9538
2025-09-18 10:08:03 +00:00
CityFun a74c6dd522 feat: Add installation support for Redis Cluster (#9561) 2025-07-18 03:41:23 +00:00
ssongliu 32b9b3f31f fix: Merge dev code up to pr-8598 (#8602) 2025-05-12 15:59:45 +08:00
3b6bb9bd22 feat: File management optimization (#8452)
Refs: #3545 #3387
2025-04-22 09:11:06 +00:00
ssongliu 5a1e010788 fix: Modify the terminal connection method (#8415) 2025-04-17 14:26:23 +00:00
ssongliu 9ffc601cf0 feat: Change the local connection mode of the terminal (#8409) 2025-04-16 17:37:07 +08:00
ssongliu c59105f050 feat: Encapsulate command execution methods (#8401) 2025-04-15 22:15:18 +08:00
ssongliu 47d8c405dd fix: Merge dev code up to pr #8141 (#8147) 2025-03-14 10:08:31 +08:00
ssongliu 90eca45347 feat: Merge code of gpu from dev (#7982) 2025-02-24 18:48:47 +08:00
ssongliu 8283cd7d02 feat: adjust internationalization errors and the positions of global … (#7767) 2025-01-24 03:00:07 +00:00
ssongliu 37df602ae8 feat: 提取分组及快速命令功能 (#6169) 2024-08-19 10:04:43 +00:00
zhengkunwang b359c7d990 feat: 创建 PHP 运行环境网站支持同步创建数据库 (#6051) 2024-08-07 05:52:34 +00:00