Add volumes column to the task row component

This commit is contained in:
Michael Lange 2020-02-12 22:14:28 -08:00
parent 9186f75c6a
commit 3fbd267263
4 changed files with 23 additions and 3 deletions

View File

@ -1,8 +1,10 @@
import attr from 'ember-data/attr';
import Fragment from 'ember-data-model-fragments/fragment';
import { fragmentArray } from 'ember-data-model-fragments/attributes';
import { fragmentArray, fragmentOwner } from 'ember-data-model-fragments/attributes';
export default Fragment.extend({
taskGroup: fragmentOwner(),
name: attr('string'),
driver: attr('string'),
kind: attr('string'),

View File

@ -1,8 +1,15 @@
import { computed } from '@ember/object';
import attr from 'ember-data/attr';
import Fragment from 'ember-data-model-fragments/fragment';
import { fragmentOwner } from 'ember-data-model-fragments/attributes';
export default Fragment.extend({
task: fragmentOwner(),
volume: attr('string'),
source: computed('task.taskGroup.volumes.@each.{name,source}', function() {
return this.task.taskGroup.volumes.findBy('name', this.volume).source;
}),
destination: attr('string'),
propagationMode: attr('string'),

View File

@ -95,6 +95,7 @@
{{#t.sort-by prop="state"}}State{{/t.sort-by}}
<th>Last Event</th>
{{#t.sort-by prop="events.lastObject.time"}}Time{{/t.sort-by}}
<th>Volumes</th>
<th>Addresses</th>
<th>CPU</th>
<th>Memory</th>

View File

@ -22,16 +22,26 @@
{{/if}}
</td>
<td data-test-time>{{format-ts task.events.lastObject.time}}</td>
<td data-test-volumes>
<ul>
{{#each task.task.volumeMounts as |volume|}}
<li data-test-volume>
<strong>{{volume.volume}}:</strong>
{{volume.source}}
</li>
{{/each}}
</ul>
</td>
<td data-test-ports>
<ul>
{{#with task.resources.networks.firstObject as |network|}}
{{#let task.resources.networks.firstObject as |network|}}
{{#each network.ports as |port|}}
<li data-test-port>
<strong>{{port.name}}:</strong>
<a href="http://{{network.ip}}:{{port.port}}" target="_blank" rel="noopener noreferrer">{{network.ip}}:{{port.port}}</a>
</li>
{{/each}}
{{/with}}
{{/let}}
</ul>
</td>
<td data-test-cpu class="is-1 has-text-centered">