Skip to content

Commit c2d24e5

Browse files
optimize: 优化头部样式,避免检索内容后样式变乱了。优化SearchBar样式。
1 parent 4c0829c commit c2d24e5

File tree

9 files changed

+63
-50
lines changed

9 files changed

+63
-50
lines changed

packages/gui/src/view/App.vue

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,26 @@ export default {
4949
message = { key: 'show-hide' }
5050
}
5151
52-
if (message.key === 'show-hide') { // 显示/隐藏
53-
this.hideSearchBar = message.hideSearchBar != null ? message.hideSearchBar : !this.hideSearchBar
52+
try {
53+
if (message.key === 'show-hide') { // 显示/隐藏
54+
this.hideSearchBar = message.hideSearchBar != null ? message.hideSearchBar : !this.hideSearchBar
5455
55-
// 显示后,获取输入框焦点
56-
if (!this.hideSearchBar) {
57-
setTimeout(() => {
58-
try {
59-
this.$refs.searchBar.$el.querySelector('input').focus()
60-
} catch {
61-
}
62-
}, 100)
56+
// 显示后,获取输入框焦点
57+
if (!this.hideSearchBar) {
58+
setTimeout(() => {
59+
try {
60+
this.$refs.searchBar.$el.querySelector('input').focus()
61+
} catch {
62+
}
63+
}, 100)
64+
}
65+
} else if (message.key === 'next') { // 下一项
66+
this.$refs.searchBar.next()
67+
} else if (message.key === 'previous') { // 上一项
68+
this.$refs.searchBar.previous()
6369
}
64-
} else if (message.key === 'next') { // 下一项
65-
this.$refs.searchBar.next()
66-
} else if (message.key === 'previous') { // 上一项
67-
this.$refs.searchBar.previous()
70+
} catch (e) {
71+
console.error('操作SearchBar出现异常:', e)
6872
}
6973
})
7074
},
@@ -89,6 +93,7 @@ export default {
8993
:highlightClass="'search-bar-highlight'"
9094
:selectedClass="'selected-highlight'"
9195
:hiden.sync="hideSearchBar"
96+
style="top:auto;right:auto;left:160px;bottom:52px;background-color:#ddd"
9297
/>
9398
<a-layout>
9499
<a-layout-sider :theme="theme">
@@ -180,9 +185,10 @@ body {
180185
}
181186
.search-bar-highlight {
182187
background-color: #ef0fff;
188+
color: #fdfdfd;
183189
184190
&.selected-highlight {
185-
background-color: #38d878;
191+
background-color: #17a450;
186192
}
187193
}
188194
</style>

packages/gui/src/view/components/container.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export default {
88
<div class="ds-container">
99
<div class="body-wrapper">
1010
<div v-if="$slots.header" class="container-header">
11-
<slot name="header" />
11+
<span><slot name="header" /></span>
12+
<span style="color:#999"><slot name="header-right" /></span>
1213
</div>
1314
<div class="container-body">
1415
<slot />

packages/gui/src/view/pages/help.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export default {
2525
<ds-container>
2626
<template slot="header">
2727
帮助中心
28-
<span>
29-
<a-button class="md-mr-10" @click="openExternal('https://github.com/docmirror/dev-sidecar/issues/new/choose')">反馈问题</a-button>
30-
<a-button class="md-mr-10" icon="profile" @click="openLog()">查看日志</a-button>
31-
</span>
28+
</template>
29+
<template slot="header-right">
30+
<a-button class="md-mr-10" @click="openExternal('https://github.com/docmirror/dev-sidecar/issues/new/choose')">反馈问题</a-button>
31+
<a-button class="md-mr-10" icon="profile" @click="openLog()">查看日志</a-button>
3232
</template>
3333

3434
<div v-if="config" class="help-list">

packages/gui/src/view/pages/index.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -259,20 +259,20 @@ export default {
259259
<DsContainer class="page_index">
260260
<template slot="header">
261261
给开发者的辅助工具
262-
<span>
263-
<a-button style="margin-right:10px" @click="openSetupCa">
264-
<a-badge :count="_rootCaSetuped ? 0 : 1" dot>安装根证书</a-badge>
265-
</a-button>
262+
</template>
263+
<template slot="header-right">
264+
<a-button style="margin-right:10px" @click="openSetupCa">
265+
<a-badge :count="_rootCaSetuped ? 0 : 1" dot>安装根证书</a-badge>
266+
</a-button>
266267

267-
<a-button
268-
style="margin-right:10px" :loading="update.downloading || update.checking" :title="`当前版本:${info.version}`"
269-
@click="doCheckUpdate(true)"
270-
>
271-
<a-badge :count="update.newVersion ? 1 : 0" dot>
272-
<span v-if="update.downloading">{{ update.progress }}%</span>{{ update.downloading ? '新版本下载中' : (`检查更新${update.checking ? '中' : ''}`) }}
273-
</a-badge>
274-
</a-button>
275-
</span>
268+
<a-button
269+
style="margin-right:10px" :loading="update.downloading || update.checking" :title="`当前版本:${info.version}`"
270+
@click="doCheckUpdate(true)"
271+
>
272+
<a-badge :count="update.newVersion ? 1 : 0" dot>
273+
<span v-if="update.downloading">{{ update.progress }}%</span>{{ update.downloading ? '新版本下载中' : (`检查更新${update.checking ? '中' : ''}`) }}
274+
</a-badge>
275+
</a-button>
276276
</template>
277277

278278
<div class="box">

packages/gui/src/view/pages/plugin/git.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export default {
99
data () {
1010
return {
1111
key: 'plugin.git',
12+
labelCol: { span: 4 },
13+
wrapperCol: { span: 20 },
1214
noProxyUrls: [],
1315
needRestart: false,
1416
}
@@ -72,9 +74,9 @@ export default {
7274
<ds-container>
7375
<template slot="header">
7476
Git.exe代理设置
75-
<span style="color:#999;">
76-
仅针对git命令行的代理设置,github网站的访问无需设置
77-
</span>
77+
</template>
78+
<template slot="header-right">
79+
仅针对git命令行的代理设置,github网站的访问无需设置
7880
</template>
7981

8082
<div v-if="config">

packages/gui/src/view/pages/plugin/node.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export default {
77
data () {
88
return {
99
key: 'plugin.node',
10+
labelCol: { span: 4 },
11+
wrapperCol: { span: 20 },
1012
npmVariables: undefined,
1113
registry: false,
1214
}
@@ -51,9 +53,9 @@ export default {
5153
<ds-container>
5254
<template slot="header">
5355
NPM加速
54-
<span style="color:#999;">
55-
由于nodejs不走系统证书,所以npm加速不是很好用,可以用淘宝registry
56-
</span>
56+
</template>
57+
<template slot="header-right">
58+
由于nodejs不走系统证书,所以npm加速不是很好用,可以用淘宝registry
5759
</template>
5860

5961
<div v-if="config">
@@ -97,7 +99,6 @@ export default {
9799
设置后立即生效,即使关闭 ds 也会继续保持
98100
</div>
99101
</a-form-item>
100-
101102
<a-form-item label="yarn仓库镜像" :label-col="labelCol" :wrapper-col="wrapperCol">
102103
<a-radio-group v-model="config.plugin.node.setting.yarnRegistry" default-value="null" button-style="solid" @change="onSwitchYarnRegistry">
103104
<a-radio-button value="default" title="https://registry.yarnpkg.com">
@@ -111,7 +112,6 @@ export default {
111112
设置后立即生效,即使关闭 ds 也会继续保持
112113
</div>
113114
</a-form-item>
114-
115115
<a-form-item label="镜像变量设置" :label-col="labelCol" :wrapper-col="wrapperCol">
116116
<a-checkbox v-model="config.plugin.node.startup.variables">
117117
自动设置,启动npm加速开关时将会设置如下环境变量
@@ -123,10 +123,10 @@ export default {
123123
<a-col :span="10">
124124
<a-input v-model="item.key" :title="item.key" read-only />
125125
</a-col>
126-
<a-col :span="10">
126+
<a-col :span="13">
127127
<a-input v-model="item.value" :title="item.value" read-only />
128128
</a-col>
129-
<a-col :span="4">
129+
<a-col :span="1">
130130
<a-icon v-if="item.exists && item.hadSet" title="已设置" style="color:green" type="check" />
131131
<a-icon v-else title="还未设置" style="color:red" type="exclamation-circle" />
132132
</a-col>

packages/gui/src/view/pages/plugin/overwall.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export default {
99
data () {
1010
return {
1111
key: 'plugin.overwall',
12+
labelCol: { span: 4 },
13+
wrapperCol: { span: 20 },
1214
targets: undefined,
1315
servers: undefined,
1416
overwallOptions: [
@@ -115,9 +117,9 @@ export default {
115117
<ds-container>
116118
<template slot="header">
117119
梯子
118-
<span>
119-
<a-button type="primary" @click="openExternal('https://github.com/docmirror/dev-sidecar-doc/blob/main/ow.md')">原理说明</a-button>
120-
</span>
120+
</template>
121+
<template slot="header-right">
122+
<a-button type="primary" @click="openExternal('https://github.com/docmirror/dev-sidecar-doc/blob/main/ow.md')">原理说明</a-button>
121123
</template>
122124

123125
<div v-if="config">
@@ -150,7 +152,7 @@ export default {
150152
注:只要下载成功后,即使关闭自动更新功能,也会优先读取最近下载的文件!
151153
</div>
152154
</a-form-item>
153-
<a-form-item label="远程PAC文件地址" :label-col="labelCol" :wrapper-col="wrapperCol">
155+
<a-form-item label="远程PAC文件" :label-col="labelCol" :wrapper-col="wrapperCol">
154156
<a-input v-model="config.plugin.overwall.pac.pacFileUpdateUrl" :title="config.plugin.overwall.pac.pacFileUpdateUrl" />
155157
<div class="form-help">
156158
远程PAC文件内容可以是<code>base64</code>编码格式,也可以是未经过编码的

packages/gui/src/view/pages/plugin/pip.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export default {
77
data () {
88
return {
99
key: 'plugin.pip',
10+
labelCol: { span: 4 },
11+
wrapperCol: { span: 20 },
1012
npmVariables: undefined,
1113
registry: false,
1214
trustedHostList: [],

packages/gui/src/view/pages/setting.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ export default {
342342
<ds-container>
343343
<template slot="header">
344344
设置
345-
<span>
346-
<a-button class="md-mr-10" icon="profile" @click="openLog()">查看日志</a-button>
347-
</span>
345+
</template>
346+
<template slot="header-right">
347+
<a-button class="md-mr-10" icon="profile" @click="openLog()">查看日志</a-button>
348348
</template>
349349

350350
<div v-if="config">

0 commit comments

Comments
 (0)