Skip to content

Commit e088f57

Browse files
authored
feat: using code editor instead of input for sql editing (#678)
* feat: using code editor instead of input for sql editing * update jq --------- Co-authored-by: rick <LinuxSuRen@users.noreply.github.com>
1 parent a6aaa98 commit e088f57

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

console/atest-ui/src/views/DataManager.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const columns = ref([] as string[])
2525
const queryTip = ref('')
2626
const loadingStores = ref(true)
2727
const showOverflowTooltip = ref(true)
28+
const complexEditor = ref(false)
2829
const dataFormat = ref('table')
2930
const dataFormatOptions = ['table', 'json']
3031
const queryDataMeta = ref({} as QueryDataMeta)
@@ -48,8 +49,10 @@ watch(store, (s) => {
4849
case 'atest-store-elasticsearch':
4950
case 'atest-store-etcd':
5051
sqlQuery.value = '*'
52+
complexEditor.value = false
5153
break
5254
default:
55+
complexEditor.value = true
5356
queryDataMeta.value.currentDatabase = ''
5457
sqlQuery.value = ''
5558
}
@@ -296,7 +299,7 @@ watch(largeContent, (e) => {
296299
</el-form-item>
297300
</el-col>
298301
<el-col :span="16">
299-
<el-form-item>
302+
<el-form-item v-if="!complexEditor">
300303
<HistoryInput :placeholder="queryTip" :callback="executeQuery" v-model="sqlQuery" />
301304
</el-form-item>
302305
</el-col>
@@ -328,6 +331,7 @@ watch(largeContent, (e) => {
328331
</el-col>
329332
</el-row>
330333
</el-form>
334+
<Codemirror v-model="sqlQuery" v-if="complexEditor" style="height: 180px"/>
331335
</el-header>
332336
<el-main>
333337
<div style="display: flex; gap: 8px;">
@@ -336,7 +340,7 @@ watch(largeContent, (e) => {
336340
<el-tag type="primary" v-for="label in queryDataMeta.labels">{{ label.value }}</el-tag>
337341
<el-check-tag type="primary" :checked="showOverflowTooltip" @change="overflowChange" v-if="queryResult.length > 0">overflow</el-check-tag>
338342
</div>
339-
<el-table :data="queryResult" stripe v-if="dataFormat === 'table'" height="calc(100vh - 200px)" @cell-dblclick="tryShowPrettyJSON">
343+
<el-table :data="queryResult" stripe v-if="dataFormat === 'table'" height="calc(100vh - 380px)" @cell-dblclick="tryShowPrettyJSON">
340344
<el-table-column v-for="col in columns" :key="col" :prop="col" :label="col" sortable :show-overflow-tooltip="showOverflowTooltip" />
341345
</el-table>
342346
<Codemirror v-else-if="dataFormat === 'json'" v-model="queryResultAsJSON" />

e2e/code-generator/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
ARG LAN_ENV=docker.io/library/golang:1.21
22

33
FROM ghcr.io/linuxsuren/api-testing:master AS atest
4-
FROM docker.io/stedolan/jq AS jq
4+
FROM ghcr.io/linuxsuren/hd:v0.0.42 as downloader
5+
RUN hd install jq
56
FROM $LAN_ENV
67

78
WORKDIR /workspace
89
COPY . .
9-
COPY --from=jq /usr/local/bin/jq /usr/local/bin/jq
10+
COPY --from=downloader /usr/local/bin/jq /usr/local/bin/jq
1011
COPY --from=atest /usr/local/bin/atest /usr/local/bin/atest
1112

1213
CMD [ "/workspace/entrypoint.sh" ]

0 commit comments

Comments
 (0)