diff --git a/BTCPayServer/Controllers/AccountController.cs b/BTCPayServer/Controllers/AccountController.cs index a5ee28a99..6f2115849 100644 --- a/BTCPayServer/Controllers/AccountController.cs +++ b/BTCPayServer/Controllers/AccountController.cs @@ -420,7 +420,7 @@ namespace BTCPayServer.Controllers } else { - TempData["StatusMessage"] = "Account created, please confirm your email"; + TempData[WellKnownTempData.SuccessMessage] = "Account created, please confirm your email"; return View(); } } diff --git a/BTCPayServer/Controllers/ServerController.Storage.cs b/BTCPayServer/Controllers/ServerController.Storage.cs index 129be3d39..45806b545 100644 --- a/BTCPayServer/Controllers/ServerController.Storage.cs +++ b/BTCPayServer/Controllers/ServerController.Storage.cs @@ -28,7 +28,7 @@ namespace BTCPayServer.Controllers [HttpGet("server/files/{fileId?}")] public async Task Files(string fileId = null, string statusMessage = null) { - TempData["StatusMessage"] = statusMessage; + TempData[WellKnownTempData.SuccessMessage] = statusMessage; var fileUrl = string.IsNullOrEmpty(fileId) ? null : await _FileService.GetFileUrl(Request.GetAbsoluteRootUri(), fileId); return View(new ViewFilesViewModel() @@ -167,7 +167,7 @@ namespace BTCPayServer.Controllers [HttpGet("server/storage")] public async Task Storage(bool forceChoice = false, string statusMessage = null) { - TempData["StatusMessage"] = statusMessage; + TempData[WellKnownTempData.SuccessMessage] = statusMessage; var savedSettings = await _SettingsRepository.GetSettingAsync(); if (forceChoice || savedSettings == null) { @@ -288,11 +288,11 @@ namespace BTCPayServer.Controllers data.Provider = storageProvider; data.Configuration = JObject.FromObject(viewModel); await _SettingsRepository.UpdateSetting(data); - TempData["StatusMessage"] = new StatusMessageModel() + TempData[WellKnownTempData.StatusMessageModel] = new StatusMessageModel() { Severity = StatusMessageModel.StatusSeverity.Success, Message = "Storage settings updated successfully" - }.ToString(); + }; return View(viewModel); } } diff --git a/BTCPayServer/Controllers/ServerController.cs b/BTCPayServer/Controllers/ServerController.cs index 405281ae3..f92ea3f5f 100644 --- a/BTCPayServer/Controllers/ServerController.cs +++ b/BTCPayServer/Controllers/ServerController.cs @@ -190,6 +190,8 @@ namespace BTCPayServer.Controllers { MaintenanceViewModel vm = new MaintenanceViewModel(); vm.CanUseSSH = _sshState.CanUseSSH; + if (!vm.CanUseSSH) + TempData[WellKnownTempData.ErrorMessage] = "Maintenance feature requires access to SSH properly configured in BTCPayServer configuration"; vm.DNSDomain = this.Request.Host.Host; if (IPAddress.TryParse(vm.DNSDomain, out var unused)) vm.DNSDomain = null; @@ -480,7 +482,7 @@ namespace BTCPayServer.Controllers } await _SettingsRepository.UpdateSetting(settings); - TempData["StatusMessage"] = "Policies updated successfully"; + TempData[WellKnownTempData.SuccessMessage] = "Policies updated successfully"; return RedirectToAction(nameof(Policies)); } @@ -1005,7 +1007,7 @@ namespace BTCPayServer.Controllers public async Task Theme(ThemeSettings settings) { await _SettingsRepository.UpdateSetting(settings); - TempData["StatusMessage"] = "Theme settings updated successfully"; + TempData[WellKnownTempData.SuccessMessage] = "Theme settings updated successfully"; return View(settings); } diff --git a/BTCPayServer/Views/Account/ForgotPassword.cshtml b/BTCPayServer/Views/Account/ForgotPassword.cshtml index 7835f783a..48d7fc087 100644 --- a/BTCPayServer/Views/Account/ForgotPassword.cshtml +++ b/BTCPayServer/Views/Account/ForgotPassword.cshtml @@ -5,11 +5,11 @@
- @if (TempData.ContainsKey("StatusMessage")) + @if (TempData.HasStatusMessage()) {
- +
} diff --git a/BTCPayServer/Views/Account/ResetPassword.cshtml b/BTCPayServer/Views/Account/ResetPassword.cshtml index a5be48c47..b4357e043 100644 --- a/BTCPayServer/Views/Account/ResetPassword.cshtml +++ b/BTCPayServer/Views/Account/ResetPassword.cshtml @@ -5,11 +5,11 @@
- @if (TempData.ContainsKey("StatusMessage")) + @if (TempData.HasStatusMessage()) {
- +
} diff --git a/BTCPayServer/Views/Server/CreateTemporaryFileUrl.cshtml b/BTCPayServer/Views/Server/CreateTemporaryFileUrl.cshtml index cfaf9dc21..6e5622b85 100644 --- a/BTCPayServer/Views/Server/CreateTemporaryFileUrl.cshtml +++ b/BTCPayServer/Views/Server/CreateTemporaryFileUrl.cshtml @@ -6,7 +6,7 @@ } - +
diff --git a/BTCPayServer/Views/Server/DynamicDnsService.cshtml b/BTCPayServer/Views/Server/DynamicDnsService.cshtml index bf5356030..dda3470b6 100644 --- a/BTCPayServer/Views/Server/DynamicDnsService.cshtml +++ b/BTCPayServer/Views/Server/DynamicDnsService.cshtml @@ -5,7 +5,7 @@

