Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bf771b6b0 | ||
|
|
83f1a2002a | ||
|
|
f50a3fe8e5 |
@@ -1,5 +1,14 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
## v2.1.0 - 2026-08-09
|
||||||
|
|
||||||
|
v2.0.0 后的修复版本。
|
||||||
|
|
||||||
|
### Bug 修复
|
||||||
|
|
||||||
|
- 修复会话总量显示网卡开机累计值与今日累计不一致:改回本次运行累计(累加差值),重启 dde-shell 清零
|
||||||
|
- 流量统计裁剪上限调整:按日 90 天 -> 30 天,按月 24 个月 -> 12 个月
|
||||||
|
|
||||||
## v2.0.0 - 2026-08-09
|
## v2.0.0 - 2026-08-09
|
||||||
|
|
||||||
本次为大版本更新,涵盖弹窗重新设计、多个新功能窗口、性能优化和架构重构。
|
本次为大版本更新,涵盖弹窗重新设计、多个新功能窗口、性能优化和架构重构。
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(JNetApplet VERSION 2.0.0 LANGUAGES CXX)
|
project(JNetApplet VERSION 2.1.0 LANGUAGES CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|||||||
@@ -545,11 +545,11 @@ void NetworkMonitorApplet::calculateSpeed()
|
|||||||
const qint64 txDeltaClamped = txDelta > 0 ? txDelta : 0;
|
const qint64 txDeltaClamped = txDelta > 0 ? txDelta : 0;
|
||||||
m_downloadSpeed = rxDeltaClamped / elapsedSec;
|
m_downloadSpeed = rxDeltaClamped / elapsedSec;
|
||||||
m_uploadSpeed = txDeltaClamped / elapsedSec;
|
m_uploadSpeed = txDeltaClamped / elapsedSec;
|
||||||
// 会话总量:直接读取活动接口累计字节数(开机至今),而非累加差值
|
// 会话总量:累加差值(dde-shell 启动至今的流量),重启清零
|
||||||
// 设计原因:用户期望"本次会话"显示当前网卡从开机起的累计流量,
|
// 设计原因:用户期望"本次会话"是本次 dde-shell 运行期间的流量,
|
||||||
// 切换网卡后立即显示新网卡的累计值,无流量网卡显示 0
|
// 与流量统计窗口的"今日累计"(从0点起)区分,数值不会超过今日累计
|
||||||
m_totalDownload = currentRxBytes;
|
m_totalDownload += rxDeltaClamped;
|
||||||
m_totalUpload = currentTxBytes;
|
m_totalUpload += txDeltaClamped;
|
||||||
// 累加日/月流量日志(仅活动接口增量,与速度计算口径一致)
|
// 累加日/月流量日志(仅活动接口增量,与速度计算口径一致)
|
||||||
appendToTrafficLog(rxDeltaClamped, txDeltaClamped);
|
appendToTrafficLog(rxDeltaClamped, txDeltaClamped);
|
||||||
m_lastRxBytes = currentRxBytes;
|
m_lastRxBytes = currentRxBytes;
|
||||||
@@ -573,15 +573,6 @@ void NetworkMonitorApplet::calculateSpeed()
|
|||||||
m_rxDropped = static_cast<quint64>(iface.rxDropped);
|
m_rxDropped = static_cast<quint64>(iface.rxDropped);
|
||||||
m_txDropped = static_cast<quint64>(iface.txDropped);
|
m_txDropped = static_cast<quint64>(iface.txDropped);
|
||||||
emit packetStatsChanged();
|
emit packetStatsChanged();
|
||||||
|
|
||||||
// 接口切换后立即更新会话总量为新网卡的累计字节数(开机至今)
|
|
||||||
// 设计原因:会话总量改为读取活动接口累计值,切换后应立即显示新网卡数据,
|
|
||||||
// 无需等下一次 calculateSpeed(1 秒后)才更新
|
|
||||||
if (m_interfaces.contains(m_activeInterface)) {
|
|
||||||
m_totalDownload = m_interfaces[m_activeInterface].rxBytes;
|
|
||||||
m_totalUpload = m_interfaces[m_activeInterface].txBytes;
|
|
||||||
emit totalChanged();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1036,7 +1027,7 @@ void NetworkMonitorApplet::appendToTrafficLog(qint64 rxDelta, qint64 txDelta)
|
|||||||
m_trafficLog[QStringLiteral("byMonth")] = byMonth;
|
m_trafficLog[QStringLiteral("byMonth")] = byMonth;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 裁剪超期记录:按日最多 90 天、按月最多 24 个月,超出删除最旧记录
|
// 裁剪超期记录:按日最多 30 天、按月最多 12 个月,超出删除最旧记录
|
||||||
// 日期/月份均为 ISO 格式("yyyy-MM-dd"/"yyyy-MM"),字典序即时间序,
|
// 日期/月份均为 ISO 格式("yyyy-MM-dd"/"yyyy-MM"),字典序即时间序,
|
||||||
// 排序后取最小的超量个删除,保证始终保留最近的记录
|
// 排序后取最小的超量个删除,保证始终保留最近的记录
|
||||||
void NetworkMonitorApplet::pruneTrafficLog()
|
void NetworkMonitorApplet::pruneTrafficLog()
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ private:
|
|||||||
void saveTrafficLog();
|
void saveTrafficLog();
|
||||||
// 将本次流量增量累加到当日/当月/当前活动接口的日志记录中(每秒调用,内存操作)
|
// 将本次流量增量累加到当日/当月/当前活动接口的日志记录中(每秒调用,内存操作)
|
||||||
void appendToTrafficLog(qint64 rxDelta, qint64 txDelta);
|
void appendToTrafficLog(qint64 rxDelta, qint64 txDelta);
|
||||||
// 裁剪超期记录:按日最多 90 天、按月最多 24 个月,超出删除最旧记录
|
// 裁剪超期记录:按日最多 30 天、按月最多 12 个月,超出删除最旧记录
|
||||||
void pruneTrafficLog();
|
void pruneTrafficLog();
|
||||||
|
|
||||||
QTimer *m_refreshTimer;
|
QTimer *m_refreshTimer;
|
||||||
@@ -303,9 +303,9 @@ private:
|
|||||||
// 降频保存计数器:每 30 秒(按刷新间隔折算)写盘一次并通知 QML,
|
// 降频保存计数器:每 30 秒(按刷新间隔折算)写盘一次并通知 QML,
|
||||||
// 避免每秒磁盘 IO 与 QML 重绘;析构函数再兜底保存一次
|
// 避免每秒磁盘 IO 与 QML 重绘;析构函数再兜底保存一次
|
||||||
int m_trafficSaveCounter;
|
int m_trafficSaveCounter;
|
||||||
// 按日记录最多保留 90 天、按月最多保留 24 个月,超出自动裁剪最旧记录
|
// 按日记录最多保留 30 天、按月最多保留 12 个月,超出自动裁剪最旧记录
|
||||||
static constexpr int MAX_DAY_ENTRIES = 90;
|
static constexpr int MAX_DAY_ENTRIES = 30;
|
||||||
static constexpr int MAX_MONTH_ENTRIES = 24;
|
static constexpr int MAX_MONTH_ENTRIES = 12;
|
||||||
|
|
||||||
// ---- TCP 连接清单成员 ----
|
// ---- TCP 连接清单成员 ----
|
||||||
// TCP 连接详情列表(QVariantList of QVariantMap),供 QML 连接清单窗口读取
|
// TCP 连接详情列表(QVariantList of QVariantMap),供 QML 连接清单窗口读取
|
||||||
|
|||||||
Reference in New Issue
Block a user