bug fix
This commit is contained in:
@@ -56,7 +56,7 @@ namespace clashN.Handler
|
||||
{
|
||||
ShowMsg(true, msg);
|
||||
|
||||
if (_process != null && !blChanged)
|
||||
if (_process != null && !_process.HasExited && !blChanged)
|
||||
{
|
||||
MainFormHandler.Instance.ClashConfigReload(fileName);
|
||||
}
|
||||
|
||||
@@ -334,12 +334,18 @@ namespace clashN.Handler
|
||||
}
|
||||
|
||||
public async void ClashSetActiveProxy(string name, string nameNode)
|
||||
{
|
||||
try
|
||||
{
|
||||
var url = $"{Global.httpProtocol}{Global.Loopback}:{LazyConfig.Instance.GetConfig().APIPort}/proxies/{name}";
|
||||
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)
|
||||
@@ -359,12 +365,18 @@ namespace clashN.Handler
|
||||
}
|
||||
|
||||
public async void ClashConfigReload(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
var url = $"{Global.httpProtocol}{Global.Loopback}:{LazyConfig.Instance.GetConfig().APIPort}/configs";
|
||||
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