diff --git a/ui/app/components/job-page/parameterized-child.js b/ui/app/components/job-page/parameterized-child.js index 559b3c8b8..841c6fa60 100644 --- a/ui/app/components/job-page/parameterized-child.js +++ b/ui/app/components/job-page/parameterized-child.js @@ -1,3 +1,16 @@ -import AbstractJobPage from './abstract'; +import { computed } from '@ember/object'; +import { alias } from '@ember/object/computed'; +import PeriodicChildJobPage from './periodic-child'; -export default AbstractJobPage.extend(); +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; + }), +}); diff --git a/ui/app/templates/components/job-page/parameterized-child.hbs b/ui/app/templates/components/job-page/parameterized-child.hbs new file mode 100644 index 000000000..245395c9f --- /dev/null +++ b/ui/app/templates/components/job-page/parameterized-child.hbs @@ -0,0 +1,52 @@ +{{#global-header class="page-header"}} + {{#each breadcrumbs as |breadcrumb index|}} + + {{/each}} +{{/global-header}} +{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} +

+ {{job.name}} + {{job.status}} +

+ +
+
+ Type: {{job.type}} | + Priority: {{job.priority}} + + Parent: + {{#link-to "jobs.job" job.parent (query-params jobNamespace=job.parent.namespace.name)}} + {{job.parent.name}} + {{/link-to}} + + {{#if (and job.namespace system.shouldShowNamespaces)}} + | Namespace: {{job.namespace.name}} + {{/if}} +
+
+ + {{job-page/parts/summary job=job}} + + {{job-page/parts/placement-failures job=job}} + + {{job-page/parts/task-groups + job=job + sortProperty=sortProperty + sortDescending=sortDescending + gotoTaskGroup=gotoTaskGroup}} + + {{job-page/parts/evaluations job=job}} + +
+
Payload
+
+ {{#if payloadJSON}} + {{json-viewer json=payloadJSON}} + {{else}} +
{{payload}}
+ {{/if}} +
+
+{{/job-page/parts/body}}