11<script setup lang="ts">
22import type { Query , SavedQueryScope } from ' ../rpc-contract'
3+ import Button from ' @antfu/design/components/Action/ActionButton.vue'
34import ActionDarkToggle from ' @antfu/design/components/Action/ActionDarkToggle.vue'
45import DisplayBadge from ' @antfu/design/components/Display/DisplayBadge.vue'
56import FormSelect from ' @antfu/design/components/Form/FormSelect.vue'
@@ -16,6 +17,7 @@ import { connect, connection } from './composables/rpc'
1617import { useSavedQueries } from ' ./composables/saved'
1718import { colorScheme } from ' ./composables/scheme'
1819import { useWorkbench } from ' ./composables/workbench'
20+ import ' @antfu/design/styles.css'
1921
2022const wb = useWorkbench ()
2123const savedApi = useSavedQueries ()
@@ -57,7 +59,6 @@ function saveCurrent(input: { title?: string, description?: string, scope: Saved
5759 <div class =" flex items-center gap-1.5 shrink-0 font-semibold text-sm select-none" >
5860 <span class =" i-ph:tree-structure-duotone text-base color-active" />
5961 <span >Data Inspector</span >
60- <DisplayBadge text="prototype" :color =" 8 " />
6162 </div >
6263
6364 <div class =" flex items-center gap-2" >
@@ -89,6 +90,37 @@ function saveCurrent(input: { title?: string, description?: string, scope: Saved
8990 <!-- The left column's sections resize with the same split-pane setup. -->
9091 <LayoutSplitPane horizontal storage-key="data-inspector-left-panes" class="h-full">
9192 <Pane :size =" 42 " min-size="20" class="flex flex-col gap-2 p-3 pb-1.5 min-h-0">
93+ <div class =" flex items-center gap-2 font-semibold text-sm select-none" >
94+ <div >Jora Query</div >
95+ <a
96+ href =" https://discoveryjs.github.io/jora/"
97+ target =" _blank"
98+ title =" Jora query language reference"
99+ class =" flex items-center gap-1 color-muted hover:color-active"
100+ >
101+ <span class =" i-ph:question-duotone" />
102+ </a >
103+ <div class =" flex-auto" />
104+ <Button
105+ v-if =" wb .query .value "
106+ :disabled =" ! wb .query .value "
107+ title="Clear query"
108+ icon="i-ph:trash-duotone "
109+ @click =" wb .query .value = ' ' "
110+ >
111+ <span >Clear</span >
112+ </Button >
113+ <Button
114+ :disabled =" wb .running .value "
115+ :loading =" wb .running .value "
116+ title="Run query"
117+ icon="i-ph:play-duotone "
118+ @click =" wb .runNow ()"
119+ >
120+ <span >Run</span >
121+ </Button >
122+ </div >
123+ <!-- TODO: Query draft should be persistent in local storage per data source, on switching data sources, it should be restored/reset -->
92124 <QueryEditor
93125 v-model =" wb .query .value "
94126 :syntax =" wb .syntax .value "
@@ -101,14 +133,6 @@ function saveCurrent(input: { title?: string, description?: string, scope: Saved
101133 />
102134 <QuerySettings v-model =" wb .settings " />
103135 </Pane >
104- <Pane :size =" 33 " min-size="12" class="p-3 py-1.5 min-h-0">
105- <SkeletonPanel
106- :skeleton =" wb .skeleton .value "
107- :error =" wb .skeletonError .value "
108- :loading =" wb .skeletonLoading .value "
109- @refresh =" wb .loadSkeleton ()"
110- />
111- </Pane >
112136 <Pane min-size="12" class="p-3 pt-1.5 min-h-0">
113137 <SavedQueriesPanel
114138 :saved =" savedApi .saved .value "
@@ -121,6 +145,15 @@ function saveCurrent(input: { title?: string, description?: string, scope: Saved
121145 @save =" saveCurrent "
122146 />
123147 </Pane >
148+ <Pane :size =" 33 " min-size="12" class="p-3 py-1.5 min-h-0">
149+ <!-- TODO: this should be replaced with "DataSourceInfoPanel", that shows the data source title/description and simple data shape with one-level depth with normal code block (not discovery), on click the prop it would set the query -->
150+ <SkeletonPanel
151+ :skeleton =" wb .skeleton .value "
152+ :error =" wb .skeletonError .value "
153+ :loading =" wb .skeletonLoading .value "
154+ @refresh =" wb .loadSkeleton ()"
155+ />
156+ </Pane >
124157 </LayoutSplitPane >
125158 </Pane >
126159 <Pane class="min-w-0">
0 commit comments