Add a node events section to the node detail page

This commit is contained in:
Michael Lange 2018-05-08 11:23:42 -07:00
parent baab8af975
commit 446e26ea07
2 changed files with 34 additions and 0 deletions

View file

@ -24,6 +24,12 @@ export default Controller.extend(Sortable, Searchable, {
listToSearch: alias('listSorted'),
sortedAllocations: alias('listSearched'),
sortedEvents: computed('model.events.@each.time', function() {
return this.get('model.events')
.sortBy('time')
.reverse();
}),
actions: {
gotoAllocation(allocation) {
this.transitionToRoute('allocations.allocation', allocation);

View file

@ -93,6 +93,34 @@
</div>
</div>
<div class="boxed-section">
<div class="boxed-section-head">
Client Events
</div>
<div class="boxed-section-body is-full-bleed">
{{#list-table source=sortedEvents class="is-striped" as |t|}}
{{#t.head}}
<th class="is-2">Time</th>
<th class="is-2">Subsystem</th>
<th>Message</th>
{{/t.head}}
{{#t.body as |row|}}
<tr data-test-node-event>
<td data-test-task-event-time>{{moment-format row.model.time "MM/DD/YY HH:mm:ss"}}</td>
<td data-test-task-event-type>{{row.model.subsystem}}</td>
<td data-test-task-event-message>
{{#if row.model.message}}
{{row.model.message}}
{{else}}
<em>No message</em>
{{/if}}
</td>
</tr>
{{/t.body}}
{{/list-table}}
</div>
</div>
<div class="boxed-section">
<div class="boxed-section-head">
Attributes