Skip to content

Commit c8be36b

Browse files
committed
refactor(ui): enhance layout consistency
1 parent b114567 commit c8be36b

File tree

9 files changed

+57
-36
lines changed

9 files changed

+57
-36
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<template>
2+
<svg viewBox="0 0 1024 1024">
3+
<path
4+
d="M293.44 981.312a231.936 231.936 0 0 1-168.896-70.592 235.776 235.776 0 0 1-69.12-167.36c0-64.512 24.64-124.352 70.656-168.96l118.272-118.208c18.432-18.368 47.552-18.368 64.448 0 18.432 18.432 18.432 47.616 0 64.512L190.592 638.912a146.24 146.24 0 0 0-43.008 104.448c0 39.936 15.36 75.2 43.008 104.384a146.24 146.24 0 0 0 104.384 43.008c38.4 0 75.264-15.36 104.448-43.008l150.4-150.4a147.328 147.328 0 0 0 0-207.36 169.216 169.216 0 0 0-42.88-30.72 46.656 46.656 0 0 1-23.04-61.44c10.688-23.04 38.336-33.728 61.376-23.04 26.112 12.352 50.688 27.712 70.592 49.216a238.144 238.144 0 0 1 0 337.792l-150.4 150.4a249.344 249.344 0 0 1-172.032 69.12z"
5+
v-bind="$attrs"
6+
></path>
7+
<path
8+
d="M513.024 666.56a40.96 40.96 0 0 1-18.432-4.608c-26.112-12.288-50.688-27.648-70.592-49.088a238.144 238.144 0 0 1-70.656-168.96c0-64.448 24.576-124.352 70.656-168.896l150.4-150.4a238.144 238.144 0 0 1 337.856 0 238.208 238.208 0 0 1 0 337.728l-118.272 118.272c-18.368 18.432-47.552 18.432-64.448 0-18.432-18.432-18.432-47.616 0-64.512l118.208-118.208a147.328 147.328 0 0 0 0-207.296 147.328 147.328 0 0 0-207.296 0l-150.4 150.464a146.24 146.24 0 0 0-43.072 104.384c0 39.936 15.36 75.264 43.008 104.448 12.288 12.288 27.648 23.04 43.008 30.72 23.04 10.752 33.792 38.4 23.04 61.44a50.88 50.88 0 0 1-43.008 24.512z"
9+
v-bind="$attrs"
10+
></path>
11+
</svg>
12+
</template>

frontend/src/components/Icon/LinkIcon.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<template>
22
<svg viewBox="0 0 1024 1024">
33
<path
4-
d="M377.6 473.6C377.6 448 384 422.4 403.2 403.2l70.4-70.4 57.6-57.6c19.2-19.2 38.4-25.6 64-25.6 25.6 0 44.8 6.4 64 25.6 38.4 38.4 38.4 89.6 0 128l-128 128C512 550.4 492.8 556.8 467.2 556.8L416 608C428.8 614.4 448 620.8 467.2 620.8 512 620.8 544 601.6 576 576l128-128c57.6-57.6 57.6-153.6 0-211.2-57.6-57.6-153.6-57.6-211.2 0l-128 128C320 403.2 307.2 467.2 326.4 524.8L377.6 473.6z"
4+
d="M574 665.4c-3.1-3.1-8.2-3.1-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8c-3.1-3.1-8.2-3.1-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zM832.6 191.4c-84.6-84.6-221.5-84.6-306 0L410.3 307.6c-3.1 3.1-3.1 8.2 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6c-3.1 3.1-3.1 8.2 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1z"
55
v-bind="$attrs"
66
></path>
77
<path
8-
d="M646.4 550.4c0 25.6-6.4 51.2-25.6 70.4l-128 128c-19.2 19.2-38.4 25.6-64 25.6-25.6 0-44.8-6.4-64-25.6-38.4-38.4-38.4-89.6 0-128l128-128c19.2-19.2 44.8-25.6 70.4-25.6l51.2-51.2C588.8 409.6 576 403.2 556.8 403.2 512 403.2 473.6 422.4 448 448L320 576c-57.6 57.6-57.6 153.6 0 211.2 57.6 57.6 153.6 57.6 211.2 0l128-128c44.8-44.8 57.6-108.8 32-160L646.4 550.4z"
8+
d="M610.1 372.3c-3.1-3.1-8.2-3.1-11.3 0L372.3 598.7c-3.1 3.1-3.1 8.2 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"
99
v-bind="$attrs"
1010
></path>
1111
</svg>

