diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 2340d7586..fe4728c07 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -2,7 +2,7 @@ Exe netcoreapp2.0 - 1.0.1.54 + 1.0.1.55 NU1701,CA1816,CA1308,CA1810,CA2208 diff --git a/BTCPayServer/Controllers/StoresController.cs b/BTCPayServer/Controllers/StoresController.cs index 4461e9037..03cb339a4 100644 --- a/BTCPayServer/Controllers/StoresController.cs +++ b/BTCPayServer/Controllers/StoresController.cs @@ -110,15 +110,15 @@ namespace BTCPayServer.Controllers } [HttpGet] - [Route("{storeId}/wallet")] - public async Task Wallet(string storeId) + [Route("{storeId}/wallet/{cryptoCode}")] + public async Task Wallet(string storeId, string cryptoCode) { var store = await _Repo.FindStore(storeId, GetUserId()); if (store == null) return NotFound(); WalletModel model = new WalletModel(); model.ServerUrl = GetStoreUrl(storeId); - model.SetCryptoCurrencies(_ExplorerProvider, store.GetDefaultCrypto()); + model.CryptoCurrency = cryptoCode; return View(model); } diff --git a/BTCPayServer/Hosting/Startup.cs b/BTCPayServer/Hosting/Startup.cs index afa361675..6409d1b5f 100644 --- a/BTCPayServer/Hosting/Startup.cs +++ b/BTCPayServer/Hosting/Startup.cs @@ -94,13 +94,13 @@ namespace BTCPayServer.Hosting }); // Needed to debug U2F for ledger support - //services.Configure(kestrel => - //{ - // kestrel.Listen(IPAddress.Loopback, 5012, l => - // { - // l.UseHttps("devtest.pfx", "toto"); - // }); - //}); + services.Configure(kestrel => + { + kestrel.Listen(IPAddress.Loopback, 5012, l => + { + l.UseHttps("devtest.pfx", "toto"); + }); + }); } // Big hack, tests fails if only call AddHangfire because Hangfire fail at initializing at the second test run diff --git a/BTCPayServer/Models/StoreViewModels/WalletModel.cs b/BTCPayServer/Models/StoreViewModels/WalletModel.cs index 5869e7f90..8038c8429 100644 --- a/BTCPayServer/Models/StoreViewModels/WalletModel.cs +++ b/BTCPayServer/Models/StoreViewModels/WalletModel.cs @@ -10,25 +10,10 @@ namespace BTCPayServer.Models.StoreViewModels public class WalletModel { public string ServerUrl { get; set; } - public SelectList CryptoCurrencies { get; set; } - [Display(Name = "Crypto currency")] public string CryptoCurrency { get; set; } - - class Format - { - public string Name { get; set; } - public string Value { get; set; } - } - public void SetCryptoCurrencies(ExplorerClientProvider explorerProvider, string selectedScheme) - { - var choices = explorerProvider.GetAll().Select(o => new Format() { Name = o.Item1.CryptoCode, Value = o.Item1.CryptoCode }).ToArray(); - var chosen = choices.FirstOrDefault(f => f.Name == selectedScheme) ?? choices.FirstOrDefault(); - CryptoCurrencies = new SelectList(choices, nameof(chosen.Value), nameof(chosen.Name), chosen); - CryptoCurrency = chosen.Name; - } } } diff --git a/BTCPayServer/Views/Stores/StoreNavPages.cs b/BTCPayServer/Views/Stores/StoreNavPages.cs index 3e816e16f..91fd277e0 100644 --- a/BTCPayServer/Views/Stores/StoreNavPages.cs +++ b/BTCPayServer/Views/Stores/StoreNavPages.cs @@ -14,10 +14,8 @@ namespace BTCPayServer.Views.Stores public static string Tokens => "Tokens"; - public static string Wallet => "Wallet"; public static string TokensNavClass(ViewContext viewContext) => PageNavClass(viewContext, Tokens); - public static string WalletNavClass(ViewContext viewContext) => PageNavClass(viewContext, Wallet); public static string IndexNavClass(ViewContext viewContext) => PageNavClass(viewContext, Index); diff --git a/BTCPayServer/Views/Stores/UpdateStore.cshtml b/BTCPayServer/Views/Stores/UpdateStore.cshtml index 64ccb132c..f7da3dc7c 100644 --- a/BTCPayServer/Views/Stores/UpdateStore.cshtml +++ b/BTCPayServer/Views/Stores/UpdateStore.cshtml @@ -93,8 +93,14 @@ { @scheme.Crypto - @scheme.Value - Modify + @scheme.Value + + @if(!string.IsNullOrWhiteSpace(scheme.Value)) + { + Wallet - + } + Modify + } diff --git a/BTCPayServer/Views/Stores/Wallet.cshtml b/BTCPayServer/Views/Stores/Wallet.cshtml index 47ca5c988..3160e6250 100644 --- a/BTCPayServer/Views/Stores/Wallet.cshtml +++ b/BTCPayServer/Views/Stores/Wallet.cshtml @@ -2,7 +2,6 @@ @{ Layout = "../Shared/_NavLayout.cshtml"; ViewData["Title"] = "Manage wallet"; - ViewData.AddActivePage(StoreNavPages.Wallet); }

@ViewData["Title"]

@@ -32,10 +31,7 @@