tabby-group-server-stats 1.7.3 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,11 @@
1
1
  # 打包、本地测试与发布
2
2
 
3
- 本文面向 `tabby-group-server-stats 1.7.3` 的维护者。源码目录为 `D:\tabby-group-server-stats`;功能与预设说明见 [中文 README](README.md) / [English README](README.en.md)。
3
+ 本文面向 `tabby-group-server-stats 1.7.5` 的维护者。源码目录为 `D:\tabby-group-server-stats`;功能与预设说明见 [中文 README](README.md) / [English README](README.en.md)。
4
4
 
5
+ 1.7.5 增加分屏模式菜单、独立复制标签组和子标签、单标签悬停弹窗、容量千位分隔符,以及中英离线 PDF 教程。默认指标调整为内存、网络、CPU 负载;升级保留已有自定义配置。打包时须确认 `docs/tutorial.zh-CN.pdf` 与 `docs/tutorial.en.pdf` 均包含在归档中。
6
+
7
+ 1.7.4 增加布局分屏独立范围与持久化底栏开关,组编辑默认折叠,改进标签卡片与删除确认,并统一 GB 单位显示。个人布局启动命令不包含在插件包中。
8
+
5
9
  1.7.3 统一 fork 作者和维护者为 lishuainan0209,加入预设重复添加保护,并完善中英文搜索元数据与安装说明;保留上游 MIT 版权与贡献声明,包含 1.7.2 的显示修正。
6
10
 
7
11
  1.7.0 增加 GitHub 预设导入、内置项持久化排序、清晰分区与卡片边框、紧凑组分隔,并更新磁盘汇总、登录会话名单、双向网络速率及累计量和默认颜色阈值。版本号不表示已经推送或发布。
@@ -46,10 +50,10 @@ TypeScript、Angular 和 Webpack 使用项目内依赖,不需要全局安装
46
50
  ```powershell
47
51
  npm.cmd pack --dry-run
48
52
  npm.cmd pack
49
- tar -tf .\tabby-group-server-stats-1.7.3.tgz
53
+ tar -tf .\tabby-group-server-stats-1.7.5.tgz
50
54
  ```
51
55
 
