Merge branch 'main' into feat/bulk-edit

This commit is contained in:
liyasthomas
2021-08-30 13:23:24 +05:30
47 changed files with 363 additions and 179 deletions

View File

@@ -197,6 +197,8 @@ _Official proxy server is hosted by Hoppscotch - **[GitHub](https://github.com/h
🌎 **i18n:** Experience the app in your own language. 🌎 **i18n:** Experience the app in your own language.
Help us to translate Hoppscotch. Please read [`TRANSLATIONS`](TRANSLATIONS.md) for details on our [`CODE OF CONDUCT`](CODE_OF_CONDUCT.md), and the process for submitting pull requests to us.
📦 **Add-ons:** Official add-ons for hoppscotch. 📦 **Add-ons:** Official add-ons for hoppscotch.
- **[Proxy](https://github.com/hoppscotch/proxyscotch)** - A simple proxy server created for Hoppscotch - **[Proxy](https://github.com/hoppscotch/proxyscotch)** - A simple proxy server created for Hoppscotch

View File

@@ -9,7 +9,7 @@
label="HOPPSCOTCH" label="HOPPSCOTCH"
to="/" to="/"
/> />
<AppGitHubStarButton class="mt-1.5 transition" /> <AppGitHubStarButton class="mt-1.5 transition hidden sm:flex" />
</div> </div>
<div class="space-x-2 inline-flex items-center"> <div class="space-x-2 inline-flex items-center">
<ButtonSecondary <ButtonSecondary
@@ -20,13 +20,13 @@
class="rounded" class="rounded"
@click.native="showInstallPrompt()" @click.native="showInstallPrompt()"
/> />
<!-- <ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="`${$t('app.search')} <kbd>/</kbd>`" :title="`${$t('app.search')} <kbd>/</kbd>`"
svg="search" svg="search"
class="rounded" class="rounded"
@click.native="showSearch = true" @click.native="showSearch = true"
/> --> />
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="`${$t('support.title')} <kbd>?</kbd>`" :title="`${$t('support.title')} <kbd>?</kbd>`"
@@ -83,7 +83,7 @@
<AppAnnouncement v-if="!isOnLine" /> <AppAnnouncement v-if="!isOnLine" />
<FirebaseLogin :show="showLogin" @hide-modal="showLogin = false" /> <FirebaseLogin :show="showLogin" @hide-modal="showLogin = false" />
<AppSupport :show="showSupport" @hide-modal="showSupport = false" /> <AppSupport :show="showSupport" @hide-modal="showSupport = false" />
<!-- <AppSearch :show="showSearch" @hide-modal="showSearch = false" /> --> <AppSearch :show="showSearch" @hide-modal="showSearch = false" />
</div> </div>
</template> </template>
@@ -98,19 +98,19 @@ import { defineActionHandler } from "~/helpers/actions"
export default defineComponent({ export default defineComponent({
setup() { setup() {
const showSupport = ref(false) const showSupport = ref(false)
// const showSearch = ref(false) const showSearch = ref(false)
defineActionHandler("modals.support.toggle", () => { defineActionHandler("modals.support.toggle", () => {
showSupport.value = !showSupport.value showSupport.value = !showSupport.value
}) })
// defineActionHandler("modals.search.toggle", () => { defineActionHandler("modals.search.toggle", () => {
// showSearch.value = !showSearch.value showSearch.value = !showSearch.value
// }) })
return { return {
currentUser: useReadonlyStream(currentUser$, null), currentUser: useReadonlyStream(currentUser$, null),
showSupport, showSupport,
// showSearch, showSearch,
} }
}, },
data() { data() {

59
components/app/Lunr.vue Normal file
View File

@@ -0,0 +1,59 @@
<template>
<div key="outputHash">
<AppSearchEntry
v-for="(shortcut, shortcutIndex) in searchResults"
:key="`shortcut-${shortcutIndex}`"
:ref="`item-${shortcutIndex}`"
:shortcut="shortcut"
@action="$emit('action', shortcut.action)"
/>
<div
v-if="searchResults.length === 0"
class="flex flex-col text-secondaryLight p-4 items-center justify-center"
>
<i class="opacity-75 pb-2 material-icons">manage_search</i>
<span class="text-center">
{{ $t("state.nothing_found") }} "{{ search }}"
</span>
</div>
</div>
</template>
<script setup lang="ts">
import { computed } from "@nuxtjs/composition-api"
import lunr from "lunr"
const props = defineProps<{
input: Record<string, any>[]
search: string
}>()
const transformedInput = computed(() =>
props.input.map((val, i) => {
return {
__id: i,
...val,
}
})
)
const firstInput = computed(() =>
transformedInput.value.length > 0 ? transformedInput.value[0] : {}
)
const idx = computed(() => {
return lunr(function () {
this.ref("__id")
Object.keys(firstInput.value).forEach((key) => this.field(key), this)
transformedInput.value.forEach((doc) => {
this.add(doc)
}, this)
})
})
const searchResults = computed(() =>
idx.value.search(`${props.search}*`).map((result) => props.input[+result.ref])
)
</script>

View File

@@ -1,24 +1,31 @@
<template> <template>
<SmartModal v-if="show" @close="$emit('hide-modal')"> <SmartModal v-if="show" full-width @close="$emit('hide-modal')">
<template #body> <template #body>
<input <input
id="command" id="command"
v-model="search" v-model="search"
v-focus v-focus
type="text" type="text"
autocomplete="off"
name="command" name="command"
:placeholder="$t('app.type_a_command_search')" :placeholder="$t('app.type_a_command_search')"
class=" class="
bg-transparent bg-transparent
border-b border-dividerLight border-b border-dividerLight
flex flex-shrink-0
text-secondaryDark text-base text-secondaryDark text-base
leading-normal p-6
px-4
pt-2
pb-6
" "
/> />
<AppLunr
v-if="search"
log
:input="lunr"
:search="search"
@action="runAction"
/>
<div <div
v-else
class=" class="
divide-y divide-dividerLight divide-y divide-dividerLight
flex flex-col flex flex-col
@@ -28,96 +35,44 @@
hide-scrollbar hide-scrollbar
" "
> >
<div <div v-for="(map, mapIndex) in mappings" :key="`map-${mapIndex}`">
v-for="(map, mapIndex) in filteredMappings" <h5 class="my-2 text-secondaryLight py-2 px-6">
:key="`map-${mapIndex}`"
>
<h5 class="my-2 text-secondaryLight py-2 px-4">
{{ $t(map.section) }} {{ $t(map.section) }}
</h5> </h5>
<div <AppSearchEntry
v-for="(shortcut, shortcutIndex) in map.shortcuts" v-for="(shortcut, shortcutIndex) in map.shortcuts"
:key="`map-${mapIndex}-shortcut-${shortcutIndex}`" :key="`map-${mapIndex}-shortcut-${shortcutIndex}`"
class=" :shortcut="shortcut"
rounded @action="runAction"
cursor-pointer />
flex
py-2
px-4
transition
items-center
group
hover:bg-primaryLight
"
@click="
runAction(shortcut.action)
hideModal()
"
>
<i class="mr-4 opacity-75 material-icons group-hover:opacity-100">
{{ shortcut.icon }}
</i>
<span class="flex flex-1 mr-4 group-hover:text-secondaryDark">
{{ $t(shortcut.label) }}
</span>
<span
v-for="(key, keyIndex) in shortcut.keys"
:key="`map-${mapIndex}-shortcut-${shortcutIndex}-key-${keyIndex}`"
class="shortcut-key"
>
{{ key }}
</span>
</div>
</div> </div>
</div> </div>
</template> </template>
</SmartModal> </SmartModal>
</template> </template>
<script> <script setup lang="ts">
import { defineComponent } from "@nuxtjs/composition-api" import { ref } from "@nuxtjs/composition-api"
import { invokeAction } from "~/helpers/actions" import { HoppAction, invokeAction } from "~/helpers/actions"
import { spotlight } from "~/helpers/shortcuts" import { spotlight as mappings, lunr } from "~/helpers/shortcuts"
export default defineComponent({ defineProps<{
props: { show: boolean
show: Boolean, }>()
},
data() {
return {
search: "",
mappings: spotlight,
}
},
computed: {
filteredMappings() {
return this.mappings.filter((mapping) =>
mapping.shortcuts.some((shortcut) =>
shortcut.keywords.some((keyword) =>
keyword.toLowerCase().includes(this.search.toLowerCase())
)
)
)
},
},
methods: {
hideModal() {
this.$emit("hide-modal")
},
runAction(command) {
invokeAction(command, "path_from_invokeAction")
},
},
})
</script>
<style lang="scss" scoped> const emit = defineEmits<{
.shortcut-key { (e: "hide-modal"): void
@apply bg-dividerLight; }>()
@apply rounded;
@apply ml-2; const search = ref("")
@apply py-1;
@apply px-2; const hideModal = () => {
@apply inline-flex; search.value = ""
emit("hide-modal")
} }
</style>
const runAction = (command: HoppAction) => {
invokeAction(command)
hideModal()
}
</script>

View File

@@ -0,0 +1,66 @@
<template>
<div
class="
cursor-pointer
flex
py-2
px-6
transition
items-center
group
hover:bg-primaryLight
focus:outline-none
focus-visible:bg-primaryLight
"
tabindex="0"
@click="$emit('action', shortcut.action)"
@keydown.enter="$emit('action', shortcut.action)"
>
<SmartIcon
class="
mr-4
opacity-75
transition
svg-icons
group-hover:opacity-100
group-focus:opacity-100
"
:name="shortcut.icon"
/>
<span
class="
flex flex-1
mr-4
transition
group-hover:text-secondaryDark
group-focus:text-secondaryDark
"
>
{{ $t(shortcut.label) }}
</span>
<span
v-for="(key, keyIndex) in shortcut.keys"
:key="`key-${keyIndex}`"
class="shortcut-key"
>
{{ key }}
</span>
</div>
</template>
<script setup lang="ts">
defineProps<{
shortcut: Object
}>()
</script>
<style lang="scss" scoped>
.shortcut-key {
@apply bg-dividerLight;
@apply rounded;
@apply ml-2;
@apply py-1;
@apply px-2;
@apply inline-flex;
}
</style>

View File

@@ -19,11 +19,11 @@
<ButtonSecondary svg="x" class="rounded" @click.native="close()" /> <ButtonSecondary svg="x" class="rounded" @click.native="close()" />
</div> </div>
</div> </div>
<div class="bg-primary border-b border-dividerLight"> <!-- <div class="bg-primary border-b border-dividerLight">
<div class="flex flex-col my-4 mx-6"> <div class="flex flex-col my-4 mx-6">
<input <input
v-model="filterText" v-model="filterText"
type="search" type="search" autocomplete="off"
class=" class="
bg-primaryLight bg-primaryLight
border border-dividerLight border border-dividerLight
@@ -37,7 +37,7 @@
:placeholder="$t('action.search')" :placeholder="$t('action.search')"
/> />
</div> </div>
</div> </div> -->
<div <div
class=" class="
divide-y divide-dividerLight divide-y divide-dividerLight
@@ -86,7 +86,7 @@ export default defineComponent({
}, },
data() { data() {
return { return {
filterText: "", // filterText: "",
mappings: shortcuts, mappings: shortcuts,
} }
}, },

View File

@@ -9,6 +9,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="addNewCollection" @keyup.enter="addNewCollection"
/> />
<label for="selectLabelAdd"> <label for="selectLabelAdd">

View File

@@ -13,6 +13,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="addFolder" @keyup.enter="addFolder"
/> />
<label for="selectLabelAddFolder"> <label for="selectLabelAddFolder">

View File

@@ -16,6 +16,7 @@
<select <select
id="team" id="team"
type="text" type="text"
autocomplete="off"
autofocus autofocus
class=" class="
bg-transparent bg-transparent

View File

@@ -9,6 +9,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="saveCollection" @keyup.enter="saveCollection"
/> />
<label for="selectLabelEdit"> <label for="selectLabelEdit">

View File

@@ -13,6 +13,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="editFolder" @keyup.enter="editFolder"
/> />
<label for="selectLabelEditFolder"> <label for="selectLabelEditFolder">

View File

@@ -9,6 +9,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="saveRequest" @keyup.enter="saveRequest"
/> />
<label for="selectLabelEditReq"> <label for="selectLabelEditReq">

View File

@@ -127,6 +127,7 @@
<div class="select-wrapper"> <div class="select-wrapper">
<select <select
type="text" type="text"
autocomplete="off"
class="select" class="select"
autofocus autofocus
@change=" @change="

View File

@@ -10,6 +10,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="saveRequestAs" @keyup.enter="saveRequestAs"
/> />
<label for="selectLabelSaveReq"> <label for="selectLabelSaveReq">

View File

@@ -9,6 +9,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="addNewCollection" @keyup.enter="addNewCollection"
/> />
<label for="selectLabelGqlAdd"> <label for="selectLabelGqlAdd">

View File

@@ -13,6 +13,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="addFolder" @keyup.enter="addFolder"
/> />
<label for="selectLabelGqlAddFolder"> <label for="selectLabelGqlAddFolder">

View File

@@ -9,6 +9,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="saveCollection" @keyup.enter="saveCollection"
/> />
<label for="selectLabelGqlEdit"> <label for="selectLabelGqlEdit">

View File

@@ -13,6 +13,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="editFolder" @keyup.enter="editFolder"
/> />
<label for="selectLabelGqlEditFolder"> <label for="selectLabelGqlEditFolder">

View File

@@ -9,6 +9,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="saveRequest" @keyup.enter="saveRequest"
/> />
<label for="selectLabelGqlEditReq"> <label for="selectLabelGqlEditReq">

View File

@@ -18,6 +18,7 @@
v-if="showCollActions" v-if="showCollActions"
v-model="filterText" v-model="filterText"
type="search" type="search"
autocomplete="off"
:placeholder="$t('action.search')" :placeholder="$t('action.search')"
class="bg-transparent flex w-full py-2 px-4" class="bg-transparent flex w-full py-2 px-4"
/> />

View File

@@ -20,6 +20,7 @@
<input <input
v-model="filterText" v-model="filterText"
type="search" type="search"
autocomplete="off"
:placeholder="$t('action.search')" :placeholder="$t('action.search')"
class="bg-transparent flex w-full py-2 pr-2 pl-4" class="bg-transparent flex w-full py-2 pr-2 pl-4"
/> />

View File

@@ -9,6 +9,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="addNewEnvironment" @keyup.enter="addNewEnvironment"
/> />
<label for="selectLabelEnvAdd"> <label for="selectLabelEnvAdd">

View File

@@ -10,6 +10,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
:disabled="editingEnvironmentIndex === 'Global'" :disabled="editingEnvironmentIndex === 'Global'"
@keyup.enter="saveEnvironment" @keyup.enter="saveEnvironment"
/> />

View File

@@ -35,7 +35,7 @@
placeholder=" " placeholder=" "
type="email" type="email"
name="email" name="email"
autocomplete="email" autocomplete="off"
required required
spellcheck="false" spellcheck="false"
autofocus autofocus

View File

@@ -6,6 +6,7 @@
v-model="url" v-model="url"
v-focus v-focus
type="url" type="url"
autocomplete="off"
spellcheck="false" spellcheck="false"
class=" class="
bg-primaryLight bg-primaryLight

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<SmartTabs styles="sticky top-upperPrimaryStickyFold z-10"> <SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10">
<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

View File

@@ -1,12 +1,13 @@
<template> <template>
<aside> <aside>
<SmartTabs styles="sticky z-10 top-0"> <SmartTabs styles="sticky bg-primary z-10 top-0">
<SmartTab :id="'docs'" :label="`Docs`" :selected="true"> <SmartTab :id="'docs'" :label="`Docs`" :selected="true">
<AppSection label="docs"> <AppSection label="docs">
<div class="bg-primary flex top-sidebarPrimaryStickyFold z-10 sticky"> <div class="bg-primary flex top-sidebarPrimaryStickyFold z-10 sticky">
<input <input
v-model="graphqlFieldsFilterText" v-model="graphqlFieldsFilterText"
type="search" type="search"
autocomplete="off"
:placeholder="$t('action.search')" :placeholder="$t('action.search')"
class="bg-transparent flex w-full p-4 py-2" class="bg-transparent flex w-full p-4 py-2"
/> />
@@ -22,7 +23,7 @@
</div> </div>
<SmartTabs <SmartTabs
ref="gqlTabs" ref="gqlTabs"
styles="border-t border-dividerLight sticky z-10 top-sidebarSecondaryStickyFold" styles="border-t border-dividerLight bg-primary sticky z-10 top-sidebarSecondaryStickyFold"
> >
<div class="gqlTabs"> <div class="gqlTabs">
<SmartTab <SmartTab

View File

@@ -13,6 +13,7 @@
<input <input
v-model="filterText" v-model="filterText"
type="search" type="search"
autocomplete="off"
class="bg-transparent flex w-full p-4 py-2" class="bg-transparent flex w-full p-4 py-2"
:placeholder="$t('action.search')" :placeholder="$t('action.search')"
/> />

View File

@@ -84,6 +84,7 @@
" "
name="url" name="url"
type="text" type="text"
autocomplete="off"
spellcheck="false" spellcheck="false"
:placeholder="$t('request.url')" :placeholder="$t('request.url')"
autofocus autofocus
@@ -166,6 +167,7 @@
:placeholder="$t('request.name')" :placeholder="$t('request.name')"
name="request-name" name="request-name"
type="text" type="text"
autocomplete="off"
class="mb-2 input" class="mb-2 input"
@keyup.enter="saveOptions.tippy().hide()" @keyup.enter="saveOptions.tippy().hide()"
/> />

View File

@@ -1,5 +1,5 @@
<template> <template>
<SmartTabs styles="sticky z-10 top-lowerPrimaryStickyFold"> <SmartTabs styles="sticky z-10 bg-primary top-lowerPrimaryStickyFold">
<SmartTab <SmartTab
v-for="(lens, index) in validLenses" v-for="(lens, index) in validLenses"
:id="lens.renderer" :id="lens.renderer"

View File

@@ -11,6 +11,7 @@
v-model="url" v-model="url"
v-focus v-focus
type="url" type="url"
autocomplete="off"
spellcheck="false" spellcheck="false"
class=" class="
bg-primaryLight bg-primaryLight
@@ -69,6 +70,7 @@
class="input" class="input"
:placeholder="$t('mqtt.topic_name')" :placeholder="$t('mqtt.topic_name')"
type="text" type="text"
autocomplete="off"
spellcheck="false" spellcheck="false"
/> />
</div> </div>
@@ -83,6 +85,7 @@
v-model="msg" v-model="msg"
class="input" class="input"
type="text" type="text"
autocomplete="off"
:placeholder="$t('mqtt.message')" :placeholder="$t('mqtt.message')"
spellcheck="false" spellcheck="false"
/> />
@@ -112,6 +115,7 @@
id="sub_topic" id="sub_topic"
v-model="sub_topic" v-model="sub_topic"
type="text" type="text"
autocomplete="off"
:placeholder="$t('mqtt.topic_name')" :placeholder="$t('mqtt.topic_name')"
spellcheck="false" spellcheck="false"
class="input" class="input"

View File

@@ -12,6 +12,7 @@
v-model="url" v-model="url"
v-focus v-focus
type="url" type="url"
autocomplete="off"
spellcheck="false" spellcheck="false"
:class="{ error: !urlValid }" :class="{ error: !urlValid }"
class=" class="
@@ -94,6 +95,7 @@
name="event_name" name="event_name"
:placeholder="$t('socketio.event_name')" :placeholder="$t('socketio.event_name')"
type="text" type="text"
autocomplete="off"
:disabled="!connectionState" :disabled="!connectionState"
/> />
</div> </div>
@@ -123,6 +125,7 @@
name="message" name="message"
:placeholder="$t('count.message', { count: index + 1 })" :placeholder="$t('count.message', { count: index + 1 })"
type="text" type="text"
autocomplete="off"
:disabled="!connectionState" :disabled="!connectionState"
@keyup.enter="connectionState ? sendMessage() : null" @keyup.enter="connectionState ? sendMessage() : null"
/> />

View File

@@ -9,6 +9,7 @@
v-model="server" v-model="server"
v-focus v-focus
type="url" type="url"
autocomplete="off"
:class="{ error: !serverValid }" :class="{ error: !serverValid }"
class=" class="
bg-primaryLight bg-primaryLight

View File

@@ -23,6 +23,7 @@
focus-visible:border-dividerDark focus-visible:border-dividerDark
" "
type="url" type="url"
autocomplete="off"
spellcheck="false" spellcheck="false"
:class="{ error: !urlValid }" :class="{ error: !urlValid }"
:placeholder="$t('websocket.url')" :placeholder="$t('websocket.url')"
@@ -89,6 +90,7 @@
:placeholder="$t('count.protocol', { count: index + 1 })" :placeholder="$t('count.protocol', { count: index + 1 })"
name="message" name="message"
type="text" type="text"
autocomplete="off"
/> />
<span> <span>
<ButtonSecondary <ButtonSecondary
@@ -174,6 +176,7 @@
v-model="communication.input" v-model="communication.input"
name="message" name="message"
type="text" type="text"
autocomplete="off"
:disabled="!connectionState" :disabled="!connectionState"
:placeholder="$t('websocket.message')" :placeholder="$t('websocket.message')"
class="input" class="input"

View File

@@ -4,6 +4,7 @@
ref="acInput" ref="acInput"
v-model="text" v-model="text"
type="text" type="text"
autocomplete="off"
:placeholder="placeholder" :placeholder="placeholder"
:spellcheck="spellcheck" :spellcheck="spellcheck"
:autocapitalize="autocapitalize" :autocapitalize="autocapitalize"

View File

@@ -37,7 +37,6 @@
shadow-lg shadow-lg
text-left text-left
w-full w-full
p-4
transform transform
transition-all transition-all
inline-block inline-block
@@ -46,7 +45,10 @@
sm:max-w-md sm:align-middle sm:max-w-md sm:align-middle
md:rounded-lg md:rounded-lg
" "
:class="{ 'mt-24 md:mb-8': placement === 'top' }" :class="[
{ 'mt-24 md:mb-8': placement === 'top' },
{ 'p-4': !fullWidth },
]"
> >
<div <div
v-if="title" v-if="title"
@@ -64,7 +66,8 @@
</span> </span>
</div> </div>
<div <div
class="flex flex-col max-h-md py-2 overflow-y-auto hide-scrollbar" class="flex flex-col max-h-md overflow-y-auto hide-scrollbar"
:class="{ 'py-2': !fullWidth }"
> >
<slot name="body"></slot> <slot name="body"></slot>
</div> </div>
@@ -115,6 +118,10 @@ export default defineComponent({
type: String, type: String,
default: "top", default: "top",
}, },
fullWidth: {
type: Boolean,
default: false,
},
}, },
setup() { setup() {
const { disableKeybindings, enableKeybindings } = useKeybindingDisabler() const { disableKeybindings, enableKeybindings } = useKeybindingDisabler()

View File

@@ -69,7 +69,6 @@ export default defineComponent({
@apply flex; @apply flex;
@apply whitespace-nowrap; @apply whitespace-nowrap;
@apply overflow-auto; @apply overflow-auto;
@apply bg-primary;
// &::after { // &::after {
// @apply absolute; // @apply absolute;

View File

@@ -6,7 +6,7 @@
<label ref="toggle" class="toggle" :class="{ on: on }"> <label ref="toggle" class="toggle" :class="{ on: on }">
<span class="handle"></span> <span class="handle"></span>
</label> </label>
<label class="cursor-pointer pl-0 align-middle truncate"> <label class="cursor-pointer pl-0 align-middle">
<slot></slot> <slot></slot>
</label> </label>
</div> </div>

View File

@@ -9,6 +9,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="addNewTeam" @keyup.enter="addNewTeam"
/> />
<label for="selectLabelTeamAdd"> <label for="selectLabelTeamAdd">

View File

@@ -10,6 +10,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="text" type="text"
autocomplete="off"
@keyup.enter="saveTeam" @keyup.enter="saveTeam"
/> />
<label for="selectLabelTeamEdit"> <label for="selectLabelTeamEdit">

View File

@@ -4,14 +4,14 @@ export default [
{ {
section: "shortcut.general.title", section: "shortcut.general.title",
shortcuts: [ shortcuts: [
// { {
// keys: ["?"], keys: ["?"],
// label: "shortcut.general.help_menu", label: "shortcut.general.help_menu",
// }, },
// { {
// keys: ["/"], keys: ["/"],
// label: "shortcut.general.command_menu", label: "shortcut.general.command_menu",
// }, },
{ {
keys: [getPlatformSpecialKey(), "K"], keys: [getPlatformSpecialKey(), "K"],
label: "shortcut.general.show_all", label: "shortcut.general.show_all",
@@ -104,15 +104,15 @@ export default [
}, },
], ],
}, },
// { {
// section: "shortcut.miscellaneous.title", section: "shortcut.miscellaneous.title",
// shortcuts: [ shortcuts: [
// { {
// keys: [getPlatformSpecialKey(), "M"], keys: [getPlatformSpecialKey(), "M"],
// label: "shortcut.miscellaneous.invite", label: "shortcut.miscellaneous.invite",
// }, },
// ], ],
// }, },
] ]
export const spotlight = [ export const spotlight = [
@@ -123,27 +123,13 @@ export const spotlight = [
keys: ["?"], keys: ["?"],
label: "shortcut.general.help_menu", label: "shortcut.general.help_menu",
action: "modals.support.toggle", action: "modals.support.toggle",
icon: "support", icon: "life-buoy",
keywords: [
"help",
"support",
"documentation",
"troubleshooting",
"chat",
"community",
"feedback",
"report",
"bug",
"issue",
"ticket",
],
}, },
{ {
keys: [getPlatformSpecialKey(), "K"], keys: [getPlatformSpecialKey(), "K"],
label: "shortcut.general.show_all", label: "shortcut.general.show_all",
action: "flyouts.keybinds.toggle", action: "flyouts.keybinds.toggle",
icon: "keyboard", icon: "zap",
keywords: ["keyboard", "shortcuts"],
}, },
], ],
}, },
@@ -154,68 +140,43 @@ export const spotlight = [
keys: [getPlatformSpecialKey(), "←"], keys: [getPlatformSpecialKey(), "←"],
label: "shortcut.navigation.back", label: "shortcut.navigation.back",
action: "navigation.jump.back", action: "navigation.jump.back",
icon: "arrow_forward", icon: "arrow-right",
keywords: ["back", "jump", "page", "navigation", "go"],
}, },
{ {
keys: [getPlatformSpecialKey(), "→"], keys: [getPlatformSpecialKey(), "→"],
label: "shortcut.navigation.forward", label: "shortcut.navigation.forward",
action: "navigation.jump.forward", action: "navigation.jump.forward",
icon: "arrow_forward", icon: "arrow-right",
keywords: ["forward", "jump", "page", "navigation", "go"],
}, },
{ {
keys: [getPlatformAlternateKey(), "R"], keys: [getPlatformAlternateKey(), "R"],
label: "shortcut.navigation.rest", label: "shortcut.navigation.rest",
action: "navigation.jump.rest", action: "navigation.jump.rest",
icon: "arrow_forward", icon: "arrow-right",
keywords: ["rest", "jump", "page", "navigation", "go"],
}, },
{ {
keys: [getPlatformAlternateKey(), "Q"], keys: [getPlatformAlternateKey(), "Q"],
label: "shortcut.navigation.graphql", label: "shortcut.navigation.graphql",
action: "navigation.jump.graphql", action: "navigation.jump.graphql",
icon: "arrow_forward", icon: "arrow-right",
keywords: ["graphql", "jump", "page", "navigation", "go"],
}, },
{ {
keys: [getPlatformAlternateKey(), "W"], keys: [getPlatformAlternateKey(), "W"],
label: "shortcut.navigation.realtime", label: "shortcut.navigation.realtime",
action: "navigation.jump.realtime", action: "navigation.jump.realtime",
icon: "arrow_forward", icon: "arrow-right",
keywords: [
"realtime",
"jump",
"page",
"navigation",
"websocket",
"socket",
"mqtt",
"sse",
"go",
],
}, },
{ {
keys: [getPlatformAlternateKey(), "D"], keys: [getPlatformAlternateKey(), "D"],
label: "shortcut.navigation.documentation", label: "shortcut.navigation.documentation",
action: "navigation.jump.documentation", action: "navigation.jump.documentation",
icon: "arrow_forward", icon: "arrow-right",
keywords: ["documentation", "jump", "page", "navigation", "go"],
}, },
{ {
keys: [getPlatformAlternateKey(), "S"], keys: [getPlatformAlternateKey(), "S"],
label: "shortcut.navigation.settings", label: "shortcut.navigation.settings",
action: "navigation.jump.settings", action: "navigation.jump.settings",
icon: "arrow_forward", icon: "arrow-right",
keywords: [
"settings",
"jump",
"page",
"navigation",
"account",
"theme",
"go",
],
}, },
], ],
}, },
@@ -226,9 +187,81 @@ export const spotlight = [
keys: [getPlatformSpecialKey(), "M"], keys: [getPlatformSpecialKey(), "M"],
label: "shortcut.miscellaneous.invite", label: "shortcut.miscellaneous.invite",
action: "modals.share.toggle", action: "modals.share.toggle",
icon: "person_add_alt", icon: "gift",
keywords: ["invite", "share", "app", "social"],
}, },
], ],
}, },
] ]
export const lunr = [
{
keys: ["?"],
label: "shortcut.general.help_menu",
action: "modals.support.toggle",
icon: "life-buoy",
tags: "help support menu discord twitter documentation troubleshooting chat community feedback report bug issue ticket",
},
{
keys: [getPlatformSpecialKey(), "K"],
label: "shortcut.general.show_all",
action: "flyouts.keybinds.toggle",
icon: "zap",
tags: "keyboard shortcuts",
},
{
keys: [getPlatformSpecialKey(), "←"],
label: "shortcut.navigation.back",
action: "navigation.jump.back",
icon: "arrow-right",
tags: "back jump page navigation go",
},
{
keys: [getPlatformSpecialKey(), "→"],
label: "shortcut.navigation.forward",
action: "navigation.jump.forward",
icon: "arrow-right",
tags: "forward jump next forward page navigation go",
},
{
keys: [getPlatformAlternateKey(), "R"],
label: "shortcut.navigation.rest",
action: "navigation.jump.rest",
icon: "arrow-right",
tags: "rest jump page navigation go",
},
{
keys: [getPlatformAlternateKey(), "Q"],
label: "shortcut.navigation.graphql",
action: "navigation.jump.graphql",
icon: "arrow-right",
tags: "graphql jump page navigation go",
},
{
keys: [getPlatformAlternateKey(), "W"],
label: "shortcut.navigation.realtime",
action: "navigation.jump.realtime",
icon: "arrow-right",
tags: "realtime jump page navigation websocket socket mqtt sse go",
},
{
keys: [getPlatformAlternateKey(), "D"],
label: "shortcut.navigation.documentation",
action: "navigation.jump.documentation",
icon: "arrow-right",
tags: "documentation jump page navigation go",
},
{
keys: [getPlatformAlternateKey(), "S"],
label: "shortcut.navigation.settings",
action: "navigation.jump.settings",
icon: "arrow-right",
tags: "settings jump page navigation account theme go",
},
{
keys: [getPlatformSpecialKey(), "M"],
label: "shortcut.miscellaneous.invite",
action: "modals.share.toggle",
icon: "gift",
tags: "invite share app friends people social",
},
]

