diff --git a/modules/data/webadmin/tmpl/traffic.tmpl b/modules/data/webadmin/tmpl/traffic.tmpl index 368f09b4..81d26c5b 100644 --- a/modules/data/webadmin/tmpl/traffic.tmpl +++ b/modules/data/webadmin/tmpl/traffic.tmpl @@ -40,51 +40,70 @@ - +
-

Traffic

+

Total

- + - - - - - - - - Add the totals separately so that if sort is ever used they stay at the bottom - By keeping them inside the loop we can figure out even/odd classes though. - - - - + + - - + + - - + + - + +
Username In Out Total
User Total
Users
ZNC Total
ZNC
Grand Total
Total
+
+
+
+ + + +
+

Users

+
+
+ + + + + + + + + + + + + + + + + + +
UsernameNetworkInOutTotal
diff --git a/modules/webadmin.cpp b/modules/webadmin.cpp index 6d6ca7ed..afc967b8 100644 --- a/modules/webadmin.cpp +++ b/modules/webadmin.cpp @@ -1475,6 +1475,17 @@ public: l["In"] = CString::ToByteStr(it.second.first); l["Out"] = CString::ToByteStr(it.second.second); l["Total"] = CString::ToByteStr(it.second.first + it.second.second); + + CZNC::TrafficStatsPair NetworkTotal; + CZNC::TrafficStatsMap NetworkTraffic = CZNC::Get().GetNetworkTrafficStats(it.first, NetworkTotal); + for (const auto& it2 : NetworkTraffic) { + CTemplate& l2 = Tmpl.AddRow("TrafficLoop"); + + l2["Network"] = it2.first; + l2["In"] = CString::ToByteStr(it2.second.first); + l2["Out"] = CString::ToByteStr(it2.second.second); + l2["Total"] = CString::ToByteStr(it2.second.first + it2.second.second); + } } Tmpl["UserIn"] = CString::ToByteStr(Users.first);