2018-01-26 00:57:58 +00:00
|
|
|
import { computed } from '@ember/object';
|
|
|
|
import { alias } from '@ember/object/computed';
|
|
|
|
import PeriodicChildJobPage from './periodic-child';
|
2018-01-25 22:18:53 +00:00
|
|
|
|
2018-01-26 00:57:58 +00:00
|
|
|
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;
|
|
|
|
}),
|
|
|
|
});
|