tabby-group-server-stats 0.0.0-stage → 1.7.2

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Akkariin Meiko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,57 @@
1
+ Tabby Group Server Stats 1.7.1
2
+
3
+ This project is a modified fork of Tabby Server Stats:
4
+ https://github.com/kasuganosoras/tabby-server-stats
5
+
6
+ Original work: Copyright (c) 2023 Akkariin Meiko.
7
+ Original package author: Akkariin.
8
+ Fork maintainer: lishuainan0209.
9
+ Fork repository: https://github.com/lishuainan0209/tabby-group-server-stats
10
+
11
+ The original MIT license and copyright notice are preserved in LICENSE.
12
+ This fork is also distributed under the MIT license.
13
+
14
+ The fork adds object checks, hover-detail commands and grouped metrics
15
+ with overview, carousel, horizontal and vertical displays. Standalone
16
+ metrics, whole groups and their main/child members can be disabled without
17
+ deleting their configuration. Unavailable-object visibility is configurable
18
+ for all displays, with a separate carousel-only setting.
19
+
20
+ Saved connection and layout scopes use stable local IDs, apply to both
21
+ display and collection, and match each pane independently in mixed layouts.
22
+ Removed targets never broaden a restricted scope to all panes.
23
+
24
+ Built-in CPU, memory, disk and network definitions are editable through the
25
+ same model as custom metrics. Per-item defaults can be restored. Both
26
+ panels use the common label display and persist the same configurable
27
+ built-in ordering. Inline editors, aligned hover rows, stable carousel
28
+ widths, section/card borders and compact group separators improve use.
29
+
30
+ The offline JSON library supports standalone and grouped presets, portable
31
+ connection-name bindings, import/export, bilingual descriptions and source
32
+ metadata. Adapted upstream presets retain their MIT source attribution.
33
+ Added presets include separate host/container disk groups, GPU memory
34
+ groups and CPU load groups. Optional GitHub import reads this fork's main
35
+ branch and merges library previews without activating downloaded commands.
36
+ Bundled disk groups aggregate valid unique filesystems, with the system
37
+ disk as their first child. Login-session details aggregate the system's
38
+ who records by username. Linux/macOS network metrics separate received
39
+ and sent rates and cumulative interface counters. Corresponding presets
40
+ also define consistent green, orange and red threshold rules.
41
+
42
+ The 26 added monitoring SVG icons are original artwork created for this
43
+ fork and are distributed under the same MIT license. The searchable icon
44
+ picker and interface support English and Chinese.
45
+
46
+ SSH output handling includes bounded completion acknowledgments; hover
47
+ detail caching follows each metric's refresh interval without automatically
48
+ rerunning user commands to recover missing output.
49
+
50
+ The SSH transport hotfix introduced in 1.6.1 is retained. Earlier oversized
51
+ exec requests could disconnect the shared SSH connection. A fixed short
52
+ exec request now streams scripts through standard input in 8 KiB chunks,
53
+ avoiding oversized packets and shell arguments. Completion acknowledgment
54
+ follows the full upload; transfer failures close only the statistics channel.
55
+
56
+ Third-party dependencies retain their respective licenses. Preserve any
57
+ license notice files emitted alongside the compiled files in dist/.
@@ -0,0 +1,139 @@
1
+ # 打包、本地测试与发布
2
+
3
+ 本文面向 `tabby-group-server-stats 1.7.2` 的维护者。源码目录为 `D:\tabby-group-server-stats`;功能与预设说明见 [中文 README](README.md) / [English README](README.en.md)。
4
+
5
+ 1.7.2 修正网速 MB/s 三位小数、底栏紧凑竖排和容量数字分列对齐。
6
+
7
+ 1.7.0 增加 GitHub 预设导入、内置项持久化排序、清晰分区与卡片边框、紧凑组分隔,并更新磁盘汇总、登录会话名单、双向网络速率及累计量和默认颜色阈值。版本号不表示已经推送或发布。
8
+
9
+ 本版保留 1.6.1 的传输修复:此前大批量指标生成的超长 SSH 执行请求可能断开整个连接,现使用固定短命令和 8 KiB 标准输入分块,完整上传后再确认结果,失败仅清理统计通道。`npm test` 包含 `tests/transport.test.cjs`,覆盖大脚本、传输限制和同连接其他会话不受影响的回归。
10
+
11
+ 下面的命令由维护者手动执行。构建和打包不会推送 GitHub、登录 npm 或自动发布插件。
12
+
13
+ ## 开发环境
14
+
15
+ 需要 Node.js、npm、Git 和 Tabby。Windows 使用 `npm.cmd`,可避免 PowerShell 对 `npm.ps1` 的执行策略限制。若刚安装后找不到命令,重新打开终端并检查:
16
+
17
+ ```powershell
18
+ Set-Location -LiteralPath 'D:\tabby-group-server-stats'
19
+ node --version
20
+ npm.cmd --version
21
+ git --version
22
+ ```
23
+
24
+ 在仓库根目录使用现有锁文件和 `.npmrc` 的 `legacy-peer-deps=true`:
25
+
26
+ ```powershell
27
+ npm.cmd ci
28
+ npm.cmd run typecheck
29
+ npm.cmd test
30
+ npm.cmd run test:ui
31
+ npm.cmd run build
32
+ ```
33
+
34
+ TypeScript、Angular 和 Webpack 使用项目内依赖,不需要全局安装。不要在功能发布前同时批量升级 Angular/Tabby 依赖。
35
+
36
+ - `npm test`:配置、范围、采集、显示、生命周期、传输、GitHub 导入、内置排序、登录用户、网络及预设回归测试。Windows 命令测试使用 Git for Windows 的 `sh.exe`,可用 `TEST_SH` 指定其他位置。
37
+ - `npm run test:ui`:用无界面 Edge 运行真实 Angular 组件和模拟会话数据,可设置 `TEST_BROWSER_CHANNEL=chrome`。这不等同于实际 Tabby 桌面验收。
38
+ - `npm run build`:生成 `dist/` 和 `typings/`。
39
+
40
+ 远端命令使用 `timeout`,或 `gtimeout` / `setsid` 回退来限制运行时间;全部缺失时显示错误,不执行无时限命令。项目不要求远端安装 Python 或额外监控服务。具体预设仍需要相应工具,例如 GPU 显存查询需要 `nvidia-smi`。
41
+
42
+ ## 生成发布包
43
+
44
+ 先同步 `package.json` 与锁文件版本,再检查和生成包:
45
+
46
+ ```powershell
47
+ npm.cmd pack --dry-run
48
+ npm.cmd pack
49
+ tar -tf .\tabby-group-server-stats-1.7.2.tgz
50
+ ```
51
+
52
+ `prepack` 自动执行类型检查、普通测试和正式构建;任一失败会阻止打包。浏览器测试需另外运行。产物为 `tabby-group-server-stats-1.7.2.tgz`,后续本地验收与发布应使用同一份已检查的包。[npm pack 文档](https://docs.npmjs.com/cli/v11/commands/npm-pack/)
53
+
54
+ 确认包内包含:
55
+
56
+ - `package.json`、`dist/index.js`、类型声明;
57
+ - 中文和英文 README、本文、`LICENSE`、`NOTICE`、`presets.json`;
58
+ - 构建生成的第三方许可证声明,例如 `dist/*.LICENSE.txt`。
59
+
60
+ 离线预设会随构建打入插件,无需联网即可使用。用户点击“从 GitHub 导入”时才从当前 fork 的 `main/presets.json` 获取并合并预览,保留本地和此前导入的其他条目;远端内容以实际推送状态为准,不保证已包含本地新改动。检查包中没有 SSH 凭据、连接地址、用户配置、私有配置 ID 或开发用整个 `node_modules`。共享标签库也应只包含可公开的命令、说明和连接名称,不包含真实连接参数。
61
+
62
+ `LICENSE` 必须保留原 MIT 全文及 Copyright (c) 2023 Akkariin Meiko;`NOTICE` 保留来源与 fork 修改说明。`package.json` 保留原作者,通过 `contributors` 标注 fork 维护者。依赖许可证继续分别适用。
63
+
64
+ ## 在独立便携版 Tabby 中安装
65
+
66
+ 从 [Tabby 官方发布页](https://github.com/Eugeny/tabby/releases) 获取对应架构的 Windows 便携版,解压到新的测试目录。不要把日常用户数据复制到测试副本。
67
+
68
+ Tabby 1.0.238 在发现 `Tabby.exe` 同级的 `data` 目录时将用户数据放到其中,配置和插件均可与日常实例分开。[便携模式源码](https://github.com/Eugeny/tabby/blob/v1.0.238/app/lib/portable.ts)
69
+
70
+ 以下示例在 `D:\tabby-group-server-stats` 运行,假设已经把便携版解压到仓库下的 `work\tabby-portable-test`:
71
+
72
+ ```powershell
73
+ Set-Location -LiteralPath 'D:\tabby-group-server-stats'
74
+ $testRoot = Join-Path (Get-Location).Path 'work\tabby-portable-test'
75
+ $archive = (Resolve-Path -LiteralPath '.\tabby-group-server-stats-1.7.2.tgz').Path
76
+
77
+ if (-not (Test-Path -LiteralPath (Join-Path $testRoot 'Tabby.exe'))) {
78
+ throw '请先将 Tabby 便携版解压到测试目录。'
79
+ }
80
+
81
+ $pluginRoot = Join-Path $testRoot 'data\plugins'
82
+ New-Item -ItemType Directory -Force -Path $pluginRoot | Out-Null
83
+ npm.cmd install --prefix "$pluginRoot" --omit=dev --legacy-peer-deps "$archive"
84
+ & (Join-Path $testRoot 'Tabby.exe') --debug
85
+ ```
86
+
87
+ 确认打开的是测试目录下的程序,使用新的配置,并在插件页确认包名。更新测试包时先完全退出这个测试副本,再重新执行安装命令并启动。
88
+
89
+ 不要仅靠 `TABBY_CONFIG_DIRECTORY` 隔离:它改变配置文件位置,用户插件目录仍由 `userData` 决定。本指南不使用该版本未实现的 `--plugin`,或未经该版本验证的 `--user-data-dir` 作为隔离依据。[配置读取](https://github.com/Eugeny/tabby/blob/v1.0.238/app/lib/config.ts)、[插件目录](https://github.com/Eugeny/tabby/blob/v1.0.238/app/lib/app.ts)、[命令行参数](https://github.com/Eugeny/tabby/blob/v1.0.238/app/lib/cli.ts)
90
+
91
+ 本 fork 沿用 `plugin.serverStats`。同一实例只启用原版或本 fork 之一;迁移日常配置前先备份,关闭原插件后再启用本 fork。
92
+
93
+ ## 发布验收
94
+
95
+ 分别记录自动测试、经授权的远端只读命令检查和实际 Tabby 界面验收。真实服务器的命令输出正确,不代表分屏、悬停或配置恢复已经验收;模拟界面通过,也不代表特定服务器已具备所需工具。记录验证类型和结论即可,不把真实地址、凭据或私有配置 ID 写入仓库。
96
+
97
+ 建议覆盖以下场景:
98
+
99
+ 1. **单标签编辑**:新建表单按需显示,默认文本类型与输出文本比较;命令顺序为校验、功能、扩展;保存、取消和展开编辑正确保留预期配置。
100
+ 2. **对象校验**:通过、失败、超时、空校验四种情况;失败时不执行功能和扩展命令,旧成功值不残留。
101
+ 3. **启用开关**:单标签、整个组、主标签和子标签分别禁用后不显示、不执行,重新启用后保留命令、颜色规则和范围。
102
+ 4. **失败可见性**:默认保留失败提示;全局隐藏开关在单标签、静态、轮播和弹出框均生效,继续定时校验以发现恢复;仅轮播跳过时,其他视图仍保留提示。超时和执行错误始终可见。
103
+ 5. **四种组展示**:概览、轮播、静态横排和竖排的悬停范围正确;组名只出现在弹出框,主标签和子标签层级明确,各列对齐,组间细线分隔紧凑。设置页四大区域和内部卡片的边框清晰。
104
+ 6. **轮播边界**:连续多个失效项不占额外周期;全部被跳过、只剩一个候选项、主标签禁用和更长输出均正确。宽度固定、内容可换行,窄分屏无溢出。
105
+ 7. **扩展信息**:空命令不执行;成功空输出保持空;错误独立显示;多个标签同时悬停、快速移入移出、持续悬停及断线重连不会混用旧会话数据。详情刷新遵循指标间隔,接收完成后释放通道。大批量脚本必须经过实际插件的传输路径验证,并保持同一 SSH 连接的交互通道可用;检查上传超时、写入失败及延迟确认均只清理统计通道。
106
+ 8. **内置指标**:修改默认命令确实改变采集结果;恢复一个内置项不影响其他项目,顶层启用状态和排序不变。上下移动 CPU、内存、磁盘、网络后,底栏与悬浮窗真实显示顺序一致,重开后保持。网络主/子标签可独立启用。
107
+ 9. **连接与混合布局**:`P1 / P2 / P1` 中按原始连接 ID 分别匹配;焦点变化不改变范围。同一连接多次打开,各自独立采集。选择布局与连接采用并集。
108
+ 10. **范围生命周期**:重命名保持关联;删除后不转为全局,同名新连接不继承。指定范围为空仍不显示。仅针对整个布局绑定,未标记的旧布局或刚保存的新布局重开一次,再检查恢复、分屏和移动窗格。
109
+ 11. **离线与 GitHub 库**:20 项(12 单标签、8 组)可离线搜索、加载和添加;GitHub 与 JSON 导入均只预览、点击添加才生效,保留当前及此前导入的条目并按同 ID 更新。检查 15 秒超时、2 MiB 上限、HTTP/JSON 错误时原列表不变。导出/导入保留类型、颜色规则、开关、来源与双语描述,不携带本地范围 ID。缺失或重名连接提示补选,保持指定范围为空而非全局。
110
+ 12. **磁盘与 GPU**:所有磁盘组主标签为总余量、系统盘为第一子标签;只汇总可读有效文件系统,同一文件系统的绑定挂载不重复计数。P1 宿主模板只绑定 P1(ai)、仅系统盘;P1 容器模板绑定 P1(s_lsn)、包含 `/public`。P0/P2/P4 检查 `/data`,P3 检查 `/data` 和 `/lsn_disk1`。GPU 主值为显存占比,详情用 `memory.free / 1024` 的 GiB;无设备主标签提示、缺失子 GPU 隐藏。
111
+ 13. **登录用户与网络**:登录用户主值包含正常 tty/pts/console 会话,悬停按用户名稳定汇总;空数据为 `0`/`-`,命令失败不冒充空数据。网络按默认路由网卡优先、无路由时回退非回环网卡;Linux/macOS 下载和上传分别验证速率 KiB/s、累计 GiB 与网卡名称。累计量自接口建立或计数器重置起算,不是本次 SSH 登录后的流量。
112
+ 14. **阈值与双语**:红色规则先于橙色。逐一验证边界:单盘 20/40 GiB、总余量 50/100 GiB、GPU 显存 50/80%、RAM 60/80%、CPU 1min/5min 负载 100/150%;比较方向与包含边界应符合 README 表格。检查中英文切换、26 个图标搜索分类及自定义 SVG。
113
+
114
+ ## 发布到 npm
115
+
116
+ 维护者需要 npm 账号和目标包名的发布权限;GitHub fork 权限不会自动带来 npm 权限。先查询包名,再在个人终端登录:
117
+
118
+ ```powershell
119
+ npm.cmd view tabby-group-server-stats name version maintainers --registry=https://registry.npmjs.org/
120
+ npm.cmd login --registry=https://registry.npmjs.org/ --auth-type=web
121
+ npm.cmd whoami --registry=https://registry.npmjs.org/
122
+ ```
123
+
124
+ 404 仅表示当前查不到公开包,不能保证名字一定可注册。若同名包属于他人,请换用其他非 scoped 的 `tabby-` 前缀包名并同步文档、锁文件。按 npm 的网页或终端提示完成登录及发布认证,不把令牌写入项目。[npm login](https://docs.npmjs.com/cli/v11/commands/npm-login/)、[npm 发布认证说明](https://docs.npmjs.com/requiring-2fa-for-package-publishing-and-settings-modification/)
125
+
126
+ 验收通过后,手动发布刚才测试的同一个包:
127
+
128
+ ```powershell
129
+ npm.cmd publish .\tabby-group-server-stats-1.7.2.tgz --access public --registry=https://registry.npmjs.org/
130
+ npm.cmd view tabby-group-server-stats version dist.tarball --registry=https://registry.npmjs.org/
131
+ ```
132
+
133
+ 同一包名和版本不能重复覆盖,后续修改需提高版本号并重新测试、构建和打包。需要自动发布时再单独设置 Trusted Publishing;本仓库的这些步骤不会创建凭据或自动上传。[npm publish](https://docs.npmjs.com/cli/v11/commands/npm-publish/)、[Trusted Publishing](https://docs.npmjs.com/trusted-publishers/)
134
+
135
+ ## 在 Tabby 插件列表找到包
136
+
137
+ Tabby 1.0.238 的插件管理器通过 npm 的 `tabby-plugin` 关键词搜索,并过滤以 `tabby-` 开头的包名。本项目使用非 scoped 的 `tabby-group-server-stats`,且包含所需关键词。[插件管理器源码](https://github.com/Eugeny/tabby/blob/v1.0.238/tabby-plugin-manager/src/services/pluginManager.service.ts)
138
+
139
+ 发布成功且 npm 搜索索引更新后,在 Tabby 设置 → 插件搜索 `group-server-stats`,安装并重启。索引可能不会立即更新;先用 `npm view` 确认版本和元数据,再刷新插件列表。推送 GitHub 或上传 GitHub Release 本身不会发布 npm 包。[Tabby 插件开发说明](https://github.com/Eugeny/tabby/blob/master/HACKING.md#plugins)
package/README.en.md ADDED
@@ -0,0 +1,178 @@
1
+ # Tabby Group Server Stats
2
+
3
+ [中文](README.md) | English
4
+
5
+ Editable server metrics, hover details and metric groups for [Tabby](https://github.com/Eugeny/tabby). The current version is **1.7.2**, with more compact static rows, three-decimal MB/s rates, and aligned capacity columns.
6
+
7
+ 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
+
9
+ **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
+
11
+ ![Offline preset library](docs/images/preset-library.png)
12
+
13
+ The preview uses example configuration data and the Chinese interface.
14
+
15
+ ## Features
16
+
17
+ - **Standalone labels:** text or progress bars with individual icons, units, color rules, refresh intervals and timeouts.
18
+ - **Three command stages:** optional object check, primary shell command and optional hover-detail command.
19
+ - **Metric groups:** one main label and multiple children, with overview, carousel, horizontal static and vertical static displays.
20
+ - **Independent switches:** disable a standalone label, an entire group, its main label or individual children without deleting commands or color rules.
21
+ - **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.
23
+ - **Offline and GitHub library:** 20 bundled presets—12 standalone labels and 8 groups—with imports from this fork, JSON import/export and search.
24
+ - **Clear section and card borders:** separate built-ins, presets, standalone labels and groups; compact line separators between displayed groups.
25
+ - **English/Chinese UI and 26 original monitoring icons:** searchable categories, existing icon support and custom SVGs.
26
+
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.
28
+
29
+ ## Create a label
30
+
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.
32
+
33
+ New labels default to **text** and checks default to **output-text comparison**. Configure commands in this order:
34
+
35
+ 1. **Object check, optional:** compare trimmed standard output or an expected exit code. Without a check, the primary command runs directly.
36
+ 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.
38
+
39
+ For a separate filesystem mounted at `/data2`:
40
+
41
+ ```sh
42
+ # Check: choose exit-code comparison, expected value 0
43
+ mountpoint -q /data2
44
+
45
+ # Primary command: text type, % suffix
46
+ data=$(df -P /data2) || exit 1
47
+ printf '%s\n' "$data" | awk 'NR==2 {gsub(/%/, "", $5); print $5}'
48
+
49
+ # Hover details
50
+ data=$(df -hP /data2) || exit 1
51
+ printf '%s\n' "$data" | awk 'NR==2 {print "available " $4 " / used " $3}'
52
+ ```
53
+
54
+ Set the unavailable message to “Not mounted”. Checking the mount point prevents an unmounted disk's remaining directory from reporting its parent filesystem instead. A failed check skips both the primary and detail commands. Commands run inside the corresponding pane's session with that connection user's permissions and require the appropriate tools on the target.
55
+
56
+ Details follow the label's refresh interval, or the global interval when unset: 3 seconds by default, with a minimum of 1 second. Repeated mouse events do not rerun a cached command. A bounded SSH completion acknowledgment protects output from fast-closing channels without automatically retrying user commands. Detail errors appear separately in red and preserve a healthy primary value; successful empty detail output stays empty.
57
+
58
+ ## Groups and visibility
59
+
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.
61
+
62
+ - **Overview:** shows the main label; hover opens the full group vertically with details.
63
+ - **Carousel:** rotates through child labels; hover pauses rotation and opens the full group. Skipped children do not consume extra rotation periods.
64
+ - **Horizontal static:** shows main and child labels together; only the hovered label expands its details.
65
+ - **Vertical static:** shows all labels vertically; hovering the group expands their details together.
66
+
67
+ After the initial results arrive, a carousel reserves the width of its longest candidate. Later, longer output wraps within that fixed width, including in narrow split panes. Collection and rotation have separate intervals. A failed main-label check does not block its children.
68
+
69
+ | Setting | Normal display and collection | When the object check fails |
70
+ | --- | --- | --- |
71
+ | `enabled: false` | No display or execution; disabling a group affects every member | Checks also stop |
72
+ | `visibleWhenUnavailable: true` (default) | Normal operation | Keep the failure notice in all views |
73
+ | `visibleWhenUnavailable: false` | Normal operation | Hide in every view; keep checking for recovery |
74
+ | `showWhenUnavailable: false` | Normal operation | Skip only in the carousel; other views follow the setting above |
75
+
76
+ An unavailable child participates in the carousel only when both visibility flags permit it. Turning off global unavailable visibility also turns off carousel participation in settings. **Timeouts, connection failures and primary-command errors are not missing-object results**, and these visibility flags do not hide them. Omitted settings retain legacy behavior: enabled, with failure notices visible. Individual presets may explicitly override these defaults.
77
+
78
+ Disabling the main label does not disable its children. Disabling one child leaves its siblings active. A group uses its empty-state text when no carousel child is eligible; a group whose every member is disabled or hidden disappears entirely.
79
+
80
+ ## Editable built-ins
81
+
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.
83
+
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.
85
+
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.
87
+
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.**
89
+
90
+ The target system needs `timeout`, `gtimeout` or `setsid` for bounded command execution.
91
+
92
+ ## Offline and GitHub preset library
93
+
94
+ The shipped library works offline. **Import from GitHub** reads [this fork's main-branch presets](https://github.com/lishuainan0209/tabby-group-server-stats/blob/main/presets.json), rather than the upstream project's URL. Successful imports merge into the current library, retaining local and earlier imported entries and replacing matching IDs. A failed fetch leaves the current list intact. Remote `main` reflects what has actually been pushed and may differ from the local version.
95
+
96
+ GitHub and JSON imports only preview entries: they do not execute commands or add status-bar items until you click **Add**. GitHub downloads have a 15-second timeout and a 2 MiB size limit, and do not upload local configuration or connection information. Search or export the current custom standalone labels and groups; exports omit built-in overrides. The format supports `kind: "metric"` and `kind: "group"`, and accepts the original flat metric array.
97
+
98
+ The 12 standalone presets cover uptime, temperature, system load, logged-in users, Docker containers, GPU memory, SSH sessions, SSH latency, I/O wait, CPU steal, failed services and service state. The 8 groups are:
99
+
100
+ **Laboratory-specific presets: P0磁盘, P1磁盘, P1容器磁盘, P2磁盘, P3磁盘 and P4磁盘 are for the author's laboratory only. Other users: please do not download or use these presets.** Their mount paths and saved connection names are specific to the author's laboratory; they are not generic server templates. This usage-scope notice does not apply to the general GPU or CPU-load presets and does not change the rights granted by the MIT license.
101
+
102
+ | Group | Main label and children | Suggested saved connections |
103
+ | --- | --- | --- |
104
+ | P0磁盘 | Aggregate free capacity; system `/`, then `/data` | P0(ai), P0(s_lsn) |
105
+ | P1磁盘 | Aggregate free capacity; system `/` child only | P1(ai) |
106
+ | P1容器磁盘 | Aggregate free capacity; system `/`, then `/public` | P1(s_lsn) |
107
+ | P2磁盘 | Aggregate free capacity; system `/`, then `/data` | P2(ai), P2(s_lsn) |
108
+ | P3磁盘 | Aggregate free capacity; system `/`, then `/data` and `/lsn_disk1` | P3(ai), P3(s_lsn) |
109
+ | P4磁盘 | Aggregate free capacity; system `/`, then `/data` | P4(ai), P4(s_lsn) |
110
+ | GPU memory | Aggregate GPU memory; eight children GPU 0–7 | All panes |
111
+ | CPU load | Thread count; 1-minute and 5-minute load | All panes |
112
+
113
+ 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.
114
+
115
+ 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.
116
+
117
+ 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.
118
+
119
+ 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.
120
+
121
+ If a faulty device blocks an all-GPU query, the aggregate command queries GPU 0–7 individually and sums readable devices. With no readable device it shows “No GPU”; this means the query is unavailable, not proof that no GPU is installed.
122
+
123
+ Suggested names resolve **when adding** a preset and must uniquely match a local saved profile. Missing or ambiguous names require manual selection, and the scope stays restricted. With no resolved profiles, it remains explicitly selected-empty and neither displays nor executes. Subsequent matching uses local stable profile IDs. Shared exports express connection bindings through names; review your own commands and descriptions before sharing them.
124
+
125
+ ## Default color thresholds
126
+
127
+ The corresponding built-ins and presets use green `#00ff00`, orange `#ffa500` and red `#ff0000`. Rules match from top to bottom, so **red rules precede orange rules**. Saved custom rules take precedence after editing.
128
+
129
+ | Metric | Red | Orange | Green |
130
+ | --- | --- | --- | --- |
131
+ | Free capacity per disk (GiB) | `< 20` | `20 ≤ x ≤ 40` | `> 40` |
132
+ | Total free disk capacity (GiB) | `< 50` | `50 ≤ x ≤ 100` | `> 100` |
133
+ | GPU memory usage (%) | `> 80` | `50 < x ≤ 80` | `≤ 50` |
134
+ | RAM usage (%) | `> 80` | `60 < x ≤ 80` | `≤ 60` |
135
+ | Normalized CPU 1min / 5min load (%) | `> 150` | `100 < x ≤ 150` | `≤ 100` |
136
+
137
+ GPU thresholds measure VRAM use, not GPU compute utilization. CPU load is normalized by the logical processor count and can exceed 100%.
138
+
139
+ ## Connection scopes and mixed panes
140
+
141
+ 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.
142
+
143
+ 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.
144
+
145
+ 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.
146
+
147
+ 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.
148
+
149
+ ## Install, develop and publish
150
+
151
+ After publication, search for `tabby-group-server-stats` in Tabby's plugin settings. Before publication, test a local `.tgz`. A GitHub fork, a successful build, npm publication and Tabby's search index are separate steps.
152
+
153
+ Development needs Node.js, npm, Git and Tabby. Global Angular CLI/Webpack installations and Python are not required for this project. Keep the lockfile and `.npmrc`, then run from the repository root:
154
+
155
+ ```powershell
156
+ Set-Location -LiteralPath 'D:\tabby-group-server-stats'
157
+ npm.cmd ci
158
+ npm.cmd run typecheck
159
+ npm.cmd test
160
+ npm.cmd run test:ui
161
+ npm.cmd pack
162
+ ```
163
+
164
+ `npm pack` reruns type checking, unit tests and the production build, producing `tabby-group-server-stats-1.7.2.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.
165
+
166
+ 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.
167
+
168
+ ## License and contributions
169
+
170
+ Original project: [kasuganosoras/tabby-server-stats](https://github.com/kasuganosoras/tabby-server-stats), by Akkariin, Copyright (c) 2023 Akkariin Meiko. [LICENSE](LICENSE) preserves the original MIT text, and [NOTICE](NOTICE) describes this fork's attribution and changes. The 26 new monitoring icons use MIT as well; dependencies retain their own licenses and notices.
171
+
172
+ Report problems or suggest improvements through [this project's Issues](https://github.com/lishuainan0209/tabby-group-server-stats/issues). Shared presets should state required tools, metric meaning and source licenses.
173
+
174
+ ### 1.7.2 display fixes
175
+
176
+ - Convert KiB/s readings to MB/s with three fractional digits.
177
+ - Remove gaps between static vertical rows, add thin separators, and reduce bottom-bar padding.
178
+ - Right-align numeric columns and both sides of capacity ratios; hover popups retain comfortable spacing.
package/README.md CHANGED
@@ -1,3 +1,178 @@
1
- # Temporary Holding Version
1
+ # Tabby Group Server Stats
2
+
3
+ 中文 | [English](README.en.md)
4
+
5
+ 为 [Tabby](https://github.com/Eugeny/tabby) 提供可编辑的服务器指标、悬停详情和多标签组。当前版本为 **1.7.2**,进一步压缩静态底栏高度,支持网速 MB/s 三位小数及容量数字分列对齐。
6
+
7
+ 本项目基于 [Akkariin 的 tabby-server-stats](https://github.com/kasuganosoras/tabby-server-stats) 二次开发,继续使用 MIT 许可证。版本号不代表已经发布到 npm。
8
+
9
+ **保留 1.6.1 的 SSH 热修复**:此前指标较多时,超长 SSH 执行请求可能导致整个连接断开。执行请求已改为固定短命令,脚本通过标准输入按 8 KiB 分块传输,保留完整接收后的有时限确认。传输失败只关闭本次统计通道,不主动关闭终端会话,也不会自动重跑用户命令。
10
+
11
+ ![离线预设库界面](docs/images/preset-library.png)
12
+
13
+ 上图使用示例配置展示离线预设库。
14
+
15
+ ## 功能一览
16
+
17
+ - **单标签**:文本或进度条,独立图标、单位、颜色规则、刷新频率和超时。
18
+ - **三条命令**:对象校验 → Shell 功能命令 → 悬停扩展信息;校验失败时不执行后两条。
19
+ - **标签组**:主标签与多个子标签,支持概览、轮播、静态横排和静态竖排。
20
+ - **分别启用**:单标签、整个标签组、组内主标签和每个子标签都能独立开关,配置及颜色规则保留。
21
+ - **按连接显示**:多选保存的连接或布局,正确区分混合分屏中的每个会话。
22
+ - **可编辑、可排序的内置指标**:CPU、内存、磁盘和网络可修改命令与样式,使用上下移按钮调整两种面板的显示顺序,也可单独恢复默认。
23
+ - **离线与 GitHub 标签库**:内附 20 个预设(12 个单标签、8 个标签组),支持从本 fork 的 GitHub 导入、JSON 导入导出和搜索。
24
+ - **清晰的区域与卡片边框**:内置指标、预设库、单标签、多标签组四块区域分别显示;状态栏组间采用紧凑细线分隔。
25
+ - **中英文界面与 26 款原创图标**:图标按用途分类、可搜索,也支持原有图标和自定义 SVG。
26
+
27
+ 底部状态栏与悬浮窗使用同一个标签显示组件,内置指标也遵循相同的校验、颜色、范围和悬停规则。
28
+
29
+ ## 从一个标签开始
30
+
31
+ 在 Tabby 设置 → 服务器状态中,点击“添加单标签”,或从标签库选择一个预设后点击“添加”。从 GitHub 或 JSON 导入都只加载可选条目;点击“添加”才把对应条目加入当前配置。已有项目使用铅笔按钮编辑,组内主、子标签点击后分别展开编辑框。
32
+
33
+ 新建标签默认使用**文本值**,校验默认比较**输出文本**。每个标签的命令顺序为:
34
+
35
+ 1. **对象校验命令,可选**:比较去除首尾空白后的输出文本,或指定退出码。未配置则直接执行功能命令。
36
+ 2. **Shell 功能命令**:定时采集状态栏主值。
37
+ 3. **悬停扩展信息命令,可选**:悬停时将结果追加到主值后,移出收起;留空不请求扩展信息。
38
+
39
+ 例如,检查独立挂载的 `/data2`,显示使用百分比:
40
+
41
+ ```sh
42
+ # 对象校验:选择“退出码”,期望值设为 0
43
+ mountpoint -q /data2
44
+
45
+ # Shell 功能命令:类型“文本”,后缀 %
46
+ data=$(df -P /data2) || exit 1
47
+ printf '%s\n' "$data" | awk 'NR==2 {gsub(/%/, "", $5); print $5}'
48
+
49
+ # 悬停扩展信息
50
+ data=$(df -hP /data2) || exit 1
51
+ printf '%s\n' "$data" | awk 'NR==2 {print "available " $4 " / used " $3}'
52
+ ```
53
+
54
+ 将校验失败文字设为“未挂载”。`mountpoint` 用于区分真正挂载的磁盘与仅剩目录,避免磁盘掉线后误读父文件系统容量。命令在对应窗格的会话内、以当前连接用户的权限执行;需要服务器具有命令使用的工具。
55
+
56
+ 扩展信息按该标签的刷新频率缓存,未设置时使用全局频率(默认 3 秒,最少 1 秒),持续悬停不会每次鼠标事件都重跑命令。快速完成的 SSH 命令使用有时限的结果接收确认,且不会自动重跑用户命令。扩展信息错误单独提示并标红,正常主值保留;成功但无输出的扩展命令保持为空。
57
+
58
+ ## 标签组与可见性
59
+
60
+ 组名只在悬停弹出框显示,状态栏直接显示标签内容。主标签顶格,子标签缩进,弹出框中的名称、数值和扩展信息按列对齐。组间使用细线和较小间距,减少有限状态栏宽度中的留白。
61
+
62
+ - **概览**:平时显示主标签;悬停后竖排展示整组及各自的扩展信息。
63
+ - **轮播**:按组的轮播间隔切换子标签;悬停暂停并展开整组。跳过无效子标签时直接选择下一个,不额外等待一个周期。
64
+ - **静态横排**:同时横向显示主标签与子标签,仅悬停的标签展开详情。
65
+ - **静态竖排**:同时竖向显示主标签与子标签,悬停整组时显示各项详情。
66
+
67
+ 轮播首次结果返回后按最长候选项预留固定宽度;后续更长的内容在固定宽度内换行,窄分屏内也能完整显示。数据刷新间隔与轮播间隔彼此独立。主标签校验失败不会阻止子标签采集。
68
+
69
+ | 配置 | 正常显示与采集 | 校验失败时 |
70
+ | --- | --- | --- |
71
+ | `enabled: false` | 不显示、不执行该项;禁用组时包含全部成员 | 不再执行校验 |
72
+ | `visibleWhenUnavailable: true`(默认) | 正常运行 | 各视图保留失败提示 |
73
+ | `visibleWhenUnavailable: false` | 正常运行 | 所有视图隐藏该项,继续定时校验以发现恢复 |
74
+ | `showWhenUnavailable: false` | 正常运行 | 仅从轮播跳过;其他视图仍遵循上一项 |
75
+
76
+ 参与失败状态轮播需要两个可见性开关同时允许。关闭“校验失败仍显示”时,设置页同时关闭“仍参与轮播”。**超时、连接失败、功能命令错误不属于“对象不存在”**,不会被这两个开关隐藏。旧配置省略开关时默认启用、默认显示失败提示;GPU 等特定预设可以主动覆盖默认值。
77
+
78
+ 组内禁用主标签不会禁用子标签,禁用某个子标签也不会影响其他成员。没有可轮播子标签时使用组的空状态文字;全部成员都被禁用或隐藏时不显示整组。
79
+
80
+ ## 内置指标也能编辑
81
+
82
+ CPU、内存、磁盘是单标签;网络是静态竖排标签组,默认显示下载和上传,主标签默认关闭。它们与自定义项目使用相同的命令编辑、对象校验、扩展信息、显示范围和颜色规则,不再另走硬编码图表采集路径。
83
+
84
+ 使用卡片右侧上下移按钮调整 CPU、内存、磁盘和网络的顺序。顺序保存在 `builtinOrder` 中,底部状态栏与悬浮窗一致,重开后保留;自定义单标签和标签组仍按各自原有顺序排列。
85
+
86
+ “恢复默认”只删除当前内置项的自定义覆盖,保留它的顶层启用开关和排列顺序,不影响其他内置项或自定义标签。网络恢复默认会恢复该组的出厂主、子标签配置。
87
+
88
+ 内置 CPU、内存、磁盘和网络均包含 Linux/macOS 适配,多数其他离线预设面向 Linux。网络下载、上传主值分别是当前接收、发送速率,显示单位为 MB/s(十进制),固定三位小数并带千位逗号;采集命令仍输出 KiB/s,颜色规则继续按原始数值判断;各自悬停显示对应方向的累计 GiB 和参与统计的网卡。默认优先选择默认路由网卡,没有可用默认路由时回退到符合条件的非回环网卡。**累计量从接口建立或计数器重置起计算,不是本次 SSH 登录后的流量**。
89
+
90
+ 目标系统需要提供 `timeout`、`gtimeout` 或 `setsid` 之一,用于命令超时保护。
91
+
92
+ ## 离线与 GitHub 标签库
93
+
94
+ 库随插件提供,可直接离线使用。“从 GitHub 导入”会读取 [当前 fork 的 main 分支预设](https://github.com/lishuainan0209/tabby-group-server-stats/blob/main/presets.json),不再读取旧项目地址。获取成功后合并到当前库,保留本地条目及之前导入的条目,同 ID 更新;获取失败保留原列表。远端 `main` 内容取决于实际推送状态,可能与当前本地版本不同。
95
+
96
+ 从 GitHub 或 JSON 导入仅预览,不执行命令,也不自动添加到状态栏;逐项点击“添加”才生效。GitHub 获取具有 15 秒超时和 2 MiB 大小上限,不上传本地配置或连接信息。设置页还支持搜索和导出当前自定义单标签/标签组;导出不包含内置指标覆盖。JSON 同时支持 `kind: "metric"`、`kind: "group"`,也兼容原版的平铺单标签数组。
97
+
98
+ 12 个单标签覆盖运行时间、温度、系统负载、登录用户、Docker 容器、GPU 显存、SSH 会话、SSH 延迟、I/O 等待、CPU Steal、失败服务和服务状态。8 个标签组如下:
99
+
100
+ **实验室专用预设说明:P0磁盘、P1磁盘、P1容器磁盘、P2磁盘、P3磁盘、P4磁盘均为作者实验室自用,其他人请勿下载使用。** 这些预设依赖作者实验室的挂载路径和连接配置,不是通用服务器模板。通用 GPU、CPU 负载等预设不受此适用范围提示影响。此提示用于说明适用环境,不改变 MIT 许可证授予的权利。
101
+
102
+ | 标签组 | 主标签与子标签 | 建议连接 |
103
+ | --- | --- | --- |
104
+ | P0磁盘 | 总余量;系统盘 `/`、`/data` | P0(ai)、P0(s_lsn) |
105
+ | P1磁盘 | 总余量;仅系统盘 `/` 子标签 | P1(ai) |
106
+ | P1容器磁盘 | 总余量;系统盘 `/`、`/public` | P1(s_lsn) |
107
+ | P2磁盘 | 总余量;系统盘 `/`、`/data` | P2(ai)、P2(s_lsn) |
108
+ | P3磁盘 | 总余量;系统盘 `/`、`/data`、`/lsn_disk1` | P3(ai)、P3(s_lsn) |
109
+ | P4磁盘 | 总余量;系统盘 `/`、`/data` | P4(ai)、P4(s_lsn) |
110
+ | GPU 显存 | 全部 GPU 汇总;GPU 0–7 八个子标签 | 所有窗格 |
111
+ | CPU负载 | 线程数;1 分钟、5 分钟负载 | 所有窗格 |
112
+
113
+ 磁盘组主标签为**磁盘总余量 GiB**,汇总系统盘及该组有效挂载的数据盘,按文件系统去重,避免绑定挂载重复计数。系统盘是第一子标签,后接数据盘;每项悬停显示剩余/总容量。掉盘不进入汇总,其子标签默认保留“未挂载”提示;没有任何可读取的有效文件系统时显示错误,而不是伪装为 0。
114
+
115
+ “登录用户”主值统计 `who` 中的系统登录会话,包含正常 tty、pts 和控制台登录;悬停按用户名汇总并排序,例如 `alice ×2, bob ×1`。无人登录时主值为 `0`、详情为 `-`;工具缺失或执行失败保持错误提示。它不是当前连接用户名,也不等于所有 TCP 或后台 SSH 连接数。
116
+
117
+ GPU 百分比是**显存使用率**(`memory.used / memory.total`),不是 `utilization.gpu` 计算利用率;悬停直接查询 `memory.free`,除以 1024 转为 GiB 后显示剩余/总显存。GPU 主标签无设备时保留提示,不存在的 GPU 子标签默认在所有视图隐藏。
118
+
119
+ 整机 GPU 查询被异常设备阻断时,汇总命令会逐一查询 GPU 0–7,只汇总可读取的设备;没有可读取设备时显示“无GPU”。该提示表示查询不可用,不等同于确认机器未安装显卡。
120
+
121
+ P1 宿主与容器是两个独立模板,分别绑定各自连接;不能仅因地址相同就合并不同端口的连接。
122
+
123
+ 预设中的连接名仅用于**添加时**匹配本机保存的配置,且必须唯一匹配;缺失或重名的连接会提示手工选择,范围保持“指定连接”,不会扩大到全部窗格。若没有匹配到任何连接,保持“指定范围为空”,暂不显示或执行。添加后按本机配置的稳定 ID 关联。导出的共享库使用连接名表达范围;分享前仍应检查自己写入的命令和说明。
124
+
125
+ ## 默认颜色阈值
126
+
127
+ 对应内置项和预设使用绿色 `#00ff00`、橙色 `#ffa500`、红色 `#ff0000`。规则自上而下首次匹配,**红色规则放在橙色之前**;修改后以保存的规则为准。
128
+
129
+ | 指标 | 红色 | 橙色 | 绿色 |
130
+ | --- | --- | --- | --- |
131
+ | 单盘剩余容量(GiB) | `< 20` | `20 ≤ x ≤ 40` | `> 40` |
132
+ | 磁盘总剩余容量(GiB) | `< 50` | `50 ≤ x ≤ 100` | `> 100` |
133
+ | GPU 显存使用率(%) | `> 80` | `50 < x ≤ 80` | `≤ 50` |
134
+ | 内存使用率(%) | `> 80` | `60 < x ≤ 80` | `≤ 60` |
135
+ | CPU 1min / 5min 归一化负载(%) | `> 150` | `100 < x ≤ 150` | `≤ 100` |
136
+
137
+ GPU 阈值衡量显存占用,不是 GPU 计算利用率;CPU 负载按逻辑处理器数量归一化,可超过 100%。
138
+
139
+ ## 连接范围与混合分屏
140
+
141
+ 单标签和整个标签组可以多选保存的连接或布局,默认“不限制范围”会在所有受支持的终端窗格显示。主、子标签继承组范围,范围不匹配时连校验命令也不运行。
142
+
143
+ 关联依据每个窗格实际使用的**原始连接配置 ID**,不依据窗口标题、当前焦点、主机地址或其他窗格。一个 `P1 / P2 / P1` 混合布局中,只绑定 P1 的指标在两个 P1 窗格出现;只绑定 P2 的指标只在中间窗格出现。绑定整个保存布局的公共指标在三格生效,各自在自己的会话采集。多选是并集:同时选择 P1 和整个布局会覆盖布局内的 P2。
144
+
145
+ 重命名不影响 ID 关联;删除连接后保留失效选择并停止匹配,同名新连接不会自动继承。删去最后一个选择也不会自动变为全局,必须明确切回“所有终端窗格”。
146
+
147
+ 保存布局拥有独立于内部连接的 ID。插件会在打开已保存布局时记录布局来源并随恢复信息保存。只有**绑定整个布局**时,安装前已打开的未标记布局、或刚从当前分屏新保存的布局,需要从配置列表重新打开一次。按原始连接 ID 绑定不受此限制。
148
+
149
+ ## 安装、开发与发布
150
+
151
+ 正式发布后可在 Tabby 插件页搜索 `tabby-group-server-stats`。未发布时使用本地 `.tgz` 包测试。GitHub fork、构建成功、npm 发布和 Tabby 搜索索引是不同步骤。
152
+
153
+ 开发需要 Node.js、npm、Git 和 Tabby;无需全局安装 Angular CLI、Webpack 或 Python。保留仓库锁文件及 `.npmrc`,在仓库根目录执行:
154
+
155
+ ```powershell
156
+ Set-Location -LiteralPath 'D:\tabby-group-server-stats'
157
+ npm.cmd ci
158
+ npm.cmd run typecheck
159
+ npm.cmd test
160
+ npm.cmd run test:ui
161
+ npm.cmd pack
162
+ ```
163
+
164
+ `npm pack` 会再次执行类型检查、普通测试和正式构建,生成 `tabby-group-server-stats-1.7.2.tgz`;构建文件在 `dist/`。浏览器测试使用真实 Angular 组件与模拟数据,命令测试在本机 shell 运行;真实 SSH 命令验证与 Tabby 分屏验收需要分别记录结果。
165
+
166
+ 本 fork 继续使用 `plugin.serverStats` 配置,方便沿用已有指标。**同一个 Tabby 实例只启用原版或本 fork 其中一个**,避免重复采集。推荐先使用独立便携版测试。完整的本地安装命令、验收项目和 npm/Tabby 发布步骤见 [打包、测试与发布](PUBLISHING.zh-CN.md)。
167
+
168
+ ## 许可证与贡献
169
+
170
+ 原项目为 [kasuganosoras/tabby-server-stats](https://github.com/kasuganosoras/tabby-server-stats),原作者 Akkariin,版权声明为 Copyright (c) 2023 Akkariin Meiko。[LICENSE](LICENSE) 保留原始 MIT 全文,[NOTICE](NOTICE) 说明本 fork 的修改和来源。新增 26 款监控图标同样采用 MIT 许可证;依赖及其许可证声明保留各自要求。
171
+
172
+ 问题反馈和改进建议请提交到 [本项目 Issues](https://github.com/lishuainan0209/tabby-group-server-stats/issues)。分享预设时请附命令所需工具、显示含义和来源许可证。
2
173
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
174
+ ### 1.7.2 显示修正
175
+
176
+ - 网速由 KiB/s 换算为 MB/s,固定三位小数。
177
+ - 静态竖排标签取消行间空隙,用细线分隔;底栏上下留白缩小。
178
+ - 同组数值右对齐,容量详情中斜杠两侧数字分别对齐,悬停弹窗保留较宽松行距。