mirror of
https://github.com/2dust/v2rayN.git
synced 2025-09-11 12:46:31 +00:00
Optimization and improvement
Some checks failed
Some checks failed
This commit is contained in:
parent
b54c67d6f1
commit
29a5abf4d6
5 changed files with 12 additions and 23 deletions
|
@ -1,10 +1,13 @@
|
||||||
|
using ReactiveUI;
|
||||||
|
using ReactiveUI.Fody.Helpers;
|
||||||
|
|
||||||
namespace ServiceLib.Models;
|
namespace ServiceLib.Models;
|
||||||
|
|
||||||
public class CheckUpdateModel
|
public class CheckUpdateModel : ReactiveObject
|
||||||
{
|
{
|
||||||
public bool? IsSelected { get; set; }
|
public bool? IsSelected { get; set; }
|
||||||
public string? CoreType { get; set; }
|
public string? CoreType { get; set; }
|
||||||
public string? Remarks { get; set; }
|
[Reactive] public string? Remarks { get; set; }
|
||||||
public string? FileName { get; set; }
|
public string? FileName { get; set; }
|
||||||
public bool? IsFinished { get; set; }
|
public bool? IsFinished { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
|
using ReactiveUI;
|
||||||
|
using ReactiveUI.Fody.Helpers;
|
||||||
|
|
||||||
namespace ServiceLib.Models;
|
namespace ServiceLib.Models;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ClashProxyModel
|
public class ClashProxyModel : ReactiveObject
|
||||||
{
|
{
|
||||||
public string? Name { get; set; }
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
@ -9,9 +12,9 @@ public class ClashProxyModel
|
||||||
|
|
||||||
public string? Now { get; set; }
|
public string? Now { get; set; }
|
||||||
|
|
||||||
public int Delay { get; set; }
|
[Reactive] public int Delay { get; set; }
|
||||||
|
|
||||||
public string? DelayName { get; set; }
|
[Reactive] public string? DelayName { get; set; }
|
||||||
|
|
||||||
public bool IsActive { get; set; }
|
public bool IsActive { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,9 +334,6 @@ public class CheckUpdateViewModel : MyReactiveObject
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
found.Remarks = model.Remarks;
|
||||||
var itemCopy = JsonUtils.DeepCopy(found);
|
|
||||||
itemCopy.Remarks = model.Remarks;
|
|
||||||
CheckUpdateModels.Replace(found, itemCopy);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,7 +391,6 @@ public class ClashProxiesViewModel : MyReactiveObject
|
||||||
|
|
||||||
public async Task ProxiesDelayTestResult(SpeedTestResult result)
|
public async Task ProxiesDelayTestResult(SpeedTestResult result)
|
||||||
{
|
{
|
||||||
//UpdateHandler(false, $"{item.name}={result}");
|
|
||||||
var detail = ProxyDetails.FirstOrDefault(it => it.Name == result.IndexId);
|
var detail = ProxyDetails.FirstOrDefault(it => it.Name == result.IndexId);
|
||||||
if (detail == null)
|
if (detail == null)
|
||||||
{
|
{
|
||||||
|
@ -414,7 +413,6 @@ public class ClashProxiesViewModel : MyReactiveObject
|
||||||
detail.Delay = _delayTimeout;
|
detail.Delay = _delayTimeout;
|
||||||
detail.DelayName = string.Empty;
|
detail.DelayName = string.Empty;
|
||||||
}
|
}
|
||||||
ProxyDetails.Replace(detail, JsonUtils.DeepCopy(detail));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion proxy function
|
#endregion proxy function
|
||||||
|
|
|
@ -293,7 +293,6 @@ public class ProfilesViewModel : MyReactiveObject
|
||||||
{
|
{
|
||||||
item.SpeedVal = result.Speed ?? string.Empty;
|
item.SpeedVal = result.Speed ?? string.Empty;
|
||||||
}
|
}
|
||||||
//_profileItems.Replace(item, JsonUtils.DeepCopy(item));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UpdateStatistics(ServerSpeedItem update)
|
public async Task UpdateStatistics(ServerSpeedItem update)
|
||||||
|
@ -314,17 +313,6 @@ public class ProfilesViewModel : MyReactiveObject
|
||||||
item.TodayUp = Utils.HumanFy(update.TodayUp);
|
item.TodayUp = Utils.HumanFy(update.TodayUp);
|
||||||
item.TotalDown = Utils.HumanFy(update.TotalDown);
|
item.TotalDown = Utils.HumanFy(update.TotalDown);
|
||||||
item.TotalUp = Utils.HumanFy(update.TotalUp);
|
item.TotalUp = Utils.HumanFy(update.TotalUp);
|
||||||
|
|
||||||
//if (SelectedProfile?.IndexId == item.IndexId)
|
|
||||||
//{
|
|
||||||
// var temp = JsonUtils.DeepCopy(item);
|
|
||||||
// _profileItems.Replace(item, temp);
|
|
||||||
// SelectedProfile = temp;
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// _profileItems.Replace(item, JsonUtils.DeepCopy(item));
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|
Loading…
Reference in a new issue