feat: init split layouts

This commit is contained in:
Liyas Thomas
2021-07-06 17:31:18 +00:00
committed by GitHub
parent 93d373c032
commit fc5a5aad8d
35 changed files with 1204 additions and 1061 deletions

View File

@@ -178,8 +178,6 @@ select {
@apply cursor-pointer; @apply cursor-pointer;
@apply appearance-none; @apply appearance-none;
// height: 40px;
&::-ms-expand { &::-ms-expand {
@apply hidden; @apply hidden;
} }
@@ -295,3 +293,64 @@ input[type="checkbox"] {
margin-bottom: env(safe-area-inset-bottom); margin-bottom: env(safe-area-inset-bottom);
} }
} }
.splitpanes__splitter {
@apply relative;
@apply bg-primaryLight;
@apply transition;
}
.splitpanes--vertical > .splitpanes__splitter {
@apply w-1;
}
.splitpanes--horizontal > .splitpanes__splitter {
@apply h-1;
}
.splitpanes__splitter::before {
@apply absolute;
@apply inset-0;
@apply bg-dividerLight;
@apply opacity-0;
@apply z-1;
@apply transition;
content: "";
}
.splitpanes__splitter::after {
@apply absolute;
@apply inset-0;
@apply z-1;
@apply transition;
@apply flex;
@apply items-center;
@apply justify-center;
@apply text-dividerDark;
@apply font-icon;
}
.splitpanes--vertical > .splitpanes__splitter::after {
content: "\e5d4";
}
.splitpanes--horizontal > .splitpanes__splitter::after {
content: "\e5d3";
}
.splitpanes__splitter:hover::before {
@apply opacity-100;
}
.splitpanes--vertical > .splitpanes__splitter::before {
left: -2px;
right: -2px;
height: 100%;
}
.splitpanes--horizontal > .splitpanes__splitter::before {
top: -2px;
bottom: -2px;
width: 100%;
}

View File

@@ -1,5 +1,5 @@
<template> <template>
<section :id="label.toLowerCase()"> <section :id="label.toLowerCase()" class="flex flex-col">
<slot></slot> <slot></slot>
</section> </section>
</template> </template>

View File

@@ -45,7 +45,7 @@
:show="showModalImportExport" :show="showModalImportExport"
@hide-modal="displayModalImportExport(false)" @hide-modal="displayModalImportExport(false)"
/> />
<div class="border-b row-wrapper border-divider"> <div class="border-b flex flex-1 border-divider">
<ButtonSecondary <ButtonSecondary
icon="new" icon="new"
:label="$t('new')" :label="$t('new')"

View File

@@ -7,7 +7,7 @@
aria-label="Search" aria-label="Search"
type="search" type="search"
:placeholder="$t('search')" :placeholder="$t('search')"
class="input rounded-t-lg" class="px-4 py-2 text-xs flex flex-1"
/> />
</div> </div>
<CollectionsChooseType <CollectionsChooseType
@@ -53,7 +53,7 @@
@hide-modal="displayModalImportExport(false)" @hide-modal="displayModalImportExport(false)"
@update-team-collections="updateTeamCollections" @update-team-collections="updateTeamCollections"
/> />
<div class="border-b row-wrapper border-divider"> <div class="border-b flex flex-1 border-divider">
<ButtonSecondary <ButtonSecondary
v-if=" v-if="
collectionsType.type == 'team-collections' && collectionsType.type == 'team-collections' &&

View File