frontend/src/components/Icon/icons.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const icons = [
22
'link',
3+
'link2',
34
'loading',
45
'selected',
56
'disabled',

frontend/src/components/Input/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ defineExpose({
122122
class="w-full overflow-hidden whitespace-nowrap text-ellipsis"
123123
>
124124
<slot name="editable" v-bind="{ value: modelValue }">
125-
{{ modelValue || t('common.none') }}
125+
{{ modelValue || t(placeholder || 'common.none') }}
126126
</slot>
127127
</div>
128128
<template v-else>

frontend/src/stores/appSettings.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ import i18n, { loadLocaleMessages, reloadLocale } from '@/lang'
4141
import {
4242
debounce,
4343
updateTrayMenus,
44-
APP_TITLE,
4544
ignoredError,
46-
APP_VERSION,
4745
sleep,
4846
getKernelFileName,
4947
GetSystemProxyBypass,
@@ -77,7 +75,7 @@ export const useAppSettingsStore = defineStore('app-settings', () => {
7775
autoSetSystemProxy: true,
7876
proxyBypassList: '',
7977
autoStartKernel: false,
80-
userAgent: APP_TITLE + '/' + APP_VERSION,
78+
userAgent: '',
8179
startupDelay: 30,
8280
connections: DefaultConnections(),
8381
kernel: {

frontend/src/views/PluginsView/components/PluginConfigItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ defineExpose({ reset: handleResetAll })
7070
</script>
7171

7272
<template>
73-
<div>
73+
<div class="flex flex-col gap-8">
7474
<slot name="header" v-bind="{ handleResetAll }"></slot>
7575
<Card
7676
v-for="(conf, index) in plugin.configuration"
7777
:key="conf.id"
7878
:title="`${index + 1}. ${conf.title}`"
7979
:class="{ warn: model[conf.key] !== undefined }"
80-
class="card mb-8"
80+
class="card"
8181
>
8282
<template v-if="model[conf.key] !== undefined" #extra>
8383
<Button

frontend/src/views/SettingsView/components/GeneralSettings.vue

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ const resetFontFamily = () => {
9696
appSettings.app.fontFamily = DefaultFontFamily
9797
}
9898
99-
const resetUserAgent = () => {
100-
appSettings.app.userAgent = APP_TITLE + '/' + APP_VERSION
99+
const clearUserAgent = () => {
100+
appSettings.app.userAgent = ''
101101
}
102102
103103
const onPermChange = async (v: boolean) => {
@@ -176,7 +176,7 @@ if (envStore.env.os === 'windows') {
176176
</script>
177177

178178
<template>
179-
<div class="flex flex-col gap-8 pr-8 mb-8">
179+
<div class="flex flex-col gap-8 px-8 mb-8">
180180
<div class="px-8 py-8 text-18 font-bold">{{ t('settings.personalization') }}</div>
181181

182182
<Card>
@@ -191,9 +191,7 @@ if (envStore.env.os === 'windows') {
191191
<div class="px-8 py-12 flex items-center justify-between">
192192
<div class="text-16 font-bold">
193193
{{ t('settings.lang.name') }}
194-
<Button @click="BrowserOpenURL(APP_LOCALES_URL)" type="text" icon="link" />
195-
</div>
196-
<div class="flex items-center">
194+
<Button @click="BrowserOpenURL(APP_LOCALES_URL)" type="text" icon="link2" />
197195
<Button @click="handleOpenLocalesFolder" type="text" icon="folder" />
198196
<Button
199197
@click="appSettings.loadLocales()"
@@ -202,8 +200,8 @@ if (envStore.env.os === 'windows') {
202200
type="text"
203201
icon="refresh"
204202
/>
205-
<Radio v-model="appSettings.app.lang" :options="appSettings.locales" class="ml-8" />
206203
</div>
204+
<Radio v-model="appSettings.app.lang" :options="appSettings.locales" />
207205
</div>
208206
<div class="px-8 py-12 flex items-center justify-between">
209207
<div class="text-16 font-bold">{{ t('settings.fontFamily') }}</div>
@@ -249,19 +247,17 @@ if (envStore.env.os === 'windows') {
249247
<span class="font-normal text-12">({{ t('settings.needAdmin') }})</span>
250248
</div>
251249
<div class="flex items-center">
252-
<Switch v-model="isTaskScheduled" @change="onTaskSchChange" />
253-
<template v-if="isTaskScheduled">
254-
<Radio
255-
v-model="appSettings.app.windowStartState"
256-
:options="windowStates"
257-
type="number"
258-
class="ml-16"
259-
/>
260-
</template>
250+
<Radio
251+
v-if="isTaskScheduled"
252+
v-model="appSettings.app.windowStartState"
253+
:options="windowStates"
254+
type="number"
255+
/>
256+
<Switch v-model="isTaskScheduled" @change="onTaskSchChange" class="ml-16" />
261257
</div>
262258
</div>
263259
<div
264-
v-if="envStore.env.os === 'windows' && isAdmin"
260+
v-if="envStore.env.os === 'windows' && isAdmin && isTaskScheduled"
265261
class="px-8 py-12 flex items-center justify-between"
266262
>
267263
<div class="text-16 font-bold">
@@ -272,8 +268,8 @@ if (envStore.env.os === 'windows') {
272268
v-model="appSettings.app.startupDelay"
273269
@submit="onStartupDelayChange"
274270
:min="0"
271+
editable
275272
type="number"
276-
class="ml-4"
277273
>
278274
<template #suffix>
279275
<span class="ml-4">{{ t('settings.startup.delay') }}</span>
@@ -328,15 +324,24 @@ if (envStore.env.os === 'windows') {
328324
{{ t('settings.proxyBypassList') }}
329325
<span class="font-normal text-12">({{ t('settings.proxyBypassListTips') }})</span>
330326
</div>
331-
<CodeViewer v-model="appSettings.app.proxyBypassList" editable lang="yaml" />
327+
<CodeViewer
328+
v-model="appSettings.app.proxyBypassList"
329+
editable
330+
lang="yaml"
331+
class="min-w-256"
332+
/>
332333
</div>
333334
<div class="px-8 py-12 flex items-center justify-between">
334335
<div class="text-16 font-bold">{{ t('settings.userAgent.name') }}</div>
335336
<div class="flex items-center">
336-
<Input v-model.lazy="appSettings.app.userAgent" editable>
337+
<Input
338+
v-model.lazy="appSettings.app.userAgent"
339+
:placeholder="APP_TITLE + '/' + APP_VERSION"
340+
editable
341+
>
337342
<template #suffix>
338343
<Button
339-
@click="resetUserAgent"
344+
@click="clearUserAgent"
340345
v-tips="'settings.userAgent.reset'"
341346
type="text"
342347
size="small"

frontend/src/views/SettingsView/components/PluginSettings.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const plugins = computed(() =>
1313
</script>
1414

1515
<template>
16-
<div class="flex flex-col pr-8">
16+
<div class="flex flex-col gap-8 px-8 mb-8">
1717
<template v-if="plugins.length === 0">
18-
<div class="text-18 font-bold pb-12">
18+
<div class="px-8 py-8 text-18 font-bold">
1919
{{ $t('plugins.configuration') }}
2020
</div>
2121
<Card>
@@ -39,9 +39,15 @@ const plugins = computed(() =>
3939
"
4040
>
4141
<template #header="{ handleResetAll }">
42-
<div class="flex items-center pb-12">
42+
<div class="flex items-center px-8 py-8">
4343
<Dropdown>
44-
<Button icon="settings" type="text"></Button>
44+
<Button
45+
icon="settings"
46+
type="text"
47+
size="small"
48+
class="mr-4"
49+
style="margin-left: -8px"
50+
/>
4551
<template #overlay="{ close }">
4652
<div class="flex flex-col gap-4 min-w-64 p-4">
4753
<Button

frontend/src/views/SubscribesView/index.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,9 @@ const onSortUpdate = debounce(subscribeStore.saveSubscribes, 1000)
285285
<Icon
286286
v-if="s.type !== 'File' && s.website"
287287
v-tips="'subscribe.website'"
288-
icon="link"
289-
:size="18"
288+
icon="link2"
290289
@click="BrowserOpenURL(s.website)"
291-
style="cursor: pointer"
290+
class="mx-4 cursor-pointer shrink-0"
292291
/>
293292
</template>
294293

0 commit comments

Comments
 (0)