docs: 更新README和AGENTS.md同步当前项目状态
功能特性补全设置窗口/字体颜色/流量波动图/IPv6/深色模式/全接口采样。 项目结构补全6个组件。C++ Backend属性列表移除interfaceStats,新增 ipv6Address/version/textColor/speedHistory等。修正卸载入口描述。
This commit is contained in:
@@ -15,14 +15,18 @@ for the UI. The C++ backend reads `/proc/net/dev` to monitor network traffic.
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Real-time download/upload speed monitoring (1-second refresh)
|
- Real-time download/upload speed monitoring (1-second refresh, real elapsed time)
|
||||||
- Total data transfer statistics
|
- Session cumulative download/upload traffic statistics
|
||||||
- Multiple network interface support with interface switching
|
- Multiple network interface support with interface switching (popup + settings)
|
||||||
- Taskbar icon displays live speed (changes color at high speeds)
|
- Taskbar icon displays live speed (changes color at high speeds)
|
||||||
- Hover tooltip shows speed summary
|
- Customizable taskbar font color (follow system theme or pick from preset)
|
||||||
- Click to open detailed popup
|
- Hover tooltip shows interface name + IP address
|
||||||
- Popup shows active interface IP address, per-interface speed comparison and stats
|
- Click to open detailed popup (speed, totals, interface chips)
|
||||||
- One-click plugin uninstall from the popup
|
- Popup shows active interface IPv4/IPv6 address
|
||||||
|
- Traffic chart window: 5-minute speed trend (download/upload dual line chart)
|
||||||
|
- Settings window: interface selection, font color picker, one-click uninstall
|
||||||
|
- Full dark mode support (taskbar icon, popup, all independent windows)
|
||||||
|
- All interfaces sampled in background; switching interfaces shows history immediately
|
||||||
|
|
||||||
## Build & install
|
## Build & install
|
||||||
|
|
||||||
@@ -75,8 +79,13 @@ then restart `dde-shell` (it discovers applets by scanning the install dir for
|
|||||||
│ ├── metadata.json.in # Plugin metadata 模板(由 CMake 生成 metadata.json)
|
│ ├── metadata.json.in # Plugin metadata 模板(由 CMake 生成 metadata.json)
|
||||||
│ ├── networkview.qml # QML UI 主入口
|
│ ├── networkview.qml # QML UI 主入口
|
||||||
│ └── components/ # 拆分出的子组件
|
│ └── components/ # 拆分出的子组件
|
||||||
│ └── AboutWindow.qml # 关于窗口组件
|
│ ├── NetCommon.qml # 公共颜色与格式化函数
|
||||||
├── docs/ # Design docs and implementation plans
|
│ ├── NetworkPopup.qml # 左键弹窗内容
|
||||||
|
│ ├── SettingsWindow.qml # 设置窗口(接口/颜色/卸载)
|
||||||
|
│ ├── TrafficChartWindow.qml # 流量波动图窗口
|
||||||
|
│ ├── TextColorPicker.qml # 字体颜色选择器
|
||||||
|
│ └── AboutWindow.qml # 关于窗口
|
||||||
|
├── docs/ # Design docs and review checklist
|
||||||
└── AGENTS.md # This file
|
└── AGENTS.md # This file
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -100,14 +109,16 @@ then restart `dde-shell` (it discovers applets by scanning the install dir for
|
|||||||
## C++ Backend (NetworkMonitorApplet)
|
## C++ Backend (NetworkMonitorApplet)
|
||||||
|
|
||||||
Inherits from `DApplet`, provides:
|
Inherits from `DApplet`, provides:
|
||||||
- `downloadSpeed` / `uploadSpeed`: Current speed in bytes/sec
|
- `downloadSpeed` / `uploadSpeed`: Current speed in bytes/sec (real elapsed time)
|
||||||
- `totalDownload` / `totalUpload`: Total data transferred
|
- `totalDownload` / `totalUpload`: Session cumulative traffic
|
||||||
- `networkInterfaces`: List of available interfaces
|
- `networkInterfaces`: List of available interfaces
|
||||||
- `interfaceStats`: Per-interface statistics
|
- `activeInterface`: Currently selected interface (persisted to `~/.config/jnetapplet/settings.ini`)
|
||||||
- `activeInterface`: Currently selected interface
|
- `ipAddress` / `ipv6Address`: IP address of the active interface
|
||||||
- `ipAddress`: IP address of the active interface
|
- `version`: Plugin version (from metadata, fallback to `PROJECT_VERSION` macro)
|
||||||
- `refresh()`: Manually trigger stats update
|
- `textColor`: Taskbar font color (empty = follow system theme, persisted)
|
||||||
- `setActiveInterface(name)`: Switch active interface
|
- `speedHistoryDownload` / `speedHistoryUpload`: Per-interface speed history (QPointF list, 5-min window)
|
||||||
|
- `setActiveInterface(name)`: Switch active interface (validates against interface list)
|
||||||
|
- `refresh()`: Internal timer callback (not Q_INVOKABLE, called by m_refreshTimer every second)
|
||||||
|
|
||||||
## Identifier correspondence (keep in sync when renaming)
|
## Identifier correspondence (keep in sync when renaming)
|
||||||
|
|
||||||
|
|||||||
@@ -9,13 +9,17 @@ QML 前端渲染界面,实时显示当前网卡的上行/下行速率与累计
|
|||||||
|
|
||||||
## 功能特性
|
## 功能特性
|
||||||
|
|
||||||
- 实时上行/下行速率监控(1 秒刷新)
|
- 实时上行/下行速率监控(1 秒刷新,按真实时间间隔计算)
|
||||||
- 累计上传/下载流量统计
|
- 本次会话累计上传/下载流量统计
|
||||||
- 多网卡支持,可在弹窗中切换活动网卡
|
- 多网卡支持,可在弹窗或设置窗口中切换活动网卡
|
||||||
- 任务栏图标实时显示速率,高速时变色提示
|
- 任务栏图标实时显示速率,高速时变色提示
|
||||||
- 悬停显示速率摘要,点击展开详情弹窗
|
- 任务栏字体颜色可自定义,支持跟随系统主题
|
||||||
- 详情弹窗展示活动网卡 IP 地址、各网卡速率对比与统计图表
|
- 悬停显示速率摘要与网卡 IP 地址,点击展开详情弹窗
|
||||||
- 支持从弹窗一键卸载插件
|
- 详情弹窗展示活动网卡 IPv4/IPv6 地址、各网卡速率对比与统计
|
||||||
|
- 流量波动图窗口:展示活动接口最近 5 分钟网速趋势(下载/上传双折线)
|
||||||
|
- 设置窗口:网络接口选择、字体颜色自定义、一键卸载插件
|
||||||
|
- 深色模式全适配(任务栏图标、弹窗、独立窗口均跟随系统主题)
|
||||||
|
- 所有接口后台持续采集速度历史,切换网卡时趋势图立即有数据
|
||||||
|
|
||||||
## 构建与安装
|
## 构建与安装
|
||||||
|
|
||||||
@@ -89,8 +93,13 @@ bash build-deb.sh
|
|||||||
│ ├── metadata.json.in # 插件元数据模板(由 CMake 生成 metadata.json)
|
│ ├── metadata.json.in # 插件元数据模板(由 CMake 生成 metadata.json)
|
||||||
│ ├── networkview.qml # QML 界面主入口
|
│ ├── networkview.qml # QML 界面主入口
|
||||||
│ └── components/ # 拆分出的子组件
|
│ └── components/ # 拆分出的子组件
|
||||||
│ └── AboutWindow.qml # 关于窗口组件
|
│ ├── NetCommon.qml # 公共颜色与格式化函数
|
||||||
├── docs/ # 设计文档与实现计划
|
│ ├── NetworkPopup.qml # 左键弹窗内容(速度/总量/网卡切换)
|
||||||
|
│ ├── SettingsWindow.qml # 设置窗口(接口选择/字体颜色/卸载)
|
||||||
|
│ ├── TrafficChartWindow.qml # 流量波动图窗口(5分钟趋势折线)
|
||||||
|
│ ├── TextColorPicker.qml # 字体颜色选择器
|
||||||
|
│ └── AboutWindow.qml # 关于窗口
|
||||||
|
├── docs/ # 设计文档与审查清单
|
||||||
├── README.md # 本文件
|
├── README.md # 本文件
|
||||||
└── AGENTS.md # AI 代理工作指引
|
└── AGENTS.md # AI 代理工作指引
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -71,11 +71,9 @@
|
|||||||
~~`NetworkInterface` 结构体解析了 `rxErrors`/`txErrors`/`rxDropped`/`txDropped`,但 `interfaceStats()` 输出时丢弃了这些字段。~~
|
~~`NetworkInterface` 结构体解析了 `rxErrors`/`txErrors`/`rxDropped`/`txDropped`,但 `interfaceStats()` 输出时丢弃了这些字段。~~
|
||||||
`interfaceStats()` 已随 #12 整体删除,不再有不完整的输出。结构体字段保留供未来使用。
|
`interfaceStats()` 已随 #12 整体删除,不再有不完整的输出。结构体字段保留供未来使用。
|
||||||
|
|
||||||
**15. README.md 和 AGENTS.md 严重过时**
|
**15. ~~README.md 和 AGENTS.md 严重过时~~ ✅ 已修复**
|
||||||
- 项目结构只列 `AboutWindow.qml`,实际有 5 个组件(缺 `NetworkPopup`、`SettingsWindow`、`TextColorPicker`、`TrafficChartWindow`)
|
~~项目结构只列 AboutWindow.qml,功能特性未提及设置窗口/字体颜色/流量波动图/IPv6/深色模式,README 写"从弹窗卸载"实际在设置窗口。~~
|
||||||
- README 功能特性未提及:设置窗口、字体颜色自定义、流量波动图、IPv6 显示
|
已更新 README.md 和 AGENTS.md 的功能特性列表、项目结构(补全 6 个组件)、C++ Backend 属性列表(移除 interfaceStats,新增 ipv6Address/version/textColor/speedHistory 等)。
|
||||||
- README 写"支持从弹窗一键卸载插件",但卸载功能实际在设置窗口
|
|
||||||
- AGENTS.md "Project structure" 同样过时
|
|
||||||
|
|
||||||
**16. `qsTr()` 源字符串为中文,无翻译基础设施**
|
**16. `qsTr()` 源字符串为中文,无翻译基础设施**
|
||||||
QML 中 `qsTr("网络速度监控")` 等以中文为源串,但项目无 `.ts` 翻译文件、无 `lupdate`/`lrelease` 构建步骤、C++ 无翻译加载逻辑。`qsTr()` 实质为空操作。若仅面向中文用户可接受;若计划国际化,需补全 i18n 基础设施并以英文为源串。
|
QML 中 `qsTr("网络速度监控")` 等以中文为源串,但项目无 `.ts` 翻译文件、无 `lupdate`/`lrelease` 构建步骤、C++ 无翻译加载逻辑。`qsTr()` 实质为空操作。若仅面向中文用户可接受;若计划国际化,需补全 i18n 基础设施并以英文为源串。
|
||||||
|
|||||||
Reference in New Issue
Block a user