btcpayserver/BTCPayServer/Views/UIPublicLightningNodeInfo/ShowLightningNodeInfo.cshtml
Dennis Reimann ba423a79e3 Fix Public Node Info View
As the Node Info was used as an ID, this didn't work with IPv6 addresses, as those contain characters not suitable for HTML IDs.

Fixes #4245.

Also: Simplify the head section of that view by reusing the existing partial.
2022-10-30 11:23:09 +01:00

67 lines
3.6 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@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.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>
}
</div>
</div>
</div>
</div>
</div>
<partial name="LayoutFoot" />
</body>
</html>