bug fix
This commit is contained in:
@@ -56,7 +56,7 @@ namespace clashN.Handler
|
|||||||
{
|
{
|
||||||
ShowMsg(true, msg);
|
ShowMsg(true, msg);
|
||||||
|
|
||||||
if (_process != null && !blChanged)
|
if (_process != null && !_process.HasExited && !blChanged)
|
||||||
{
|
{
|
||||||
MainFormHandler.Instance.ClashConfigReload(fileName);
|
MainFormHandler.Instance.ClashConfigReload(fileName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -335,11 +335,17 @@ namespace clashN.Handler
|
|||||||
|
|
||||||
public async void ClashSetActiveProxy(string name, string nameNode)
|
public async void ClashSetActiveProxy(string name, string nameNode)
|
||||||
{
|
{
|
||||||
var url = $"{Global.httpProtocol}{Global.Loopback}:{LazyConfig.Instance.GetConfig().APIPort}/proxies/{name}";
|
try
|
||||||
Dictionary<string, string> headers = new Dictionary<string, string>();
|
{
|
||||||
headers.Add("name", nameNode);
|
var url = $"{Global.httpProtocol}{Global.Loopback}:{LazyConfig.Instance.GetConfig().APIPort}/proxies/{name}";
|
||||||
await HttpClientHelper.GetInstance().PutAsync(url, headers);
|
Dictionary<string, string> headers = new Dictionary<string, string>();
|
||||||
|
headers.Add("name", nameNode);
|
||||||
|
await HttpClientHelper.GetInstance().PutAsync(url, headers);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClashConfigUpdate(Dictionary<string, string> headers)
|
public void ClashConfigUpdate(Dictionary<string, string> headers)
|
||||||
@@ -358,13 +364,19 @@ namespace clashN.Handler
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void ClashConfigReload( string filePath)
|
public async void ClashConfigReload(string filePath)
|
||||||
{
|
{
|
||||||
var url = $"{Global.httpProtocol}{Global.Loopback}:{LazyConfig.Instance.GetConfig().APIPort}/configs";
|
try
|
||||||
Dictionary<string, string> headers = new Dictionary<string, string>();
|
{
|
||||||
headers.Add("path", filePath);
|
var url = $"{Global.httpProtocol}{Global.Loopback}:{LazyConfig.Instance.GetConfig().APIPort}/configs";
|
||||||
await HttpClientHelper.GetInstance().PutAsync(url, headers);
|
Dictionary<string, string> headers = new Dictionary<string, string>();
|
||||||
|
headers.Add("path", filePath);
|
||||||
|
await HttpClientHelper.GetInstance().PutAsync(url, headers);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user