mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-23 07:04:26 +01:00
Allowing copying of Payment Request URL
This commit is contained in:
committed by
nicolas.dorier
parent
d2debaa842
commit
fdde3096d0
@@ -92,5 +92,17 @@ namespace BTCPayServer.Services
|
||||
pathBase: request.PathBase
|
||||
) ?? throw Bug();
|
||||
}
|
||||
|
||||
public string PaymentRequestLink(string payReqId, HttpRequest request)
|
||||
{
|
||||
return LinkGenerator.GetUriByAction(
|
||||
action: nameof(UIPaymentRequestController.ViewPaymentRequest),
|
||||
controller: "UIPaymentRequest",
|
||||
values: new { payReqId },
|
||||
scheme: request.Scheme,
|
||||
host: request.Host,
|
||||
pathBase: request.PathBase
|
||||
) ?? throw Bug();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using BTCPayServer.Components
|
||||
@using BTCPayServer.Client
|
||||
@using BTCPayServer.Services
|
||||
@using BTCPayServer.TagHelpers
|
||||
@inject CallbackGenerator CallbackGenerator
|
||||
@model BTCPayServer.Models.PaymentRequestViewModels.ListPaymentRequestsViewModel
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
@@ -119,6 +122,11 @@
|
||||
<td class="text-end">
|
||||
<div class="d-inline-flex align-items-center gap-3">
|
||||
<a asp-action="ViewPaymentRequest" asp-route-payReqId="@item.Id" id="PaymentRequest-@item.Id" target="_blank" text-translate="true">View</a>
|
||||
<button type="button" class="btn btn-link p-0 clipboard-button"
|
||||
data-clipboard="@CallbackGenerator.PaymentRequestByIdLink(item.Id, this.Context.Request)"
|
||||
title="Copy Link">
|
||||
<vc:icon symbol="actions-copy" />
|
||||
</button>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-link dropdown-toggle p-0 dropdown-toggle-no-caret text-body" type="button" data-bs-toggle="dropdown" aria-expanded="false" id="ToggleActions-@item.Id">
|
||||
<vc:icon symbol="dots" />
|
||||
|
||||
Reference in New Issue
Block a user