chore: add open app link

This commit is contained in:
nivedin
2023-12-05 22:00:26 +05:30
committed by Andrew Bastin
parent bb0bf35164
commit fbca9b06c3
2 changed files with 20 additions and 3 deletions

View File

@@ -10,7 +10,11 @@
to="/"
/>
<div class="flex">
<HoppSmartItem :label="t('app.open_in_hoppscotch')" />
<HoppSmartItem
:label="t('app.open_in_hoppscotch')"
:to="sharedRequestURL"
blank
/>
</div>
</div>
</header>
@@ -96,7 +100,6 @@
</div>
<div>
{{ tab.document.response }}
<HttpResponse :document="tab.document" />
</div>
</div>
@@ -122,6 +125,8 @@ const toast = useToast()
const props = defineProps<{
modelTab: HoppTab<HoppRESTDocument>
properties: string[]
sharedRequestID: string
}>()
const tab = useModel(props, "modelTab")
@@ -134,6 +139,11 @@ const requestCancelFunc: Ref<(() => void) | null> = ref(null)
const loading = ref(false)
const baseURL = import.meta.env.VITE_SHORTCODE_BASE_URL ?? "https://hopp.sh"
const sharedRequestURL = computed(() => {
return `${baseURL}/r/${props.sharedRequestID}`
})
const methods = [
"GET",
"POST",

View File

@@ -1,6 +1,11 @@
<template>
<div class="flex flex-col flex-1 w-full">
<Embeds v-if="tab" v-model:modelTab="tab" />
<Embeds
v-if="tab"
v-model:modelTab="tab"
:properties="properties"
:shared-request-i-d="sharedRequestID"
/>
</div>
</template>
@@ -28,6 +33,7 @@ const route = useRoute()
const sharedRequestID = ref("")
const invalidLink = ref(false)
const properties = ref([])
const sharedRequestDetails = useGQLQuery<
ResolveShortcodeQuery,
@@ -81,6 +87,7 @@ watch(
applySetting("BG_COLOR", "system")
}
console.log("properties", JSON.parse(data.right.shortcode.properties))
properties.value = parsedProperties.options
}
}
}