@@ -16,7 +16,7 @@
:placeholder="editingEnvironment.name" :placeholder="editingEnvironment.name"
@keyup.enter="saveEnvironment" @keyup.enter="saveEnvironment"
/> />
<div class="row-wrapper"> <div class="flex flex-1">
<label for="variableList">{{ $t("env_variable_list") }}</label> <label for="variableList">{{ $t("env_variable_list") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div class="row-wrapper"> <div class="flex flex-1">
<div> <div>
<ButtonSecondary <ButtonSecondary
icon="layers" icon="layers"

View File

@@ -35,7 +35,7 @@
:show="showModalImportExport" :show="showModalImportExport"
@hide-modal="displayModalImportExport(false)" @hide-modal="displayModalImportExport(false)"
/> />
<div class="border-b row-wrapper border-divider"> <div class="border-b flex flex-1 border-divider">
<div> <div>
<ButtonSecondary <ButtonSecondary
icon="add" icon="add"

View File

@@ -1,12 +1,12 @@
<template> <template>
<AppSection label="history"> <AppSection label="history" class="bg-green-200">
<div class="flex"> <div class="flex">
<input <input
v-model="filterText" v-model="filterText"
aria-label="Search" aria-label="Search"
type="search" type="search"
class="px-4 py-2 text-xs flex flex-1"
:placeholder="$t('search')" :placeholder="$t('search')"
class="input rounded-t-lg"
/> />
</div> </div>
<div <div
@@ -39,8 +39,11 @@
<p v-if="history.length === 0"> <p v-if="history.length === 0">
<i class="material-icons">schedule</i> {{ $t("history_empty") }} <i class="material-icons">schedule</i> {{ $t("history_empty") }}
</p> </p>
<div v-if="history.length !== 0" class="rounded-b-lg bg-primaryDark"> <div v-if="history.length !== 0" class="rounded-b-lg bg-primaryLight">
<div v-if="!isClearingHistory" class="row-wrapper"> <div
v-if="!isClearingHistory"
class="flex items-center justify-between flex-1"
>
<ButtonSecondary <ButtonSecondary
data-testid="clear_history" data-testid="clear_history"
:disabled="history.length === 0" :disabled="history.length === 0"
@@ -51,14 +54,15 @@
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="!showMore ? $t('show_more') : $t('hide_more')" :title="!showMore ? $t('show_more') : $t('hide_more')"
icon="!showMore ? 'unfold_more' : 'unfold_less'" :icon="!showMore ? 'unfold_more' : 'unfold_less'"
@click.native="toggleCollapse()" @click.native="toggleCollapse()"
/> />
</div> </div>
<div v-else class="row-wrapper"> <div v-else class="flex items-center justify-between flex-1">
<p> <span class="flex items-center">
<i class="material-icons">help_outline</i> {{ $t("are_you_sure") }} <i class="material-icons mx-2">help_outline</i>
</p> {{ $t("are_you_sure") }}
</span>
<div> <div>
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"

View File

@@ -2,7 +2,7 @@
<div> <div>
<ul> <ul>
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="reqParamList">{{ $t("request_body") }}</label> <label for="reqParamList">{{ $t("request_body") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -41,7 +41,7 @@
/> />
</tippy> </tippy>
</span> </span>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="generatedCode">{{ $t("generated_code") }}</label> <label for="generatedCode">{{ $t("generated_code") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -2,7 +2,7 @@
<AppSection label="headers"> <AppSection label="headers">
<ul v-if="headers.length !== 0"> <ul v-if="headers.length !== 0">
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="headerList">{{ $t("header_list") }}</label> <label for="headerList">{{ $t("header_list") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -2,7 +2,7 @@
<AppSection label="parameters"> <AppSection label="parameters">
<ul v-if="params.length !== 0"> <ul v-if="params.length !== 0">
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="paramList">{{ $t("parameter_list") }}</label> <label for="paramList">{{ $t("parameter_list") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -2,7 +2,7 @@
<div> <div>
<ul> <ul>
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="rawBody">{{ $t("raw_request_body") }}</label> <label for="rawBody">{{ $t("raw_request_body") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -7,7 +7,7 @@
</div> </div>
</template> </template>
<template #body> <template #body>
<div class="row-wrapper"> <div class="flex flex-1">
<label>{{ $t("token_list") }}</label> <label>{{ $t("token_list") }}</label>
<div v-if="tokens.length != 0"> <div v-if="tokens.length != 0">
<ButtonSecondary <ButtonSecondary
@@ -35,7 +35,7 @@
<li> <li>
<input class="input" :value="token.value" readonly /> <input class="input" :value="token.value" readonly />
</li> </li>
<div class="row-wrapper"> <div class="flex flex-1">
<li> <li>
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="flex p-4 relative overflow-hidden"> <div class="flex p-4 relative">
<div class="relative my-16 z-10 max-w-3xl"> <div class="relative my-16 z-10 max-w-3xl">
<h2 <h2
class=" class="
@@ -45,7 +45,7 @@
</div> </div>
</div> </div>
<div class="lg:absolute lg:inset-y-0 lg:right-0 lg:w-1/2"> <div class="lg:absolute lg:inset-y-0 lg:right-0 lg:w-1/2">
<LandingGlobe class="h-64 w-full sm:h-72 md:h-96 lg:w-full lg:h-full" /> <LandingGlobe class="h-64 w-full sm:h-72 md:h-96 lg:h-full" />
</div> </div>
</div> </div>
</template> </template>

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="body">{{ $t("response_body") }}</label> <label for="body">{{ $t("response_body") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="body">{{ $t("response_body") }}</label> <label for="body">{{ $t("response_body") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="body">{{ $t("response_body") }}</label> <label for="body">{{ $t("response_body") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="body">{{ $t("response_body") }}</label> <label for="body">{{ $t("response_body") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="body">{{ $t("response_body") }}</label> <label for="body">{{ $t("response_body") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -1,5 +1,9 @@
<template> <template>
<div> <div>
<Splitpanes vertical :dbl-click-splitter="false">
<Pane class="overflow-auto">
<Splitpanes horizontal :dbl-click-splitter="false">
<Pane class="overflow-auto">
<AppSection label="request"> <AppSection label="request">
<ul> <ul>
<li> <li>
@@ -18,9 +22,15 @@
<ButtonSecondary <ButtonSecondary
id="connect" id="connect"
:disabled="!validUrl" :disabled="!validUrl"
class="button rounded-b-lg md:rounded-bl-none md:rounded-br-lg" class="
button
rounded-b-lg
md:rounded-bl-none md:rounded-br-lg
"
:icon="!connectionState ? 'sync' : 'sync_disabled'" :icon="!connectionState ? 'sync' : 'sync_disabled'"
:label="connectionState ? $t('disconnect') : $t('connect')" :label="
connectionState ? $t('disconnect') : $t('connect')
"
reverse reverse
@click.native="toggleConnection" @click.native="toggleConnection"
/> />
@@ -28,13 +38,20 @@
</div> </div>
</ul> </ul>
</AppSection> </AppSection>
</Pane>
<Pane class="overflow-auto">
<AppSection label="response"> <AppSection label="response">
<ul> <ul>
<li> <li>
<RealtimeLog :title="$t('log')" :log="log" /> <RealtimeLog :title="$t('log')" :log="log" />
</li> </li>
</ul> </ul>
</AppSection>
</Pane>
</Splitpanes>
</Pane>
<Pane max-size="35" min-size="20" class="overflow-auto">
<AppSection label="messages">
<ul> <ul>
<li> <li>
<label for="pub_topic">{{ $t("mqtt_topic") }}</label> <label for="pub_topic">{{ $t("mqtt_topic") }}</label>
@@ -87,7 +104,11 @@
id="subscribe" id="subscribe"
name="get" name="get"
:disabled="!cansubscribe" :disabled="!cansubscribe"
class="button rounded-b-lg md:rounded-bl-none md:rounded-br-lg" class="
button
rounded-b-lg
md:rounded-bl-none md:rounded-br-lg
"
:icon="subscriptionState ? 'sync_disabled' : 'sync'" :icon="subscriptionState ? 'sync_disabled' : 'sync'"
:label=" :label="
subscriptionState subscriptionState
@@ -101,14 +122,18 @@
</div> </div>
</ul> </ul>
</AppSection> </AppSection>
</Pane>
</Splitpanes>
</div> </div>
</template> </template>
<script> <script>
import { Splitpanes, Pane } from "splitpanes"
import Paho from "paho-mqtt" import Paho from "paho-mqtt"
import debounce from "~/helpers/utils/debounce" import debounce from "~/helpers/utils/debounce"
export default { export default {
components: { Splitpanes, Pane },
data() { data() {
return { return {
url: "wss://test.mosquitto.org:8081", url: "wss://test.mosquitto.org:8081",

View File

@@ -1,5 +1,9 @@
<template> <template>
<div> <div>
<Splitpanes vertical :dbl-click-splitter="false">
<Pane class="overflow-auto">
<Splitpanes horizontal :dbl-click-splitter="false">
<Pane class="overflow-auto">
<AppSection label="request"> <AppSection label="request">
<ul> <ul>
<li> <li>
@@ -32,9 +36,15 @@
id="connect" id="connect"
:disabled="!urlValid" :disabled="!urlValid"
name="connect" name="connect"
class="button rounded-b-lg md:rounded-bl-none md:rounded-br-lg" class="
button
rounded-b-lg
md:rounded-bl-none md:rounded-br-lg
"
:icon="!connectionState ? 'sync' : 'sync_disabled'" :icon="!connectionState ? 'sync' : 'sync_disabled'"
:label="!connectionState ? $t('connect') : $t('disconnect')" :label="
!connectionState ? $t('connect') : $t('disconnect')
"
reverse reverse
@click.native="toggleConnection" @click.native="toggleConnection"
/> />
@@ -42,13 +52,20 @@
</div> </div>
</ul> </ul>
</AppSection> </AppSection>
</Pane>
<Pane class="overflow-auto">
<AppSection label="response"> <AppSection label="response">
<ul> <ul>
<li> <li>
<RealtimeLog :title="$t('log')" :log="communication.log" /> <RealtimeLog :title="$t('log')" :log="communication.log" />
</li> </li>
</ul> </ul>
</AppSection>
</Pane>
</Splitpanes>
</Pane>
<Pane max-size="35" min-size="20" class="overflow-auto">
<AppSection label="messages">
<ul> <ul>
<li> <li>
<label for="event_name">{{ $t("event_name") }}</label> <label for="event_name">{{ $t("event_name") }}</label>
@@ -64,7 +81,7 @@
</ul> </ul>
<ul> <ul>
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label>{{ $t("message") }}s</label> <label>{{ $t("message") }}s</label>
</div> </div>
</li> </li>
@@ -126,15 +143,19 @@
</li> </li>
</ul> </ul>
</AppSection> </AppSection>
</Pane>
</Splitpanes>
</div> </div>
</template> </template>
<script> <script>
import { Splitpanes, Pane } from "splitpanes"
import { io as Client } from "socket.io-client" import { io as Client } from "socket.io-client"
import wildcard from "socketio-wildcard" import wildcard from "socketio-wildcard"
import debounce from "~/helpers/utils/debounce" import debounce from "~/helpers/utils/debounce"
export default { export default {
components: { Splitpanes, Pane },
data() { data() {
return { return {
url: "wss://main-daxrc78qyb411dls-gtw.qovery.io", url: "wss://main-daxrc78qyb411dls-gtw.qovery.io",

View File

@@ -1,5 +1,7 @@
<template> <template>
<div> <div>
<Splitpanes horizontal :dbl-click-splitter="false">
<Pane class="overflow-auto">
<AppSection label="request"> <AppSection label="request">
<ul> <ul>
<li> <li>
@@ -20,7 +22,11 @@
id="start" id="start"
:disabled="!serverValid" :disabled="!serverValid"
name="start" name="start"
class="button rounded-b-lg md:rounded-bl-none md:rounded-br-lg" class="
button
rounded-b-lg
md:rounded-bl-none md:rounded-br-lg
"
:icon="!connectionSSEState ? 'sync' : 'sync_disabled'" :icon="!connectionSSEState ? 'sync' : 'sync_disabled'"
:label="!connectionSSEState ? $t('start') : $t('stop')" :label="!connectionSSEState ? $t('start') : $t('stop')"
reverse reverse
@@ -30,7 +36,8 @@
</div> </div>
</ul> </ul>
</AppSection> </AppSection>
</Pane>
<Pane class="overflow-auto">
<AppSection label="response"> <AppSection label="response">
<ul> <ul>
<li> <li>
@@ -39,13 +46,17 @@
</li> </li>
</ul> </ul>
</AppSection> </AppSection>
</Pane>
</Splitpanes>
</div> </div>
</template> </template>
<script> <script>
import { Splitpanes, Pane } from "splitpanes"
import debounce from "~/helpers/utils/debounce" import debounce from "~/helpers/utils/debounce"
export default { export default {
components: { Splitpanes, Pane },
data() { data() {
return { return {
connectionSSEState: false, connectionSSEState: false,

View File

@@ -1,5 +1,9 @@
<template> <template>
<div> <div>
<Splitpanes vertical :dbl-click-splitter="false">
<Pane class="overflow-auto">
<Splitpanes horizontal :dbl-click-splitter="false">
<Pane class="overflow-auto">
<AppSection label="request"> <AppSection label="request">
<ul> <ul>
<li> <li>
@@ -23,7 +27,9 @@
class="button" class="button"
name="connect" name="connect"
:icon="!connectionState ? 'sync' : 'sync_disabled'" :icon="!connectionState ? 'sync' : 'sync_disabled'"
:label="!connectionState ? $t('connect') : $t('disconnect')" :label="
!connectionState ? $t('connect') : $t('disconnect')
"
reverse reverse
@click.native="toggleConnection" @click.native="toggleConnection"
/> />
@@ -32,7 +38,7 @@
</ul> </ul>
<ul> <ul>
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label>{{ $t("protocols") }}</label> <label>{{ $t("protocols") }}</label>
</div> </div>
</li> </li>
@@ -108,13 +114,20 @@
</li> </li>
</ul> </ul>
</AppSection> </AppSection>
</Pane>
<Pane class="overflow-auto">
<AppSection label="response"> <AppSection label="response">
<ul> <ul>
<li> <li>
<RealtimeLog :title="$t('log')" :log="communication.log" /> <RealtimeLog :title="$t('log')" :log="communication.log" />
</li> </li>
</ul> </ul>
</AppSection>
</Pane>
</Splitpanes>
</Pane>
<Pane max-size="35" min-size="20" class="overflow-auto">
<AppSection label="messages">
<ul> <ul>
<li> <li>
<label for="websocket-message">{{ $t("message") }}</label> <label for="websocket-message">{{ $t("message") }}</label>
@@ -136,7 +149,11 @@
id="send" id="send"
name="send" name="send"
:disabled="!connectionState" :disabled="!connectionState"
class="button rounded-b-lg md:rounded-bl-none md:rounded-br-lg" class="
button
rounded-b-lg
md:rounded-bl-none md:rounded-br-lg
"
icon="send" icon="send"
:label="$t('send')" :label="$t('send')"
@click.native="sendMessage" @click.native="sendMessage"
@@ -145,13 +162,18 @@
</div> </div>
</ul> </ul>
</AppSection> </AppSection>
</Pane>
</Splitpanes>
</div> </div>
</template> </template>
<script> <script>
import { Splitpanes, Pane } from "splitpanes"
import debounce from "~/helpers/utils/debounce" import debounce from "~/helpers/utils/debounce"
import "splitpanes/dist/splitpanes.css"
export default { export default {
components: { Splitpanes, Pane },
data() { data() {
return { return {
connectionState: false, connectionState: false,

View File

@@ -44,7 +44,7 @@
</div> </div>
</div> </div>
<div v-if="hasFooterSlot" class="p-2"> <div v-if="hasFooterSlot" class="p-2">
<div class="row-wrapper"> <div class="flex flex-1">
<slot name="footer"></slot> <slot name="footer"></slot>
</div> </div>
</div> </div>

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="tabs-wrapper"> <div class="tabs-wrapper bg-blue-300">
<div class="tabs" :class="styles"> <div class="tabs" :class="styles">
<div class="flex w-0"> <div class="flex w-0">
<div class="inline-flex"> <div class="inline-flex">
@@ -65,17 +65,19 @@ export default {
.tabs { .tabs {
@apply flex; @apply flex;
@apply flex-1;
@apply whitespace-nowrap; @apply whitespace-nowrap;
@apply overflow-auto; @apply overflow-auto;
@apply mt-4;
.tab { .tab {
@apply flex; @apply flex;
@apply items-center; @apply items-center;
@apply justify-center; @apply justify-center;
@apply p-3; @apply px-4;
@apply py-2;
@apply text-secondaryLight; @apply text-secondaryLight;
@apply font-semibold; @apply font-semibold;
@apply text-xs;
@apply cursor-pointer; @apply cursor-pointer;
@apply transition; @apply transition;
@apply border-b-2; @apply border-b-2;

View File

@@ -7,7 +7,7 @@
<template #body> <template #body>
<ul> <ul>
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label>{{ $t("label") }}</label> <label>{{ $t("label") }}</label>
</div> </div>
</li> </li>
@@ -25,7 +25,7 @@
</ul> </ul>
<ul> <ul>
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="memberList">{{ $t("team_member_list") }}</label> <label for="memberList">{{ $t("team_member_list") }}</label>
<div></div> <div></div>
</div> </div>

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="row-wrapper"> <div class="flex flex-1">
<div> <div>
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"

View File

@@ -23,7 +23,7 @@
:editingteam-i-d="editingteamID" :editingteam-i-d="editingteamID"
@hide-modal="displayModalEdit(false)" @hide-modal="displayModalEdit(false)"
/> />
<div class="row-wrapper"> <div class="flex flex-1">
<div> <div>
<ButtonSecondary <ButtonSecondary
icon="add" icon="add"

View File

@@ -1,36 +1,28 @@
<template> <template>
<div class="flex h-screen w-screen"> <div class="flex h-screen w-screen">
<Splitpanes horizontal class="hoppscotch-theme"> <Splitpanes horizontal :dbl-click-splitter="false">
<Pane class="flex-1"> <Pane class="flex flex-1 overflow-auto">
<Splitpanes vertical class="hoppscotch-theme"> <Splitpanes vertical :dbl-click-splitter="false">
<Pane <Pane
v-if="!hideNavigationPane" v-if="!hideNavigationPane"
style="width: auto" style="width: auto"
class="overflow-y-auto bg-primaryLight flex items-stretch" class="overflow-auto"
> >
<AppSidenav /> <AppSidenav />
</Pane> </Pane>
<Pane class="flex-1"> <Pane class="flex flex-1 overflow-auto">
<Splitpanes <Splitpanes horizontal :dbl-click-splitter="false">
horizontal <Pane v-if="!zenMode" style="height: auto" class="overflow-auto">
:push-other-panes="false"
class="hoppscotch-theme"
>
<Pane v-if="!zenMode" style="height: auto">
<AppHeader /> <AppHeader />
</Pane> </Pane>
<Pane class="flex-1"> <Pane class="flex flex-1 overflow-auto">
<Splitpanes vertical class="hoppscotch-theme">
<Pane class="overflow-y-auto">
<nuxt class="container" :hide-right-pane="hideRightPane" /> <nuxt class="container" :hide-right-pane="hideRightPane" />
</Pane> </Pane>
</Splitpanes> </Splitpanes>
</Pane> </Pane>
</Splitpanes> </Splitpanes>
</Pane> </Pane>
</Splitpanes> <Pane style="height: auto" class="overflow-auto">
</Pane>
<Pane style="height: auto" class="bg-primaryDark">
<div class="flex justify-between"> <div class="flex justify-between">
<div> <div>
<ButtonSecondary <ButtonSecondary
@@ -56,6 +48,7 @@
@click.native="zenMode = !zenMode" @click.native="zenMode = !zenMode"
/> />
</div> </div>
<div>
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="hideRightPane ? $t('show_sidebar') : $t('hide_sidebar')" :title="hideRightPane ? $t('show_sidebar') : $t('hide_sidebar')"
@@ -64,6 +57,7 @@
@click.native="hideRightPane = !hideRightPane" @click.native="hideRightPane = !hideRightPane"
/> />
</div> </div>
</div>
</Pane> </Pane>
</Splitpanes> </Splitpanes>
</div> </div>

View File

@@ -1,10 +1,10 @@
<template> <template>
<!-- eslint-disable --> <!-- eslint-disable -->
<div> <div>
<Splitpanes vertical class="hoppscotch-theme"> <Splitpanes vertical :dbl-click-splitter="false">
<Pane min-size="60" class="bg-violet-100"> <Pane class="overflow-auto">
<Splitpanes horizontal class="hoppscotch-theme"> <Splitpanes horizontal :dbl-click-splitter="false">
<Pane class="bg-indigo-100"> <Pane class="overflow-auto">
<AppSection ref="request" label="request"> <AppSection ref="request" label="request">
<ul> <ul>
<li class="shrink"> <li class="shrink">
@@ -142,7 +142,7 @@
</ul> </ul>
<ul> <ul>
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<span> <span>
<SmartToggle <SmartToggle
v-if="canListParameters" v-if="canListParameters"
@@ -175,7 +175,7 @@
" "
/> />
</div> </div>
<div class="row-wrapper"> <div class="flex flex-1">
<span> <span>
<ButtonSecondary <ButtonSecondary
@click.native="showCurlImportModal = !showCurlImportModal" @click.native="showCurlImportModal = !showCurlImportModal"
@@ -262,7 +262,7 @@
<AppSection label="authentication"> <AppSection label="authentication">
<ul> <ul>
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="auth">{{ $t("authentication") }}</label> <label for="auth">{{ $t("authentication") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary
@@ -317,7 +317,7 @@
</ul> </ul>
<ul v-if="auth === 'Bearer Token' || auth === 'OAuth 2.0'"> <ul v-if="auth === 'Bearer Token' || auth === 'OAuth 2.0'">
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<input <input
class="input" class="input"
placeholder="Token" placeholder="Token"
@@ -343,7 +343,7 @@
</div> </div>
</li> </li>
</ul> </ul>
<div class="row-wrapper"> <div class="flex flex-1">
<SmartToggle <SmartToggle
:on="!URL_EXCLUDES.auth" :on="!URL_EXCLUDES.auth"
@change="setExclude('auth', !$event)" @change="setExclude('auth', !$event)"
@@ -359,7 +359,7 @@
> >
<ul> <ul>
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="token-name">{{ $t("token_name") }}</label> <label for="token-name">{{ $t("token_name") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary
@@ -487,7 +487,7 @@
<AppSection v-if="showPreRequestScript" label="preRequest"> <AppSection v-if="showPreRequestScript" label="preRequest">
<ul> <ul>
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label>{{ $t("javascript_code") }}</label> <label>{{ $t("javascript_code") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary
@@ -521,7 +521,7 @@
<AppSection v-if="testsEnabled" label="postRequestTests"> <AppSection v-if="testsEnabled" label="postRequestTests">
<ul> <ul>
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label>{{ $t("javascript_code") }}</label> <label>{{ $t("javascript_code") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary
@@ -547,7 +547,7 @@
completeMode="test" completeMode="test"
/> />
<div v-if="testReports.length !== 0"> <div v-if="testReports.length !== 0">
<div class="row-wrapper"> <div class="flex flex-1">
<label>Test Reports</label> <label>Test Reports</label>
<div> <div>
<ButtonSecondary <ButtonSecondary
@@ -570,7 +570,7 @@
</div> </div>
<p <p
v-else-if="testReport.result" v-else-if="testReport.result"
class="row-wrapper info" class="flex flex-1 info"
> >
<span :class="testReport.styles.class"> <span :class="testReport.styles.class">
<i class="material-icons"> <i class="material-icons">
@@ -595,7 +595,7 @@
</SmartTabs> </SmartTabs>
</section> </section>
</Pane> </Pane>
<Pane class="bg-purple-100"> <Pane class="overflow-auto">
<HttpResponse <HttpResponse
:response="response" :response="response"
:active="runningRequest" :active="runningRequest"
@@ -604,9 +604,8 @@
</Pane> </Pane>
</Splitpanes> </Splitpanes>
</Pane> </Pane>
<Pane max-size="40" class="bg-pink-100"> <Pane max-size="35" min-size="20" class="overflow-auto">
<aside class="lg:max-w-md"> <aside class="h-full bg-yellow-200">
<section>
<SmartTabs> <SmartTabs>
<SmartTab :id="'history'" :label="$t('history')" :selected="true"> <SmartTab :id="'history'" :label="$t('history')" :selected="true">
<History <History
@@ -624,7 +623,6 @@
<Environments /> <Environments />
</SmartTab> </SmartTab>
</SmartTabs> </SmartTabs>
</section>
</aside> </aside>
</Pane> </Pane>
</Splitpanes> </Splitpanes>
@@ -673,7 +671,7 @@
</div> </div>
</template> </template>
<template #body> <template #body>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="token-req-list">{{ $t("token_req_list") }}</label> <label for="token-req-list">{{ $t("token_req_list") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary

View File

@@ -1,14 +1,16 @@
<template> <template>
<div class="page"> <div>
<div class="content"> <Splitpanes vertical :dbl-click-splitter="false">
<div class=""> <Pane class="overflow-auto">
<Splitpanes horizontal :dbl-click-splitter="false">
<Pane class="overflow-auto">
<AppSection label="import"> <AppSection label="import">
<div class="flex flex-col"> <div class="flex flex-col">
<label>{{ $t("collection") }}</label> <label>{{ $t("collection") }}</label>
<p> <p>
{{ $t("generate_docs_message") }} {{ $t("generate_docs_message") }}
</p> </p>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="collectionUpload"> <label for="collectionUpload">
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
@@ -54,14 +56,15 @@
/> />
</div> </div>
</AppSection> </AppSection>
</Pane>
<Pane class="overflow-auto">
<AppSection label="documentation"> <AppSection label="documentation">
<div class="flex flex-col"> <div class="flex flex-col">
<label>{{ $t("documentation") }}</label> <label>{{ $t("documentation") }}</label>
<p v-if="items.length === 0"> <p v-if="items.length === 0">
{{ $t("generate_docs_first") }} {{ $t("generate_docs_first") }}
</p> </p>
<div v-else class="row-wrapper"> <div v-else class="flex flex-1">
<div <div
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title=" :title="
@@ -96,8 +99,10 @@
</div> </div>
</div> </div>
</AppSection> </AppSection>
</div> </Pane>
</Splitpanes>
</Pane>
<Pane max-size="35" min-size="20" class="overflow-auto">
<aside class="lg:max-w-md"> <aside class="lg:max-w-md">
<Collections <Collections
:selected="selected" :selected="selected"
@@ -106,11 +111,13 @@
@remove-collection="removeSelectedCollection($event)" @remove-collection="removeSelectedCollection($event)"
/> />
</aside> </aside>
</div> </Pane>
</Splitpanes>
</div> </div>
</template> </template>
<script> <script>
import { Splitpanes, Pane } from "splitpanes"
import Mustache from "mustache" import Mustache from "mustache"
import { currentUser$ } from "~/helpers/fb/auth" import { currentUser$ } from "~/helpers/fb/auth"
import DocsTemplate from "~/assets/md/docs.md" import DocsTemplate from "~/assets/md/docs.md"
@@ -118,6 +125,7 @@ import folderContents from "~/assets/md/folderContents.md"
import folderBody from "~/assets/md/folderBody.md" import folderBody from "~/assets/md/folderBody.md"
export default { export default {
components: { Splitpanes, Pane },
data() { data() {
return { return {
collectionJSON: "[]", collectionJSON: "[]",

View File

@@ -1,7 +1,9 @@
<template> <template>
<div class="page"> <div>
<div class="content"> <Splitpanes vertical :dbl-click-splitter="false">
<div class=""> <Pane class="overflow-auto">
<Splitpanes horizontal :dbl-click-splitter="false">
<Pane class="overflow-auto">
<AppSection label="endpoint"> <AppSection label="endpoint">
<ul> <ul>
<li> <li>
@@ -22,20 +24,21 @@
id="get" id="get"
name="get" name="get"
:icon="!isPollingSchema ? 'sync' : 'sync_disabled'" :icon="!isPollingSchema ? 'sync' : 'sync_disabled'"
:label="!isPollingSchema ? $t('connect') : $t('disconnect')" :label="
!isPollingSchema ? $t('connect') : $t('disconnect')
"
@click.native="onPollSchemaClick" @click.native="onPollSchemaClick"
/> />
</li> </li>
</div> </div>
</ul> </ul>
</AppSection> </AppSection>
<AppSection label="headers"> <AppSection label="headers">
<div class="flex flex-col"> <div class="flex flex-col">
<label>{{ $t("headers") }}</label> <label>{{ $t("headers") }}</label>
<ul v-if="headers.length !== 0"> <ul v-if="headers.length !== 0">
<li> <li>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="headerList">{{ $t("header_list") }}</label> <label for="headerList">{{ $t("header_list") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary
@@ -141,9 +144,79 @@
</ul> </ul>
</div> </div>
</AppSection> </AppSection>
<AppSection label="query">
<div class="flex flex-1 gqlRunQuery">
<label for="gqlQuery">{{ $t("query") }}</label>
<div>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
title="
`${$t('run_query')} (${getSpecialKey()}-Enter)`
"
class="button"
icon="play_arrow"
@click.native="runQuery()"
/>
<ButtonSecondary
ref="copyQueryButton"
v-tippy="{ theme: 'tooltip' }"
:title="$t('copy_query')"
:icon="copyQueryIcon"
@click.native="copyQuery"
/>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="`${$t('prettify_query')} (${getSpecialKey()}-P)`"
:icon="prettifyIcon"
@click.native="doPrettifyQuery"
/>
<ButtonSecondary
ref="saveRequest"
v-tippy="{ theme: 'tooltip' }"
:title="$t('save_to_collections')"
icon="create_new_folder"
@click.native="saveRequest"
/>
</div>
</div>
<GraphqlQueryEditor
ref="queryEditor"
v-model="gqlQueryString"
styles="rounded-b-lg"
:on-run-g-q-l-query="runQuery"
:options="{
maxLines: responseBodyMaxLines,
minLines: 10,
fontSize: '15px',
autoScrollEditorIntoView: true,
showPrintMargin: false,
useWorker: false,
}"
@update-query="updateQuery"
/>
</AppSection>
<AppSection label="variables">
<div class="flex flex-col">
<label>{{ $t("variables") }}</label>
<SmartAceEditor
v-model="variableString"
:lang="'json'"
:options="{
maxLines: 10,
minLines: 5,
fontSize: '15px',
autoScrollEditorIntoView: true,
showPrintMargin: false,
useWorker: false,
}"
styles="rounded-b-lg"
/>
</div>
</AppSection>
</Pane>
<Pane class="overflow-auto">
<AppSection ref="schema" label="schema"> <AppSection ref="schema" label="schema">
<div class="row-wrapper"> <div class="flex flex-1">
<label>{{ $t("schema") }}</label> <label>{{ $t("schema") }}</label>
<div v-if="schema"> <div v-if="schema">
<ButtonSecondary <ButtonSecondary
@@ -198,82 +271,10 @@
type="text" type="text"
/> />
</AppSection> </AppSection>
<AppSection label="query">
<div class="row-wrapper gqlRunQuery">
<label for="gqlQuery">{{ $t("query") }}</label>
<div>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
title="
`${$t('run_query')} (${getSpecialKey()}-Enter)`
"
class="button"
icon="play_arrow"
@click.native="runQuery()"
/>
<ButtonSecondary
ref="copyQueryButton"
v-tippy="{ theme: 'tooltip' }"
:title="$t('copy_query')"
:icon="copyQueryIcon"
@click.native="copyQuery"
/>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="`${$t('prettify_query')} (${getSpecialKey()}-P)`"
:icon="prettifyIcon"
@click.native="doPrettifyQuery"
/>
<ButtonSecondary
ref="saveRequest"
v-tippy="{ theme: 'tooltip' }"
:title="$t('save_to_collections')"
icon="create_new_folder"
@click.native="saveRequest"
/>
</div>
</div>
<GraphqlQueryEditor
ref="queryEditor"
v-model="gqlQueryString"
styles="rounded-b-lg"
:on-run-g-q-l-query="runQuery"
:options="{
maxLines: responseBodyMaxLines,
minLines: 10,
fontSize: '15px',
autoScrollEditorIntoView: true,
showPrintMargin: false,
useWorker: false,
}"
@update-query="updateQuery"
/>
</AppSection>
<AppSection label="variables">
<div class="flex flex-col">
<label>{{ $t("variables") }}</label>
<SmartAceEditor
v-model="variableString"
:lang="'json'"
:options="{
maxLines: 10,
minLines: 5,
fontSize: '15px',
autoScrollEditorIntoView: true,
showPrintMargin: false,
useWorker: false,
}"
styles="rounded-b-lg"
/>
</div>
</AppSection>
<AppSection ref="response" label="response"> <AppSection ref="response" label="response">
<div class="flex flex-col"> <div class="flex flex-col">
<label>{{ $t("response") }}</label> <label>{{ $t("response") }}</label>
<div class="row-wrapper"> <div class="flex flex-1">
<label for="responseField">{{ $t("response_body") }}</label> <label for="responseField">{{ $t("response_body") }}</label>
<div> <div>
<ButtonSecondary <ButtonSecondary
@@ -321,8 +322,10 @@
/> />
</div> </div>
</AppSection> </AppSection>
</div> </Pane>
</Splitpanes>
</Pane>
<Pane max-size="35" min-size="20" class="overflow-auto">
<aside class="lg:max-w-md"> <aside class="lg:max-w-md">
<SmartTabs> <SmartTabs>
<SmartTab :id="'docs'" :label="`Docs`" :selected="true"> <SmartTab :id="'docs'" :label="`Docs`" :selected="true">
@@ -437,7 +440,9 @@
</SmartTab> </SmartTab>
</SmartTabs> </SmartTabs>
</aside> </aside>
</div> </Pane>
</Splitpanes>
<CollectionsSaveRequest <CollectionsSaveRequest
mode="graphql" mode="graphql"
:show="showSaveRequestModal" :show="showSaveRequestModal"
@@ -448,6 +453,7 @@
</template> </template>
<script> <script>
import { Splitpanes, Pane } from "splitpanes"
import * as gql from "graphql" import * as gql from "graphql"
import { commonHeaders } from "~/helpers/headers" import { commonHeaders } from "~/helpers/headers"
import { getPlatformSpecialKey } from "~/helpers/platformutils" import { getPlatformSpecialKey } from "~/helpers/platformutils"
@@ -456,10 +462,10 @@ import { getSettingSubject } from "~/newstore/settings"
import { addGraphqlHistoryEntry } from "~/newstore/history" import { addGraphqlHistoryEntry } from "~/newstore/history"
export default { export default {
components: { Splitpanes, Pane },
beforeRouteLeave(_to, _from, next) { beforeRouteLeave(_to, _from, next) {
this.isPollingSchema = false this.isPollingSchema = false
if (this.timeoutSubscription) clearTimeout(this.timeoutSubscription) if (this.timeoutSubscription) clearTimeout(this.timeoutSubscription)
next() next()
}, },
data() { data() {
@@ -1122,8 +1128,6 @@ export default {
.gqlTabs { .gqlTabs {
@apply relative; @apply relative;
@apply overflow-auto; @apply overflow-auto;
max-height: calc(100vh - 192px);
} }
.gqlRunQuery { .gqlRunQuery {

View File

@@ -1,24 +1,19 @@
<template> <template>
<div class="page"> <div>
<section id="options">
<SmartTabs> <SmartTabs>
<SmartTab :id="'websocket'" :label="$t('websocket')" :selected="true"> <SmartTab :id="'websocket'" :label="$t('websocket')" :selected="true">
<RealtimeWebsocket /> <RealtimeWebsocket />
</SmartTab> </SmartTab>
<SmartTab :id="'sse'" :label="$t('sse')"> <SmartTab :id="'sse'" :label="$t('sse')">
<RealtimeSse /> <RealtimeSse />
</SmartTab> </SmartTab>
<SmartTab :id="'socketio'" :label="$t('socketio')"> <SmartTab :id="'socketio'" :label="$t('socketio')">
<RealtimeSocketio /> <RealtimeSocketio />
</SmartTab> </SmartTab>
<SmartTab :id="'mqtt'" :label="$t('mqtt')"> <SmartTab :id="'mqtt'" :label="$t('mqtt')">
<RealtimeMqtt /> <RealtimeMqtt />
</SmartTab> </SmartTab>
</SmartTabs> </SmartTabs>
</section>
</div> </div>
</template> </template>

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="page"> <div>
<div class="space-y-8"> <div class="space-y-8">
<div class="md:grid md:grid-cols-3 md:gap-4"> <div class="md:grid md:grid-cols-3 md:gap-4">
<div class="md:col-span-1 p-8"> <div class="md:col-span-1 p-8">