Skip to content

Commit b45f1d8

Browse files
author
Warren Buckley
authored
Merge pull request #707 from EBD232/nesting
Add support for multiple levels of nesting, and fix empty values
2 parents b636abb + 78683fc commit b45f1d8

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

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

Lines changed: 18 additions & 11 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

@@ -47,17 +63,8 @@ <h3>Properties</h3>
4763
<a ng-switch-when="MachineName" ng-click="vm.findItem(key, val.value)" title="Find Logs with Machine Name" class="btn btn-primary">{{val.value}}</a>
4864
<a ng-switch-when="RequestUrl" ng-href="{{val.value}}" target="_blank" rel="noopener" title="Open">{{val.value}}</a>
4965
<div ng-switch-default>
50-
<span ng-if="val.value">{{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">{{prop.value.value}}</td>
57-
</tr>
58-
</tbody>
59-
</table>
60-
</div>
66+
<span ng-if="val.value !== undefined">{{val.value}}</span>
67+
<div ng-if="val.properties || val.elements" ng-include="'nestedTable'"></div>
6168
</div>
6269
</td>
6370
</tr>

0 commit comments

Comments
 (0)