Compare commits
8 Commits
fix-array-
...
193-bump
Author | SHA1 | Date | |
---|---|---|---|
|
845a7ec06f | ||
|
210fb090a8 | ||
|
92cb15e95a | ||
|
9c96c391ce | ||
|
137e80c0c9 | ||
|
44de5a1f88 | ||
|
57358f8fc5 | ||
|
190beeb70d |
@@ -1301,20 +1301,10 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
case JTokenType.Array:
|
||||
var items = item.Value.AsEnumerable().ToList();
|
||||
var arrayResult = new List<object>();
|
||||
for (var i = 0; i < items.Count; i++)
|
||||
{
|
||||
if (items[i] is JObject)
|
||||
{
|
||||
arrayResult.Add( ParsePosData(items[i]));
|
||||
}
|
||||
else
|
||||
{
|
||||
arrayResult.Add( items[i].ToString());
|
||||
}
|
||||
result.TryAdd($"{item.Key}[{i}]", ParsePosData(items[i]));
|
||||
}
|
||||
|
||||
result.TryAdd(item.Key, arrayResult);
|
||||
|
||||
break;
|
||||
case JTokenType.Object:
|
||||
|
@@ -1,77 +1,47 @@
|
||||
@model (Dictionary<string, object> Items, int Level)
|
||||
|
||||
@functions {
|
||||
|
||||
private bool IsValidURL(string source)
|
||||
{
|
||||
return Uri.TryCreate(source, UriKind.Absolute, out var uriResult) &&
|
||||
(uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
|
||||
return Uri.TryCreate(source, UriKind.Absolute, out var uriResult) &&
|
||||
(uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@if (Model.Items.Count > 0)
|
||||
{
|
||||
<table class="table my-0" v-pre>
|
||||
@foreach (var (key, value) in Model.Items)
|
||||
{
|
||||
<tr>
|
||||
@if (value is string str)
|
||||
<table class="table my-0" v-pre>
|
||||
@foreach (var (key, value) in Model.Items)
|
||||
{
|
||||
<tr>
|
||||
@if (value is string str)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(key))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(key))
|
||||
<th class="w-150px">@key</th>
|
||||
}
|
||||
<td>
|
||||
@if (IsValidURL(str))
|
||||
{
|
||||
<th class="w-150px">@key</th>
|
||||
<a href="@str" target="_blank" rel="noreferrer noopener">@str</a>
|
||||
}
|
||||
<td>
|
||||
@if (IsValidURL(str))
|
||||
{
|
||||
<a href="@str" target="_blank" rel="noreferrer noopener">@str</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
@value?.ToString()
|
||||
}
|
||||
</td>
|
||||
}
|
||||
else if (value is Dictionary<string, object> {Count: > 0 } subItems)
|
||||
{
|
||||
<td colspan="2">
|
||||
@{
|
||||
@if (!string.IsNullOrEmpty(key))
|
||||
{
|
||||
Write(Html.Raw($"<h{Model.Level + 3} class=\"mt-4 mb-3\">"));
|
||||
Write(key);
|
||||
Write(Html.Raw($"</h{Model.Level + 3}>"));
|
||||
}
|
||||
}
|
||||
<partial name="PosData" model="@((subItems, Model.Level + 1))" />
|
||||
</td>
|
||||
}
|
||||
else if (value is IEnumerable<object> valueArray)
|
||||
{
|
||||
<td colspan="2">
|
||||
@{
|
||||
@if (!string.IsNullOrEmpty(key))
|
||||
{
|
||||
Write(Html.Raw($"<h{Model.Level + 3} class=\"mt-4 mb-3\">"));
|
||||
Write(key);
|
||||
Write(Html.Raw($"</h{Model.Level + 3}>"));
|
||||
}
|
||||
}
|
||||
@foreach (var item in valueArray)
|
||||
{
|
||||
@if (item is Dictionary<string, object> {Count: > 0 } subItems2)
|
||||
{
|
||||
<partial name="PosData" model="@((subItems2, Model.Level + 1))" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<partial name="PosData" model="@((new Dictionary<string, object>() {{"", item}}, Model.Level + 1))" />
|
||||
}
|
||||
}
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
else
|
||||
{
|
||||
@value?.ToString()
|
||||
}
|
||||
</td>
|
||||
}
|
||||
else if (value is Dictionary<string, object> {Count: > 0 } subItems)
|
||||
{
|
||||
<td colspan="2" >
|
||||
@{
|
||||
Write(Html.Raw($"<h{Model.Level + 3} class=\"mt-4 mb-3\">"));
|
||||
Write(key);
|
||||
Write(Html.Raw($"</h{Model.Level + 3}>"));
|
||||
}
|
||||
<partial name="PosData" model="@((subItems, Model.Level + 1))"/>
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>1.9.2</Version>
|
||||
<Version>1.9.3</Version>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
18
Changelog.md
18
Changelog.md
@@ -1,5 +1,23 @@
|
||||
# Changelog
|
||||
|
||||
## 1.9.3
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* Fix: Missing Shopify link (#4945) @Kukks
|
||||
* Rates: Fix advanced rules example formatting (#4926) @dennisreimann
|
||||
* Crowdfund: Fix redirect URL fallback (#4943) @dennisreimann
|
||||
* Greenfield: Apply store default payment method on invoice creation (#4947) @dennisreimann
|
||||
* POS: Fix Firefox issues (#4950) @r0ckstardev
|
||||
* Fix viewing arrays in the invoice details when set in metadata (#4954) @Kukks
|
||||
* Do not crash checkout when attempting LNURL checkout through non-secure page (#4964) @Kukks
|
||||
* NFC: Handle HTTP-related exceptions (#4965) @dennisreimann
|
||||
|
||||
### Improvements
|
||||
|
||||
* LN Settings: Show only node host name (#4927) @dennisreimann
|
||||
* Checkout: Improve truncation of shown addresses (#4924) @dennisreimann
|
||||
|
||||
## 1.9.2
|
||||
|
||||
### Bug fixes
|
||||
|
Reference in New Issue
Block a user