Skip to content

Commit 9cb6818

Browse files
committed
Improve UI
1 parent 5141090 commit 9cb6818

File tree

9 files changed

+39
-46
lines changed

9 files changed

+39
-46
lines changed

frontend/src/assets/styles/utilities/flex.less

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
.flex {
2-
display: flex;
3-
}
4-
.inline-flex {
5-
display: inline-flex;
6-
}
7-
81
.flex-row {
92
flex-direction: row;
103
}

frontend/src/assets/styles/utilities/grid.less

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.grid {
2-
display: grid;
3-
}
4-
51
@cols: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 32, 64;
62

73
.generate-cols(@i: 1) when (@i <= length(@cols)) {

frontend/src/assets/styles/utilities/others.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
right: 8px;
5151
}
5252

53+
.right-32 {
54+
right: 32px;
55+
}
56+
5357
.bottom-4 {
5458
bottom: 4px;
5559
}
@@ -58,6 +62,10 @@
5862
bottom: 12px;
5963
}
6064

65+
.bottom-32 {
66+
bottom: 32px;
67+
}
68+
6169
.left-8 {
6270
left: 8px;
6371
}
Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import { computed } from 'vue'
23
import { useI18n } from 'vue-i18n'
34
45
type TabItemType = {
@@ -9,27 +10,35 @@ type TabItemType = {
910
interface Props {
1011
activeKey: string
1112
items: readonly TabItemType[]
12-
height?: string
1313
tabPosition?: 'left' | 'top'
14+
tabWidth?: string
15+
contentWidth?: string
1416
}
1517
1618
const props = withDefaults(defineProps<Props>(), {
17-
height: '',
1819
tabPosition: 'left',
20+
tabWidth: '20%',
21+
contentWidth: '80%',
1922
})
2023
2124
const emits = defineEmits(['update:activeKey'])
2225
2326
const { t } = useI18n()
2427
28+
const isTop = computed(() => props.tabPosition === 'top')
29+
2530
const handleChange = (key: string) => emits('update:activeKey', key)
2631
2732
const isActive = ({ key }: TabItemType) => key === props.activeKey
2833
</script>
2934

3035
<template>
31-
<div :style="{ height }" :class="'position-' + tabPosition" class="gui-tabs flex">
32-
<div class="gui-tabs-tab flex">
36+
<div :class="{ 'flex-col': isTop }" class="gui-tabs flex">
37+
<div
38+
:class="{ 'justify-center mb-8': isTop, 'flex-col': !isTop }"
39+
:style="{ width: isTop ? 'auto' : tabWidth }"
40+
class="gui-tabs-tab flex"
41+
>
3342
<Button
3443
v-for="tab in items"
3544
:key="tab.key"
@@ -41,27 +50,8 @@ const isActive = ({ key }: TabItemType) => key === props.activeKey
4150
<slot name="extra"></slot>
4251
</div>
4352

44-
<div class="slot flex flex-col overflow-y-auto">
53+
<div class="flex flex-col overflow-y-auto" :style="{ width: isTop ? 'auto' : contentWidth }">
4554
<slot :name="activeKey"></slot>
4655
</div>
4756
</div>
4857
</template>
49-
50-
<style lang="less" scoped>
51-
.position-left {
52-
.gui-tabs-tab {
53-
min-width: 20%;
54-
flex-direction: column;
55-
}
56-
.slot {
57-
width: 80%;
58-
}
59-
}
60-
.position-top {
61-
flex-direction: column;
62-
.gui-tabs-tab {
63-
justify-content: center;
64-
margin-bottom: 8px;
65-
}
66-
}
67-
</style>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ defineExpose({ reset: handleResetAll })
7070
</script>
7171

7272
<template>
73-
<div class="flex flex-col gap-8">
73+
<div class="flex flex-col gap-8 pr-8">
7474
<slot name="header" v-bind="{ handleResetAll }"></slot>
7575
<Card
7676
v-for="(conf, index) in plugin.configuration"

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ if (envStore.env.os === 'windows') {
176176
</script>
177177

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

182182
<Card>
183183
<div class="px-8 py-12 flex items-center justify-between">
@@ -223,7 +223,7 @@ if (envStore.env.os === 'windows') {
223223
</div>
224224
</Card>
225225

226-
<div class="px-8 py-8 text-18 font-bold">{{ t('settings.behavior') }}</div>
226+
<div class="px-8 py-12 text-18 font-bold">{{ t('settings.behavior') }}</div>
227227

228228
<Card>
229229
<div
@@ -311,7 +311,7 @@ if (envStore.env.os === 'windows') {
311311
</div>
312312
</Card>
313313

314-
<div class="px-8 py-8 text-18 font-bold">{{ t('settings.systemProxy') }}</div>
314+
<div class="px-8 py-12 text-18 font-bold">{{ t('settings.systemProxy') }}</div>
315315

316316
<Card>
317317
<div class="px-8 py-12 flex items-center justify-between">
@@ -351,7 +351,7 @@ if (envStore.env.os === 'windows') {
351351
</div>
352352
</Card>
353353

354-
<div class="px-8 py-8 text-18 font-bold">{{ t('settings.advanced') }}</div>
354+
<div class="px-8 py-12 text-18 font-bold">{{ t('settings.advanced') }}</div>
355355

356356
<Card>
357357
<div class="px-8 py-12 flex items-center justify-between">
@@ -380,7 +380,7 @@ if (envStore.env.os === 'windows') {
380380
</div>
381381
</Card>
382382

383-
<div class="px-8 py-8 text-18 font-bold">{{ t('settings.debug') }}</div>
383+
<div class="px-8 py-12 text-18 font-bold">{{ t('settings.debug') }}</div>
384384

385385
<Card>
386386
<div class="px-8 py-12 flex items-center justify-between">

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

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

1515
<template>
16-
<div class="flex flex-col gap-8 px-8 mb-8">
16+
<div class="flex flex-col gap-8 pr-12 mb-8">
1717
<template v-if="plugins.length === 0">
1818
<div class="px-8 py-8 text-18 font-bold">
1919
{{ $t('plugins.configuration') }}
@@ -39,7 +39,7 @@ const plugins = computed(() =>
3939
"
4040
>
4141
<template #header="{ handleResetAll }">
42-
<div class="flex items-center px-8 py-8">
42+
<div class="flex items-center px-8 py-12">
4343
<Dropdown>
4444
<Button
4545
icon="settings"

frontend/src/views/SettingsView/index.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ const appStore = useAppStore()
2121
</script>
2222

2323
<template>
24-
<Tabs v-model:active-key="activeKey" :items="settings" height="100%">
24+
<Tabs
25+
v-model:active-key="activeKey"
26+
:items="settings"
27+
tab-width="15%"
28+
content-width="85%"
29+
class="h-full"
30+
>
2531
<template #general>
2632
<GeneralSettings />
2733
</template>

frontend/src/views/SubscribesView/components/ProxiesEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,5 @@ defineExpose({ modalSlots })
9191
</script>
9292

9393
<template>
94-
<CodeViewer v-model="proxiesText" lang="yaml" editable class="code" />
94+
<CodeViewer v-model="proxiesText" lang="yaml" editable class="h-full" />
9595
</template>

0 commit comments

Comments
 (0)