mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 03:15:42 +03:00
Adds sorting to evaluations
This commit is contained in:
@@ -1,12 +1,24 @@
|
||||
import { alias } from '@ember/object/computed';
|
||||
import Controller, { inject as controller } from '@ember/controller';
|
||||
import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting';
|
||||
import Sortable from 'nomad-ui/mixins/sortable';
|
||||
|
||||
export default Controller.extend(WithNamespaceResetting, {
|
||||
export default Controller.extend(WithNamespaceResetting, Sortable, {
|
||||
jobController: controller('jobs.job'),
|
||||
|
||||
queryParams: {
|
||||
sortProperty: 'sort',
|
||||
sortDescending: 'desc',
|
||||
},
|
||||
|
||||
sortProperty: 'modifyIndex',
|
||||
sortDescending: true,
|
||||
|
||||
job: alias('model'),
|
||||
evaluations: alias('model.evaluations'),
|
||||
|
||||
breadcrumbs: alias('jobController.breadcrumbs'),
|
||||
|
||||
listToSort: alias('evaluations'),
|
||||
sortedEvaluations: alias('listSorted'),
|
||||
});
|
||||
|
||||
@@ -12,15 +12,18 @@
|
||||
<div class="boxed-section-head">
|
||||
Evaluations
|
||||
</div>
|
||||
<div class="boxed-section-body {{if evaluations.length "is-full-bleed"}} evaluations">
|
||||
{{#if evaluations.length}}
|
||||
{{#list-table source=evaluations as |t|}}
|
||||
<div class="boxed-section-body {{if sortedEvaluations.length "is-full-bleed"}}">
|
||||
{{#if sortedEvaluations.length}}
|
||||
{{#list-table
|
||||
source=sortedEvaluations
|
||||
sortProperty=sortProperty
|
||||
sortDescending=sortDescending as |t|}}
|
||||
{{#t.head}}
|
||||
<th>ID</th>
|
||||
<th>Priority</th>
|
||||
<th>Triggered By</th>
|
||||
<th>Status</th>
|
||||
<th>Placement Failures</th>
|
||||
{{#t.sort-by prop="priority"}}Priority{{/t.sort-by}}
|
||||
{{#t.sort-by prop="triggeredBy"}}Triggered By{{/t.sort-by}}
|
||||
{{#t.sort-by prop="status"}}Status{{/t.sort-by}}
|
||||
{{#t.sort-by prop="hasPlacementFailures"}}Placement Failures{{/t.sort-by}}
|
||||
{{/t.head}}
|
||||
{{#t.body as |row|}}
|
||||
<tr data-test-evaluation="{{row.model.shortId}}">
|
||||
|
||||
Reference in New Issue
Block a user