fix traffic report

This commit is contained in:
Nova 2025-04-02 01:48:58 +03:30
parent fc0b4bf72e
commit 3fa7deacb8
3 changed files with 5 additions and 5 deletions

View File

@ -19,7 +19,7 @@ require (
google.golang.org/protobuf v1.36.6
)
replace github.com/sagernet/sing-box => github.com/Mahdi-zarei/sing-box v1.3.5-0.20250330212248-5e1acd1fa0b1
replace github.com/sagernet/sing-box => github.com/Mahdi-zarei/sing-box v1.3.5-0.20250401221729-163beb8eadb1
replace github.com/sagernet/sing-dns => github.com/Mahdi-zarei/sing-dns v0.3.0-beta.14.0.20250201180230-3ed9d1ef74d5

View File

@ -1,5 +1,5 @@
github.com/Mahdi-zarei/sing-box v1.3.5-0.20250330212248-5e1acd1fa0b1 h1:jgIecHHaWJMjrRgSbNUz1DaYPuze2DC9w1i7qOxTzK8=
github.com/Mahdi-zarei/sing-box v1.3.5-0.20250330212248-5e1acd1fa0b1/go.mod h1:Qj9fRk26crpl3H8MTtLtZ+q5Jme0Kj3Lnxdvku/Mgos=
github.com/Mahdi-zarei/sing-box v1.3.5-0.20250401221729-163beb8eadb1 h1:JXGnvTuSyVA251hAhYtLv0d7NpjERQvwCrt3lkPvdOI=
github.com/Mahdi-zarei/sing-box v1.3.5-0.20250401221729-163beb8eadb1/go.mod h1:Qj9fRk26crpl3H8MTtLtZ+q5Jme0Kj3Lnxdvku/Mgos=
github.com/Mahdi-zarei/sing-dns v0.3.0-beta.14.0.20250201180230-3ed9d1ef74d5 h1:AdwcBEKyia7lvdqJq77G0imGej8IFkHGENfjif+OwHs=
github.com/Mahdi-zarei/sing-dns v0.3.0-beta.14.0.20250201180230-3ed9d1ef74d5/go.mod h1:8wuFcoFkWM4vJuQyg8e97LyvDwe0/Vl7G839WLcKDs8=
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=

View File

@ -31,8 +31,8 @@ namespace NekoGui_traffic {
auto down = resp.downs().at(item->tag);
item->uplink += up;
item->downlink += down;
item->uplink_rate = up * 1000 / interval;
item->downlink_rate = down * 1000 / interval;
item->uplink_rate = static_cast<double>(up) * 1000.0 / static_cast<double>(interval);
item->downlink_rate = static_cast<double>(down) * 1000.0 / static_cast<double>(interval);
auto isInter = false;
for (const auto& inter_tag : resp.intermediate_tags())
{