1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-06 02:58:31 +00:00
FrankerFaceZ/src/modules/main_menu/components/example-report.vue
SirStendec 92917453a7 Add settings for controlling the error reporting system.
Fix issues with destroying rooms and users.
Fix the control center not being available on certain pages.
Fix the host menu appearing when you aren't logged in.
Clean up some old CSS.
2018-04-11 20:48:02 -04:00

58 lines
1 KiB
Vue

<template lang="html">
<div class="ffz--example-report">
<h4 class="tw-mg-b-05">{{ t('reports.example', 'Example Report') }}</h4>
<div class="tw-c-background-alt-2 tw-font-size-5 tw-pd-y-05 tw-pd-x-1 tw-border-radius-large">
<code>{{ JSON.stringify(example, null, 4) }}</code>
</div>
</div>
</template>
<script>
export default {
props: ['item', 'context'],
data() {
return {
example: null
}
},
created() {
this.refresh();
const ctx = this.context.context;
for(const key of this.item.watch)
ctx.on(`changed:${key}`, this.refresh, this);
},
destroyed() {
const ctx = this.context.context;
for(const key of this.item.watch)
ctx.off(`changed:${key}`, this.refresh, this);
},
methods: {
refresh() {
this.example = 'Loading...';
this.item.data().then(data => this.example = data);
}
}
}
</script>
<style lang="scss" scoped>
.ffz--example-report {
div {
max-height: 30rem;
overflow-y: auto;
code {
font-family: monospace;
white-space: pre-wrap;
word-break: break-all;
}
}
}
</style>