Dynamic DNS Service

- + @if (!this.ViewContext.ModelState.IsValid) {
diff --git a/BTCPayServer/Views/Server/DynamicDnsServices.cshtml b/BTCPayServer/Views/Server/DynamicDnsServices.cshtml index 2d24cd79a..d5af68b68 100644 --- a/BTCPayServer/Views/Server/DynamicDnsServices.cshtml +++ b/BTCPayServer/Views/Server/DynamicDnsServices.cshtml @@ -5,7 +5,7 @@

Dynamic DNS Settings

- +
diff --git a/BTCPayServer/Views/Server/EditAmazonS3StorageProvider.cshtml b/BTCPayServer/Views/Server/EditAmazonS3StorageProvider.cshtml index 99a48a232..85c606f6d 100644 --- a/BTCPayServer/Views/Server/EditAmazonS3StorageProvider.cshtml +++ b/BTCPayServer/Views/Server/EditAmazonS3StorageProvider.cshtml @@ -4,7 +4,7 @@ } - +
diff --git a/BTCPayServer/Views/Server/EditAzureBlobStorageStorageProvider.cshtml b/BTCPayServer/Views/Server/EditAzureBlobStorageStorageProvider.cshtml index cfbfd2869..787617bfb 100644 --- a/BTCPayServer/Views/Server/EditAzureBlobStorageStorageProvider.cshtml +++ b/BTCPayServer/Views/Server/EditAzureBlobStorageStorageProvider.cshtml @@ -4,7 +4,7 @@ } - +
diff --git a/BTCPayServer/Views/Server/EditFilesystemStorageProvider.cshtml b/BTCPayServer/Views/Server/EditFilesystemStorageProvider.cshtml index 837da99da..b1aa00a85 100644 --- a/BTCPayServer/Views/Server/EditFilesystemStorageProvider.cshtml +++ b/BTCPayServer/Views/Server/EditFilesystemStorageProvider.cshtml @@ -3,7 +3,7 @@ ViewData.SetActivePageAndTitle(ServerNavPages.Services, $"Storage - Local Filesystem"); } - +
diff --git a/BTCPayServer/Views/Server/EditGoogleCloudStorageStorageProvider.cshtml b/BTCPayServer/Views/Server/EditGoogleCloudStorageStorageProvider.cshtml index bb0533ce6..c85b59b5e 100644 --- a/BTCPayServer/Views/Server/EditGoogleCloudStorageStorageProvider.cshtml +++ b/BTCPayServer/Views/Server/EditGoogleCloudStorageStorageProvider.cshtml @@ -3,7 +3,7 @@ ViewData.SetActivePageAndTitle(ServerNavPages.Services, $"Storage - Google Cloud Storage"); } - +
diff --git a/BTCPayServer/Views/Server/Files.cshtml b/BTCPayServer/Views/Server/Files.cshtml index da5a8d207..ad8bd73d8 100644 --- a/BTCPayServer/Views/Server/Files.cshtml +++ b/BTCPayServer/Views/Server/Files.cshtml @@ -4,7 +4,7 @@ } - +

File Storage

diff --git a/BTCPayServer/Views/Server/LightningChargeServices.cshtml b/BTCPayServer/Views/Server/LightningChargeServices.cshtml index 6bc4e9946..d6fde539d 100644 --- a/BTCPayServer/Views/Server/LightningChargeServices.cshtml +++ b/BTCPayServer/Views/Server/LightningChargeServices.cshtml @@ -5,7 +5,7 @@

