Skip to content

Commit 0f947c4

Browse files
committed
chore: move styles into css files
1 parent 2f0dcf4 commit 0f947c4

File tree

11 files changed

+88
-20
lines changed

11 files changed

+88
-20
lines changed

console/atest-ui/src/App.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,14 @@ watch(theme, (e) => {
101101
</script>
102102

103103
<template>
104-
<el-container style="height: 100%;">
104+
<el-container class="full-height">
105105
<el-aside width="auto" style="display: flex; flex-direction: column;">
106-
<el-radio-group v-model="isCollapse">
106+
<el-radio-group v-model="isCollapse" class="el-menu">
107107
<el-radio-button :value="false">+</el-radio-button>
108108
<el-radio-button :value="true">-</el-radio-button>
109109
</el-radio-group>
110110
<el-menu
111-
class="el-menu-vertical"
112-
style="height: 100%;"
111+
class="el-menu-vertical full-height"
113112
:default-active="activeMenu"
114113
:collapse="isCollapse"
115114
@select="handleSelect"
@@ -145,7 +144,7 @@ watch(theme, (e) => {
145144
</el-menu>
146145
</el-aside>
147146

148-
<el-main style="padding-top: 0px;">
147+
<el-main class="center-zone">
149148
<div class="top-menu">
150149
<el-col style="display: flex; align-items: center;">
151150
<el-icon @click="settingDialogVisible=true" size="20"><Setting /></el-icon>
@@ -219,4 +218,7 @@ watch(theme, (e) => {
219218
.el-menu-vertical:not(.el-menu--collapse) {
220219
width: 200px;
221220
}
221+
.el-menu-vertical:is(.el-menu--collapse) {
222+
width: 80px;
223+
}
222224
</style>

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

Lines changed: 31 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,12 @@
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;
3745
}
3846

3947
*,
@@ -67,3 +75,26 @@ html.dark .el-main {
6775
color: #fff;
6876
}
6977

78+
.center-zone {
79+
padding-left: var(--center-zone-side-padding) !important;
80+
padding-right: var(--center-zone-side-padding) !important;
81+
padding-top: 0px !important;
82+
}
83+
84+
.tool-box {
85+
position: var(--tool-box-position);
86+
bottom: var(--tool-box-bottom);
87+
}
88+
89+
.edit-button {
90+
height: 32px !important;
91+
margin-left: 10px;
92+
}
93+
94+
.page-title {
95+
padding-right: var(--page-title-right-padding);
96+
}
97+
98+
.page-header {
99+
padding-bottom: var(--page-title-bottom-padding, 0px);
100+
}

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

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

33
#app {
44
margin: 0 auto;
5-
padding: 1rem;
65
padding-top: 40px;
76
height: 100vh;
87
font-weight: normal;
@@ -14,6 +13,14 @@
1413
right: 20px;
1514
}
1615

16+
.full-height {
17+
height: 100%;
18+
}
19+
20+
.full-width {
21+
width: 100%;
22+
}
23+
1724
a,
1825
.green {
1926
text-decoration: none;

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>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"updateStore": "Update Store",
3636
"createSecret": "Create Secret",
3737
"secretManager": "Secret Manager",
38+
"storeManager": "Store Manager",
3839
"protoContent": "Proto Content",
3940
"protoFile": "Proto File",
4041
"protoImport": "Proto Import",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"updateStore": "更新存储",
3636
"createSecret": "创建凭据",
3737
"secretManager": "凭据管理",
38+
"storeManager": "存储管理",
3839
"apiRequestParameter": "API 请求参数",
3940
"codeGenerator": "代码生成",
4041
"testing": "测试",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
6666
</script>
6767

6868
<template>
69-
<div>{{t('title.secretManager')}}</div>
70-
<div>
69+
<div class="page-header">
70+
<span class="page-title">{{t('title.secretManager')}}</span>
7171
<el-button type="primary" @click="addSecret" :icon="Edit">{{t('button.new')}}</el-button>
7272
</div>
7373
<el-table :data="secrets" style="width: 100%">

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ function loadStores() {
6767
})
6868
}
6969
loadStores()
70-
Magic.Keys(loadStores, ['Alt+KeyR'])
7170
7271
function deleteStore(name: string) {
7372
API.DeleteStore(name, () => {
@@ -108,7 +107,14 @@ function addStore() {
108107
dialogVisible.value = true
109108
createAction.value = true
110109
}
111-
Magic.Keys(addStore, ['Alt+KeyN'])
110+
111+
Magic.AdvancedKeys([{
112+
Keys: ['Alt+KeyE', 'ctrl+n'],
113+
Func: addStore
114+
}, {
115+
Keys: ['Alt+KeyR'],
116+
Func: loadStores
117+
}])
112118
113119
const rules = reactive<FormRules<Store>>({
114120
name: [{ required: true, message: 'Name is required', trigger: 'blur' }],
@@ -211,10 +217,10 @@ const storeExtLink = ref('')
211217
</script>
212218

213219
<template>
214-
<div>Store Manager</div>
215-
<div>
216-
<Button type="primary" @click="addStore" :icon="Edit">{{t('button.new')}}</Button>
217-
<Button type="primary" @click="loadStores" :icon="Refresh">{{t('button.refresh')}}</Button>
220+
<div class="page-header">
221+
<span class="page-title">{{t('title.storeManager')}}</span>
222+
<Button type="primary" @click="addStore" :icon="Edit">{{t('button.new')}}</Button>
223+
<Button type="primary" @click="loadStores" :icon="Refresh">{{t('button.refresh')}}</Button>
218224
</div>
219225
<el-table :data="stores" style="width: 100%" v-loading=storesLoading>
220226
<el-table-column :label="t('field.name')" width="180">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Magic.Keys(() => {
2424
</script>
2525

2626
<template>
27-
<el-affix position="bottom" :offset="20" style="position: absolute; bottom: 5px;" >
27+
<el-affix position="bottom" :offset="20" class="tool-box">
2828
<el-button type="primary" @click="dialogVisible = !dialogVisible"
2929
data-intro="You can search your desired template functions.">{{ t('button.toolbox') }}</el-button>
3030
</el-affix>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ const renameTestSuite = (name: string) => {
305305
<el-form-item :label="t('tip.apiAddress')" prop="api">
306306
<HistoryInput placeholder="API" v-model="suite.api" group="apiAddress" />
307307
</el-form-item>
308-
<table style="width: 100%">
308+
<table class="full-width">
309309
<tr>
310310
<td>
311311
<el-select
@@ -333,7 +333,7 @@ const renameTestSuite = (name: string) => {
333333

334334
<el-collapse>
335335
<el-collapse-item :title="t('title.parameter')">
336-
<el-table :data="suite.param" style="width: 100%">
336+
<el-table :data="suite.param" class="full-width">
337337
<el-table-column :label="t('field.key')" width="180">
338338
<template #default="scope">
339339
<el-input v-model="scope.row.key" :placeholder="t('field.key')" @change="paramChange" />

0 commit comments

Comments
 (0)