fix: wire response + init error handling

This commit is contained in:
liyasthomas
2021-07-15 09:40:45 +05:30
parent 86c9e09782
commit 3ef8e677c7
16 changed files with 283 additions and 152 deletions

View File

@@ -1,33 +1,39 @@
<template>
<div
class="
flex
sticky
top-0
z-10
bg-primary
items-center
p-4
font-mono font-semibold
space-x-8
"
>
<i v-if="response.type === 'loading'" class="animate-spin material-icons">
refresh
</i>
<div v-else :class="statusCategory.className">
<span v-if="response.statusCode">
<span class="text-secondaryDark"> Status: </span>
{{ response.statusCode || $t("waiting_send_req") }}
</span>
<span v-if="response.meta.responseDuration" class="text-xs">
<span class="text-secondaryDark"> Time: </span>
{{ `${response.meta.responseDuration} ms` }}
</span>
<span v-if="response.meta.responseSize" class="text-xs">
<span class="text-secondaryDark"> Size: </span>
{{ `${response.meta.responseSize} B` }}
</span>
<div>
<span v-if="response == null">
{{ $t("waiting_send_req") }}
</span>
<div
v-else
class="
flex
sticky
top-0
z-10
bg-primary
items-center
p-4
font-mono font-semibold
space-x-8
"
>
<i v-if="response.type === 'loading'" class="animate-spin material-icons">
refresh
</i>
<div v-else :class="statusCategory.className">
<span v-if="response.statusCode">
<span class="text-secondaryDark"> Status: </span>
{{ response.statusCode || $t("waiting_send_req") }}
</span>
<span v-if="response.meta.responseDuration" class="text-xs">
<span class="text-secondaryDark"> Time: </span>
{{ `${response.meta.responseDuration} ms` }}
</span>
<span v-if="response.meta.responseSize" class="text-xs">
<span class="text-secondaryDark"> Size: </span>
{{ `${response.meta.responseSize} B` }}
</span>
</div>
</div>
</div>
</template>