Lightning charge service

- +
diff --git a/BTCPayServer/Views/Server/LightningWalletServices.cshtml b/BTCPayServer/Views/Server/LightningWalletServices.cshtml index 7b4d1f0a2..2b801e194 100644 --- a/BTCPayServer/Views/Server/LightningWalletServices.cshtml +++ b/BTCPayServer/Views/Server/LightningWalletServices.cshtml @@ -5,7 +5,7 @@

@Model.WalletName

- + @if (Model.ShowQR) { diff --git a/BTCPayServer/Views/Server/LndServices.cshtml b/BTCPayServer/Views/Server/LndServices.cshtml index f6eadf545..98570b15b 100644 --- a/BTCPayServer/Views/Server/LndServices.cshtml +++ b/BTCPayServer/Views/Server/LndServices.cshtml @@ -5,7 +5,7 @@

LND @Model.ConnectionType

- +
diff --git a/BTCPayServer/Views/Server/Maintenance.cshtml b/BTCPayServer/Views/Server/Maintenance.cshtml index 07001bf2f..44b45e7fb 100644 --- a/BTCPayServer/Views/Server/Maintenance.cshtml +++ b/BTCPayServer/Views/Server/Maintenance.cshtml @@ -4,11 +4,7 @@ } - -@if (!Model.CanUseSSH) -{ - -} +
diff --git a/BTCPayServer/Views/Server/P2PService.cshtml b/BTCPayServer/Views/Server/P2PService.cshtml index 288cbe4cd..cad8fb1de 100644 --- a/BTCPayServer/Views/Server/P2PService.cshtml +++ b/BTCPayServer/Views/Server/P2PService.cshtml @@ -5,7 +5,7 @@

@Model.WalletName

- + @if (Model.ShowQR) { diff --git a/BTCPayServer/Views/Server/Policies.cshtml b/BTCPayServer/Views/Server/Policies.cshtml index 2750d4975..89516c016 100644 --- a/BTCPayServer/Views/Server/Policies.cshtml +++ b/BTCPayServer/Views/Server/Policies.cshtml @@ -4,7 +4,7 @@ } - + @if (!this.ViewContext.ModelState.IsValid) {
diff --git a/BTCPayServer/Views/Server/Rates.cshtml b/BTCPayServer/Views/Server/Rates.cshtml index 76a78bfc3..c9c1f5978 100644 --- a/BTCPayServer/Views/Server/Rates.cshtml +++ b/BTCPayServer/Views/Server/Rates.cshtml @@ -4,7 +4,7 @@ } - +
diff --git a/BTCPayServer/Views/Server/SSHService.cshtml b/BTCPayServer/Views/Server/SSHService.cshtml index e15b56524..7c03b74e3 100644 --- a/BTCPayServer/Views/Server/SSHService.cshtml +++ b/BTCPayServer/Views/Server/SSHService.cshtml @@ -5,7 +5,7 @@

SSH settings

