diff --git a/ui/app/components/job-page.js b/ui/app/components/job-page.js new file mode 100644 index 000000000..cc6e0f037 --- /dev/null +++ b/ui/app/components/job-page.js @@ -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'), + }; + } +} diff --git a/ui/app/templates/components/job-page.hbs b/ui/app/templates/components/job-page.hbs new file mode 100644 index 000000000..54a882396 --- /dev/null +++ b/ui/app/templates/components/job-page.hbs @@ -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) + ) + ) +}} \ No newline at end of file diff --git a/ui/app/templates/components/job-page/parts/das-recommendations.hbs b/ui/app/templates/components/job-page/parts/das-recommendations.hbs new file mode 100644 index 000000000..c9539e2ed --- /dev/null +++ b/ui/app/templates/components/job-page/parts/das-recommendations.hbs @@ -0,0 +1,5 @@ +{{#if (can "accept recommendations")}} + {{#each @job.recommendationSummaries as |summary|}} + + {{/each}} +{{/if}} \ No newline at end of file