-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
126 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Controller from '@ember/controller'; | ||
|
||
export default class EvaluationController extends Controller { | ||
get eval() { | ||
return this.model; | ||
} | ||
|
||
get breadcrumb() { | ||
return { | ||
title: 'Evaluation', | ||
label: this.eval.get('shortId'), | ||
args: ['evaluations.evaluation', this.eval.get('id')], | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* eslint-disable ember/no-observers */ | ||
/* eslint-disable ember/no-incorrect-calls-with-inline-anonymous-functions */ | ||
import { alias } from '@ember/object/computed'; | ||
import Controller from '@ember/controller'; | ||
import { action, computed } from '@ember/object'; | ||
import { observes } from '@ember-decorators/object'; | ||
import { scheduleOnce } from '@ember/runloop'; | ||
import { task } from 'ember-concurrency'; | ||
import intersection from 'lodash.intersection'; | ||
import Sortable from 'nomad-ui/mixins/sortable'; | ||
import Searchable from 'nomad-ui/mixins/searchable'; | ||
import messageFromAdapterError from 'nomad-ui/utils/message-from-adapter-error'; | ||
import { | ||
serialize, | ||
deserializedQueryParam as selection, | ||
} from 'nomad-ui/utils/qp-serialize'; | ||
import classic from 'ember-classic-decorator'; | ||
|
||
@classic | ||
export default class EvaluationController extends Controller.extend( | ||
Sortable, | ||
Searchable | ||
) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { bool, equal } from '@ember/object/computed'; | ||
import Model from '@ember-data/model'; | ||
import { attr, belongsTo, hasMany } from '@ember-data/model'; | ||
import { fragmentArray } from 'ember-data-model-fragments/attributes'; | ||
import shortUUIDProperty from '../utils/properties/short-uuid'; | ||
import Fragment from 'ember-data-model-fragments/fragment'; | ||
|
||
export default class EvaluationStub extends Fragment { | ||
@shortUUIDProperty('evalId') shortId; | ||
@attr('string') evalId; | ||
@attr('string') type; | ||
@attr('string') triggeredBy; | ||
@attr('string') status; | ||
@attr('string') statusDescription; | ||
|
||
@belongsTo('job') job; | ||
@belongsTo('node') node; | ||
|
||
get hasJob() { | ||
return !!this.plainJobId; | ||
} | ||
|
||
get hasNode() { | ||
return !!this.belongsTo('node').id(); | ||
} | ||
|
||
get nodeId() { | ||
return this.belongsTo('node').id(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { inject as service } from '@ember/service'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default class EvaluationRoute extends Route { | ||
@service store; | ||
|
||
model(params) { | ||
return this.store.findRecord('evaluation', params.evaluation_id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Route from '@ember/routing/route'; | ||
import WithWatchers from 'nomad-ui/mixins/with-watchers'; | ||
|
||
export default class EvaluationRoute extends Route.extend(WithWatchers) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { inject as service } from '@ember/service'; | ||
import { get } from '@ember/object'; | ||
import ApplicationSerializer from './application'; | ||
import classic from 'ember-classic-decorator'; | ||
|
||
@classic | ||
export default class EvaluationStub extends ApplicationSerializer { | ||
@service system; | ||
|
||
mapToArray = ['FailedTGAllocs']; | ||
separateNanos = ['CreateTime', 'ModifyTime']; | ||
|
||
normalize(typeHash, hash) { | ||
console.log(hash); | ||
console.log(typeHash); | ||
hash.EvalId = hash.ID; | ||
hash.PlainJobId = hash.JobID; | ||
hash.Namespace = hash.Namespace || get(hash, 'Job.Namespace') || 'default'; | ||
hash.JobID = JSON.stringify([hash.JobID, hash.Namespace]); | ||
|
||
return super.normalize(typeHash, hash); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Breadcrumb @crumb={{this.breadcrumb}} />{{outlet}} | ||
<h1>Related Evals</h1> | ||
<ul> | ||
{{#each model.relatedEvals as |e|}} | ||
<li>{{e.evalId}}</li> | ||
{{/each}} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Hi</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters