mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-11 23:15:01 +03:00
Display more information for Connections (#10116)
* Display sniff host * Display process path
This commit is contained in:
@@ -63,8 +63,20 @@ public partial class ClashConnectionsViewModel : MyReactiveObject
|
||||
var lstModel = new List<ClashConnectionModel>();
|
||||
foreach (var item in connections ?? [])
|
||||
{
|
||||
var host =
|
||||
$"{(item.metadata.host.IsNullOrEmpty() ? item.metadata.destinationIP : item.metadata.host)}:{item.metadata.destinationPort}";
|
||||
if (item.metadata == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var dest = item.metadata.host.IsNullOrEmpty() ? item.metadata.destinationIP : item.metadata.host;
|
||||
var hostSb = new StringBuilder();
|
||||
hostSb.Append(dest);
|
||||
hostSb.Append($":{item.metadata.destinationPort}");
|
||||
if (!string.IsNullOrEmpty(item.metadata.sniffHost) &&
|
||||
dest?.Equals(item.metadata.sniffHost, StringComparison.OrdinalIgnoreCase) == false)
|
||||
{
|
||||
hostSb.Append($" ({item.metadata.sniffHost})");
|
||||
}
|
||||
var host = hostSb.ToString();
|
||||
if (HostFilter.IsNotEmpty() && !host.Contains(HostFilter))
|
||||
{
|
||||
continue;
|
||||
@@ -79,6 +91,7 @@ public partial class ClashConnectionsViewModel : MyReactiveObject
|
||||
Time = (dtNow - item.start).TotalSeconds < 0 ? 1 : (dtNow - item.start).TotalSeconds,
|
||||
Elapsed = (dtNow - item.start).ToString(@"hh\:mm\:ss"),
|
||||
Chain = $"{item.rule} , {string.Join("->", item.chains ?? [])}",
|
||||
ProcessPath = item.metadata.processPath,
|
||||
};
|
||||
|
||||
lstModel.Add(model);
|
||||
|
||||
Reference in New Issue
Block a user