diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-11-01 22:43:19 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-11-01 22:43:19 +0900 |
| commit | d3e764d7f9321e5a778834766b9651187627a20d (patch) | |
| tree | 4dbbed3de633b59ef42194cd7c31779f8d6d8955 /src/client/components/taskmanager.api-window.vue | |
| parent | Improve task manager etc (diff) | |
| download | sharkey-d3e764d7f9321e5a778834766b9651187627a20d.tar.gz sharkey-d3e764d7f9321e5a778834766b9651187627a20d.tar.bz2 sharkey-d3e764d7f9321e5a778834766b9651187627a20d.zip | |
Improve task manager
Diffstat (limited to 'src/client/components/taskmanager.api-window.vue')
| -rw-r--r-- | src/client/components/taskmanager.api-window.vue | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/client/components/taskmanager.api-window.vue b/src/client/components/taskmanager.api-window.vue new file mode 100644 index 0000000000..9cdc8227e3 --- /dev/null +++ b/src/client/components/taskmanager.api-window.vue @@ -0,0 +1,69 @@ +<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"> + <MkTab v-model:value="tab" :items="[{ label: 'Request', value: 'req', }, { label: 'Response', value: 'res', }]" style="border-bottom: solid 1px var(--divider);"/> + + <code v-if="tab === 'req'">{{ reqStr }}</code> + <code v-if="tab === 'res'">{{ resStr }}</code> + </div> +</XWindow> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import * as JSON5 from 'json5'; +import XWindow from '@/components/ui/window.vue'; +import MkTab from '@/components/tab.vue'; + +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; + tab-size: 2; + white-space: pre; + font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace; + } +} +</style> |