Skip to content

Commit b808f44

Browse files
committed
Add support for arrays and multiple levels of nesting
1 parent 76050e6 commit b808f44

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

LogViewer.Client/views/components/log-items.html

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
<script type="text/ng-template" id="nestedTable">
2+
<table class="table nested-prop">
3+
<tbody>
4+
<tr ng-if="val.properties" ng-repeat="prop in val.properties">
5+
<th>{{prop.name}}</th>
6+
<td ng-if="prop.value.value !== undefined">{{prop.value.value}}</td>
7+
<td ng-if="prop.value.properties || prop.value.elements" ng-init="val = prop.value" ng-include="'nestedTable'"></td>
8+
</tr>
9+
<tr ng-if="val.elements" ng-repeat="element in val.elements">
10+
<td ng-if="element.value !== undefined">{{element.value}}</td>
11+
<td ng-if="element.properties || element.elements" ng-init="val = element" ng-include="'nestedTable'" ></td>
12+
</tr>
13+
</tbody>
14+
</table>
15+
</script>
16+
117
<div class="card">
218
<div class="card-body">
319

@@ -48,16 +64,7 @@ <h3>Properties</h3>
4864
<a ng-switch-when="RequestUrl" ng-href="{{val.value}}" target="_blank" rel="noopener" title="Open">{{val.value}}</a>
4965
<div ng-switch-default>
5066
<span ng-if="val.value !== undefined">{{val.value}}</span>
51-
<div ng-if="val.properties">
52-
<table class="table nested-prop">
53-
<tbody>
54-
<tr ng-repeat="prop in val.properties">
55-
<th>{{prop.name}}</th>
56-
<td ng-if="prop.value.value !== undefined">{{prop.value.value}}</td>
57-
</tr>
58-
</tbody>
59-
</table>
60-
</div>
67+
<div ng-if="val.properties || val.elements" ng-include="'nestedTable'"></div>
6168
</div>
6269
</td>
6370
</tr>

0 commit comments

Comments
 (0)