Commit ff57d477 authored by Andrea Ida Malkah Klaura's avatar Andrea Ida Malkah Klaura
Browse files

added simple debug panel

parent b5a64b84
......@@ -25,7 +25,8 @@ export default {
{ slug: 'shows', title: 'Sendungen verwalten' },
{ slug: 'files', title: 'Dateien und Playlists' },
{ slug: 'settings', title: 'Settings' },
{ slug: 'credits', title: 'Credits' }
{ slug: 'credits', title: 'Credits' },
{ slug: 'debug', title: 'Debug' }
],
'user': {
name: 'jackie',
......
<template>
<b-container>
<h1>Debugging page</h1>
<p>
This page is only used for debugging purposes and should be removed from
a productive version.
</p>
<p>
Here we go: <b-button size="lg" variant="warning" @click="debug()">Debug now!</b-button>
</p>
Response headers: <br />
<div style="border: 1px dotted #aaa">
{{ response.headers }}
</div>
Response data: <br />
<div style="border: 1px dotted #aaa">
{{ response.data }}
</div>
</b-container>
</template>
<script>
import axios from 'axios'
function debugErrorRequest (data, headers) {
console.log('Request headers:')
console.log(headers)
console.log('Request data:')
console.log(data)
return data
}
function debugErrorResponse (data) {
console.log('Response data:')
console.log(data)
return data
}
export default {
data () {
return {
response: ''
}
},
methods: {
debug () {
axios.get(process.env.API_STEERING_SHOWS + 'user/', {
widthCredentials: true,
transformRequest: [debugErrorRequest],
transformResponse: [debugErrorResponse]
}).then(response => {
this.response = response
console.log(response)
}).catch(error => {
console.log(error)
alert(error)
})
}
}
}
</script>
<style scoped>
p {
text-align: left;
}
</style>
......@@ -7,6 +7,7 @@ import Credits from '@/components/Credits'
import Settings from '@/components/Settings'
import ShowManager from '@/components/ShowManager'
import FileManager from '@/components/FileManager'
import Debug from '@/components/Debug'
Vue.use(Router)
......@@ -18,6 +19,7 @@ export default new Router({
{ path: '/login', name: 'login', component: LogIn },
{ path: '/help', name: 'help', component: Help },
{ path: '/settings', name: 'settings', component: Settings },
{ path: '/credits', name: 'credits', component: Credits }
{ path: '/credits', name: 'credits', component: Credits },
{ path: '/debug', name: 'debug', component: Debug }
]
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment