1.1.5 (alpha) 更新

This commit is contained in:
Space Time 2024-12-30 15:41:45 +08:00
parent f428de3fd7
commit d748976aa9
5 changed files with 19 additions and 4 deletions

View File

@ -150,6 +150,15 @@ namespace Sheas_Cealer.Consts {
}
}
/// <summary>
/// 查找类似 You are using hosts-based non-wildcard domain global cealing. Do you want to continue? 的本地化字符串。
/// </summary>
public static string _LaunchHostsNginxPrompt {
get {
return ResourceManager.GetString("_LaunchHostsNginxPrompt", resourceCulture);
}
}
/// <summary>
/// 查找类似 Mihomo failed to launch 的本地化字符串。
/// </summary>

View File

@ -285,6 +285,9 @@
<data name="_KillBrowserProcessPrompt" xml:space="preserve">
<value>All processes of the selected browser will be closed before launching. Do you want to continue?</value>
</data>
<data name="_LaunchHostsNginxPrompt" xml:space="preserve">
<value>You are using hosts-based non-wildcard domain global cealing. Do you want to continue?</value>
</data>
<data name="_LaunchMihomoErrorMsg" xml:space="preserve">
<value>Mihomo failed to launch</value>
</data>

View File

@ -285,6 +285,9 @@
<data name="_KillBrowserProcessPrompt" xml:space="preserve">
<value>启动前将关闭所选浏览器的所有进程,是否继续?</value>
</data>
<data name="_LaunchHostsNginxPrompt" xml:space="preserve">
<value>正在使用基于 Hosts 的非泛域名全局伪造,是否继续?</value>
</data>
<data name="_LaunchMihomoErrorMsg" xml:space="preserve">
<value>Mihomo 启动失败</value>
</data>

View File

@ -12,7 +12,7 @@ internal class AboutVersionButtonContentConv : IMultiValueConverter
string versionButtonVersionContent = (string)values[1];
bool isSheasCealerUtd = (bool)values[2];
return $"{versionButtonLabelContent} {versionButtonVersionContent}" + (isSheasCealerUtd ? string.Empty : " *");
return $"{versionButtonVersionContent} (alpha)" + (isSheasCealerUtd ? string.Empty : " *");
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();

View File

@ -85,8 +85,6 @@ public partial class MainWin : Window
foreach (string cealHostPath in Directory.GetFiles(CealHostWatcher.Path, CealHostWatcher.Filter))
CealHostWatcher_Changed(null!, new(new(), Path.GetDirectoryName(cealHostPath)!, Path.GetFileName(cealHostPath)));
MihomoConfWatcher_Changed(null!, null!);
if (MainConst.IsAdmin && !MainPres.IsConginxRunning && !MainPres.IsNginxRunning)
await NginxCleaner.Clean();
@ -217,6 +215,7 @@ public partial class MainWin : Window
(CealHostRulesDict.ContainsValue(null!) && MessageBox.Show(MainConst._CealHostErrorPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) ||
(NginxHttpsPort != 443 && MessageBox.Show(string.Format(MainConst._NginxHttpsPortOccupiedPrompt, NginxHttpsPort), string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) ||
(NginxHttpPort != 80 && MessageBox.Show(string.Format(MainConst._NginxHttpPortOccupiedPrompt, NginxHttpPort), string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) ||
(sender != null && MessageBox.Show(MainConst._LaunchHostsNginxPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) ||
(MessageBox.Show(MainConst._LaunchProxyPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) ||
(MainPres.IsFlashing && MessageBox.Show(MainConst._LaunchNginxFlashingPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes))
return;
@ -755,6 +754,7 @@ public partial class MainWin : Window
CealArgs = @$"--host-rules=""{hostRules.TrimEnd(',')}"" --host-resolver-rules=""{hostResolverRules.TrimEnd(',')}"" --test-type --ignore-certificate-errors";
NginxConfWatcher_Changed(null!, null!);
MihomoConfWatcher_Changed(null!, null!);
}
}
private async void NginxConfWatcher_Changed(object sender, FileSystemEventArgs e)
@ -799,7 +799,7 @@ public partial class MainWin : Window
.AddOrUpdate("events:worker_connections", "65536")
.AddOrUpdate("http:proxy_set_header", "Host $http_host")
.AddOrUpdate("http:proxy_ssl_server_name", !MainPres.IsFlashing ? "on" : "off")
.AddOrUpdate("http:proxy_buffer_size", "8k")
.AddOrUpdate("http:proxy_buffer_size", "14k")
.AddOrUpdate($"http:server[{serverIndex}]:listen", $"{NginxHttpPort} default_server")
.AddOrUpdate($"http:server[{serverIndex}]:return", "https://$host$request_uri");