2020-11-01 15:43:19 +02:00
|
|
|
<template>
|
|
|
|
<XWindow ref="window"
|
|
|
|
:initial-width="370"
|
|
|
|
:initial-height="450"
|
|
|
|
:can-resize="true"
|
|
|
|
@close="$refs.window.close()"
|
|
|
|
@closed="$emit('closed')"
|
|
|
|
>
|
|
|
|
<template #header>Req Viewer</template>
|
|
|
|
|
|
|
|
<div class="rlkneywz">
|
2020-11-17 07:59:15 +02:00
|
|
|
<MkTab v-model:value="tab" style="border-bottom: solid 1px var(--divider);">
|
|
|
|
<option value="req">Request</option>
|
|
|
|
<option value="res">Response</option>
|
|
|
|
</MkTab>
|
2020-11-01 15:43:19 +02:00
|
|
|
|
2020-11-25 14:31:34 +02:00
|
|
|
<code v-if="tab === 'req'" class="_monospace">{{ reqStr }}</code>
|
|
|
|
<code v-if="tab === 'res'" class="_monospace">{{ resStr }}</code>
|
2020-11-01 15:43:19 +02:00
|
|
|
</div>
|
|
|
|
</XWindow>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
|
|
|
import * as JSON5 from 'json5';
|
2021-03-23 10:30:14 +02:00
|
|
|
import XWindow from '@client/components/ui/window.vue';
|
|
|
|
import MkTab from '@client/components/tab.vue';
|
2020-11-01 15:43:19 +02:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
XWindow,
|
|
|
|
MkTab,
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
req: {
|
|
|
|
required: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
emits: ['closed'],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
tab: 'req',
|
|
|
|
reqStr: JSON5.stringify(this.req.req, null, '\t'),
|
|
|
|
resStr: JSON5.stringify(this.req.res, null, '\t'),
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.rlkneywz {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
> code {
|
|
|
|
display: block;
|
|
|
|
flex: 1;
|
|
|
|
padding: 8px;
|
|
|
|
overflow: auto;
|
2020-11-02 08:16:48 +02:00
|
|
|
font-size: 0.9em;
|
2020-11-01 15:43:19 +02:00
|
|
|
tab-size: 2;
|
|
|
|
white-space: pre;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|