Fix activity node display

pull/3165/head
2dust 2023-01-31 13:25:52 +08:00
parent 703e17478d
commit 84b91e9649
2 changed files with 6 additions and 7 deletions

View File

@ -86,7 +86,6 @@ namespace v2rayN.Handler
{ {
var sql = @$"select a.* var sql = @$"select a.*
,b.remarks subRemarks ,b.remarks subRemarks
,case when a.indexId = '{_config.indexId}' then true else false end isActive
from ProfileItem a from ProfileItem a
left join SubItem b on a.subid = b.id left join SubItem b on a.subid = b.id
where 1=1 "; where 1=1 ";

View File

@ -684,6 +684,8 @@ namespace v2rayN.ViewModels
List<ProfileItemModel> lstModel = LazyConfig.Instance.ProfileItems(_subId, _serverFilter); List<ProfileItemModel> lstModel = LazyConfig.Instance.ProfileItems(_subId, _serverFilter);
_lstProfile = Utils.FromJson<List<ProfileItem>>(Utils.ToJson(lstModel)); _lstProfile = Utils.FromJson<List<ProfileItem>>(Utils.ToJson(lstModel));
ConfigHandler.SetDefaultServer(_config, _lstProfile);
List<ServerStatItem> lstServerStat = new(); List<ServerStatItem> lstServerStat = new();
if (_statistics != null && _statistics.Enable) if (_statistics != null && _statistics.Enable)
{ {
@ -704,7 +706,7 @@ namespace v2rayN.ViewModels
network = t.network, network = t.network,
streamSecurity = t.streamSecurity, streamSecurity = t.streamSecurity,
subRemarks = t.subRemarks, subRemarks = t.subRemarks,
isActive = t.isActive, isActive = t.indexId == _config.indexId,
delay = t.delay, delay = t.delay,
delayVal = t.delay != 0 ? $"{t.delay} {Global.DelayUnit}" : string.Empty, delayVal = t.delay != 0 ? $"{t.delay} {Global.DelayUnit}" : string.Empty,
speedVal = t.speed != 0 ? $"{t.speed} {Global.SpeedUnit}" : string.Empty, speedVal = t.speed != 0 ? $"{t.speed} {Global.SpeedUnit}" : string.Empty,
@ -714,8 +716,6 @@ namespace v2rayN.ViewModels
totalUp = t22 == null ? "" : Utils.HumanFy(t22.totalUp) totalUp = t22 == null ? "" : Utils.HumanFy(t22.totalUp)
}).ToList(); }).ToList();
ConfigHandler.SetDefaultServer(_config, _lstProfile);
Application.Current.Dispatcher.Invoke((Action)(() => Application.Current.Dispatcher.Invoke((Action)(() =>
{ {
_profileItems.Clear(); _profileItems.Clear();
@ -1134,7 +1134,7 @@ namespace v2rayN.ViewModels
if (sb.Length > 0) if (sb.Length > 0)
{ {
Utils.SetClipboardData(sb.ToString()); Utils.SetClipboardData(sb.ToString());
_noticeHandler?.Enqueue(ResUI.BatchExportURLSuccessfully); _noticeHandler?.SendMessage(ResUI.BatchExportURLSuccessfully);
} }
} }
@ -1159,7 +1159,7 @@ namespace v2rayN.ViewModels
if (sb.Length > 0) if (sb.Length > 0)
{ {
Utils.SetClipboardData(Utils.Base64Encode(sb.ToString())); Utils.SetClipboardData(Utils.Base64Encode(sb.ToString()));
_noticeHandler?.Enqueue(ResUI.BatchExportSubscriptionSuccessfully); _noticeHandler?.SendMessage(ResUI.BatchExportSubscriptionSuccessfully);
} }
} }