From a126ec17186586921fe2da09ad12743201bc0a07 Mon Sep 17 00:00:00 2001 From: rockstardev Date: Sun, 3 Nov 2019 13:18:09 -0600 Subject: [PATCH] Renaming to LndServiceViewModel, used both by grpc and rest --- BTCPayServer/Controllers/ServerController.cs | 5 ++++- .../ServerViewModels/LndRestServicesViewModel.cs | 14 -------------- ...ervicesViewModel.cs => LndServicesViewModel.cs} | 8 ++------ BTCPayServer/Views/Server/LndServices.cshtml | 2 +- 4 files changed, 7 insertions(+), 22 deletions(-) delete mode 100644 BTCPayServer/Models/ServerViewModels/LndRestServicesViewModel.cs rename BTCPayServer/Models/ServerViewModels/{LndGrpcServicesViewModel.cs => LndServicesViewModel.cs} (80%) diff --git a/BTCPayServer/Controllers/ServerController.cs b/BTCPayServer/Controllers/ServerController.cs index f92ea3f5f..d06e74820 100644 --- a/BTCPayServer/Controllers/ServerController.cs +++ b/BTCPayServer/Controllers/ServerController.cs @@ -491,6 +491,8 @@ namespace BTCPayServer.Controllers { var result = new ServicesViewModel(); result.ExternalServices = _Options.ExternalServices.ToList(); + + // other services foreach (var externalService in _Options.OtherExternalServices) { result.OtherExternalServices.Add(new ServicesViewModel.OtherExternalService() @@ -536,6 +538,7 @@ namespace BTCPayServer.Controllers } } + // external storage services var storageSettings = await _SettingsRepository.GetSettingAsync(); result.ExternalStorageServices.Add(new ServicesViewModel.OtherExternalService() { @@ -647,7 +650,7 @@ namespace BTCPayServer.Controllers private IActionResult LndServices(ExternalService service, ExternalConnectionString connectionString, uint? nonce) { - var model = new LndGrpcServicesViewModel(); + var model = new LndServicesViewModel(); if (service.Type == ExternalServiceTypes.LNDGRPC) { model.Host = $"{connectionString.Server.DnsSafeHost}:{connectionString.Server.Port}"; diff --git a/BTCPayServer/Models/ServerViewModels/LndRestServicesViewModel.cs b/BTCPayServer/Models/ServerViewModels/LndRestServicesViewModel.cs deleted file mode 100644 index 1d4efc5bc..000000000 --- a/BTCPayServer/Models/ServerViewModels/LndRestServicesViewModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace BTCPayServer.Models.ServerViewModels -{ - public class LndRestServicesViewModel - { - public string BaseApiUrl { get; set; } - public string Macaroon { get; set; } - public string CertificateThumbprint { get; set; } - } -} diff --git a/BTCPayServer/Models/ServerViewModels/LndGrpcServicesViewModel.cs b/BTCPayServer/Models/ServerViewModels/LndServicesViewModel.cs similarity index 80% rename from BTCPayServer/Models/ServerViewModels/LndGrpcServicesViewModel.cs rename to BTCPayServer/Models/ServerViewModels/LndServicesViewModel.cs index 54f33dbd8..3ece5c1b5 100644 --- a/BTCPayServer/Models/ServerViewModels/LndGrpcServicesViewModel.cs +++ b/BTCPayServer/Models/ServerViewModels/LndServicesViewModel.cs @@ -1,12 +1,8 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; namespace BTCPayServer.Models.ServerViewModels { - public class LndGrpcServicesViewModel + public class LndServicesViewModel { public string Host { get; set; } public bool SSL { get; set; } diff --git a/BTCPayServer/Views/Server/LndServices.cshtml b/BTCPayServer/Views/Server/LndServices.cshtml index 98570b15b..1dead47e2 100644 --- a/BTCPayServer/Views/Server/LndServices.cshtml +++ b/BTCPayServer/Views/Server/LndServices.cshtml @@ -1,4 +1,4 @@ -@model LndGrpcServicesViewModel +@model LndServicesViewModel @{ ViewData.SetActivePageAndTitle(ServerNavPages.Services); }