meme: remove URL and format config on meme page

This commit is contained in:
Chris Sexton 2021-01-09 16:28:27 -05:00 committed by Chris Sexton
parent 8408da48d4
commit 841d4c000e
1 changed files with 6 additions and 2 deletions

View File

@ -102,7 +102,7 @@ var memeIndex = `
:items="results" :items="results"
:fields="fields"> :fields="fields">
<template v-slot:cell(config)="data"> <template v-slot:cell(config)="data">
<pre>{{data.item.config}}</pre> <pre>{{data.item.config | pretty}}</pre>
<b-button @click="startEdit(data.item)">Edit</b-button> <b-button @click="startEdit(data.item)">Edit</b-button>
</template> </template>
<template v-slot:cell(image)="data"> <template v-slot:cell(image)="data">
@ -133,7 +133,6 @@ var memeIndex = `
editConfig: null, editConfig: null,
fields: [ fields: [
{ key: 'name', sortable: true }, { key: 'name', sortable: true },
{ key: 'url', sortable: true },
{ key: 'config' }, { key: 'config' },
{ key: 'image' } { key: 'image' }
] ]
@ -146,6 +145,11 @@ var memeIndex = `
.catch(err => console.log(err)) .catch(err => console.log(err))
this.refresh(); this.refresh();
}, },
filters: {
pretty: function(value) {
return JSON.stringify(JSON.parse(value), null, 2);
}
},
methods: { methods: {
refresh: function() { refresh: function() {
axios.get('/meme/all') axios.get('/meme/all')