2017-12-15 21:39:18 +00:00
|
|
|
import Component from '@ember/component';
|
|
|
|
import { computed } from '@ember/object';
|
2020-07-28 04:24:14 +00:00
|
|
|
import { classNames, classNameBindings } from '@ember-decorators/component';
|
2020-06-10 13:49:16 +00:00
|
|
|
import classic from 'ember-classic-decorator';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@classic
|
|
|
|
@classNames('json-viewer')
|
2020-07-28 04:24:14 +00:00
|
|
|
@classNameBindings('fluidHeight:has-fluid-height')
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class JsonViewer extends Component {
|
|
|
|
json = null;
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@computed('json')
|
|
|
|
get jsonStr() {
|
2019-03-26 07:46:44 +00:00
|
|
|
return JSON.stringify(this.json, null, 2);
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
|
|
|
}
|