mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-03 05:38:51 +00:00
Improve traffic refresh
This commit is contained in:
parent
43b96ea4e5
commit
0f099a19cd
5 changed files with 25 additions and 7 deletions
|
@ -98,7 +98,7 @@
|
||||||
public static readonly List<string> fingerprints = new List<string> { "chrome", "firefox", "safari", "randomized", "" };
|
public static readonly List<string> fingerprints = new List<string> { "chrome", "firefox", "safari", "randomized", "" };
|
||||||
public static readonly List<string> allowInsecures = new List<string> { "true", "false", "" };
|
public static readonly List<string> allowInsecures = new List<string> { "true", "false", "" };
|
||||||
public static readonly List<string> domainStrategy4Freedoms = new List<string> { "AsIs", "UseIP", "UseIPv4", "UseIPv6", "" };
|
public static readonly List<string> domainStrategy4Freedoms = new List<string> { "AsIs", "UseIP", "UseIPv4", "UseIPv6", "" };
|
||||||
public static readonly List<string> Languages = new List<string> { "zh-Hans", "en" ,"fa-Ir" };
|
public static readonly List<string> Languages = new List<string> { "zh-Hans", "en", "fa-Ir" };
|
||||||
public static readonly List<string> alpns = new List<string> { "h2", "http/1.1", "h2,http/1.1", "" };
|
public static readonly List<string> alpns = new List<string> { "h2", "http/1.1", "h2,http/1.1", "" };
|
||||||
public static readonly List<string> LogLevel = new List<string> { "debug", "info", "warning", "error", "none" };
|
public static readonly List<string> LogLevel = new List<string> { "debug", "info", "warning", "error", "none" };
|
||||||
public static readonly List<string> InboundTags = new List<string> { "socks", "http", "socks2", "http2" };
|
public static readonly List<string> InboundTags = new List<string> { "socks", "http", "socks2", "http2" };
|
||||||
|
|
|
@ -91,6 +91,10 @@ namespace v2rayN.Handler
|
||||||
if (Global.ShowInTaskbar)
|
if (Global.ShowInTaskbar)
|
||||||
{
|
{
|
||||||
server.indexId = config_.indexId;
|
server.indexId = config_.indexId;
|
||||||
|
server.todayUp = _serverStatItem.todayUp;
|
||||||
|
server.todayDown = _serverStatItem.todayDown;
|
||||||
|
server.totalUp = _serverStatItem.totalUp;
|
||||||
|
server.totalDown = _serverStatItem.totalDown;
|
||||||
updateFunc_(server);
|
updateFunc_(server);
|
||||||
}
|
}
|
||||||
if (server.proxyUp != 0 || server.proxyDown != 0)
|
if (server.proxyUp != 0 || server.proxyDown != 0)
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
namespace v2rayN.Mode
|
namespace v2rayN.Mode
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
class ServerSpeedItem
|
class ServerSpeedItem : ServerStatItem
|
||||||
{
|
{
|
||||||
public string indexId
|
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
public long proxyUp
|
public long proxyUp
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
|
|
|
@ -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));
|
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));
|
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)
|
catch (Exception ex)
|
||||||
|
|
Loading…
Reference in a new issue