Improve everything

This commit is contained in:
Kukks
2023-11-15 15:24:21 +01:00
parent 206875b133
commit 83807d18b8
16 changed files with 233 additions and 95 deletions

View File

@@ -56,6 +56,24 @@ namespace BTCPayServer.Plugins.Wabisabi
_instanceManager = instanceManager;
_socks5HttpClientHandler = serviceProvider.GetRequiredService<Socks5HttpClientHandler>();
}
[HttpGet("toggle-active")]
public async Task<IActionResult> ToggleActive(string storeId, string returnUrl)
{
var settings = await _WabisabiService.GetWabisabiForStore(storeId);
if (settings is null)
{
return NotFound();
}
settings.Active = !settings.Active;
await _WabisabiService.SetWabisabiForStore(storeId, settings);
TempData["SuccessMessage"] = $"Coinjoin is now {(settings.Active ? "active" : "inactive")}";
returnUrl = Url.EnsureLocal(returnUrl, HttpContext.Request);
if(returnUrl is null)
return RedirectToAction(nameof(UpdateWabisabiStoreSettings), new {storeId});
return Redirect(returnUrl);
}
[HttpGet("")]
public async Task<IActionResult> UpdateWabisabiStoreSettings(string storeId)