@@ -3,35 +3,24 @@ import { ref, inject, onMounted } from 'vue'
33import InputPanel from ' @/components/InputPanel.vue'
44import GraphOutput from ' @/components/output/GraphOutput.vue'
55import TableOutput from ' @/components/output/TableOutput.vue'
6- import ExplanationOutput from ' @/components/output/ExplanationOutput.vue'
76import { version } from ' ../../package.json'
87import interact from ' interactjs'
98import Iframe from ' @/components/Iframe.vue'
109
1110const Neo4jApi = inject (' Neo4jApi' )
12- const LlmApi = inject (' LlmApi' )
1311const GlobalVariables = inject (' GlobalVariables' )
1412
1513const emits = defineEmits ([' clear' , ' share' , ' update' ])
1614
17- const props = defineProps ([
18- ' query' ,
19- ' queryTypeInput' ,
20- ' disableInput' ,
21- ' disableTopBar' ,
22- ' disableResizer'
23- ])
15+ const props = defineProps ([' query' , ' disableInput' , ' disableTopBar' , ' disableResizer' ])
2416
2517const cypherQuery = ref (' ' )
26- const textQuery = ref (' ' )
27- const queryType = ref (' ' )
2818const tab = ref (' graph' )
2919const loading = ref (false )
3020const nodes = ref ([])
3121const relationships = ref ([])
3222const rows = ref ([])
3323const columns = ref ([])
34- const explanationText = ref (' ' )
3524const errorText = ref (' ' )
3625const outputPanel = ref ()
3726const isFullscreen = ref (false )
@@ -56,35 +45,17 @@ const runCypher = async (cypher) => {
5645 relationships .value = []
5746 rows .value = []
5847 columns .value = []
59- explanationText .value = []
6048 }
6149 loading .value = false
6250}
6351
64- const runLlm = async (text ) => {
65- loading .value = true
66- const res = await LlmApi .run (text)
67- cypherQuery .value = res .cypher
68- explanationText .value = res .explanation
69- runCypher (cypherQuery .value )
70- loading .value = false
71- }
72-
73- const run = async (queryInput , queryInputType ) => {
74- queryType .value = queryInputType
52+ const run = async (queryInput ) => {
7553 errorText .value = ' '
7654 tab .value = ' graph'
77- if (queryType .value === ' cypher' ) {
78- cypherQuery .value = queryInput
79- textQuery .value = ' '
80- runCypher (cypherQuery .value )
81- } else {
82- textQuery .value = queryInput
83- runLlm (textQuery .value )
84- }
55+ cypherQuery .value = queryInput
56+ runCypher (cypherQuery .value )
8557 emits (' update' , {
86- query: queryInput,
87- queryType: queryInputType
58+ query: queryInput
8859 })
8960}
9061
@@ -121,7 +92,7 @@ const changeTab = (tabName) => {
12192}
12293
12394onMounted (() => {
124- run (props .query , props . queryTypeInput )
95+ run (props .query )
12596 if (! props .disableResizer ) {
12697 interact (outputPanel .value )
12798 .origin (' self' )
@@ -151,7 +122,7 @@ onMounted(() => {
151122 <q-btn dense flat icon =" link" color =" white" @click =" emits('share')" >
152123 <q-tooltip >Share</q-tooltip >
153124 </q-btn >
154- <Iframe :query =" cypherQuery" :query-type = " queryType " />
125+ <Iframe :query =" cypherQuery" />
155126 <q-btn
156127 dense
157128 flat
@@ -168,8 +139,6 @@ onMounted(() => {
168139 <InputPanel
169140 v-if =" !disableInput"
170141 :cypher-input =" cypherQuery"
171- :text-input =" textQuery"
172- :active-tab =" queryType"
173142 :serve-in-output =" true"
174143 @run =" run"
175144 @clear =" emits('clear')"
@@ -180,12 +149,6 @@ onMounted(() => {
180149 <q-btn-group outline class =" output-tabs q-ml-md q-pt-sm" >
181150 <q-btn outline label =" Graph" v-if =" nodes.length" @click =" changeTab('graph')" />
182151 <q-btn outline label =" Table" v-if =" rows.length" @click =" changeTab('table')" />
183- <q-btn
184- outline
185- label =" Explanation"
186- v-if =" textQuery !== ''"
187- @click =" changeTab('explanation')"
188- />
189152 <q-btn outline label =" Error" v-if =" errorText !== ''" @click =" changeTab('error')" />
190153 </q-btn-group >
191154 <q-tab-panels v-model =" tab" vertical class =" output-panels" >
@@ -200,9 +163,6 @@ onMounted(() => {
200163 <q-tab-panel name =" table" v-if =" rows.length" class =" output-tab-panel" >
201164 <TableOutput :rows =" rows" :columns =" columns" />
202165 </q-tab-panel >
203- <q-tab-panel name =" explanation" v-if =" textQuery !== ''" class =" output-tab-panel" >
204- <ExplanationOutput :text =" explanationText" />
205- </q-tab-panel >
206166 <q-tab-panel name =" error" v-if =" errorText !== ''" class =" output-tab-panel" >
207167 <div class =" text-body2 q-pt-xl" >{{ errorText }}</div >
208168 </q-tab-panel >
0 commit comments