open-nomad/ui/app/components/job-page/parameterized-child.js

17 lines
452 B
JavaScript
Raw Normal View History

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 {
2019-03-26 07:46:44 +00:00
json = JSON.parse(this.payload);
} catch (e) {
// Swallow error and fall back to plain text rendering
}
return json;
}),
});