mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-13 12:52:08 +08:00
1.1.1 -> 1.1.2 第17次更新
This commit is contained in:
parent
53384ee2ad
commit
db19a759ff
58
Consts/MainMultilangConst.Designer.cs
generated
58
Consts/MainMultilangConst.Designer.cs
generated
@ -72,9 +72,9 @@ namespace Sheas_Cealer.Consts {
|
||||
/// <summary>
|
||||
/// 查找类似 The config cannot be recognized, check if the config contain syntax errors 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string _ConfigErrorHint {
|
||||
public static string _ConfErrorHint {
|
||||
get {
|
||||
return ResourceManager.GetString("_ConfigErrorHint", resourceCulture);
|
||||
return ResourceManager.GetString("_ConfErrorHint", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,6 +168,42 @@ namespace Sheas_Cealer.Consts {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Edit Mihomo Conf 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string EditMihomoConfButtonContent {
|
||||
get {
|
||||
return ResourceManager.GetString("EditMihomoConfButtonContent", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Click to edit mihomo conf 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string EditMihomoConfButtonToolTip {
|
||||
get {
|
||||
return ResourceManager.GetString("EditMihomoConfButtonToolTip", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Edit Nginx Conf 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string EditNginxConfButtonContent {
|
||||
get {
|
||||
return ResourceManager.GetString("EditNginxConfButtonContent", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Click to edit nginx conf 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string EditNginxConfButtonToolTip {
|
||||
get {
|
||||
return ResourceManager.GetString("EditNginxConfButtonToolTip", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Edit Upstream Host 的本地化字符串。
|
||||
/// </summary>
|
||||
@ -231,6 +267,24 @@ namespace Sheas_Cealer.Consts {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Mysterious Button 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string MysteriousButtonContent {
|
||||
get {
|
||||
return ResourceManager.GetString("MysteriousButtonContent", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Click for SURPRISE 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string MysteriousButtonToolTip {
|
||||
get {
|
||||
return ResourceManager.GetString("MysteriousButtonToolTip", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Stop Nginx 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -132,6 +132,18 @@
|
||||
<data name="EditLocalHostButtonToolTip" xml:space="preserve">
|
||||
<value>Click to edit local host</value>
|
||||
</data>
|
||||
<data name="EditMihomoConfButtonContent" xml:space="preserve">
|
||||
<value>Edit Mihomo Conf</value>
|
||||
</data>
|
||||
<data name="EditMihomoConfButtonToolTip" xml:space="preserve">
|
||||
<value>Click to edit mihomo conf</value>
|
||||
</data>
|
||||
<data name="EditNginxConfButtonContent" xml:space="preserve">
|
||||
<value>Edit Nginx Conf</value>
|
||||
</data>
|
||||
<data name="EditNginxConfButtonToolTip" xml:space="preserve">
|
||||
<value>Click to edit nginx conf</value>
|
||||
</data>
|
||||
<data name="EditUpstreamHostButtonContent" xml:space="preserve">
|
||||
<value>Edit Upstream Host</value>
|
||||
</data>
|
||||
@ -153,6 +165,12 @@
|
||||
<data name="MihomoButtonIsStoppedToolTip" xml:space="preserve">
|
||||
<value>Click to launch a local Mihomo</value>
|
||||
</data>
|
||||
<data name="MysteriousButtonContent" xml:space="preserve">
|
||||
<value>Mysterious Button</value>
|
||||
</data>
|
||||
<data name="MysteriousButtonToolTip" xml:space="preserve">
|
||||
<value>Click for SURPRISE</value>
|
||||
</data>
|
||||
<data name="NginxButtonIsRunningContent" xml:space="preserve">
|
||||
<value>Stop Nginx</value>
|
||||
</data>
|
||||
@ -219,7 +237,7 @@
|
||||
<data name="_BrowserPathDialogFilterFileType" xml:space="preserve">
|
||||
<value>Browser</value>
|
||||
</data>
|
||||
<data name="_ConfigErrorHint" xml:space="preserve">
|
||||
<data name="_ConfErrorHint" xml:space="preserve">
|
||||
<value>The config cannot be recognized, check if the config contain syntax errors</value>
|
||||
</data>
|
||||
<data name="_HostErrorHint" xml:space="preserve">
|
||||
|
@ -132,6 +132,18 @@
|
||||
<data name="EditLocalHostButtonToolTip" xml:space="preserve">
|
||||
<value>点击编辑本地规则</value>
|
||||
</data>
|
||||
<data name="EditMihomoConfButtonContent" xml:space="preserve">
|
||||
<value>编辑 Mihomo 配置</value>
|
||||
</data>
|
||||
<data name="EditMihomoConfButtonToolTip" xml:space="preserve">
|
||||
<value>点击编辑 Mihomo 配置</value>
|
||||
</data>
|
||||
<data name="EditNginxConfButtonContent" xml:space="preserve">
|
||||
<value>编辑 Nginx 配置</value>
|
||||
</data>
|
||||
<data name="EditNginxConfButtonToolTip" xml:space="preserve">
|
||||
<value>点击编辑 Nginx 配置</value>
|
||||
</data>
|
||||
<data name="EditUpstreamHostButtonContent" xml:space="preserve">
|
||||
<value>编辑上游规则</value>
|
||||
</data>
|
||||
@ -153,6 +165,12 @@
|
||||
<data name="MihomoButtonIsStoppedToolTip" xml:space="preserve">
|
||||
<value>点击启动本地 Mihomo</value>
|
||||
</data>
|
||||
<data name="MysteriousButtonContent" xml:space="preserve">
|
||||
<value>神秘按钮</value>
|
||||
</data>
|
||||
<data name="MysteriousButtonToolTip" xml:space="preserve">
|
||||
<value>点击有惊喜</value>
|
||||
</data>
|
||||
<data name="NginxButtonIsRunningContent" xml:space="preserve">
|
||||
<value>停止 Nginx</value>
|
||||
</data>
|
||||
@ -219,7 +237,7 @@
|
||||
<data name="_BrowserPathDialogFilterFileType" xml:space="preserve">
|
||||
<value>浏览器</value>
|
||||
</data>
|
||||
<data name="_ConfigErrorHint" xml:space="preserve">
|
||||
<data name="_ConfErrorHint" xml:space="preserve">
|
||||
<value>配置无法识别,请检查配置文件中是否含有语法错误</value>
|
||||
</data>
|
||||
<data name="_HostErrorHint" xml:space="preserve">
|
||||
|
@ -5,7 +5,7 @@ using System.Windows.Data;
|
||||
|
||||
namespace Sheas_Cealer.Convs;
|
||||
|
||||
internal class MainProxyButtonVisibilityConv : IValueConverter
|
||||
internal class MainAdminControlVisibilityConv : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
@ -16,6 +16,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0">
|
||||
@ -125,7 +126,7 @@
|
||||
<Button.Visibility>
|
||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
||||
<Binding.Converter>
|
||||
<convs:MainProxyButtonVisibilityConv />
|
||||
<convs:MainAdminControlVisibilityConv />
|
||||
</Binding.Converter>
|
||||
</Binding>
|
||||
</Button.Visibility>
|
||||
@ -156,7 +157,7 @@
|
||||
<Button.Visibility>
|
||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
||||
<Binding.Converter>
|
||||
<convs:MainProxyButtonVisibilityConv />
|
||||
<convs:MainAdminControlVisibilityConv />
|
||||
</Binding.Converter>
|
||||
</Binding>
|
||||
</Button.Visibility>
|
||||
@ -176,7 +177,6 @@
|
||||
</Button.ToolTip>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.3*" />
|
||||
@ -215,5 +215,27 @@
|
||||
Grid.Column="4" Margin="5" Content="{Binding Source={x:Static consts:MainConst.AboutButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.AboutButtonToolTip}}"
|
||||
Click="AboutButton_Click" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="1.5*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.Visibility>
|
||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
||||
<Binding.Converter>
|
||||
<convs:MainAdminControlVisibilityConv />
|
||||
</Binding.Converter>
|
||||
</Binding>
|
||||
</Grid.Visibility>
|
||||
|
||||
<Button x:Name="EditNginxConfButton"
|
||||
Grid.Column="0" Margin="5" Content="{Binding Source={x:Static consts:MainConst.EditNginxConfButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.EditNginxConfButtonToolTip}}"
|
||||
Click="EditConfButton_Click" />
|
||||
<Button Grid.Column="1" Margin="5" Content="{Binding Source={x:Static consts:MainConst.EditMihomoConfButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.EditMihomoConfButtonToolTip}}"
|
||||
Click="EditConfButton_Click" />
|
||||
<Button Grid.Column="2" Margin="5" Content="{Binding Source={x:Static consts:MainConst.MysteriousButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.MysteriousButtonToolTip}}"
|
||||
Click="MysteriousButton_Click" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
@ -179,7 +179,7 @@ public partial class MainWin : Window
|
||||
configStream.Load(File.OpenText(configPath));
|
||||
|
||||
try { configMapNode = (YamlMappingNode)configStream.Documents[0].RootNode; }
|
||||
catch { throw new Exception(MainConst._ConfigErrorHint); }
|
||||
catch { throw new Exception(MainConst._ConfErrorHint); }
|
||||
|
||||
if (!configMapNode.Children.TryGetValue("mixed-port", out mihomoPortNode!) && !configMapNode.Children.TryGetValue("port", out mihomoPortNode!))
|
||||
mihomoPortNode = "7890";
|
||||
@ -242,6 +242,23 @@ public partial class MainWin : Window
|
||||
private void ThemesButton_Click(object sender, RoutedEventArgs e) => MainPres!.IsLightTheme = MainPres.IsLightTheme.HasValue ? MainPres.IsLightTheme.Value ? null : true : false;
|
||||
private void AboutButton_Click(object sender, RoutedEventArgs e) => new AboutWin().ShowDialog();
|
||||
|
||||
private void EditConfButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Button? senderButton = sender as Button;
|
||||
|
||||
string confPath = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, senderButton == EditNginxConfButton ? "nginx.conf" : "config.json");
|
||||
|
||||
if (!File.Exists(confPath))
|
||||
File.Create(confPath).Dispose();
|
||||
|
||||
ProcessStartInfo processStartInfo = new(confPath) { UseShellExecute = true };
|
||||
Process.Start(processStartInfo);
|
||||
}
|
||||
private void MysteriousButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void ProxyTimer_Tick(object? sender, EventArgs e)
|
||||
{
|
||||
MainPres!.IsNginxExist = File.Exists(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Nginx.exe"));
|
||||
|
Loading…
Reference in New Issue
Block a user