mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
* Store selector * Footer * Notifications * Checkout Appearance * Users list * Forms * Emails * Pay Button * Edit Dictionary * Remove newlines, fix typos * Forms * Pull payments and payouts * Various pages * Use local docs link * Fix * Even more translations * Fixes #6325 * Account pages * Notifications * Placeholders * Various pages and components * Add more
43 lines
1.3 KiB
Plaintext
43 lines
1.3 KiB
Plaintext
@using Microsoft.AspNetCore.Http
|
|
|
|
@inject IHttpContextAccessor HttpContextAccessor
|
|
|
|
@if (Users?.Any() is true)
|
|
{
|
|
<div @attributes="Attrs" class="@CssClass">
|
|
<label for="SignedInUser" class="form-label" text-translate="true">Signed in user</label>
|
|
<select id="SignedInUser" class="form-select" value="@_userId" @onchange="@(e => _userId = e.Value?.ToString())">
|
|
<option value="" text-translate="true">None, just open the URL</option>
|
|
@foreach (var u in Users)
|
|
{
|
|
<option value="@u.Key">@u.Value</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
}
|
|
|
|
@if (string.IsNullOrEmpty(_userId))
|
|
{
|
|
<QrCode Data="@PosUrl" />
|
|
}
|
|
else
|
|
{
|
|
<UserLoginCode UserId="@_userId" RedirectUrl="@PosPath" />
|
|
}
|
|
|
|
@code {
|
|
[Parameter, EditorRequired]
|
|
public string PosPath { get; set; }
|
|
|
|
[Parameter]
|
|
public Dictionary<string,string> Users { get; set; }
|
|
|
|
[Parameter(CaptureUnmatchedValues = true)]
|
|
public Dictionary<string, object> Attrs { get; set; }
|
|
|
|
private string _userId;
|
|
private string PosUrl => Request.GetAbsoluteRoot() + PosPath;
|
|
private HttpRequest Request => HttpContextAccessor.HttpContext?.Request;
|
|
private string CssClass => $"form-group {(Attrs?.ContainsKey("class") is true ? Attrs["class"] : "")}".Trim();
|
|
}
|