feat: create job-page contextual component
This commit is contained in:
parent
89390b71ee
commit
d23dcc1ede
|
@ -0,0 +1,26 @@
|
|||
import { action } from '@ember/object';
|
||||
import Component from '@glimmer/component';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import messageForError from 'nomad-ui/utils/message-from-adapter-error';
|
||||
|
||||
export default class JobPage extends Component {
|
||||
@tracked errorMessage = null;
|
||||
|
||||
@action
|
||||
clearErrorMessage() {
|
||||
this.errorMessage = null;
|
||||
}
|
||||
|
||||
@action
|
||||
handleError(errorObject) {
|
||||
this.errorMessage = errorObject;
|
||||
}
|
||||
|
||||
@action
|
||||
setError(err) {
|
||||
this.errorMessage = {
|
||||
title: 'Could Not Force Launch',
|
||||
description: messageForError(err, 'submit jobs'),
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{{yield
|
||||
(hash
|
||||
data=(hash)
|
||||
fns=(hash)
|
||||
ui=(hash
|
||||
Body=(component "job-page/parts/body" job=@job)
|
||||
Error=(component
|
||||
"job-page/parts/error" errorMessage=this.errorMessage onDismiss=this.clearErrorMessage
|
||||
)
|
||||
Title=(component "job-page/parts/title" job=@job handleError=this.handleError)
|
||||
StatsBox=(component "job-page/parts/stats-box" job=@job)
|
||||
Summary=(component "job-page/parts/summary" job=@job)
|
||||
PlacementFailures=(component "job-page/parts/placement-failures" job=@job)
|
||||
LatestDeployment=(component
|
||||
"job-page/parts/latest-deployment" job=@job handleError=this.handleError
|
||||
)
|
||||
TaskGroups=(component "job-page/parts/task-groups" job=@job)
|
||||
RecentAllocations=(component "job-page/parts/recent-allocations" job=@job)
|
||||
Meta=(component "job-page/parts/meta" job=@job)
|
||||
DasRecommendations=(component "job-page/parts/das-recommendations" job=@job)
|
||||
JobClientStatusSummary=(component "job-page/parts/job-client-status-summary" job=@job)
|
||||
Children=(component "job-page/parts/children" job=@job)
|
||||
)
|
||||
)
|
||||
}}
|
|
@ -0,0 +1,5 @@
|
|||
{{#if (can "accept recommendations")}}
|
||||
{{#each @job.recommendationSummaries as |summary|}}
|
||||
<Das::RecommendationAccordion @summary={{summary}} />
|
||||
{{/each}}
|
||||
{{/if}}
|
Loading…
Reference in New Issue