diff --git a/Consts/MainMultilangConst.Designer.cs b/Consts/MainMultilangConst.Designer.cs
index a3fb154..73afc47 100644
--- a/Consts/MainMultilangConst.Designer.cs
+++ b/Consts/MainMultilangConst.Designer.cs
@@ -72,9 +72,9 @@ namespace Sheas_Cealer.Consts {
///
/// 查找类似 The config cannot be recognized, check if the config contain syntax errors 的本地化字符串。
///
- 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 {
}
}
+ ///
+ /// 查找类似 Edit Mihomo Conf 的本地化字符串。
+ ///
+ public static string EditMihomoConfButtonContent {
+ get {
+ return ResourceManager.GetString("EditMihomoConfButtonContent", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Click to edit mihomo conf 的本地化字符串。
+ ///
+ public static string EditMihomoConfButtonToolTip {
+ get {
+ return ResourceManager.GetString("EditMihomoConfButtonToolTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Edit Nginx Conf 的本地化字符串。
+ ///
+ public static string EditNginxConfButtonContent {
+ get {
+ return ResourceManager.GetString("EditNginxConfButtonContent", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Click to edit nginx conf 的本地化字符串。
+ ///
+ public static string EditNginxConfButtonToolTip {
+ get {
+ return ResourceManager.GetString("EditNginxConfButtonToolTip", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Edit Upstream Host 的本地化字符串。
///
@@ -231,6 +267,24 @@ namespace Sheas_Cealer.Consts {
}
}
+ ///
+ /// 查找类似 Mysterious Button 的本地化字符串。
+ ///
+ public static string MysteriousButtonContent {
+ get {
+ return ResourceManager.GetString("MysteriousButtonContent", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Click for SURPRISE 的本地化字符串。
+ ///
+ public static string MysteriousButtonToolTip {
+ get {
+ return ResourceManager.GetString("MysteriousButtonToolTip", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Stop Nginx 的本地化字符串。
///
diff --git a/Consts/MainMultilangConst.resx b/Consts/MainMultilangConst.resx
index 61142b7..dda212d 100644
--- a/Consts/MainMultilangConst.resx
+++ b/Consts/MainMultilangConst.resx
@@ -132,6 +132,18 @@
Click to edit local host
+
+ Edit Mihomo Conf
+
+
+ Click to edit mihomo conf
+
+
+ Edit Nginx Conf
+
+
+ Click to edit nginx conf
+
Edit Upstream Host
@@ -153,6 +165,12 @@
Click to launch a local Mihomo
+
+ Mysterious Button
+
+
+ Click for SURPRISE
+
Stop Nginx
@@ -219,7 +237,7 @@
Browser
-
+
The config cannot be recognized, check if the config contain syntax errors
diff --git a/Consts/MainMultilangConst.zh.resx b/Consts/MainMultilangConst.zh.resx
index 201732d..e1cbb3b 100644
--- a/Consts/MainMultilangConst.zh.resx
+++ b/Consts/MainMultilangConst.zh.resx
@@ -132,6 +132,18 @@
点击编辑本地规则
+
+ 编辑 Mihomo 配置
+
+
+ 点击编辑 Mihomo 配置
+
+
+ 编辑 Nginx 配置
+
+
+ 点击编辑 Nginx 配置
+
编辑上游规则
@@ -153,6 +165,12 @@
点击启动本地 Mihomo
+
+ 神秘按钮
+
+
+ 点击有惊喜
+
停止 Nginx
@@ -219,7 +237,7 @@
浏览器
-
+
配置无法识别,请检查配置文件中是否含有语法错误
diff --git a/Convs/MainProxyButtonVisibilityConv.cs b/Convs/MainAdminControlVisibilityConv.cs
similarity index 88%
rename from Convs/MainProxyButtonVisibilityConv.cs
rename to Convs/MainAdminControlVisibilityConv.cs
index b316392..7f2461d 100644
--- a/Convs/MainProxyButtonVisibilityConv.cs
+++ b/Convs/MainAdminControlVisibilityConv.cs
@@ -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)
{
diff --git a/Wins/MainWin.xaml b/Wins/MainWin.xaml
index 9544dd4..7391acf 100644
--- a/Wins/MainWin.xaml
+++ b/Wins/MainWin.xaml
@@ -16,6 +16,7 @@
+
@@ -125,7 +126,7 @@
-
+
@@ -156,7 +157,7 @@
-
+
@@ -176,7 +177,6 @@
-
@@ -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" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Wins/MainWin.xaml.cs b/Wins/MainWin.xaml.cs
index 416a52a..677908b 100644
--- a/Wins/MainWin.xaml.cs
+++ b/Wins/MainWin.xaml.cs
@@ -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"));