diff --git a/assets/scss/styles.scss b/assets/scss/styles.scss index 686631a90..f54c9535e 100644 --- a/assets/scss/styles.scss +++ b/assets/scss/styles.scss @@ -35,12 +35,14 @@ @apply text-accentContrast; } -input::placeholder { +input::placeholder, +textarea::placeholder { @apply text-secondaryDark; @apply opacity-25; } -input { +input, +textarea { @apply text-secondaryDark; @apply font-medium; } @@ -194,7 +196,7 @@ hr { .input, .select, .textarea { - @apply flex flex-1; + @apply flex; @apply w-full; @apply px-4 py-2; @apply bg-transparent; diff --git a/components/graphql/RequestOptions.vue b/components/graphql/RequestOptions.vue index 6e79dcd99..0aba1a240 100644 --- a/components/graphql/RequestOptions.vue +++ b/components/graphql/RequestOptions.vue @@ -27,6 +27,13 @@ class="rounded-none !text-accent" @click.native="runQuery()" /> +
+
+ +
-
- + - - - - - - - -
-
- - {{ $t("empty.headers") }} - - + + + + + + +
+
+ + {{ $t("empty.headers") }} + + +
@@ -311,6 +364,25 @@ export default defineComponent({ const t = i18n.t.bind(i18n) const nuxt = useNuxt() + const bulkMode = ref(false) + const bulkHeaders = ref("") + + watch(bulkHeaders, () => { + try { + const transformation = bulkHeaders.value.split("\n").map((item) => ({ + key: item.substring(0, item.indexOf(":")).trim().replace(/^\/\//, ""), + value: item.substring(item.indexOf(":") + 1).trim(), + active: !item.trim().startsWith("//"), + })) + setGQLHeaders(transformation) + } catch (e) { + $toast.error(t("error.something_went_wrong").toString(), { + icon: "error_outline", + }) + console.error(e) + } + }) + const url = useReadonlyStream(gqlURL$, "") const gqlQueryString = useStream(gqlQuery$, "", setGQLQuery) const variableString = useStream(gqlVariables$, "", setGQLVariables) @@ -475,6 +547,8 @@ export default defineComponent({ commonHeaders, updateGQLHeader, + bulkMode, + bulkHeaders, } }, }) diff --git a/components/http/Headers.vue b/components/http/Headers.vue index 924a2fdd3..3294219b8 100644 --- a/components/http/Headers.vue +++ b/components/http/Headers.vue @@ -28,139 +28,185 @@ v-tippy="{ theme: 'tooltip' }" :title="$t('action.clear_all')" svg="trash-2" + :disabled="bulkMode" @click.native="clearContent" /> + -
- + - - - - + - - - - -
-
- - {{ $t("empty.headers") }} - - + + + + + + + +
+
+ + {{ $t("empty.headers") }} + + +