From 232ceed8b008c443ed3e99ce5240f651c14accad Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 7 May 2019 14:44:26 +0900 Subject: [PATCH] Prettify the bitcoin core node page --- BTCPayServer/Controllers/ServerController.cs | 2 +- BTCPayServer/Extensions.cs | 6 ++++++ BTCPayServer/Views/Server/P2PService.cshtml | 10 ++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/BTCPayServer/Controllers/ServerController.cs b/BTCPayServer/Controllers/ServerController.cs index 80fa8b11f..4f5da9766 100644 --- a/BTCPayServer/Controllers/ServerController.cs +++ b/BTCPayServer/Controllers/ServerController.cs @@ -601,7 +601,7 @@ namespace BTCPayServer.Controllers { ShowQR = showQR, WalletName = service.ServiceName, - ServiceLink = service.ConnectionString.Server.AbsoluteUri + ServiceLink = service.ConnectionString.Server.AbsoluteUri.WithoutEndingSlash() }); } var connectionString = await service.ConnectionString.Expand(this.Request.GetAbsoluteUriNoPathBase(), service.Type); diff --git a/BTCPayServer/Extensions.cs b/BTCPayServer/Extensions.cs index 91168c85f..b6dfe50de 100644 --- a/BTCPayServer/Extensions.cs +++ b/BTCPayServer/Extensions.cs @@ -132,6 +132,12 @@ namespace BTCPayServer return str; return $"/{str}"; } + public static string WithoutEndingSlash(this string str) + { + if (str.EndsWith("/", StringComparison.InvariantCulture)) + return str.Substring(0, str.Length - 1); + return str; + } public static void SetHeaderOnStarting(this HttpResponse resp, string name, string value) { diff --git a/BTCPayServer/Views/Server/P2PService.cshtml b/BTCPayServer/Views/Server/P2PService.cshtml index 92bbc0c2c..95e655f11 100644 --- a/BTCPayServer/Views/Server/P2PService.cshtml +++ b/BTCPayServer/Views/Server/P2PService.cshtml @@ -27,9 +27,9 @@
-
QR Code connection
+
Full node connection

- You can use QR Code to connect to @Model.WalletName with compatible wallets.
+ This page exposes information to connect remotely to your full node via the P2P protocol.

@@ -52,6 +52,12 @@
+
+
QR Code connection
+

+ You can use QR Code to connect to @Model.WalletName with compatible wallets.
+

+
@if (!Model.ShowQR) {