Use vue-json-pretty

This commit is contained in:
syuilo 2019-03-04 09:16:24 +09:00
parent db8625c31a
commit fcdfd8d323
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
2 changed files with 10 additions and 1 deletions

View File

@ -235,6 +235,7 @@
"vue-cropperjs": "3.0.0", "vue-cropperjs": "3.0.0",
"vue-i18n": "8.8.2", "vue-i18n": "8.8.2",
"vue-js-modal": "1.3.28", "vue-js-modal": "1.3.28",
"vue-json-pretty": "1.4.1",
"vue-loader": "15.7.0", "vue-loader": "15.7.0",
"vue-marquee-text-component": "1.1.1", "vue-marquee-text-component": "1.1.1",
"vue-prism-component": "1.1.1", "vue-prism-component": "1.1.1",

View File

@ -20,7 +20,10 @@
<div class="nqjzuvev"> <div class="nqjzuvev">
<code v-for="log in logs" :key="log._id" :class="log.level"> <code v-for="log in logs" :key="log._id" :class="log.level">
<mk-time :time="log.createdAt"/> [{{ log.domain.join('.') }}] {{ log.message }} <details>
<summary><mk-time :time="log.createdAt"/> [{{ log.domain.join('.') }}] {{ log.message }}</summary>
<vue-json-pretty v-if="log.data" :data="log.data"></vue-json-pretty>
</details>
</code> </code>
</div> </div>
</section> </section>
@ -32,10 +35,15 @@
import Vue from 'vue'; import Vue from 'vue';
import i18n from '../../i18n'; import i18n from '../../i18n';
import { faStream } from '@fortawesome/free-solid-svg-icons'; import { faStream } from '@fortawesome/free-solid-svg-icons';
import VueJsonPretty from 'vue-json-pretty';
export default Vue.extend({ export default Vue.extend({
i18n: i18n('admin/views/logs.vue'), i18n: i18n('admin/views/logs.vue'),
components: {
VueJsonPretty
},
data() { data() {
return { return {
logs: [], logs: [],