Improve Lightning settings display

This commit is contained in:
Dennis Reimann 2021-11-24 10:55:11 +01:00 committed by Andrew Camilleri
parent 285a30f67a
commit 3b3fac98ad
2 changed files with 33 additions and 6 deletions

View file

@ -1,3 +1,4 @@
@using BTCPayServer.Lightning
@model LightningSettingsViewModel
@{
Layout = "../Shared/_NavLayout.cshtml";
@ -21,10 +22,24 @@
</tr>
@if (Model.LightningNodeType != LightningNodeType.Internal)
{
<tr>
<th>Connection String</th>
<td class="text-break">@Model.ConnectionString</td>
</tr>
if (LightningConnectionString.TryParse(Model.ConnectionString, out var cs))
{
<tr>
<th>Connection Type</th>
<td>@typeof(LightningConnectionType).DisplayName(cs.ConnectionType.ToString())</td>
</tr>
<tr>
<th>Base URI</th>
<td>@cs.BaseUri</td>
</tr>
}
else
{
<tr>
<th>Connection String</th>
<td>@Model.ConnectionString</td>
</tr>
}
}
</tbody>
</table>

View file

@ -1,4 +1,6 @@
@using System.Text.RegularExpressions
@using BTCPayServer.Lightning
@using BTCPayServer.Services
@model PaymentMethodsViewModel
@{
Layout = "../Shared/_NavLayout.cshtml";
@ -120,8 +122,18 @@
<strong class="me-3">@scheme.CryptoCode</strong>
@if (isSetUp)
{
<span class="smMaxWidth text-truncate text-secondary me-3">@scheme.Address</span>
<a class="text-secondary"
<span class="text-truncate text-secondary me-3" style="max-width:150px;">
@if (LightningConnectionString.TryParse(scheme.Address, out var cs))
{
<span>@typeof(LightningConnectionType).DisplayName(cs.ConnectionType.ToString())</span>
<span>@cs.BaseUri.Host</span>
}
else
{
@scheme.Address
}
</span>
<a class="text-secondary me-3"
asp-controller="PublicLightningNodeInfo"
asp-action="ShowLightningNodeInfo"
asp-route-cryptoCode="@scheme.CryptoCode"