-
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 #3829 from hashicorp/f-ui-specialized-job-pages
UI: Specialized Job Detail Pages
- Loading branch information
Showing
58 changed files
with
2,059 additions
and
582 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
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 { computed } from '@ember/object'; | ||
import DistributionBar from './distribution-bar'; | ||
|
||
export default DistributionBar.extend({ | ||
layoutName: 'components/distribution-bar', | ||
|
||
job: null, | ||
|
||
'data-test-children-status-bar': true, | ||
|
||
data: computed('job.{pendingChildren,runningChildren,deadChildren}', function() { | ||
if (!this.get('job')) { | ||
return []; | ||
} | ||
|
||
const children = this.get('job').getProperties( | ||
'pendingChildren', | ||
'runningChildren', | ||
'deadChildren' | ||
); | ||
return [ | ||
{ label: 'Pending', value: children.pendingChildren, className: 'queued' }, | ||
{ label: 'Running', value: children.runningChildren, className: 'running' }, | ||
{ label: 'Dead', value: children.deadChildren, className: 'complete' }, | ||
]; | ||
}), | ||
}); |
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,29 @@ | ||
import Component from '@ember/component'; | ||
import { computed } from '@ember/object'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default Component.extend({ | ||
system: service(), | ||
|
||
job: null, | ||
|
||
// Provide a value that is bound to a query param | ||
sortProperty: null, | ||
sortDescending: null, | ||
|
||
// Provide actions that require routing | ||
onNamespaceChange() {}, | ||
gotoTaskGroup() {}, | ||
gotoJob() {}, | ||
|
||
breadcrumbs: computed('job.{name,id}', function() { | ||
const job = this.get('job'); | ||
return [ | ||
{ label: 'Jobs', args: ['jobs'] }, | ||
{ | ||
label: job.get('name'), | ||
args: ['jobs.job', job], | ||
}, | ||
]; | ||
}), | ||
}); |
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,3 @@ | ||
import AbstractJobPage from './abstract'; | ||
|
||
export default AbstractJobPage.extend(); |
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,16 @@ | ||
import { computed } from '@ember/object'; | ||
import { alias } from '@ember/object/computed'; | ||
import PeriodicChildJobPage from './periodic-child'; | ||
|
||
export default PeriodicChildJobPage.extend({ | ||
payload: alias('job.decodedPayload'), | ||
payloadJSON: computed('payload', function() { | ||
let json; | ||
try { | ||
json = JSON.parse(this.get('payload')); | ||
} catch (e) { | ||
// Swallow error and fall back to plain text rendering | ||
} | ||
return json; | ||
}), | ||
}); |
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,3 @@ | ||
import AbstractJobPage from './abstract'; | ||
|
||
export default AbstractJobPage.extend(); |
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,31 @@ | ||
import Component from '@ember/component'; | ||
import { computed } from '@ember/object'; | ||
import { alias } from '@ember/object/computed'; | ||
import Sortable from 'nomad-ui/mixins/sortable'; | ||
|
||
export default Component.extend(Sortable, { | ||
job: null, | ||
|
||
classNames: ['boxed-section'], | ||
|
||
// Provide a value that is bound to a query param | ||
sortProperty: null, | ||
sortDescending: null, | ||
currentPage: null, | ||
|
||
// Provide an action with access to the router | ||
gotoJob() {}, | ||
|
||
pageSize: 10, | ||
|
||
taskGroups: computed('job.taskGroups.[]', function() { | ||
return this.get('job.taskGroups') || []; | ||
}), | ||
|
||
children: computed('job.children.[]', function() { | ||
return this.get('job.children') || []; | ||
}), | ||
|
||
listToSort: alias('children'), | ||
sortedChildren: alias('listSorted'), | ||
}); |
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,12 @@ | ||
import Component from '@ember/component'; | ||
import { computed } from '@ember/object'; | ||
|
||
export default Component.extend({ | ||
job: null, | ||
|
||
classNames: ['boxed-section'], | ||
|
||
sortedEvaluations: computed('job.evaluations.@each.modifyIndex', function() { | ||
return (this.get('job.evaluations') || []).sortBy('modifyIndex').reverse(); | ||
}), | ||
}); |
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,6 @@ | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
job: null, | ||
tagName: '', | ||
}); |
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,6 @@ | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
job: null, | ||
tagName: '', | ||
}); |
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 @@ | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
job: null, | ||
|
||
classNames: ['boxed-section'], | ||
}); |
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,24 @@ | ||
import Component from '@ember/component'; | ||
import { computed } from '@ember/object'; | ||
import { alias } from '@ember/object/computed'; | ||
import Sortable from 'nomad-ui/mixins/sortable'; | ||
|
||
export default Component.extend(Sortable, { | ||
job: null, | ||
|
||
classNames: ['boxed-section'], | ||
|
||
// Provide a value that is bound to a query param | ||
sortProperty: null, | ||
sortDescending: null, | ||
|
||
// Provide an action with access to the router | ||
gotoTaskGroup() {}, | ||
|
||
taskGroups: computed('job.taskGroups.[]', function() { | ||
return this.get('job.taskGroups') || []; | ||
}), | ||
|
||
listToSort: alias('taskGroups'), | ||
sortedTaskGroups: alias('listSorted'), | ||
}); |
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,21 @@ | ||
import AbstractJobPage from './abstract'; | ||
import { computed } from '@ember/object'; | ||
|
||
export default AbstractJobPage.extend({ | ||
breadcrumbs: computed('job.{name,id}', 'job.parent.{name,id}', function() { | ||
const job = this.get('job'); | ||
const parent = this.get('job.parent'); | ||
|
||
return [ | ||
{ label: 'Jobs', args: ['jobs'] }, | ||
{ | ||
label: parent.get('name'), | ||
args: ['jobs.job', parent], | ||
}, | ||
{ | ||
label: job.get('trimmedName'), | ||
args: ['jobs.job', job], | ||
}, | ||
]; | ||
}), | ||
}); |
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 AbstractJobPage from './abstract'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default AbstractJobPage.extend({ | ||
store: service(), | ||
actions: { | ||
forceLaunch() { | ||
this.get('job') | ||
.forcePeriodic() | ||
.then(() => { | ||
this.get('store').findAll('job'); | ||
}); | ||
}, | ||
}, | ||
}); |
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,3 @@ | ||
import AbstractJobPage from './abstract'; | ||
|
||
export default AbstractJobPage.extend(); |
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.