Skip to content

Commit 59372d0

Browse files
committed
add button to run cypher queries on iyp browser
1 parent e9f6411 commit 59372d0

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

src/components/controllers/IypController.vue

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import {
1616
useQuasar,
1717
exportFile,
1818
QMarkupTable,
19-
copyToClipboard
19+
copyToClipboard,
20+
uid
2021
} from 'quasar'
2122
import { useRoute, useRouter } from 'vue-router'
2223
import Tr from '@/i18n/translation'
@@ -402,22 +403,28 @@ onMounted(() => {
402403
</QTable>
403404
</QTabPanel>
404405
<QTabPanel name="api" class="text-left q-pa-lg" light>
405-
<QBtn
406-
no-caps
407-
dense
408-
flat
409-
@click="copyToClipboard(cypherQuery.replace(/^\s+|\s+$/gm, ''))"
410-
style="width: 100%"
411-
align="left"
412-
>
406+
<div>
413407
<pre
414408
style="text-align: left"
415409
><code style="white-space: pre-wrap;" v-html="hljs.highlight(cypherQuery.replace(/^\s+|\s+$/gm, ''), { language: 'cypher' }).value"></code></pre>
416-
<QTooltip>Click to copy</QTooltip>
417-
</QBtn>
410+
</div>
411+
<div class="row">
412+
<QBtn
413+
label="Copy query"
414+
color="secondary"
415+
class="q-mr-md"
416+
@click="copyToClipboard(cypherQuery.replace(/^\s+|\s+$/gm, ''))"
417+
/>
418+
<QBtn
419+
label="Run query to IYP"
420+
color="secondary"
421+
:href="`https://iyp.iijlab.net/browser/?session=[${encodeURIComponent(JSON.stringify({ query: cypherQuery.replace(/^\s+|\s+$/gm, ''), uuid: uid() }))}]`"
422+
target="_blank"
423+
/>
424+
</div>
418425
<div>
419426
<br />IYP Public Instance Link:
420-
<a href="https://iyp.iijlab.net/">https://iyp.iijlab.net/</a>
427+
<a href="https://iyp.iijlab.net/" target="_blank">https://iyp.iijlab.net/</a>
421428
</div>
422429
</QTabPanel>
423430
<QTabPanel name="metadata">

0 commit comments

Comments
 (0)