Compare commits
2 Commits
release/20
...
fix/embed-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a267e9c411 | ||
|
|
b53ae0cefe |
@@ -105,9 +105,11 @@ const requestCancelFunc: Ref<(() => void) | null> = ref(null)
|
|||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
const baseURL = import.meta.env.VITE_SHORTCODE_BASE_URL ?? "https://hopp.sh"
|
const shortcodeBaseURL =
|
||||||
|
import.meta.env.VITE_SHORTCODE_BASE_URL ?? "https://hopp.sh"
|
||||||
|
|
||||||
const sharedRequestURL = computed(() => {
|
const sharedRequestURL = computed(() => {
|
||||||
return `${baseURL}/r/${props.sharedRequestID}`
|
return `${shortcodeBaseURL}/r/${props.sharedRequestID}`
|
||||||
})
|
})
|
||||||
|
|
||||||
const { subscribeToStream } = useStreamSubscriber()
|
const { subscribeToStream } = useStreamSubscriber()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div
|
<div
|
||||||
class="sticky top-0 z-10 flex flex-shrink-0 flex-col overflow-x-auto border-b border-dividerLight bg-primary"
|
class="sticky top-0 z-10 flex flex-shrink-0 flex-col overflow-x-auto border-b border-dividerLight bg-primary"
|
||||||
>
|
>
|
||||||
<WorkspaceCurrent :section="t('tab.history')" />
|
<WorkspaceCurrent :section="t('tab.history')" :is-only-personal="true" />
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<input
|
<input
|
||||||
v-model="filterText"
|
v-model="filterText"
|
||||||
|
|||||||
@@ -180,6 +180,18 @@
|
|||||||
class="input mb-2 !bg-primaryContrast"
|
class="input mb-2 !bg-primaryContrast"
|
||||||
@keyup.enter="hide()"
|
@keyup.enter="hide()"
|
||||||
/>
|
/>
|
||||||
|
<HoppSmartItem
|
||||||
|
ref="saveRequestAction"
|
||||||
|
:label="`${t('request.save_as')}`"
|
||||||
|
:icon="IconFolderPlus"
|
||||||
|
@click="
|
||||||
|
() => {
|
||||||
|
showSaveRequestModal = true
|
||||||
|
hide()
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<hr />
|
||||||
<HoppSmartItem
|
<HoppSmartItem
|
||||||
ref="copyRequestAction"
|
ref="copyRequestAction"
|
||||||
:label="t('request.share_request')"
|
:label="t('request.share_request')"
|
||||||
@@ -192,18 +204,6 @@
|
|||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<hr />
|
|
||||||
<HoppSmartItem
|
|
||||||
ref="saveRequestAction"
|
|
||||||
:label="`${t('request.save_as')}`"
|
|
||||||
:icon="IconFolderPlus"
|
|
||||||
@click="
|
|
||||||
() => {
|
|
||||||
showSaveRequestModal = true
|
|
||||||
hide()
|
|
||||||
}
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</tippy>
|
</tippy>
|
||||||
|
|||||||
@@ -370,10 +370,11 @@ const linkVariants: LinkVariant[] = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const baseURL = import.meta.env.VITE_SHORTCODE_BASE_URL ?? "https://hopp.sh"
|
const shortcodeBaseURL =
|
||||||
|
import.meta.env.VITE_SHORTCODE_BASE_URL ?? "https://hopp.sh"
|
||||||
|
|
||||||
const copyEmbed = () => {
|
const copyEmbed = () => {
|
||||||
return `<iframe src="${baseURL}/e/${props.request?.id}' style='width: 100%; height: 500px; border: 0; border-radius: 4px; overflow: hidden;'></iframe>`
|
return `<iframe src="${shortcodeBaseURL}/e/${props.request?.id}" title="Hoppscotch Embed" style="width: 100%; height: 480px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.1);"></iframe>`
|
||||||
}
|
}
|
||||||
|
|
||||||
const copyButton = (
|
const copyButton = (
|
||||||
@@ -390,18 +391,18 @@ const copyButton = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type === "markdown") {
|
if (type === "markdown") {
|
||||||
return `[](${baseURL}/r/${props.request?.id})`
|
return `[](${shortcodeBaseURL}/r/${props.request?.id})`
|
||||||
}
|
}
|
||||||
return `<a href="${baseURL}/r/${props.request?.id}"><img src="${baseURL}/${badge}" alt="Run in Hoppscotch" /></a>`
|
return `<a href="${shortcodeBaseURL}/r/${props.request?.id}"><img src="${shortcodeBaseURL}/${badge}" alt="Run in Hoppscotch" /></a>`
|
||||||
}
|
}
|
||||||
|
|
||||||
const copyLink = (variationID: string) => {
|
const copyLink = (variationID: string) => {
|
||||||
if (variationID === "link1") {
|
if (variationID === "link1") {
|
||||||
return `${baseURL}/r/${props.request?.id}`
|
return `${shortcodeBaseURL}/r/${props.request?.id}`
|
||||||
} else if (variationID === "link2") {
|
} else if (variationID === "link2") {
|
||||||
return `<a href="${baseURL}/r/${props.request?.id}">Run in Hoppscotch</a>`
|
return `<a href="${shortcodeBaseURL}/r/${props.request?.id}">Run in Hoppscotch</a>`
|
||||||
}
|
}
|
||||||
return `[Run in Hoppscotch](${baseURL}/r/${props.request?.id})`
|
return `[Run in Hoppscotch](${shortcodeBaseURL}/r/${props.request?.id})`
|
||||||
}
|
}
|
||||||
|
|
||||||
const copyContent = ({
|
const copyContent = ({
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
>
|
>
|
||||||
<HoppButtonSecondary
|
<HoppButtonSecondary
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
to="https://docs.hoppscotch.io/documentation/features/shared-request"
|
to="https://docs.hoppscotch.io/documentation/features/share-requests"
|
||||||
blank
|
blank
|
||||||
:title="t('app.wiki')"
|
:title="t('app.wiki')"
|
||||||
:icon="IconHelpCircle"
|
:icon="IconHelpCircle"
|
||||||
|
|||||||
@@ -21,7 +21,12 @@ const props = defineProps<{
|
|||||||
label?: string | undefined
|
label?: string | undefined
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
const shortcodeBaseURL =
|
||||||
|
import.meta.env.VITE_SHORTCODE_BASE_URL ?? "https://hopp.sh"
|
||||||
|
|
||||||
const text = computed(() => {
|
const text = computed(() => {
|
||||||
return props.label ? t(props.label) : `hopp.sh/r/${props.link ?? "xxxx"}`
|
return props.label
|
||||||
|
? t(props.label)
|
||||||
|
: `${shortcodeBaseURL}/r/${props.link ?? "xxxx"}`
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<HoppSmartLink
|
<HoppSmartLink
|
||||||
:to="to"
|
:to="to"
|
||||||
:blank="blank"
|
:blank="blank"
|
||||||
class="button-primary relative inline-flex items-center justify-center whitespace-nowrap py-2 font-semibold transition focus:outline-none focus-visible:bg-accentDark"
|
class="relative inline-flex items-center justify-center whitespace-nowrap py-2 font-semibold transition focus:outline-none focus-visible:bg-accentDark"
|
||||||
:exact="exact"
|
:exact="exact"
|
||||||
:class="[
|
:class="[
|
||||||
color
|
color
|
||||||
|
|||||||
Reference in New Issue
Block a user