52
- `prepack` 自动执行类型检查、普通测试和正式构建;任一失败会阻止打包。浏览器测试需另外运行。产物为 `tabby-group-server-stats-1.7.3.tgz`,后续本地验收与发布应使用同一份已检查的包。[npm pack 文档](https://docs.npmjs.com/cli/v11/commands/npm-pack/)
56
+ `prepack` 自动执行类型检查、普通测试和正式构建;任一失败会阻止打包。浏览器测试需另外运行。产物为 `tabby-group-server-stats-1.7.5.tgz`,后续本地验收与发布应使用同一份已检查的包。[npm pack 文档](https://docs.npmjs.com/cli/v11/commands/npm-pack/)
53
57
 
54
58
  确认包内包含:
55
59
 
@@ -72,7 +76,7 @@ Tabby 1.0.238 在发现 `Tabby.exe` 同级的 `data` 目录时将用户数据放
72
76
  ```powershell
73
77
  Set-Location -LiteralPath 'D:\tabby-group-server-stats'
74
78
  $testRoot = Join-Path (Get-Location).Path 'work\tabby-portable-test'
75
- $archive = (Resolve-Path -LiteralPath '.\tabby-group-server-stats-1.7.3.tgz').Path
79
+ $archive = (Resolve-Path -LiteralPath '.\tabby-group-server-stats-1.7.5.tgz').Path
76
80
 
77
81
  if (-not (Test-Path -LiteralPath (Join-Path $testRoot 'Tabby.exe'))) {
78
82
  throw '请先将 Tabby 便携版解压到测试目录。'
@@ -127,7 +131,7 @@ npm.cmd whoami --registry=https://registry.npmjs.org/
127
131
  验收通过后,手动发布刚才测试的同一个包:
128
132
 
129
133
  ```powershell
130
- npm.cmd publish .\tabby-group-server-stats-1.7.3.tgz --access public --registry=https://registry.npmjs.org/
134
+ npm.cmd publish .\tabby-group-server-stats-1.7.5.tgz --access public --registry=https://registry.npmjs.org/
131
135
  npm.cmd view tabby-group-server-stats version dist.tarball --registry=https://registry.npmjs.org/
132
136
  ```
133
137
 
package/README.en.md CHANGED
@@ -2,10 +2,12 @@
2
2
 
3
3
  [中文](README.md) | English
4
4
 
5
- SSH server monitoring for [Tabby](https://github.com/Eugeny/tabby): CPU load, memory, disk capacity, network rates and GPU memory metrics. Add custom shell commands, hover details and metric groups with overview, carousel or static layouts. The current version is **1.7.3**, adding duplicate-preset protection while retaining compact rows, three-decimal MB/s rates and aligned capacity columns.
5
+ SSH server monitoring for [Tabby](https://github.com/Eugeny/tabby): CPU load, memory, disk capacity, network rates and GPU memory metrics. Add custom shell commands, hover details and metric groups with overview, carousel or static layouts. The current source version is **1.7.5**, adding per-pane display menus, group/child duplication, capacity thousands separators and offline PDF tutorials.
6
6
 
7
7
  Fork author and maintainer: [lishuainan0209](https://github.com/lishuainan0209). This is an MIT-licensed fork of [Akkariin's tabby-server-stats](https://github.com/kasuganosoras/tabby-server-stats). The version number alone does not mean that the package has been published to npm.
8
8
 
9
+ **1.7.5 updates:** built-ins now comprise memory, network and CPU load. Choosing a group mode from a pane's lower-left menu also shows its bar and saves both choices. Standalone hover details open above the bar, and redundant white name tooltips are removed.
10
+
9
11
  **The SSH hotfix from 1.6.1 is retained.** Previously, oversized SSH execution requests could disconnect the entire connection when many metrics were enabled. A fixed short command now receives the script through standard input in 8 KiB chunks, retaining the bounded completion acknowledgment. Transfer failures close only the statistics channel, without deliberately closing the terminal session or automatically rerunning user commands.
10
12
 
11
13
  ![Offline preset library](docs/images/preset-library.png)
@@ -19,22 +21,31 @@ The preview uses example configuration data and the Chinese interface.
19
21
  - **Metric groups:** one main label and multiple children, with overview, carousel, horizontal static and vertical static displays.
20
22
  - **Independent switches:** disable a standalone label, an entire group, its main label or individual children without deleting commands or color rules.
21
23
  - **Connection scopes:** select saved connections or layouts; each pane in a mixed layout retains its own connection identity.
22
- - **Editable, reorderable built-ins:** customize CPU, memory, disk and network definitions, move them up or down in both panels, or restore one built-in's defaults.
24
+ - **Editable, reorderable built-ins:** customize memory, network and CPU load, move them up or down in the bottom bar, or restore one built-in's defaults.
25
+ - **Independent copies:** duplicate an entire group or a child within its group, then adjust device paths, GPU indices and commands.
26
+ - **Per-pane display menus:** choose Show, Hide, Overview, Carousel or Static from a vertical lower-left menu; choosing a mode also shows the bar, and each pane remembers its selection.
27
+ - **Offline PDF manuals:** a highlighted **Tutorial (PDF)** button opens the Chinese or English manual with the system's default PDF application, covering pane menus, label editing, presets and a disk-group walkthrough.
23
28
  - **Offline and GitHub library:** 20 bundled presets—12 standalone labels and 8 groups—with imports from this fork, JSON import/export and search; repeated clicks do not add another copy of an existing preset.
24
29
  - **Clear section and card borders:** separate built-ins, presets, standalone labels and groups; compact line separators between displayed groups.
25
30
  - **English/Chinese UI and 26 original monitoring icons:** searchable categories, existing icon support and custom SVGs.
26
31
 
27
- The bottom bar and floating panel share the same label renderer. Built-ins use the same checks, colors, scopes and details as custom metrics.
32
+ Display is fixed to the bottom status bar, with an enable switch in settings. Legacy floating-panel preferences automatically use the bottom bar. Built-ins use the same checks, colors, scopes and details as custom metrics. Standalone details open above the bar without widening it. Group overview/carousel popups and static hover behavior retain their existing rules.
28
33
 
29
34
  ## Create a label
30
35
 
31
- Open Tabby Settings → Server Stats, then choose **Add single label**, or find a library preset and click **Add**. Importing from GitHub or JSON loads choices into the library; adding a preset puts it into the active configuration. Use the pencil button to edit an existing item. Within a group, each main/child label opens its own editor.
36
+ Open Tabby Settings → Bottom Status Bar, then choose **Add single label**, or find a library preset and click **Add**. Importing from GitHub or JSON loads choices into the library; adding a preset puts it into the active configuration. Use the pencil button to edit an existing item. Within a group, each main/child label opens its own editor.
37
+
38
+ To get started, click the highlighted **Tutorial (PDF)** button at the top of settings. The complete manual ships with the plugin for offline use and opens in the system's default PDF application, choosing Chinese or English from the interface language. It starts with the lower-left menu, built-ins and standalone labels, then walks through finding mount points and configuring system/data disks and an aggregate value. Continue with copies, enable switches, colors, display scopes, preset import/export and troubleshooting. You can also read the [English PDF](docs/tutorial.en.pdf) or [中文 PDF](docs/tutorial.zh-CN.pdf) directly.
39
+
40
+ Group cards place the main label and child labels on separate adjacent rows. The group's pencil button opens its editor with every member collapsed; clicking a bordered label button opens that member directly. Delete buttons sit at the lower right of their cards and ask for confirmation with the item's name. Deleting a child takes effect only after saving the whole group.
41
+
42
+ Click a group card's **Duplicate** button to create and save an independent copy immediately after it, then open that copy for editing. Commands, scopes, styling and enabled states are retained, while the group and every member receive new IDs. Editing the copy does not change its source. Inside the group editor, a child's **Duplicate** button inserts a copy after that child and opens its editor; this remains a draft until you save the whole group. Deliberate copies do not retain the source preset's duplicate-detection identity, unlike repeatedly clicking **Add** in the library.
32
43
 
33
44
  New labels default to **text** and checks default to **output-text comparison**. Configure commands in this order:
34
45
 
35
46
  1. **Object check, optional:** compare trimmed standard output or an expected exit code. Without a check, the primary command runs directly.
36
47
  2. **Shell command:** periodically collects the primary value.
37
- 3. **Hover detail command, optional:** appends information while hovered and collapses on mouse leave. An empty command makes no detail request.
48
+ 3. **Hover detail command, optional:** a standalone label opens its primary value and details in a popup above the bar, closing on mouse leave. An empty command makes no detail request. Group members expand according to the group's display mode.
38
49
 
39
50
  For a separate filesystem mounted at `/data2`:
40
51
 
@@ -57,7 +68,7 @@ Details follow the label's refresh interval, or the global interval when unset:
57
68
 
58
69
  ## Groups and visibility
59
70
 
60
- Group names appear in the hover popup, without a repeated prefix in the status bar. The main label is flush left, children are indented, and popup names, values and details align in columns. Thin separators and smaller gaps between groups conserve status-bar width.
71
+ Group names appear in the hover popup, without a repeated prefix in the status bar. The main label is flush left, children are indented, and popup names, values and details align in columns. Capacity numbers have thousands separators, such as `7,912 GB`. In details such as `433.9/8,786.0 GB`, each side of the slash is independently right-aligned, retaining the original decimal precision and raw values for color rules. Thin separators and smaller gaps between groups conserve status-bar width.
61
72
 
62
73
  - **Overview:** shows the main label; hover opens the full group vertically with details.
63
74
  - **Carousel:** rotates through child labels; hover pauses rotation and opens the full group. Skipped children do not consume extra rotation periods.
@@ -79,13 +90,17 @@ Disabling the main label does not disable its children. Disabling one child leav
79
90
 
80
91
  ## Editable built-ins
81
92
 
82
- CPU, memory and disk are standalone labels. Network is a vertical static group with download/upload children; its main label starts disabled. All use the common commands, checks, details, scopes and color rules rather than a separate hardcoded chart collector.
93
+ New configurations have only three built-ins: **memory, network and CPU load**. Memory is a standalone label. Network is a vertical static group with download/upload children; its main label starts disabled. CPU load is an overview group with runnable/total thread counts as its main value and 1min/5min load percentages normalized by logical processor count as children. All use the common commands, checks, details, scopes and color rules rather than a separate hardcoded chart collector.
83
94
 
84
- Use each card's up/down buttons to reorder CPU, memory, disk and network. The order is persisted in `builtinOrder`, shared by the bottom bar and floating panel, and retained after restarting. Custom labels and groups retain their existing relative order.
95
+ During upgrades, enabled legacy CPU/disk built-ins and edited overrides are preserved as ordinary standalone labels, retaining commands, scopes and enabled states. Existing custom CPU-load groups stay in place; when an existing group is recognized as that preset, the new built-in CPU-load group starts disabled to avoid duplicate displays.
85
96
 
86
- **Restore defaults** removes only the selected built-in's override, preserving its top-level enable switch and ordering, and leaving other built-ins and custom labels untouched. Restoring network resets that group's main/child definitions to their factory configuration.
97
+ Use each card's up/down buttons to reorder memory, network and CPU load. The order is persisted in `builtinOrder` and retained after restarting. Custom labels and groups retain their existing relative order.
87
98
 
88
- Built-in CPU, memory, disk and network commands support Linux/macOS; most other library presets target Linux. Download and upload show the current received/sent rates in decimal MB/s with three fractional digits and thousands separators. Commands still return KiB/s; thresholds continue to use raw values. Each direction's hover detail shows its own cumulative GiB and the interfaces included. Default-route interfaces are preferred; without a usable default route, eligible non-loopback interfaces are used. **Totals cover the time since interface creation or counter reset, not since the current SSH login.**
99
+ **Restore defaults** removes only the selected built-in's override, preserving its top-level enable switch and ordering, and leaving other built-ins and custom labels untouched. Restoring network or CPU load resets that group's main/child definitions to their factory configuration.
100
+
101
+ Memory, network and CPU-load commands support Linux/macOS; most other library presets target Linux. Download and upload show the current received/sent rates in decimal MB/s with three fractional digits and thousands separators. Commands still return KiB/s; thresholds continue to use raw values. Each direction's hover detail shows its own cumulative GB and the interfaces included. Default-route interfaces are preferred; without a usable default route, eligible non-loopback interfaces are used. **Totals cover the time since interface creation or counter reset, not since the current SSH login.**
102
+
103
+ Capacity and cumulative traffic use the **GB** label while retaining the existing base-1024 calculation (1024³ bytes per displayed unit). Only the unit name changes; readings and alert thresholds stay the same. Network rates in MB/s remain decimal.
89
104
 
90
105
  The target system needs `timeout`, `gtimeout` or `setsid` for bounded command execution.
91
106
 
@@ -112,11 +127,11 @@ The 12 standalone presets cover uptime, temperature, system load, logged-in user
112
127
  | GPU memory | Aggregate GPU memory; eight children GPU 0–7 | All panes |
113
128
  | CPU load | Thread count; 1-minute and 5-minute load | All panes |
114
129
 
115
- Each disk group's main label shows **aggregate free GiB** across its readable system and mounted data filesystems, deduplicating filesystems so bind mounts are not counted twice. The system disk is the first child, followed by data mounts; hover shows free/total capacity. Missing mounts are omitted from the aggregate while their child labels retain a notice by default. No readable valid filesystem produces an error, not a misleading zero.
130
+ Each disk group's main label shows **aggregate free GB** across its readable system and mounted data filesystems, deduplicating filesystems so bind mounts are not counted twice. The system disk is the first child, followed by data mounts; hover shows free/total capacity. Missing mounts are omitted from the aggregate while their child labels retain a notice by default. No readable valid filesystem produces an error, not a misleading zero.
116
131
 
117
132
  The **Users** preset counts system login records from `who`, including normal tty, pts and console sessions. Hover groups and sorts counts by username, for example `alice ×2, bob ×1`. Empty records produce a primary value of `0` and a detail of `-`; missing tools or execution failures remain errors. This is neither the current connection's username nor a count of every TCP or background SSH connection.
118
133
 
119
- GPU percentages mean **VRAM usage** (`memory.used / memory.total`), not `utilization.gpu`. Details query `memory.free` directly and divide by 1024 to display free/total GiB. The main GPU label keeps a no-GPU notice; nonexistent GPU children are hidden in every view by default.
134
+ GPU percentages mean **VRAM usage** (`memory.used / memory.total`), not `utilization.gpu`. Details query `memory.free` directly, retain the division by 1024, and show free/total memory with the GB label. The main GPU label keeps a no-GPU notice; nonexistent GPU children are hidden in every view by default.
120
135
 
121
136
  The P1 host and container are separate presets bound to separate saved connections. They must not be merged merely because they share a host address and use different ports.
122
137
 
@@ -130,8 +145,8 @@ The corresponding built-ins and presets use green `#00ff00`, orange `#ffa500` an
130
145
 
131
146
  | Metric | Red | Orange | Green |
132
147
  | --- | --- | --- | --- |
133
- | Free capacity per disk (GiB) | `< 20` | `20 ≤ x ≤ 40` | `> 40` |
134
- | Total free disk capacity (GiB) | `< 50` | `50 ≤ x ≤ 100` | `> 100` |
148
+ | Free capacity per disk (GB) | `< 20` | `20 ≤ x ≤ 40` | `> 40` |
149
+ | Total free disk capacity (GB) | `< 50` | `50 ≤ x ≤ 100` | `> 100` |
135
150
  | GPU memory usage (%) | `> 80` | `50 < x ≤ 80` | `≤ 50` |
136
151
  | RAM usage (%) | `> 80` | `60 < x ≤ 80` | `≤ 60` |
137
152
  | Normalized CPU 1min / 5min load (%) | `> 150` | `100 < x ≤ 150` | `≤ 100` |
@@ -140,13 +155,25 @@ GPU thresholds measure VRAM use, not GPU compute utilization. CPU load is normal
140
155
 
141
156
  ## Connection scopes and mixed panes
142
157
 
143
- A standalone label or whole group can select multiple saved connections or layouts. The default unrestricted scope covers every supported terminal pane. Group members inherit the group's scope; an unmatched pane does not run even the object's check.
158
+ A standalone label or whole group can select saved connections, whole layouts or individual panes within layouts. Layouts expand by default with indented pane entries. A pane remains selectable after its original connection profile is deleted, as long as the saved layout retains its copy. The default unrestricted scope covers every supported terminal pane. Group members inherit the group's scope; an unmatched pane does not run even the object's check.
159
+
160
+ Checking a connection selects every entry with the **same original connection ID**; unchecking affects only that entry. Per-pane opt-outs override connection-wide or layout-wide selections and survive saving, reopening and JSON export/import. A layout checkbox selects or clears only its own panes. Equal names with different IDs do not link selections.
144
161
 
145
- Matching uses each pane's **original saved connection ID**, not the focused pane, tab title, host address or a sibling connection. In a `P1 / P2 / P1` layout, P1-bound metrics appear in both P1 panes and P2-bound metrics only in the middle pane. A layout-bound metric applies to all three, executing independently in each session. Multiple selections form a union: choosing P1 plus the whole layout also includes its P2 pane.
162
+ Matching prioritizes each pane's **original saved connection ID**, not the focused pane, tab title or a sibling connection. If an old saved layout retains an obsolete connection ID, the plugin looks for exactly one current SSH profile with the same host, port, username and jump/proxy route. Missing or ambiguous matches do not inherit a scope. Hosts and containers on different ports remain separate. This compatibility fix is included in 1.7.4.
163
+
164
+ In a `P1 / P2 / P1` layout, P1-bound metrics appear in both P1 panes and P2-bound metrics only in the middle pane. A layout-bound metric applies to all three, executing independently in each session. Multiple selections form a union: choosing P1 plus the whole layout also includes its P2 pane.
146
165
 
147
166
  Renaming preserves the association. Deleted profiles remain marked unavailable and stop matching; a new profile with the same name does not inherit the old ID. Removing the last selection does not make the metric global—you must explicitly choose all terminal panes.
148
167
 
149
- Saved layouts have IDs separate from the connections inside them. The plugin records a layout's origin when it is opened and retains that marker in recovery data. For **whole-layout bindings only**, an unmarked layout already open before installation, or a newly saved layout, must be reopened once from the saved-profile list. Direct connection-ID bindings need no such reopening.
168
+ Saved layouts have IDs separate from the connections inside them. The plugin records a layout's origin when it is opened and retains that marker in recovery data. Whole-layout and individual-pane bindings require an unmarked layout already open before installation, or a newly saved layout, to be reopened once from the saved-profile list. Direct connection-ID bindings need no such reopening.
169
+
170
+ Individual pane bindings also require that layout-origin marker; reopen an unmarked old window from its saved layout once. Pane targets combine the layout ID, saved position and original connection ID, so repeated connections can be unchecked individually. After editing a saved layout or removing/replacing panes, review unavailable scope entries and select the intended targets again.
171
+
172
+ Click each pane's lower-left button to open a vertical menu: **Show, Hide, Overview, Carousel, Static**. Show/Hide controls that pane's entire status bar, while the button remains available when hidden. Choosing Overview, Carousel or Static automatically shows the bar and saves both visibility and mode; no extra Show action is needed. The three modes override the presentation of groups in that pane; Static retains each group's horizontal/vertical layout, and standalone labels are unaffected. Choosing a mode does not modify shared group definitions. Without a pane override, each group uses its configured mode.
173
+
174
+ Saved layouts remember visibility and mode for each pane. For three identical connections, choose Hide in the first two and Carousel directly in the third to show it. The layout retains those choices when reopened, without affecting other layouts.
175
+
176
+ The menu opens on click and stays open while crossing the gap above the icon, including when Tabby's focus-follows-mouse setting is enabled. Selecting an option, clicking the icon again or outside, pressing Escape, or tabbing out closes it. Changing sessions or removing the pane also closes the old menu.
150
177
 
151
178
  ## Install, develop and publish
152
179
 
@@ -167,7 +194,7 @@ npm.cmd run test:ui
167
194
  npm.cmd pack
168
195
  ```
169
196
 
170
- `npm pack` reruns type checking, unit tests and the production build, producing `tabby-group-server-stats-1.7.3.tgz`; compiled files are in `dist/`. Browser tests use real Angular components with simulated data, while command tests use a local shell. Live SSH command validation and desktop split-pane acceptance need their own recorded results.
197
+ `npm pack` reruns type checking, unit tests and the production build, producing `tabby-group-server-stats-1.7.5.tgz`; compiled files are in `dist/`. Browser tests use real Angular components with simulated data, while command tests use a local shell. Live SSH command validation and desktop split-pane acceptance need their own recorded results.
171
198
 
172
199
  This fork retains `plugin.serverStats` configuration compatibility. **Enable either the upstream plugin or this fork in a Tabby instance**, to avoid duplicate collection. An isolated portable Tabby installation is recommended for initial testing. See the [packaging, local-installation and publishing guide (Chinese)](PUBLISHING.zh-CN.md) for commands and acceptance checks.
173
200
 
@@ -189,3 +216,21 @@ Report problems or suggest improvements through [this project's Issues](https://
189
216
  - Retain Akkariin's upstream MIT copyright, source links and contributor credit.
190
217
  - Prevent duplicate preset additions using source and stable ID, including renamed or disabled items; use commands and scope to recognize legacy entries.
191
218
  - Add relevant bilingual metadata and document installation through maintainer search, without promising a search ranking.
219
+
220
+ ### 1.7.4 pane controls and editing
221
+
222
+ - Bind individual saved-layout panes, link checks for matching connection IDs and allow individual opt-outs, including legacy layout profiles.
223
+ - Use a fixed bottom bar with a persistent, independent lower-left toggle for each pane.
224
+ - Put main/child buttons together for direct editing; collapse group editors initially and move named deletion confirmations to the lower right.
225
+ - Display capacity as GB while retaining base-1024 readings and thresholds, with compatibility for legacy GiB configuration.
226
+
227
+ ### 1.7.5 pane menus, copies and user manuals
228
+
229
+ - Use a vertical lower-left menu to persist each pane's visibility and Overview/Carousel/Static mode. Choosing a mode also shows the bar without changing shared group definitions.
230
+ - Duplicate groups and children independently; group copies are created immediately, while child copies belong to the group editing draft.
231
+ - Open standalone hover details above the bar, retain static-group behavior and remove redundant white name tooltips.
232
+ - Add thousands separators to capacity values and right-align primary values and both sides of ratio details.
233
+ - Limit built-ins to memory, network and CPU load, preserving enabled or edited legacy CPU/disk definitions.
234
+ - Open bundled English/Chinese complete user manuals, including the disk-group walkthrough, through the highlighted tutorial button.
235
+ - Fix the lower-left menu closing as the pointer moves upward with focus-follows-mouse enabled.
236
+ - Fix a configuration migration incompatibility that left the settings page blank, and persist built-in ordering and first-time edits across restarts.
package/README.md CHANGED
@@ -2,10 +2,12 @@
2
2
 
3
3
  中文 | [English](README.en.md)
4
4
 
5
- 为 [Tabby](https://github.com/Eugeny/tabby) 提供 SSH 服务器监控(server monitoring):CPU 负载、内存、磁盘容量、网络速率和 GPU 显存指标。支持自定义 Shell 命令、悬停详情,以及概览、轮播、静态显示的多标签组(metric groups)。当前版本为 **1.7.3**,加入预设重复添加保护,保留紧凑底栏、MB/s 三位小数及容量数字分列对齐。
5
+ 为 [Tabby](https://github.com/Eugeny/tabby) 提供 SSH 服务器监控(server monitoring):CPU 负载、内存、磁盘容量、网络速率和 GPU 显存指标。支持自定义 Shell 命令、悬停详情,以及概览、轮播、静态显示的多标签组(metric groups)。当前源码版本为 **1.7.5**,新增分屏显示菜单、标签组与子标签复制、容量千位分隔和离线 PDF 教程。
6
6
 
7
7
  本 fork 作者及维护者:[lishuainan0209](https://github.com/lishuainan0209)。本项目基于 [Akkariin 的 tabby-server-stats](https://github.com/kasuganosoras/tabby-server-stats) 二次开发,继续使用 MIT 许可证。版本号不代表已经发布到 npm。
8
8
 
9
+ **1.7.5 更新**:默认指标调整为内存、网络和 CPU 负载;每个分屏左下角可选择显示、隐藏及三种标签组模式,选择模式会自动显示状态栏并持久保存;单标签悬停详情改为上方弹窗,并移除重复的白色名称提示。
10
+
9
11
  **保留 1.6.1 的 SSH 热修复**:此前指标较多时,超长 SSH 执行请求可能导致整个连接断开。执行请求已改为固定短命令,脚本通过标准输入按 8 KiB 分块传输,保留完整接收后的有时限确认。传输失败只关闭本次统计通道,不主动关闭终端会话,也不会自动重跑用户命令。
10
12
 
11
13
  ![离线预设库界面](docs/images/preset-library.png)
@@ -18,23 +20,32 @@
18
20
  - **三条命令**:对象校验 → Shell 功能命令 → 悬停扩展信息;校验失败时不执行后两条。
19
21
  - **标签组**:主标签与多个子标签,支持概览、轮播、静态横排和静态竖排。
20
22
  - **分别启用**:单标签、整个标签组、组内主标签和每个子标签都能独立开关,配置及颜色规则保留。
21
- - **按连接显示**:多选保存的连接或布局,正确区分混合分屏中的每个会话。
22
- - **可编辑、可排序的内置指标**:CPU、内存、磁盘和网络可修改命令与样式,使用上下移按钮调整两种面板的显示顺序,也可单独恢复默认。
23
+ - **按连接或布局分屏显示**:多选保存的连接、整个布局或布局内单个分屏;同连接 ID 勾选联动,取消可逐个进行。
24
+ - **可编辑、可排序的内置指标**:内存、网络和 CPU 负载可修改命令与样式,使用上下移按钮调整底部状态栏的显示顺序,也可单独恢复默认。
25
+ - **独立复制**:复制整个标签组,或在同组内复制子标签,再修改设备路径、卡号和命令。
26
+ - **分屏显示菜单**:左下角竖排菜单选择显示、隐藏、概览、轮播或静态;选择模式会同时显示状态栏,每个分屏保存自己的选择。
27
+ - **离线 PDF 手册**:设置页高亮的“使用教程(PDF)”按钮使用系统默认程序打开中英文手册,讲解分屏菜单、标签编辑、预设库,并逐步配置磁盘标签组。
23
28
  - **离线与 GitHub 标签库**:内附 20 个预设(12 个单标签、8 个标签组),支持从本 fork 的 GitHub 导入、JSON 导入导出和搜索;已添加的预设不会因重复点击而产生副本。
24
29
  - **清晰的区域与卡片边框**:内置指标、预设库、单标签、多标签组四块区域分别显示;状态栏组间采用紧凑细线分隔。
25
30
  - **中英文界面与 26 款原创图标**:图标按用途分类、可搜索,也支持原有图标和自定义 SVG。
26
31
 
27
- 底部状态栏与悬浮窗使用同一个标签显示组件,内置指标也遵循相同的校验、颜色、范围和悬停规则。
32
+ 显示方式固定为底部状态栏,设置页提供启用开关;旧配置中的浮动面板模式自动按底部栏处理。内置指标遵循与自定义标签相同的校验、颜色、范围和悬停规则。单标签的扩展信息在上方弹窗显示,避免撑宽底栏;标签组的概览、轮播弹窗及静态模式悬停方式保持原有规则。
28
33
 
29
34
  ## 从一个标签开始
30
35
 
31
- 在 Tabby 设置 → 服务器状态中,点击“添加单标签”,或从标签库选择一个预设后点击“添加”。从 GitHub 或 JSON 导入都只加载可选条目;点击“添加”才把对应条目加入当前配置。已有项目使用铅笔按钮编辑,组内主、子标签点击后分别展开编辑框。
36
+ 在 Tabby 设置 → 底部状态栏中,点击“添加单标签”,或从标签库选择一个预设后点击“添加”。从 GitHub 或 JSON 导入都只加载可选条目;点击“添加”才把对应条目加入当前配置。已有项目使用铅笔按钮编辑,组内主、子标签点击后分别展开编辑框。
37
+
38
+ 初次使用时,先点击设置页上方高亮的**“使用教程(PDF)”**。完整手册随插件离线提供,并由系统默认 PDF 程序打开;根据界面语言选择中文或英文。手册先带你操作左下角菜单、配置默认指标与单标签,再从确认挂载点开始,填写系统盘、数据盘、总余量命令;随后练习复制、启停、颜色、显示范围、预设导入导出和异常排查。也可直接查看[中文 PDF](docs/tutorial.zh-CN.pdf)或[English PDF](docs/tutorial.en.pdf)。
39
+
40
+ 标签组卡片中,主标签与子标签分两行排列。点击标签组的铅笔按钮进入编辑时,主、子标签默认全部折叠;点击带边框的标签按钮则直接展开并编辑对应项目。删除按钮位于各自卡片右下角,并弹出包含名称的确认提示;子标签删除后仍需保存整个标签组才会生效。
41
+
42
+ 点击标签组卡片的**复制**按钮,会在原组后创建并保存独立副本,然后打开副本编辑。副本保留命令、范围、样式与启用状态,但组和每个成员都有新的 ID;后续编辑不会修改原组。编辑组时,点击某个子标签的**复制**按钮,会在它后面插入子标签副本并打开编辑;此时仍是草稿,点击“保存整个标签组”才生效。主动复制与预设库重复点击“添加”不同:副本不再沿用原预设的去重身份。
32
43
 
33
44
  新建标签默认使用**文本值**,校验默认比较**输出文本**。每个标签的命令顺序为:
34
45
 
35
46
  1. **对象校验命令,可选**:比较去除首尾空白后的输出文本,或指定退出码。未配置则直接执行功能命令。
36
47
  2. **Shell 功能命令**:定时采集状态栏主值。
37
- 3. **悬停扩展信息命令,可选**:悬停时将结果追加到主值后,移出收起;留空不请求扩展信息。
48
+ 3. **悬停扩展信息命令,可选**:单标签悬停时在上方弹窗显示主值与扩展信息,移出收起;留空不请求扩展信息。组内标签按该组的显示模式展开详情。
38
49
 
39
50
  例如,检查独立挂载的 `/data2`,显示使用百分比:
40
51
 
@@ -57,7 +68,7 @@ printf '%s\n' "$data" | awk 'NR==2 {print "available " $4 " / used " $3}'
57
68
 
58
69
  ## 标签组与可见性
59
70
 
60
- 组名只在悬停弹出框显示,状态栏直接显示标签内容。主标签顶格,子标签缩进,弹出框中的名称、数值和扩展信息按列对齐。组间使用细线和较小间距,减少有限状态栏宽度中的留白。
71
+ 组名只在悬停弹出框显示,状态栏直接显示标签内容。主标签顶格,子标签缩进,弹出框中的名称、数值和扩展信息按列对齐。容量数字使用千位逗号,例如 `7,912 GB`;`433.9/8,786.0 GB` 这类详情中,斜杠前后的数字分别右对齐,保留原有小数位和颜色判断数值。组间使用细线和较小间距,减少有限状态栏宽度中的留白。
61
72
 
62
73
  - **概览**:平时显示主标签;悬停后竖排展示整组及各自的扩展信息。
63
74
  - **轮播**:按组的轮播间隔切换子标签;悬停暂停并展开整组。跳过无效子标签时直接选择下一个,不额外等待一个周期。
@@ -79,13 +90,17 @@ printf '%s\n' "$data" | awk 'NR==2 {print "available " $4 " / used " $3}'
79
90
 
80
91
  ## 内置指标也能编辑
81
92
 
82
- CPU、内存、磁盘是单标签;网络是静态竖排标签组,默认显示下载和上传,主标签默认关闭。它们与自定义项目使用相同的命令编辑、对象校验、扩展信息、显示范围和颜色规则,不再另走硬编码图表采集路径。
93
+ 新配置仅提供**内存、网络、CPU 负载**三个内置指标。内存是单标签;网络是静态竖排标签组,默认显示下载和上传,主标签默认关闭;CPU 负载是概览标签组,主标签显示可运行/总线程数,子标签显示按逻辑处理器数量归一化的 1min、5min 负载百分比。它们与自定义项目使用相同的命令编辑、对象校验、扩展信息、显示范围和颜色规则,不再另走硬编码图表采集路径。
83
94
 
84
- 使用卡片右侧上下移按钮调整 CPU、内存、磁盘和网络的顺序。顺序保存在 `builtinOrder` 中,底部状态栏与悬浮窗一致,重开后保留;自定义单标签和标签组仍按各自原有顺序排列。
95
+ 升级时,旧内置 CPU 或磁盘的已启用配置、已编辑覆盖会保留为普通单标签,包括原有命令、范围与启用状态。已有自定义 CPU 负载组保持不变;识别到来自该预设的既有组时,新的内置 CPU 负载默认关闭,避免重复显示。
85
96
 
86
- “恢复默认”只删除当前内置项的自定义覆盖,保留它的顶层启用开关和排列顺序,不影响其他内置项或自定义标签。网络恢复默认会恢复该组的出厂主、子标签配置。
97
+ 使用卡片右侧上下移按钮调整内存、网络和 CPU 负载的顺序。顺序保存在 `builtinOrder` 中,重开后保留;自定义单标签和标签组仍按各自原有顺序排列。
87
98
 
88
- 内置 CPU、内存、磁盘和网络均包含 Linux/macOS 适配,多数其他离线预设面向 Linux。网络下载、上传主值分别是当前接收、发送速率,显示单位为 MB/s(十进制),固定三位小数并带千位逗号;采集命令仍输出 KiB/s,颜色规则继续按原始数值判断;各自悬停显示对应方向的累计 GiB 和参与统计的网卡。默认优先选择默认路由网卡,没有可用默认路由时回退到符合条件的非回环网卡。**累计量从接口建立或计数器重置起计算,不是本次 SSH 登录后的流量**。
99
+ “恢复默认”只删除当前内置项的自定义覆盖,保留它的顶层启用开关和排列顺序,不影响其他内置项或自定义标签。网络或 CPU 负载恢复默认会恢复该组的出厂主、子标签配置。
100
+
101
+ 内存、网络和 CPU 负载均包含 Linux/macOS 适配,多数其他离线预设面向 Linux。网络下载、上传主值分别是当前接收、发送速率,显示单位为 MB/s(十进制),固定三位小数并带千位逗号;采集命令仍输出 KiB/s,颜色规则继续按原始数值判断;各自悬停显示对应方向的累计 GB 和参与统计的网卡。默认优先选择默认路由网卡,没有可用默认路由时回退到符合条件的非回环网卡。**累计量从接口建立或计数器重置起计算,不是本次 SSH 登录后的流量**。
102
+
103
+ 容量和累计流量统一标为 **GB**,沿用现有的 1024 进制计算口径(每单位 1024³ 字节),仅调整单位名称,数值和告警阈值保持不变;网络速率 MB/s 仍使用十进制。
89
104
 
90
105
  目标系统需要提供 `timeout`、`gtimeout` 或 `setsid` 之一,用于命令超时保护。
91
106
 
@@ -112,11 +127,11 @@ CPU、内存、磁盘是单标签;网络是静态竖排标签组,默认显
112
127
  | GPU 显存 | 全部 GPU 汇总;GPU 0–7 八个子标签 | 所有窗格 |
113
128
  | CPU负载 | 线程数;1 分钟、5 分钟负载 | 所有窗格 |
114
129
 
115
- 磁盘组主标签为**磁盘总余量 GiB**,汇总系统盘及该组有效挂载的数据盘,按文件系统去重,避免绑定挂载重复计数。系统盘是第一子标签,后接数据盘;每项悬停显示剩余/总容量。掉盘不进入汇总,其子标签默认保留“未挂载”提示;没有任何可读取的有效文件系统时显示错误,而不是伪装为 0。
130
+ 磁盘组主标签为**磁盘总余量 GB**,汇总系统盘及该组有效挂载的数据盘,按文件系统去重,避免绑定挂载重复计数。系统盘是第一子标签,后接数据盘;每项悬停显示剩余/总容量。掉盘不进入汇总,其子标签默认保留“未挂载”提示;没有任何可读取的有效文件系统时显示错误,而不是伪装为 0。
116
131
 
117
132
  “登录用户”主值统计 `who` 中的系统登录会话,包含正常 tty、pts 和控制台登录;悬停按用户名汇总并排序,例如 `alice ×2, bob ×1`。无人登录时主值为 `0`、详情为 `-`;工具缺失或执行失败保持错误提示。它不是当前连接用户名,也不等于所有 TCP 或后台 SSH 连接数。
118
133
 
119
- GPU 百分比是**显存使用率**(`memory.used / memory.total`),不是 `utilization.gpu` 计算利用率;悬停直接查询 `memory.free`,除以 1024 转为 GiB 后显示剩余/总显存。GPU 主标签无设备时保留提示,不存在的 GPU 子标签默认在所有视图隐藏。
134
+ GPU 百分比是**显存使用率**(`memory.used / memory.total`),不是 `utilization.gpu` 计算利用率;悬停直接查询 `memory.free`,沿用除以 1024 的计算口径,以 GB 标签显示剩余/总显存。GPU 主标签无设备时保留提示,不存在的 GPU 子标签默认在所有视图隐藏。
120
135
 
121
136
  整机 GPU 查询被异常设备阻断时,汇总命令会逐一查询 GPU 0–7,只汇总可读取的设备;没有可读取设备时显示“无GPU”。该提示表示查询不可用,不等同于确认机器未安装显卡。
122
137
 
@@ -130,8 +145,8 @@ P1 宿主与容器是两个独立模板,分别绑定各自连接;不能仅
130
145
 
131
146
  | 指标 | 红色 | 橙色 | 绿色 |
132
147
  | --- | --- | --- | --- |
133
- | 单盘剩余容量(GiB) | `< 20` | `20 ≤ x ≤ 40` | `> 40` |
134
- | 磁盘总剩余容量(GiB) | `< 50` | `50 ≤ x ≤ 100` | `> 100` |
148
+ | 单盘剩余容量(GB) | `< 20` | `20 ≤ x ≤ 40` | `> 40` |
149
+ | 磁盘总剩余容量(GB) | `< 50` | `50 ≤ x ≤ 100` | `> 100` |
135
150
  | GPU 显存使用率(%) | `> 80` | `50 < x ≤ 80` | `≤ 50` |
136
151
  | 内存使用率(%) | `> 80` | `60 < x ≤ 80` | `≤ 60` |
137
152
  | CPU 1min / 5min 归一化负载(%) | `> 150` | `100 < x ≤ 150` | `≤ 100` |
@@ -140,13 +155,25 @@ GPU 阈值衡量显存占用,不是 GPU 计算利用率;CPU 负载按逻辑
140
155
 
141
156
  ## 连接范围与混合分屏
142
157
 
143
- 单标签和整个标签组可以多选保存的连接或布局,默认“不限制范围”会在所有受支持的终端窗格显示。主、子标签继承组范围,范围不匹配时连校验命令也不运行。
158
+ 单标签和整个标签组可以多选保存的连接、整个布局或布局内单个分屏,默认“不限制范围”会在所有受支持的终端窗格显示。布局默认展开,分屏缩进显示;即使原连接配置已删除,只要布局中仍保留连接副本,就可以直接选择该分屏。主、子标签继承组范围,范围不匹配时连校验命令也不运行。
159
+
160
+ 勾选一项连接时,列表中**原始连接 ID 相同**的所有对应项一起选中;取消时只取消当前项。单个分屏的取消优先于连接或整个布局的选择,保存、重开和 JSON 导入导出均保留此例外。布局复选框仅用于全选或取消本布局内的分屏。相同名称但不同 ID 不会联动。
144
161
 
145
- 关联依据每个窗格实际使用的**原始连接配置 ID**,不依据窗口标题、当前焦点、主机地址或其他窗格。一个 `P1 / P2 / P1` 混合布局中,只绑定 P1 的指标在两个 P1 窗格出现;只绑定 P2 的指标只在中间窗格出现。绑定整个保存布局的公共指标在三格生效,各自在自己的会话采集。多选是并集:同时选择 P1 和整个布局会覆盖布局内的 P2。
162
+ 关联优先依据每个窗格实际使用的**原始连接配置 ID**,不依据窗口标题、当前焦点或其他窗格。旧保存布局中的连接 ID 已失效时,插件会按 SSH 地址、端口、用户名及跳板/代理路径查找唯一的现有连接;找不到或存在多个候选时不自动关联。宿主机和容器使用不同端口时不会混淆。此兼容修复已包含在 1.7.4 中。
163
+
164
+ 一个 `P1 / P2 / P1` 混合布局中,只绑定 P1 的指标在两个 P1 窗格出现;只绑定 P2 的指标只在中间窗格出现。绑定整个保存布局的公共指标在三格生效,各自在自己的会话采集。多选是并集:同时选择 P1 和整个布局会覆盖布局内的 P2。
146
165
 
147
166
  重命名不影响 ID 关联;删除连接后保留失效选择并停止匹配,同名新连接不会自动继承。删去最后一个选择也不会自动变为全局,必须明确切回“所有终端窗格”。
148
167
 
149
- 保存布局拥有独立于内部连接的 ID。插件会在打开已保存布局时记录布局来源并随恢复信息保存。只有**绑定整个布局**时,安装前已打开的未标记布局、或刚从当前分屏新保存的布局,需要从配置列表重新打开一次。按原始连接 ID 绑定不受此限制。
168
+ 保存布局拥有独立于内部连接的 ID。插件会在打开已保存布局时记录布局来源并随恢复信息保存。绑定整个布局或布局内单个分屏时,安装前已打开的未标记布局、或刚从当前分屏新保存的布局,需要从配置列表重新打开一次。按原始连接 ID 绑定不受此限制。
169
+
170
+ 布局内单个分屏的绑定也需要已记录的布局来源;未标记的旧窗口请从保存布局重新打开一次。分屏选项按布局 ID、保存时的位置和原始连接 ID 区分,同一连接重复出现也可逐个取消。修改保存布局、删除或替换分屏后,请检查范围列表中的失效项并重新选择。
171
+
172
+ 点击每个分屏左下角的小图标,会打开竖排菜单:**显示、隐藏、概览、轮播、静态**。显示/隐藏控制当前分屏整条状态栏;隐藏后图标仍在,可再次打开菜单。选择概览、轮播或静态会自动显示当前分屏的状态栏,并一起保存显示状态和模式,无需额外点击“显示”。后三项统一覆盖当前分屏内各标签组的显示模式,静态模式沿用各组的横排/竖排设置,单标签不受模式切换影响。模式选择不修改共享的标签组配置;未选择覆盖模式时使用各组原有模式。
173
+
174
+ 保存布局内的可见性和模式均按分屏独立持久化:三个相同连接中,前两格选择“隐藏”,第三格直接选择“轮播”即可显示;再次打开该布局仍保留各自选择,其他布局不受影响。
175
+
176
+ 菜单由点击打开,鼠标穿过图标与菜单之间的间隙时保持打开,兼容 Tabby 的“焦点跟随鼠标”。选择选项、再次点击图标、点击外部、按 Esc 或从菜单按 Tab 离开时关闭;切换会话或移除分屏也会关闭旧菜单。
150
177
 
151
178
  ## 安装、开发与发布
152
179
 
@@ -167,7 +194,7 @@ npm.cmd run test:ui
167
194
  npm.cmd pack
168
195
  ```
169
196
 
170
- `npm pack` 会再次执行类型检查、普通测试和正式构建,生成 `tabby-group-server-stats-1.7.3.tgz`;构建文件在 `dist/`。浏览器测试使用真实 Angular 组件与模拟数据,命令测试在本机 shell 运行;真实 SSH 命令验证与 Tabby 分屏验收需要分别记录结果。
197
+ `npm pack` 会再次执行类型检查、普通测试和正式构建,生成 `tabby-group-server-stats-1.7.5.tgz`;构建文件在 `dist/`。浏览器测试使用真实 Angular 组件与模拟数据,命令测试在本机 shell 运行;真实 SSH 命令验证与 Tabby 分屏验收需要分别记录结果。
171
198
 
172
199
  本 fork 继续使用 `plugin.serverStats` 配置,方便沿用已有指标。**同一个 Tabby 实例只启用原版或本 fork 其中一个**,避免重复采集。推荐先使用独立便携版测试。完整的本地安装命令、验收项目和 npm/Tabby 发布步骤见 [打包、测试与发布](PUBLISHING.zh-CN.md)。
173
200
 
@@ -189,3 +216,21 @@ npm.cmd pack
189
216
  - 保留上游作者 Akkariin 的 MIT 版权、来源链接和贡献声明。
190
217
  - 预设按来源和稳定 ID 防止重复添加,改名或禁用后仍能识别;旧配置以命令与显示范围辅助匹配。
191
218
  - 补充中英文功能描述与相关关键词,并说明按维护者搜索安装的方法;不承诺搜索排名。
219
+
220
+ ### 1.7.4 分屏控制与编辑体验
221
+
222
+ - 布局内分屏可独立绑定,同连接 ID 勾选联动、取消逐项生效,兼容旧布局的连接副本。
223
+ - 固定底部状态栏,每个分屏左下角独立开关,保存布局重新打开后保持各自状态。
224
+ - 主、子标签按钮相邻排列,可直接编辑对应成员;组编辑默认折叠,删除移至右下角并确认名称。
225
+ - 容量统一显示 GB,保留原有 1024 进制数值与告警阈值,兼容旧 GiB 配置。
226
+
227
+ ### 1.7.5 分屏菜单、复制与使用手册
228
+
229
+ - 左下角改为竖排显示菜单,选择概览、轮播或静态会自动显示状态栏,按分屏持久保存可见性及模式,不改动共享组定义。
230
+ - 标签组和子标签可独立复制;组副本直接创建,子标签副本随组编辑草稿保存。
231
+ - 单标签悬停详情使用上方弹窗,静态标签组保持原有展示方式;移除重复的白色名称提示。
232
+ - 容量数字加入千位逗号,主值及斜杠两侧数字分别右对齐。
233
+ - 默认指标仅内存、网络和 CPU 负载,保留旧版已启用或编辑的 CPU/磁盘配置。
234
+ - 高亮教程按钮打开随包提供的中英文完整使用手册,包含磁盘标签组实操教程。
235
+ - 修复开启“焦点跟随鼠标”后,左下角菜单在鼠标上移时意外关闭的问题。
236
+ - 修复升级迁移与 Tabby 配置对象不兼容导致设置页空白的问题,并确保默认指标排序和首次编辑结果在重启后保留。