mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 05:33:31 +01:00
562f88555c
Fixes #4246. `LightningLikePaymentHandler.GetNodeInfo` needed the `throws` argument to handle the cases as previously, otherwise the catch case in `ShowLightningNodeInfo` never occured. State with this PR: A node can be available, but not have any public addresses. The latter will now be reported when testing the connection and on the public node info page.
75 lines
4.0 KiB
Plaintext
75 lines
4.0 KiB
Plaintext
@model BTCPayServer.Controllers.ShowLightningNodeInfoViewModel
|
||
@{
|
||
Layout = null;
|
||
ViewData["Title"] = $"{Model.StoreName} – {Model.CryptoCode} Lightning Node";
|
||
}
|
||
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<partial name="LayoutHead" />
|
||
<link href="~/main/qrcode.css" rel="stylesheet" asp-append-version="true" />
|
||
</head>
|
||
<body>
|
||
<div id="app" class="container">
|
||
<div class="row" style="height:100vh">
|
||
<div class="col-md-8 col-sm-12 col-lg-6 mx-auto my-auto">
|
||
<div class="card border-0">
|
||
<div class="card-body p-4">
|
||
<h1 class="card-title text-center mt-3">@Model.StoreName</h1>
|
||
<h2 class="h3 card-subtitle text-center text-secondary my-3">
|
||
<span>@Model.CryptoCode</span>
|
||
Lightning Node
|
||
</h2>
|
||
<h4 class="text-center">
|
||
<span class="me-1 btcpay-status btcpay-status--@(Model.Available ? "enabled" : "disabled")"></span>
|
||
<span>
|
||
@(Model.Available ? "Online" : "Unavailable")
|
||
</span>
|
||
</h4>
|
||
@if (Model.Available)
|
||
{
|
||
@if (Model.NodeInfo.Any())
|
||
{
|
||
@if (Model.NodeInfo.Length > 1)
|
||
{
|
||
<ul class="nav nav-pills justify-content-center mt-4" id="nodeInfo-tab" role="tablist">
|
||
@for (var i = 0; i < Model.NodeInfo.Length; i++)
|
||
{
|
||
var nodeInfo = Model.NodeInfo[i];
|
||
<li class="nav-item" role="presentation">
|
||
<button class="nav-link w-100px @(i == 0 ? "active" : "")" id="nodeInfo-tab-@i" data-bs-toggle="pill" data-bs-target="#nodeInfo-@i" type="button" role="tab" aria-controls="nodeInfo-@i" aria-selected="true">@(nodeInfo.IsTor ? "Tor" : "Clearnet")</button>
|
||
</li>
|
||
}
|
||
</ul>
|
||
}
|
||
<div class="tab-content" id="nodeInfo-tabContent">
|
||
@for (var i = 0; i < Model.NodeInfo.Length; i++)
|
||
{
|
||
var nodeInfo = Model.NodeInfo[i].ToString();
|
||
<div class="tab-pane fade @(i == 0 ? "show active" : "")" id="nodeInfo-@i" role="tabpanel" aria-labelledby="nodeInfo-tab-@i">
|
||
<div class="qr-container my-4 w-100">
|
||
<img alt="@Model.CryptoCode" class="qr-icon" src="@Model.CryptoImage"/>
|
||
<vc:qr-code data="@nodeInfo"/>
|
||
</div>
|
||
<div class="input-group" data-clipboard="@nodeInfo">
|
||
<input type="text" class="form-control" style="cursor:copy" readonly="readonly" value="@nodeInfo" id="nodeInfo-addr-@i"/>
|
||
<button type="button" class="btn btn-outline-secondary" data-clipboard-confirm>Copy</button>
|
||
</div>
|
||
</div>
|
||
}
|
||
</div>
|
||
}
|
||
else
|
||
{
|
||
<p class="text-center mt-4">No public address available.</p>
|
||
}
|
||
}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<partial name="LayoutFoot" />
|
||
</body>
|
||
</html>
|