- +
diff --git a/BTCPayServer/Views/Server/Services.cshtml b/BTCPayServer/Views/Server/Services.cshtml index b98595ecb..d4e13f719 100644 --- a/BTCPayServer/Views/Server/Services.cshtml +++ b/BTCPayServer/Views/Server/Services.cshtml @@ -4,7 +4,7 @@ } - +
diff --git a/BTCPayServer/Views/Server/Storage.cshtml b/BTCPayServer/Views/Server/Storage.cshtml index 7143926eb..ae1f71548 100644 --- a/BTCPayServer/Views/Server/Storage.cshtml +++ b/BTCPayServer/Views/Server/Storage.cshtml @@ -5,7 +5,7 @@ } - + @if (Model.ShowChangeWarning) {
diff --git a/BTCPayServer/Views/Server/Theme.cshtml b/BTCPayServer/Views/Server/Theme.cshtml index 986a1e374..ebea95c57 100644 --- a/BTCPayServer/Views/Server/Theme.cshtml +++ b/BTCPayServer/Views/Server/Theme.cshtml @@ -4,7 +4,7 @@ } - +
diff --git a/BTCPayServer/Views/Stores/CheckoutExperience.cshtml b/BTCPayServer/Views/Stores/CheckoutExperience.cshtml index 5ccc2e7da..5eff154d9 100644 --- a/BTCPayServer/Views/Stores/CheckoutExperience.cshtml +++ b/BTCPayServer/Views/Stores/CheckoutExperience.cshtml @@ -4,7 +4,7 @@ ViewData.SetActivePageAndTitle(StoreNavPages.Checkout, "Checkout experience"); } - +
diff --git a/BTCPayServer/Views/Stores/Rates.cshtml b/BTCPayServer/Views/Stores/Rates.cshtml index 51385b2cc..6c0fa1518 100644 --- a/BTCPayServer/Views/Stores/Rates.cshtml +++ b/BTCPayServer/Views/Stores/Rates.cshtml @@ -4,7 +4,7 @@ ViewData.SetActivePageAndTitle(StoreNavPages.Rates, "Rates"); } - +
diff --git a/BTCPayServer/Views/Stores/StoreUsers.cshtml b/BTCPayServer/Views/Stores/StoreUsers.cshtml index f5745243b..1753c3f3a 100644 --- a/BTCPayServer/Views/Stores/StoreUsers.cshtml +++ b/BTCPayServer/Views/Stores/StoreUsers.cshtml @@ -4,7 +4,7 @@ ViewData.SetActivePageAndTitle(StoreNavPages.Users, "Manage users"); } - +
diff --git a/BTCPayServer/Views/Stores/UpdateStore.cshtml b/BTCPayServer/Views/Stores/UpdateStore.cshtml index eadba6d45..1ad0e2d65 100644 --- a/BTCPayServer/Views/Stores/UpdateStore.cshtml +++ b/BTCPayServer/Views/Stores/UpdateStore.cshtml @@ -4,7 +4,7 @@ ViewData.SetActivePageAndTitle(StoreNavPages.Index, "Profile"); } - +
diff --git a/BTCPayServer/Views/UserStores/ListStores.cshtml b/BTCPayServer/Views/UserStores/ListStores.cshtml index 7227cb751..db4620df1 100644 --- a/BTCPayServer/Views/UserStores/ListStores.cshtml +++ b/BTCPayServer/Views/UserStores/ListStores.cshtml @@ -5,11 +5,11 @@
- @if (TempData.ContainsKey("TempDataProperty-StatusMessage")) + @if (TempData.HasStatusMessage()) {
- +
} diff --git a/BTCPayServer/Views/Wallets/ListWallets.cshtml b/BTCPayServer/Views/Wallets/ListWallets.cshtml index 426728e35..abed6f779 100644 --- a/BTCPayServer/Views/Wallets/ListWallets.cshtml +++ b/BTCPayServer/Views/Wallets/ListWallets.cshtml @@ -5,11 +5,11 @@
- @if (TempData.ContainsKey("TempDataProperty-StatusMessage")) + @if (TempData.HasStatusMessage()) {
- +
} diff --git a/BTCPayServer/Views/Wallets/WalletPSBT.cshtml b/BTCPayServer/Views/Wallets/WalletPSBT.cshtml index b77944822..7e5e9df13 100644 --- a/BTCPayServer/Views/Wallets/WalletPSBT.cshtml +++ b/BTCPayServer/Views/Wallets/WalletPSBT.cshtml @@ -4,11 +4,11 @@ ViewData["Title"] = "PSBT"; ViewData.SetActivePageAndTitle(WalletsNavPages.PSBT); } -@if (TempData.ContainsKey("TempDataProperty-StatusMessage")) +@if (TempData.HasStatusMessage()) {
- +
} diff --git a/BTCPayServer/Views/Wallets/WalletSettings.cshtml b/BTCPayServer/Views/Wallets/WalletSettings.cshtml index bcbeec6d5..f1427a3c6 100644 --- a/BTCPayServer/Views/Wallets/WalletSettings.cshtml +++ b/BTCPayServer/Views/Wallets/WalletSettings.cshtml @@ -4,11 +4,11 @@ ViewData["Title"] = "Wallet settings"; ViewData.SetActivePageAndTitle(WalletsNavPages.Settings); } -@if (TempData.ContainsKey("TempDataProperty-StatusMessage")) +@if (TempData.HasStatusMessage()) {
- +
} diff --git a/BTCPayServer/Views/Wallets/WalletTransactions.cshtml b/BTCPayServer/Views/Wallets/WalletTransactions.cshtml index 73413b1eb..88927b989 100644 --- a/BTCPayServer/Views/Wallets/WalletTransactions.cshtml +++ b/BTCPayServer/Views/Wallets/WalletTransactions.cshtml @@ -47,11 +47,11 @@ border: 0; } -@if (TempData.ContainsKey("TempDataProperty-StatusMessage")) +@if (TempData.HasStatusMessage()) {
- +
}