View File

@@ -181,7 +181,7 @@ export default {
position: "bottom-center", position: "bottom-center",
duration: 3000, duration: 3000,
keepOnHover: true, keepOnHover: true,
singleton: true, // singleton: true,
}, },
// Google Analytics module configuration (https://github.com/nuxt-community/analytics-module) // Google Analytics module configuration (https://github.com/nuxt-community/analytics-module)

24
package-lock.json generated
View File

@@ -25,6 +25,7 @@
"graphql-language-service-interface": "^2.8.4", "graphql-language-service-interface": "^2.8.4",
"json-loader": "^0.5.7", "json-loader": "^0.5.7",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"lunr": "^2.3.9",
"mustache": "^4.2.0", "mustache": "^4.2.0",
"node-interval-tree": "^1.3.3", "node-interval-tree": "^1.3.3",
"nuxt": "^2.15.8", "nuxt": "^2.15.8",
@@ -60,6 +61,7 @@
"@testing-library/jest-dom": "^5.14.1", "@testing-library/jest-dom": "^5.14.1",
"@types/cookie": "^0.4.1", "@types/cookie": "^0.4.1",
"@types/lodash": "^4.14.172", "@types/lodash": "^4.14.172",
"@types/lunr": "^2.3.4",
"@types/splitpanes": "^2.2.1", "@types/splitpanes": "^2.2.1",
"@vue/runtime-dom": "^3.2.6", "@vue/runtime-dom": "^3.2.6",
"@vue/test-utils": "^1.2.2", "@vue/test-utils": "^1.2.2",
@@ -8126,6 +8128,12 @@
"resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz",
"integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w=="
}, },
"node_modules/@types/lunr": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/@types/lunr/-/lunr-2.3.4.tgz",
"integrity": "sha512-j4x4XJwZvorEUbA519VdQ5b9AOU9TSvfi8tvxMAfP8XzNLtFex7A8vFQwqOx3WACbV0KMXbACV3cZl4/gynQ7g==",
"dev": true
},
"node_modules/@types/mdast": { "node_modules/@types/mdast": {
"version": "3.0.7", "version": "3.0.7",
"resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.7.tgz", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.7.tgz",
@@ -23215,6 +23223,11 @@
"yallist": "^3.0.2" "yallist": "^3.0.2"
} }
}, },
"node_modules/lunr": {
"version": "2.3.9",
"resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
"integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow=="
},
"node_modules/magic-string": { "node_modules/magic-string": {
"version": "0.25.7", "version": "0.25.7",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
@@ -42032,6 +42045,12 @@
"resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz",
"integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w=="
}, },
"@types/lunr": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/@types/lunr/-/lunr-2.3.4.tgz",
"integrity": "sha512-j4x4XJwZvorEUbA519VdQ5b9AOU9TSvfi8tvxMAfP8XzNLtFex7A8vFQwqOx3WACbV0KMXbACV3cZl4/gynQ7g==",
"dev": true
},
"@types/mdast": { "@types/mdast": {
"version": "3.0.7", "version": "3.0.7",
"resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.7.tgz", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.7.tgz",
@@ -53735,6 +53754,11 @@
"yallist": "^3.0.2" "yallist": "^3.0.2"
} }
}, },
"lunr": {
"version": "2.3.9",
"resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
"integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow=="
},
"magic-string": { "magic-string": {
"version": "0.25.7", "version": "0.25.7",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",

View File

@@ -41,6 +41,7 @@
"graphql-language-service-interface": "^2.8.4", "graphql-language-service-interface": "^2.8.4",
"json-loader": "^0.5.7", "json-loader": "^0.5.7",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"lunr": "^2.3.9",
"mustache": "^4.2.0", "mustache": "^4.2.0",
"node-interval-tree": "^1.3.3", "node-interval-tree": "^1.3.3",
"nuxt": "^2.15.8", "nuxt": "^2.15.8",
@@ -76,6 +77,7 @@
"@testing-library/jest-dom": "^5.14.1", "@testing-library/jest-dom": "^5.14.1",
"@types/cookie": "^0.4.1", "@types/cookie": "^0.4.1",
"@types/lodash": "^4.14.172", "@types/lodash": "^4.14.172",
"@types/lunr": "^2.3.4",
"@types/splitpanes": "^2.2.1", "@types/splitpanes": "^2.2.1",
"@vue/runtime-dom": "^3.2.6", "@vue/runtime-dom": "^3.2.6",
"@vue/test-utils": "^1.2.2", "@vue/test-utils": "^1.2.2",

View File

@@ -4,7 +4,7 @@
<Splitpanes class="smart-splitter" :dbl-click-splitter="false" horizontal> <Splitpanes class="smart-splitter" :dbl-click-splitter="false" horizontal>
<Pane class="hide-scrollbar !overflow-auto"> <Pane class="hide-scrollbar !overflow-auto">
<HttpRequest /> <HttpRequest />
<SmartTabs styles="sticky top-upperPrimaryStickyFold z-10"> <SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10">
<SmartTab <SmartTab
:id="'params'" :id="'params'"
:label="$t('tab.parameters')" :label="$t('tab.parameters')"
@@ -55,7 +55,7 @@
class="hide-scrollbar !overflow-auto" class="hide-scrollbar !overflow-auto"
> >
<aside> <aside>
<SmartTabs styles="sticky z-10 top-0"> <SmartTabs styles="sticky bg-primary z-10 top-0">
<SmartTab :id="'history'" :label="$t('tab.history')" :selected="true"> <SmartTab :id="'history'" :label="$t('tab.history')" :selected="true">
<History ref="historyComponent" :page="'rest'" /> <History ref="historyComponent" :page="'rest'" />
</SmartTab> </SmartTab>

View File

@@ -1,7 +1,7 @@
<template> <template>
<SmartTabs <SmartTabs
class="h-full overflow-hidden" class="h-full overflow-hidden"
styles="sticky 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
id="websocket" id="websocket"

View File

@@ -305,6 +305,7 @@
class="input floating-input" class="input floating-input"
placeholder=" " placeholder=" "
type="url" type="url"
autocomplete="off"
:disabled="!PROXY_ENABLED" :disabled="!PROXY_ENABLED"
/> />
<label for="url"> <label for="url">