From 3b3fac98ad7ec7f09da4bd46f8b621868e8e9ab0 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Wed, 24 Nov 2021 10:55:11 +0100 Subject: [PATCH] Improve Lightning settings display --- .../Views/Stores/LightningSettings.cshtml | 23 +++++++++++++++---- .../Views/Stores/PaymentMethods.cshtml | 16 +++++++++++-- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/BTCPayServer/Views/Stores/LightningSettings.cshtml b/BTCPayServer/Views/Stores/LightningSettings.cshtml index 7cb1de178..a12675c97 100644 --- a/BTCPayServer/Views/Stores/LightningSettings.cshtml +++ b/BTCPayServer/Views/Stores/LightningSettings.cshtml @@ -1,3 +1,4 @@ +@using BTCPayServer.Lightning @model LightningSettingsViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; @@ -21,10 +22,24 @@ @if (Model.LightningNodeType != LightningNodeType.Internal) { - - Connection String - @Model.ConnectionString - + if (LightningConnectionString.TryParse(Model.ConnectionString, out var cs)) + { + + Connection Type + @typeof(LightningConnectionType).DisplayName(cs.ConnectionType.ToString()) + + + Base URI + @cs.BaseUri + + } + else + { + + Connection String + @Model.ConnectionString + + } } diff --git a/BTCPayServer/Views/Stores/PaymentMethods.cshtml b/BTCPayServer/Views/Stores/PaymentMethods.cshtml index 13fe7adf4..3acad3a5c 100644 --- a/BTCPayServer/Views/Stores/PaymentMethods.cshtml +++ b/BTCPayServer/Views/Stores/PaymentMethods.cshtml @@ -1,4 +1,6 @@ @using System.Text.RegularExpressions +@using BTCPayServer.Lightning +@using BTCPayServer.Services @model PaymentMethodsViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; @@ -120,8 +122,18 @@ @scheme.CryptoCode @if (isSetUp) { - @scheme.Address - + @if (LightningConnectionString.TryParse(scheme.Address, out var cs)) + { + @typeof(LightningConnectionType).DisplayName(cs.ConnectionType.ToString()) + @cs.BaseUri.Host + } + else + { + @scheme.Address + } + +