diff --git a/v2rayN/v2rayN/Global.cs b/v2rayN/v2rayN/Global.cs index 7f41bb6f..1f7775c2 100644 --- a/v2rayN/v2rayN/Global.cs +++ b/v2rayN/v2rayN/Global.cs @@ -98,7 +98,7 @@ public static readonly List fingerprints = new List { "chrome", "firefox", "safari", "randomized", "" }; public static readonly List allowInsecures = new List { "true", "false", "" }; public static readonly List domainStrategy4Freedoms = new List { "AsIs", "UseIP", "UseIPv4", "UseIPv6", "" }; - public static readonly List Languages = new List { "zh-Hans", "en" ,"fa-Ir" }; + public static readonly List Languages = new List { "zh-Hans", "en", "fa-Ir" }; public static readonly List alpns = new List { "h2", "http/1.1", "h2,http/1.1", "" }; public static readonly List LogLevel = new List { "debug", "info", "warning", "error", "none" }; public static readonly List InboundTags = new List { "socks", "http", "socks2", "http2" }; diff --git a/v2rayN/v2rayN/Handler/StatisticsHandler.cs b/v2rayN/v2rayN/Handler/StatisticsHandler.cs index 1427a4fd..022e5853 100644 --- a/v2rayN/v2rayN/Handler/StatisticsHandler.cs +++ b/v2rayN/v2rayN/Handler/StatisticsHandler.cs @@ -91,6 +91,10 @@ namespace v2rayN.Handler if (Global.ShowInTaskbar) { server.indexId = config_.indexId; + server.todayUp = _serverStatItem.todayUp; + server.todayDown = _serverStatItem.todayDown; + server.totalUp = _serverStatItem.totalUp; + server.totalDown = _serverStatItem.totalDown; updateFunc_(server); } if (server.proxyUp != 0 || server.proxyDown != 0) diff --git a/v2rayN/v2rayN/Mode/ServerSpeedItem.cs b/v2rayN/v2rayN/Mode/ServerSpeedItem.cs index 6546d772..b12b4f61 100644 --- a/v2rayN/v2rayN/Mode/ServerSpeedItem.cs +++ b/v2rayN/v2rayN/Mode/ServerSpeedItem.cs @@ -1,12 +1,8 @@ namespace v2rayN.Mode { [Serializable] - class ServerSpeedItem + class ServerSpeedItem : ServerStatItem { - public string indexId - { - get; set; - } public long proxyUp { get; set; diff --git a/v2rayN/v2rayN/Tool/Utils.cs b/v2rayN/v2rayN/Tool/Utils.cs index 060f7b58..318eb2c7 100644 --- a/v2rayN/v2rayN/Tool/Utils.cs +++ b/v2rayN/v2rayN/Tool/Utils.cs @@ -611,7 +611,7 @@ namespace v2rayN catch (Exception ex) { SaveLog(ex.Message, ex); - } + } } /// diff --git a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs index edef700f..45ee85cf 100644 --- a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs @@ -533,6 +533,24 @@ namespace v2rayN.ViewModels } SpeedProxyDisplay = string.Format("{0}:{1}/s¡ü | {2}/s¡ý", Global.agentTag, Utils.HumanFy(update.proxyUp), Utils.HumanFy(update.proxyDown)); SpeedDirectDisplay = string.Format("{0}:{1}/s¡ü | {2}/s¡ý", Global.directTag, Utils.HumanFy(update.directUp), Utils.HumanFy(update.directDown)); + + if (update.proxyUp + update.proxyDown > 0) + { + var second = DateTime.Now.Second; + if (second % 3 == 0) + { + var item = _profileItems.Where(it => it.indexId == update.indexId).FirstOrDefault(); + if (item != null) + { + item.todayDown = Utils.HumanFy(update.todayDown); + item.todayUp = Utils.HumanFy(update.todayUp); + item.totalDown = Utils.HumanFy(update.totalDown); + item.totalUp = Utils.HumanFy(update.totalUp); + + _profileItems.Replace(item, Utils.DeepCopy(item)); + } + } + } })); } catch (Exception ex)