Improved UI

https://github.com/2dust/v2rayN/issues/5814
This commit is contained in:
2dust
2024-10-14 17:28:10 +08:00
parent bdae08b13b
commit 2698137dea
4 changed files with 97 additions and 90 deletions

View File

@@ -106,12 +106,10 @@ namespace ServiceLib.ViewModels
public StatusBarViewModel(Func<EViewAction, object?, Task<bool>>? updateView)
{
_config = AppHandler.Instance.Config;
_updateView = updateView;
if (_updateView != null)
if (updateView != null)
{
MessageBus.Current.Listen<string>(EMsgCommand.RefreshProfiles.ToString())
.Subscribe(async x => await _updateView?.Invoke(EViewAction.DispatcherRefreshServersBiz, null));
Init(updateView);
}
SelectedRouting = new();
@@ -127,7 +125,7 @@ namespace ServiceLib.ViewModels
}
RefreshRoutingsMenu();
InboundDisplayStaus();
InboundDisplayStatus();
ChangeSystemProxyAsync(_config.systemProxyItem.sysProxyType, true);
#region WhenAnyValue && ReactiveCommand
@@ -426,19 +424,12 @@ namespace ServiceLib.ViewModels
#region UI
public void InboundDisplayStaus()
public void InboundDisplayStatus()
{
StringBuilder sb = new();
sb.Append($"[{EInboundProtocol.socks}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks)}]");
sb.Append(" | ");
//if (_config.systemProxyItem.sysProxyType == ESysProxyType.ForcedChange)
//{
// sb.Append($"[{Global.InboundHttp}({ResUI.SystemProxy}):{LazyConfig.Instance.GetLocalPort(Global.InboundHttp)}]");
//}
//else
//{
sb.Append($"[{EInboundProtocol.http}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.http)}]");
//}
InboundDisplay = $"{ResUI.LabLocal}:{sb}";
if (_config.inbound[0].allowLANConn)