mirror of
https://github.com/netchx/netch.git
synced 2026-03-16 17:53:17 +08:00
refactor: set StatusPortInfoText.ShareLan
This commit is contained in:
@@ -69,6 +69,8 @@ namespace Netch.Controllers
|
||||
throw new StartFailedException();
|
||||
}
|
||||
|
||||
StatusPortInfoText.UpdateShareLan();
|
||||
|
||||
if (!await StartMode(server, mode))
|
||||
{
|
||||
throw new StartFailedException();
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace Netch.Forms
|
||||
{
|
||||
private static ushort? _socks5Port;
|
||||
private static ushort? _httpPort;
|
||||
private static bool ShareLan => Global.Settings.LocalAddress != "127.0.0.1";
|
||||
private static bool _shareLan;
|
||||
|
||||
public static ushort HttpPort
|
||||
{
|
||||
@@ -199,6 +199,8 @@ namespace Netch.Forms
|
||||
set => _socks5Port = value;
|
||||
}
|
||||
|
||||
public static void UpdateShareLan() => _shareLan = Global.Settings.LocalAddress != "127.0.0.1";
|
||||
|
||||
public static string Value
|
||||
{
|
||||
get
|
||||
@@ -218,7 +220,7 @@ namespace Netch.Forms
|
||||
if (!strings.Any())
|
||||
return string.Empty;
|
||||
|
||||
return $" ({(ShareLan ? i18N.Translate("Allow other Devices to connect") + " " : "")}{string.Join(" | ", strings)})";
|
||||
return $" ({(_shareLan ? i18N.Translate("Allow other Devices to connect") + " " : "")}{string.Join(" | ", strings)})";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user