mirror of
https://github.com/netchx/netch.git
synced 2026-05-11 23:45:06 +08:00
refactor: set StatusPortInfoText.ShareLan
This commit is contained in:
@@ -69,6 +69,8 @@ namespace Netch.Controllers
|
|||||||
throw new StartFailedException();
|
throw new StartFailedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StatusPortInfoText.UpdateShareLan();
|
||||||
|
|
||||||
if (!await StartMode(server, mode))
|
if (!await StartMode(server, mode))
|
||||||
{
|
{
|
||||||
throw new StartFailedException();
|
throw new StartFailedException();
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ namespace Netch.Forms
|
|||||||
{
|
{
|
||||||
private static ushort? _socks5Port;
|
private static ushort? _socks5Port;
|
||||||
private static ushort? _httpPort;
|
private static ushort? _httpPort;
|
||||||
private static bool ShareLan => Global.Settings.LocalAddress != "127.0.0.1";
|
private static bool _shareLan;
|
||||||
|
|
||||||
public static ushort HttpPort
|
public static ushort HttpPort
|
||||||
{
|
{
|
||||||
@@ -199,6 +199,8 @@ namespace Netch.Forms
|
|||||||
set => _socks5Port = value;
|
set => _socks5Port = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void UpdateShareLan() => _shareLan = Global.Settings.LocalAddress != "127.0.0.1";
|
||||||
|
|
||||||
public static string Value
|
public static string Value
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -218,7 +220,7 @@ namespace Netch.Forms
|
|||||||
if (!strings.Any())
|
if (!strings.Any())
|
||||||
return string.Empty;
|
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