Skip to content

Commit 403545f

Browse files
authored
improve the table on the data manager ui (#673)
* chore: improve ui style * improve the table on the data manager ui --------- Co-authored-by: rick <[email protected]>
1 parent e12888f commit 403545f

File tree

4 files changed

+42
-23
lines changed

4 files changed

+42
-23
lines changed

console/atest-ui/src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ const toHistoryPanel = ({ ID: selectID, panelName: historyPanelName }) => {
134134
</el-menu>
135135
</el-aside>
136136

137-
<el-main style="padding-top: 5px; padding-bottom: 5px;">
138-
<div style="position: absolute; top: 10px; right: 20px;">
137+
<el-main style="padding-top: 0px;">
138+
<div class="top-menu">
139139
<el-col style="display: flex; align-items: center;">
140140
<el-tag style="font-size: 18px;">{{ t('language') }}</el-tag>
141141
<el-dropdown trigger="click" @command="(command: string) => handleChangeLan(command)">
Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
@import './base.css';
22

33
#app {
4-
/* max-width: 1280px; */
5-
margin: 0 auto;
6-
padding: 1rem;
7-
height: 100vh;
8-
font-weight: normal;
4+
margin: 0 auto;
5+
padding: 1rem;
6+
padding-top: 40px;
7+
height: 100vh;
8+
font-weight: normal;
9+
}
10+
11+
.top-menu {
12+
position: absolute;
13+
top: 10px;
14+
right: 20px;
915
}
1016

1117
a,
1218
.green {
13-
text-decoration: none;
14-
color: hsla(160, 100%, 37%, 1);
15-
transition: 0.4s;
19+
text-decoration: none;
20+
color: hsla(160, 100%, 37%, 1);
21+
transition: 0.4s;
1622
}
1723

1824
@media (hover: hover) {
19-
a:hover {
20-
background-color: hsla(160, 100%, 37%, 0.2);
21-
}
25+
a:hover {
26+
background-color: hsla(160, 100%, 37%, 0.2);
27+
}
2228
}

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

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const query = ref({
1717
offset: 0,
1818
limit: 10
1919
} as QueryObject)
20+
const currentTable = ref('')
2021
const sqlQuery = ref('')
2122
const queryResult = ref([] as any[])
2223
const queryResultAsJSON = ref('')
@@ -70,6 +71,7 @@ interface QueryData {
7071
7172
const queryDataFromTable = (data: QueryData) => {
7273
sqlQuery.value = `@selectTableLImit100_${data.label}`
74+
currentTable.value = data.label
7375
executeQuery()
7476
}
7577
const describeTable = (data: QueryData) => {
@@ -233,7 +235,7 @@ const nextPage = () => {
233235

234236
<template>
235237
<div>
236-
<el-container style="height: calc(100vh - 50px);">
238+
<el-container style="height: calc(100vh - 80px);">
237239
<el-aside v-if="kind === 'atest-store-orm' || kind === 'atest-store-iotdb' || kind === 'atest-store-cassandra' || kind === 'atest-store-elasticsearch' || kind === 'atest-store-opengemini'">
238240
<el-scrollbar>
239241
<el-select v-model="queryDataMeta.currentDatabase" placeholder="Select database"
@@ -247,18 +249,20 @@ const nextPage = () => {
247249
<el-tree :data="tablesTree" node-key="label" highlight-current
248250
draggable>
249251
<template #default="{node, data}">
250-
<span @click="queryDataFromTable(data)">
251-
{{ node.label }}
252-
</span>
253-
<el-icon style="margin-left: 6px;" @click="describeTable(data)" v-if="kind === 'atest-store-orm' || kind === 'atest-store-cassandra'"><Document /></el-icon>
252+
<div class="space-between">
253+
<span @click="queryDataFromTable(data)">
254+
{{ node.label }}
255+
</span>
256+
<el-icon style="margin-left: 6px;" @click="describeTable(data)" v-if="kind === 'atest-store-orm' || kind === 'atest-store-cassandra'"><Document /></el-icon>
257+
</div>
254258
</template>
255259
</el-tree>
256260
</el-scrollbar>
257261
</el-aside>
258262
<el-container>
259263
<el-header style="height: auto">
260264
<el-form @submit.prevent="executeQuery">
261-
<el-row :gutter="10">
265+
<el-row :gutter="10" justify="center">
262266
<el-col :span="4">
263267
<el-form-item>
264268
<el-select v-model="store" placeholder="Select store" filterable
@@ -309,7 +313,7 @@ const nextPage = () => {
309313
<el-tag type="primary" v-if="queryDataMeta.duration">{{ queryDataMeta.duration }}</el-tag>
310314
<el-tag type="primary" v-for="label in queryDataMeta.labels">{{ label.value }}</el-tag>
311315
</div>
312-
<el-table :data="queryResult" stripe v-if="dataFormat === 'table'">
316+
<el-table :data="queryResult" stripe v-if="dataFormat === 'table'" height="calc(100vh - 200px)">
313317
<el-table-column v-for="col in columns" :key="col" :prop="col" :label="col" sortable />
314318
</el-table>
315319
<Codemirror v-else-if="dataFormat === 'json'" v-model="queryResultAsJSON" />
@@ -318,3 +322,12 @@ const nextPage = () => {
318322
</el-container>
319323
</div>
320324
</template>
325+
326+
<style>
327+
.space-between {
328+
justify-content: space-between;
329+
display: flex;
330+
width: 100%;
331+
padding-right: 8px;
332+
}
333+
</style>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ const renameTestCase = (name: string) => {
921921
<EditButton :value="props.name" @changed="renameTestCase"/>
922922
</div>
923923
<div>
924-
<el-row>
924+
<el-row justify="space-between" gutter="10">
925925
<el-col :span="3">
926926
<el-select
927927
v-if="props.kindName !== 'tRPC' && props.kindName !== 'gRPC'"
@@ -942,7 +942,7 @@ const renameTestCase = (name: string) => {
942942
</el-option>
943943
</el-select>
944944
</el-col>
945-
<el-col :span="18">
945+
<el-col :span="19">
946946
<el-autocomplete
947947
v-model="testCaseWithSuite.data.request.api"
948948
style="width: 100%"
@@ -957,7 +957,7 @@ const renameTestCase = (name: string) => {
957957
</template>
958958
</el-autocomplete>
959959
</el-col>
960-
<el-col :span="3">
960+
<el-col :span="2" style="text-align-last: right;">
961961
<el-dropdown split-button type="primary"
962962
@click="sendRequest"
963963
v-loading="requestLoading"

0 commit comments

Comments
 (0)