chore: minor ui improvements
This commit is contained in:
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-align-left"><line x1="17" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="17" y1="18" x2="3" y2="18"></line></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="17" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="17" y1="18" x2="3" y2="18"></line></svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 362 B |
@@ -35,59 +35,65 @@
|
|||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
svg="help-circle"
|
svg="help-circle"
|
||||||
class="!rounded-none"
|
class="!rounded-none"
|
||||||
:label="$t('app.help')"
|
:label="`${$t('app.help')}`"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<SmartItem
|
<SmartItem
|
||||||
svg="book"
|
svg="book"
|
||||||
:label="$t('app.documentation')"
|
:label="`${$t('app.documentation')}`"
|
||||||
to="https://docs.hoppscotch.io"
|
to="https://docs.hoppscotch.io"
|
||||||
blank
|
blank
|
||||||
@click.native="$refs.options.tippy().hide()"
|
@click.native="$refs.options.tippy().hide()"
|
||||||
/>
|
/>
|
||||||
<SmartItem
|
<SmartItem
|
||||||
svg="zap"
|
svg="zap"
|
||||||
:label="$t('app.keyboard_shortcuts')"
|
:label="`${$t('app.keyboard_shortcuts')}`"
|
||||||
@click.native="
|
@click.native="
|
||||||
showShortcuts = true
|
() => {
|
||||||
$refs.options.tippy().hide()
|
showShortcuts = true
|
||||||
|
$refs.options.tippy().hide()
|
||||||
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<SmartItem
|
<SmartItem
|
||||||
svg="gift"
|
svg="gift"
|
||||||
:label="$t('app.whats_new')"
|
:label="`${$t('app.whats_new')}`"
|
||||||
to="https://docs.hoppscotch.io/changelog"
|
to="https://docs.hoppscotch.io/changelog"
|
||||||
blank
|
blank
|
||||||
@click.native="$refs.options.tippy().hide()"
|
@click.native="$refs.options.tippy().hide()"
|
||||||
/>
|
/>
|
||||||
<SmartItem
|
<SmartItem
|
||||||
svg="message-circle"
|
svg="message-circle"
|
||||||
:label="$t('app.chat_with_us')"
|
:label="`${$t('app.chat_with_us')}`"
|
||||||
@click.native="
|
@click.native="
|
||||||
chatWithUs()
|
() => {
|
||||||
$refs.options.tippy().hide()
|
chatWithUs()
|
||||||
|
$refs.options.tippy().hide()
|
||||||
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<hr />
|
<hr />
|
||||||
<SmartItem
|
<SmartItem
|
||||||
svg="twitter"
|
svg="twitter"
|
||||||
:label="$t('app.twitter')"
|
:label="`${$t('app.twitter')}`"
|
||||||
to="https://hoppscotch.io/twitter"
|
to="https://hoppscotch.io/twitter"
|
||||||
blank
|
blank
|
||||||
@click.native="$refs.options.tippy().hide()"
|
@click.native="$refs.options.tippy().hide()"
|
||||||
/>
|
/>
|
||||||
<SmartItem
|
<SmartItem
|
||||||
svg="user-plus"
|
svg="user-plus"
|
||||||
:label="$t('app.invite')"
|
:label="`${$t('app.invite')}`"
|
||||||
@click.native="
|
@click.native="
|
||||||
showShare = true
|
() => {
|
||||||
$refs.options.tippy().hide()
|
showShare = true
|
||||||
|
$refs.options.tippy().hide()
|
||||||
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<SmartItem
|
<SmartItem
|
||||||
svg="lock"
|
svg="lock"
|
||||||
:label="$t('app.terms_and_privacy')"
|
:label="`${$t('app.terms_and_privacy')}`"
|
||||||
to="https://docs.hoppscotch.io/privacy"
|
to="https://docs.hoppscotch.io/privacy"
|
||||||
blank
|
blank
|
||||||
@click.native="$refs.options.tippy().hide()"
|
@click.native="$refs.options.tippy().hide()"
|
||||||
|
|||||||
@@ -1,6 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10">
|
<SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10">
|
||||||
|
<template #actions>
|
||||||
|
<ButtonSecondary
|
||||||
|
:label="`${$t('request.run')}`"
|
||||||
|
svg="play"
|
||||||
|
class="rounded-none !text-accent"
|
||||||
|
@click.native="runQuery()"
|
||||||
|
/>
|
||||||
|
<ButtonSecondary
|
||||||
|
ref="saveRequest"
|
||||||
|
:label="`${$t('request.save')}`"
|
||||||
|
class="rounded-none"
|
||||||
|
@click.native="saveRequest"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
<SmartTab :id="'query'" :label="`${$t('tab.query')}`" :selected="true">
|
<SmartTab :id="'query'" :label="`${$t('tab.query')}`" :selected="true">
|
||||||
<AppSection label="query">
|
<AppSection label="query">
|
||||||
<div
|
<div
|
||||||
@@ -21,12 +36,6 @@
|
|||||||
{{ $t("request.query") }}
|
{{ $t("request.query") }}
|
||||||
</label>
|
</label>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<ButtonSecondary
|
|
||||||
:label="`${$t('request.run')}`"
|
|
||||||
svg="play"
|
|
||||||
class="rounded-none !text-accent"
|
|
||||||
@click.native="runQuery()"
|
|
||||||
/>
|
|
||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
to="https://docs.hoppscotch.io"
|
to="https://docs.hoppscotch.io"
|
||||||
@@ -37,22 +46,15 @@
|
|||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:title="$t('action.copy')"
|
:title="$t('action.copy')"
|
||||||
:svg="copyQueryIcon"
|
:svg="`${copyQueryIcon}`"
|
||||||
@click.native="copyQuery"
|
@click.native="copyQuery"
|
||||||
/>
|
/>
|
||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:title="$t('action.prettify')"
|
:title="$t('action.prettify')"
|
||||||
:svg="prettifyQueryIcon"
|
:svg="`${prettifyQueryIcon}`"
|
||||||
@click.native="prettifyQuery"
|
@click.native="prettifyQuery"
|
||||||
/>
|
/>
|
||||||
<ButtonSecondary
|
|
||||||
ref="saveRequest"
|
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
|
||||||
:title="$t('request.save')"
|
|
||||||
svg="folder-plus"
|
|
||||||
@click.native="saveRequest"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div ref="queryEditor"></div>
|
<div ref="queryEditor"></div>
|
||||||
@@ -88,7 +90,7 @@
|
|||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:title="$t('action.copy')"
|
:title="$t('action.copy')"
|
||||||
:svg="copyVariablesIcon"
|
:svg="`${copyVariablesIcon}`"
|
||||||
@click.native="copyVariables"
|
@click.native="copyVariables"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -127,7 +129,7 @@
|
|||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:title="$t('action.clear_all')"
|
:title="$t('action.clear_all')"
|
||||||
svg="trash-2"
|
svg="trash-2"
|
||||||
:disabled="bulkMode"
|
:disabled="Boolean(bulkMode)"
|
||||||
@click.native="headers = []"
|
@click.native="headers = []"
|
||||||
/>
|
/>
|
||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
@@ -141,7 +143,7 @@
|
|||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:title="$t('add.new')"
|
:title="$t('add.new')"
|
||||||
svg="plus"
|
svg="plus"
|
||||||
:disabled="bulkMode"
|
:disabled="Boolean(bulkMode)"
|
||||||
@click.native="addRequestHeader"
|
@click.native="addRequestHeader"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -150,7 +152,7 @@
|
|||||||
<div v-else>
|
<div v-else>
|
||||||
<div
|
<div
|
||||||
v-for="(header, index) in headers"
|
v-for="(header, index) in headers"
|
||||||
:key="`header-${index}`"
|
:key="`header-${String(index)}`"
|
||||||
class="
|
class="
|
||||||
divide-x divide-dividerLight
|
divide-x divide-dividerLight
|
||||||
border-b border-dividerLight
|
border-b border-dividerLight
|
||||||
@@ -183,7 +185,7 @@
|
|||||||
<input
|
<input
|
||||||
class="bg-transparent flex flex-1 py-2 px-4"
|
class="bg-transparent flex flex-1 py-2 px-4"
|
||||||
:placeholder="`${$t('count.value', { count: index + 1 })}`"
|
:placeholder="`${$t('count.value', { count: index + 1 })}`"
|
||||||
:name="`value ${index}`"
|
:name="`value ${String(index)}`"
|
||||||
:value="header.value"
|
:value="header.value"
|
||||||
autofocus
|
autofocus
|
||||||
@change="
|
@change="
|
||||||
@@ -258,7 +260,7 @@
|
|||||||
|
|
||||||
<CollectionsSaveRequest
|
<CollectionsSaveRequest
|
||||||
mode="graphql"
|
mode="graphql"
|
||||||
:show="showSaveRequestModal"
|
:show="Boolean(showSaveRequestModal)"
|
||||||
@hide-modal="hideRequestModal"
|
@hide-modal="hideRequestModal"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -407,7 +409,7 @@ const runQuery = async () => {
|
|||||||
const startTime = Date.now()
|
const startTime = Date.now()
|
||||||
|
|
||||||
nuxt.value.$loading.start()
|
nuxt.value.$loading.start()
|
||||||
response.value = `${t("state.loading")}`
|
response.value = "loading"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const runURL = clone(url.value)
|
const runURL = clone(url.value)
|
||||||
|
|||||||
@@ -1,47 +1,55 @@
|
|||||||
<template>
|
<template>
|
||||||
<AppSection ref="response" label="response">
|
<AppSection ref="response" label="response">
|
||||||
<div
|
<div
|
||||||
v-if="responseString"
|
v-if="responseString === 'loading'"
|
||||||
class="
|
class="flex flex-col p-4 items-center justify-center"
|
||||||
bg-primary
|
|
||||||
border-b border-dividerLight
|
|
||||||
flex flex-1
|
|
||||||
pl-4
|
|
||||||
top-0
|
|
||||||
z-10
|
|
||||||
sticky
|
|
||||||
items-center
|
|
||||||
justify-between
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<label class="font-semibold text-secondaryLight">
|
<SmartSpinner class="mb-4" />
|
||||||
{{ $t("response.title") }}
|
<span class="text-secondaryLight">{{ $t("state.loading") }}</span>
|
||||||
</label>
|
</div>
|
||||||
<div class="flex">
|
<div v-else-if="responseString">
|
||||||
<ButtonSecondary
|
<div
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
class="
|
||||||
:title="$t('state.linewrap')"
|
bg-primary
|
||||||
:class="{ '!text-accent': linewrapEnabled }"
|
border-b border-dividerLight
|
||||||
svg="corner-down-left"
|
flex flex-1
|
||||||
@click.native.prevent="linewrapEnabled = !linewrapEnabled"
|
pl-4
|
||||||
/>
|
top-0
|
||||||
<ButtonSecondary
|
z-10
|
||||||
ref="downloadResponse"
|
sticky
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
items-center
|
||||||
:title="$t('action.download_file')"
|
justify-between
|
||||||
:svg="downloadResponseIcon"
|
"
|
||||||
@click.native="downloadResponse"
|
>
|
||||||
/>
|
<label class="font-semibold text-secondaryLight">
|
||||||
<ButtonSecondary
|
{{ $t("response.title") }}
|
||||||
ref="copyResponseButton"
|
</label>
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
<div class="flex">
|
||||||
:title="$t('action.copy')"
|
<ButtonSecondary
|
||||||
:svg="copyResponseIcon"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
@click.native="copyResponse"
|
:title="$t('state.linewrap')"
|
||||||
/>
|
:class="{ '!text-accent': linewrapEnabled }"
|
||||||
</div>
|
svg="corner-down-left"
|
||||||
|
@click.native.prevent="linewrapEnabled = !linewrapEnabled"
|
||||||
|
/>
|
||||||
|
<ButtonSecondary
|
||||||
|
ref="downloadResponse"
|
||||||
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
|
:title="$t('action.download_file')"
|
||||||
|
:svg="downloadResponseIcon"
|
||||||
|
@click.native="downloadResponse"
|
||||||
|
/>
|
||||||
|
<ButtonSecondary
|
||||||
|
ref="copyResponseButton"
|
||||||
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
|
:title="$t('action.copy')"
|
||||||
|
:svg="copyResponseIcon"
|
||||||
|
@click.native="copyResponse"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ref="schemaEditor"></div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="responseString" ref="schemaEditor"></div>
|
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
class="
|
class="
|
||||||
|
|||||||
@@ -51,8 +51,12 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="flex flex-col flex-1">
|
<div v-else class="flex flex-col flex-1">
|
||||||
<div v-if="response.type === 'loading'">
|
<div
|
||||||
<i class="animate-spin material-icons"> refresh </i>
|
v-if="response.type === 'loading'"
|
||||||
|
class="flex flex-col items-center justify-center"
|
||||||
|
>
|
||||||
|
<SmartSpinner class="mb-4" />
|
||||||
|
<span class="text-secondaryLight">{{ $t("state.loading") }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="response.type === 'network_fail'"
|
v-if="response.type === 'network_fail'"
|
||||||
|
|||||||
@@ -117,7 +117,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col space-y-2 px-4">
|
<div class="flex flex-col space-y-2 px-4 pb-4">
|
||||||
<div
|
<div
|
||||||
v-for="(input, index) of communication.inputs"
|
v-for="(input, index) of communication.inputs"
|
||||||
:key="`input-${index}`"
|
:key="`input-${index}`"
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ const SmartLink = {
|
|||||||
let on = {}
|
let on = {}
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case ANCHOR_TAG:
|
case ANCHOR_TAG:
|
||||||
|
attrs["aria-label"] = "Link"
|
||||||
|
|
||||||
// Map `to` prop to the correct attribute
|
// Map `to` prop to the correct attribute
|
||||||
attrs.href = context.props.to
|
attrs.href = context.props.to
|
||||||
|
|
||||||
@@ -53,6 +55,7 @@ const SmartLink = {
|
|||||||
break
|
break
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
attrs["aria-label"] = "Button"
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
<template>
|
<template>
|
||||||
<svg
|
<SmartIcon class="animate-spin svg-icons" name="loader" />
|
||||||
class="h-4 animate-spin w-4"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
fill="none"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
>
|
|
||||||
<circle
|
|
||||||
class="opacity-25"
|
|
||||||
cx="12"
|
|
||||||
cy="12"
|
|
||||||
r="10"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="4"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
class="opacity-75"
|
|
||||||
fill="currentColor"
|
|
||||||
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="flex flex-nowrap flex-1 h-full"
|
class="flex flex-nowrap flex-1 h-full"
|
||||||
:class="{ 'flex-col': !vertical }"
|
:class="{ 'flex-col h-auto': !vertical }"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="tabs hide-scrollbar relative"
|
class="tabs hide-scrollbar relative"
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
class="tab"
|
class="tab"
|
||||||
:class="[{ active: tab.active }, { vertical: vertical }]"
|
:class="[{ active: tab.active }, { vertical: vertical }]"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
:aria-label="tab.label"
|
||||||
@keyup.enter="selectTab(tab)"
|
@keyup.enter="selectTab(tab)"
|
||||||
@click="selectTab(tab)"
|
@click="selectTab(tab)"
|
||||||
>
|
>
|
||||||
@@ -42,8 +43,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
class="contents h-full w-full"
|
||||||
:class="{
|
:class="{
|
||||||
'flex flex-col flex-1 overflow-y-auto hide-scrollbar': vertical,
|
'!flex flex-col flex-1 overflow-y-auto hide-scrollbar': vertical,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
|||||||
@@ -17,13 +17,13 @@
|
|||||||
outline
|
outline
|
||||||
@click.native="displayModalAdd(true)"
|
@click.native="displayModalAdd(true)"
|
||||||
/>
|
/>
|
||||||
<p
|
<div
|
||||||
v-if="myTeamsLoading"
|
v-if="myTeamsLoading"
|
||||||
class="flex flex-col items-center justify-center"
|
class="flex flex-col items-center justify-center"
|
||||||
>
|
>
|
||||||
<SmartSpinner class="mb-4" />
|
<SmartSpinner class="mb-4" />
|
||||||
<span class="text-secondaryLight">{{ $t("state.loading") }}</span>
|
<span class="text-secondaryLight">{{ $t("state.loading") }}</span>
|
||||||
</p>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="!myTeamsLoading && myTeams.myTeams.length === 0"
|
v-if="!myTeamsLoading && myTeams.myTeams.length === 0"
|
||||||
class="flex items-center"
|
class="flex items-center"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
OperationVariables,
|
OperationVariables,
|
||||||
split,
|
split,
|
||||||
ApolloError,
|
ApolloError,
|
||||||
isApolloError as _isApolloError
|
isApolloError as _isApolloError,
|
||||||
} from "@apollo/client/core"
|
} from "@apollo/client/core"
|
||||||
import { WebSocketLink } from "@apollo/client/link/ws"
|
import { WebSocketLink } from "@apollo/client/link/ws"
|
||||||
import { setContext } from "@apollo/client/link/context"
|
import { setContext } from "@apollo/client/link/context"
|
||||||
|
|||||||
@@ -177,6 +177,7 @@ export default defineComponent({
|
|||||||
action: [
|
action: [
|
||||||
{
|
{
|
||||||
text: `${this.$t("app.reload")}`,
|
text: `${this.$t("app.reload")}`,
|
||||||
|
class: "!ml-auto",
|
||||||
onClick: (_, toastObject) => {
|
onClick: (_, toastObject) => {
|
||||||
toastObject.goAway(0)
|
toastObject.goAway(0)
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<SmartTabs
|
<SmartTabs
|
||||||
class="h-full overflow-hidden"
|
class="h-full !overflow-hidden"
|
||||||
styles="sticky bg-primary top-0 z-10 border-b border-dividerLight !overflow-visible"
|
styles="sticky bg-primary top-0 z-10 border-b border-dividerLight !overflow-visible"
|
||||||
>
|
>
|
||||||
<SmartTab
|
<SmartTab
|
||||||
|
|||||||
Reference in New Issue
Block a user