-
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.
Merge pull request #3603 from hashicorp/f-ui-placement-failures
UI Placement Failures & Evaluations
- Loading branch information
Showing
17 changed files
with
428 additions
and
6 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,27 @@ | ||
import Ember from 'ember'; | ||
import Model from 'ember-data/model'; | ||
import attr from 'ember-data/attr'; | ||
import { belongsTo } from 'ember-data/relationships'; | ||
import { fragmentArray } from 'ember-data-model-fragments/attributes'; | ||
import shortUUIDProperty from '../utils/properties/short-uuid'; | ||
|
||
const { computed } = Ember; | ||
|
||
export default Model.extend({ | ||
shortId: shortUUIDProperty('id'), | ||
priority: attr('number'), | ||
type: attr('string'), | ||
triggeredBy: attr('string'), | ||
status: attr('string'), | ||
statusDescription: attr('string'), | ||
failedTGAllocs: fragmentArray('placement-failure', { defaultValue: () => [] }), | ||
|
||
hasPlacementFailures: computed.bool('failedTGAllocs.length'), | ||
|
||
// TEMPORARY: https://github.com/emberjs/data/issues/5209 | ||
originalJobId: attr('string'), | ||
|
||
job: belongsTo('job'), | ||
|
||
modifyIndex: attr('number'), | ||
}); |
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,20 @@ | ||
import attr from 'ember-data/attr'; | ||
import Fragment from 'ember-data-model-fragments/fragment'; | ||
|
||
export default Fragment.extend({ | ||
name: attr('string'), | ||
|
||
coalescedFailures: attr('number'), | ||
|
||
nodesEvaluated: attr('number'), | ||
nodesExhausted: attr('number'), | ||
|
||
// Maps keyed by relevant dimension (dc, class, constraint, etc) with count values | ||
nodesAvailable: attr(), | ||
classFiltered: attr(), | ||
constraintFiltered: attr(), | ||
classExhausted: attr(), | ||
dimensionExhausted: attr(), | ||
quotaExhausted: attr(), | ||
scores: attr(), | ||
}); |
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,27 @@ | ||
import Ember from 'ember'; | ||
import ApplicationSerializer from './application'; | ||
|
||
const { inject, get, assign } = Ember; | ||
|
||
export default ApplicationSerializer.extend({ | ||
system: inject.service(), | ||
|
||
normalize(typeHash, hash) { | ||
hash.FailedTGAllocs = Object.keys(hash.FailedTGAllocs || {}).map(key => { | ||
return assign({ Name: key }, get(hash, `FailedTGAllocs.${key}`) || {}); | ||
}); | ||
|
||
hash.PlainJobId = hash.JobID; | ||
hash.Namespace = | ||
hash.Namespace || | ||
get(hash, 'Job.Namespace') || | ||
this.get('system.activeNamespace.id') || | ||
'default'; | ||
hash.JobID = JSON.stringify([hash.JobID, hash.Namespace]); | ||
|
||
// TEMPORARY: https://github.com/emberjs/data/issues/5209 | ||
hash.OriginalJobId = hash.JobID; | ||
|
||
return this._super(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
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,9 @@ | ||
.simple-list { | ||
list-style: disc; | ||
list-style-position: inside; | ||
margin-left: 1.5rem; | ||
|
||
li { | ||
margin-bottom: 0.5em; | ||
} | ||
} |
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
Oops, something went wrong.