Skip to content

Commit 9ad453e

Browse files
authored
Merge branch 'master' into master
2 parents 2a28e14 + 9e5fdd8 commit 9ad453e

File tree

19 files changed

+1835
-137
lines changed

19 files changed

+1835
-137
lines changed

console/atest-ui/package-lock.json

Lines changed: 1538 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

console/atest-ui/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"test": "vitest"
1717
},
1818
"dependencies": {
19+
"@codemirror/lang-json": "^6.0.2",
20+
"@codemirror/lang-sql": "github:codemirror/lang-sql",
1921
"@vueuse/core": "^10.11.0",
2022
"codemirror": "^5.65.17",
2123
"diff-match-patch": "^1.0.5",
@@ -45,6 +47,7 @@
4547
"@vue/eslint-config-typescript": "^14.3.0",
4648
"@vue/test-utils": "^2.4.0",
4749
"@vue/tsconfig": "^0.4.0",
50+
"autoprefixer": "^10.4.21",
4851
"cypress": "^13.1.0",
4952
"eslint": "^9.27.0",
5053
"eslint-plugin-cypress": "^4.1.0",
@@ -54,8 +57,10 @@
5457
"jest-fetch-mock": "^3.0.3",
5558
"jsdom": "^26.1.0",
5659
"npm-run-all": "^4.1.5",
60+
"postcss": "^8.5.6",
5761
"prettier": "^3.4.2",
5862
"start-server-and-test": "^2.0.0",
63+
"tailwindcss": "^3.4.3",
5964
"ts-jest": "^29.1.1",
6065
"typescript": "~5.0.4",
6166
"vite": "^4.5.5",

console/atest-ui/postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

console/atest-ui/src/App.vue

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import StoreManager from './views/StoreManager.vue'
1919
import SecretManager from './views/SecretManager.vue'
2020
import WelcomePage from './views/WelcomePage.vue'
2121
import DataManager from './views/DataManager.vue'
22+
import MagicKey from './components/MagicKey.vue'
2223
import { useI18n } from 'vue-i18n'
2324
import ElementPlus from 'element-plus';
2425
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
@@ -111,15 +112,14 @@ watch(theme, (e) => {
111112
</script>
112113

113114
<template>
114-
<el-container style="height: 100%;">
115+
<el-container class="full-height">
115116
<el-aside width="auto" style="display: flex; flex-direction: column;">
116-
<el-radio-group v-model="isCollapse">
117+
<el-radio-group v-model="isCollapse" class="el-menu">
117118
<el-radio-button :value="false">+</el-radio-button>
118119
<el-radio-button :value="true">-</el-radio-button>
119120
</el-radio-group>
120121
<el-menu
121-
class="el-menu-vertical"
122-
style="height: 100%;"
122+
class="el-menu-vertical full-height"
123123
:default-active="activeMenu"
124124
:collapse="isCollapse"
125125
@select="handleSelect"
@@ -155,7 +155,7 @@ watch(theme, (e) => {
155155
</el-menu>
156156
</el-aside>
157157

158-
<el-main style="padding-top: 0px;">
158+
<el-main class="center-zone">
159159
<div class="top-menu">
160160
<el-col style="display: flex; align-items: center;">
161161
<el-icon @click="settingDialogVisible=true" size="20"><Setting /></el-icon>
@@ -223,10 +223,15 @@ watch(theme, (e) => {
223223
</el-col>
224224
</el-row>
225225
</el-dialog>
226+
227+
<MagicKey />
226228
</template>
227229

228230
<style>
229231
.el-menu-vertical:not(.el-menu--collapse) {
230232
width: 200px;
231233
}
234+
.el-menu-vertical:is(.el-menu--collapse) {
235+
width: 80px;
236+
}
232237
</style>

console/atest-ui/src/assets/base.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
2020
--vt-c-text-dark-1: var(--vt-c-white);
2121
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
22+
23+
--center-zone-side-padding: 5px;
2224
}
2325

2426
/* semantic color variables for this project */
@@ -34,6 +36,15 @@
3436
--color-text: var(--vt-c-text-light-1);
3537

3638
--section-gap: 160px;
39+
40+
--tool-box-bottom: 5px;
41+
--tool-box-position: absolute;
42+
43+
--page-title-right-padding: 10px;
44+
--page-title-bottom-padding: 5px;
45+
46+
--sql-editor-height: 180px;
47+
--payload-editor-height: 180px;
3748
}
3849

3950
*,
@@ -67,3 +78,32 @@ html.dark .el-main {
6778
color: #fff;
6879
}
6980

81+
.center-zone {
82+
padding-left: var(--center-zone-side-padding) !important;
83+
padding-right: var(--center-zone-side-padding) !important;
84+
padding-top: 0px !important;
85+
}
86+
87+
.tool-box {
88+
position: var(--tool-box-position);
89+
bottom: var(--tool-box-bottom);
90+
}
91+
92+
.edit-button {
93+
height: 32px !important;
94+
margin-left: 10px;
95+
}
96+
97+
.page-title {
98+
padding-right: var(--page-title-right-padding);
99+
}
100+
101+
.page-header {
102+
height: 32px;
103+
padding-bottom: var(--page-title-bottom-padding, 0px);
104+
}
105+
106+
.block-align-right {
107+
display: flex;
108+
justify-content: flex-end;
109+
}

console/atest-ui/src/assets/main.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
#app {
44
margin: 0 auto;
5-
padding: 1rem;
6-
padding-top: 40px;
75
height: 100vh;
86
font-weight: normal;
97
}
@@ -14,6 +12,14 @@
1412
right: 20px;
1513
}
1614

15+
.full-height {
16+
height: 100%;
17+
}
18+
19+
.full-width {
20+
width: 100%;
21+
}
22+
1723
a,
1824
.green {
1925
text-decoration: none;

console/atest-ui/src/assets/tailwind.css

Whitespace-only changes.

console/atest-ui/src/components/EditButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const handleInputConfirm = () => {
4040
@keyup.enter="handleInputConfirm"
4141
@blur="handleInputConfirm"
4242
/>
43-
<el-button v-else class="button-new-tag" size="small" @click="showInput">
43+
<el-button v-else class="button-new-tag" size="small edit-button" @click="showInput">
4444
{{ value }}
4545
</el-button>
4646
</span>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<script setup lang="ts">
2+
import { ref, onMounted, onBeforeUnmount } from 'vue'
3+
import { useI18n } from 'vue-i18n'
4+
import { Magic } from '@/views/magicKeys'
5+
6+
const { t } = useI18n()
7+
const keyBindingsDialogVisible = ref(false)
8+
const keyBindings = ref([])
9+
const showKeyBindingsDialog = (keys: any) => {
10+
keyBindingsDialogVisible.value = true
11+
keyBindings.value = keys.detail || []
12+
}
13+
14+
onMounted(() => {
15+
window.addEventListener(Magic.MagicKeyEventName, showKeyBindingsDialog)
16+
})
17+
18+
onBeforeUnmount(() => {
19+
window.removeEventListener(Magic.MagicKeyEventName, showKeyBindingsDialog)
20+
})
21+
</script>
22+
23+
<template>
24+
<el-drawer v-model="keyBindingsDialogVisible" size="50%">
25+
<template #header>
26+
<h4>{{ t('title.keyBindings') }}</h4>
27+
</template>
28+
<template #default>
29+
<el-table :data="keyBindings">
30+
<el-table-column prop="keys" :label="t('field.shortcut')" />
31+
<el-table-column prop="description" :label="t('field.description')" />
32+
</el-table>
33+
</template>
34+
</el-drawer>
35+
</template>

console/atest-ui/src/locales/en.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"send": "Send",
1212
"copy": "Copy",
1313
"ok": "OK",
14+
"next-page": "Next",
1415
"reload": "Reload",
1516
"insertSample": "Insert Sample",
1617
"toolbox": "Tool Box",
@@ -35,6 +36,8 @@
3536
"updateStore": "Update Store",
3637
"createSecret": "Create Secret",
3738
"secretManager": "Secret Manager",
39+
"storeManager": "Store Manager",
40+
"dataManager": "Data Manager",
3841
"protoContent": "Proto Content",
3942
"protoFile": "Proto File",
4043
"protoImport": "Proto Import",
@@ -53,7 +56,8 @@
5356
"proxy": "Proxy",
5457
"secure": "Secure",
5558
"data": "Data",
56-
"setting": "Setting"
59+
"setting": "Setting",
60+
"keyBindings": "Key Bindings"
5761
},
5862
"tip": {
5963
"filter": "Filter Keyword",
@@ -78,6 +82,8 @@
7882
"key": "Key",
7983
"value": "Value",
8084
"proxy": "Proxy",
85+
"shortcut": "Shortcut",
86+
"description": "Description",
8187
"insecure": "Insecure"
8288
},
8389
"proxy": {

0 commit comments

Comments
 (0)