Skip to content

Commit 515a5ad

Browse files
authored
Merge pull request #778 from imsyy/dev-set
🦄 refactor: 全局设置重构,支持搜索 / 跳转
2 parents 916f3cf + baba5d7 commit 515a5ad

40 files changed

Lines changed: 5842 additions & 3944 deletions

components.d.ts

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,50 @@ declare module 'vue' {
1818
AutoClose: typeof import('./src/components/Modal/AutoClose.vue')['default']
1919
BackgroundRender: typeof import('./src/components/AMLL/BackgroundRender.vue')['default']
2020
BatchList: typeof import('./src/components/Modal/BatchList.vue')['default']
21+
CacheDirectory: typeof import('./src/components/Setting/components/CacheDirectory.vue')['default']
22+
CacheLimitConfig: typeof import('./src/components/Setting/components/CacheLimitConfig.vue')['default']
23+
CacheSizeLimit: typeof import('./src/components/Setting/components/CacheSizeLimit.vue')['default']
2124
ChangeRate: typeof import('./src/components/Modal/ChangeRate.vue')['default']
2225
CloudMatch: typeof import('./src/components/Modal/CloudMatch.vue')['default']
2326
CommentList: typeof import('./src/components/List/CommentList.vue')['default']
27+
ConfigurableInputNumber: typeof import('./src/components/Setting/items/ConfigurableInputNumber.vue')['default']
2428
CopyLyrics: typeof import('./src/components/Modal/CopyLyrics.vue')['default']
2529
CoverList: typeof import('./src/components/List/CoverList.vue')['default']
2630
CoverMenu: typeof import('./src/components/Menu/CoverMenu.vue')['default']
2731
CreatePlaylist: typeof import('./src/components/Modal/CreatePlaylist.vue')['default']
2832
CustomCode: typeof import('./src/components/Modal/Setting/CustomCode.vue')['default']
2933
DefaultLyric: typeof import('./src/components/Player/PlayerLyric/DefaultLyric.vue')['default']
34+
DiscordRpcConfig: typeof import('./src/components/Setting/components/DiscordRpcConfig.vue')['default']
35+
DownloadDirectory: typeof import('./src/components/Setting/components/DownloadDirectory.vue')['default']
3036
DownloadModal: typeof import('./src/components/Modal/DownloadModal.vue')['default']
37+
DownloadPathButtons: typeof import('./src/components/Setting/components/DownloadPathButtons.vue')['default']
3138
Equalizer: typeof import('./src/components/Modal/Equalizer.vue')['default']
3239
ExcludeLyrics: typeof import('./src/components/Modal/Setting/ExcludeLyrics.vue')['default']
3340
FontManager: typeof import('./src/components/Modal/Setting/FontManager.vue')['default']
3441
FullPlayer: typeof import('./src/components/Player/FullPlayer.vue')['default']
3542
FullPlayerMobile: typeof import('./src/components/Player/FullPlayerMobile.vue')['default']
36-
GeneralSetting: typeof import('./src/components/Setting/GeneralSetting.vue')['default']
43+
GeneralSetting: typeof import('./src/components/Setting/old/GeneralSetting.vue')['default']
3744
HomePageSectionManager: typeof import('./src/components/Modal/Setting/HomePageSectionManager.vue')['default']
3845
JumpArtist: typeof import('./src/components/Modal/JumpArtist.vue')['default']
39-
KeyboardSetting: typeof import('./src/components/Setting/KeyboardSetting.vue')['default']
46+
KeyboardSetting: typeof import('./src/components/Setting/old/KeyboardSetting.vue')['default']
47+
LastfmConfig: typeof import('./src/components/Setting/components/LastfmConfig.vue')['default']
4048
ListComment: typeof import('./src/components/List/ListComment.vue')['default']
4149
ListDetail: typeof import('./src/components/List/ListDetail.vue')['default']
42-
LocalSetting: typeof import('./src/components/Setting/LocalSetting.vue')['default']
50+
LocalLyricDirectories: typeof import('./src/components/Setting/components/LocalLyricDirectories.vue')['default']
51+
LocalMusicDirectories: typeof import('./src/components/Setting/components/LocalMusicDirectories.vue')['default']
52+
LocalMusicDirectory: typeof import('./src/components/Modal/Setting/LocalMusicDirectory.vue')['default']
53+
LocalMusicDirectoryModal: typeof import('./src/components/Modal/Setting/LocalMusicDirectoryModal.vue')['default']
54+
LocalPathConfig: typeof import('./src/components/Setting/components/LocalPathConfig.vue')['default']
55+
LocalSetting: typeof import('./src/components/Setting/old/LocalSetting.vue')['default']
4356
Login: typeof import('./src/components/Modal/Login/Login.vue')['default']
4457
LoginCookie: typeof import('./src/components/Modal/Login/LoginCookie.vue')['default']
4558
LoginPhone: typeof import('./src/components/Modal/Login/LoginPhone.vue')['default']
4659
LoginQRCode: typeof import('./src/components/Modal/Login/LoginQRCode.vue')['default']
4760
LoginUID: typeof import('./src/components/Modal/Login/LoginUID.vue')['default']
4861
Logo: typeof import('./src/components/Layout/Logo.vue')['default']
4962
LyricPlayer: typeof import('./src/components/AMLL/LyricPlayer.vue')['default']
50-
LyricsSetting: typeof import('./src/components/Setting/LyricsSetting.vue')['default']
63+
LyricPreview: typeof import('./src/components/Setting/components/LyricPreview.vue')['default']
64+
LyricsSetting: typeof import('./src/components/Setting/old/LyricsSetting.vue')['default']
5165
MainPlayer: typeof import('./src/components/Player/MainPlayer.vue')['default']
5266
MainSetting: typeof import('./src/components/Setting/MainSetting.vue')['default']
5367
Menu: typeof import('./src/components/Layout/Menu.vue')['default']
@@ -129,7 +143,7 @@ declare module 'vue' {
129143
NText: typeof import('naive-ui')['NText']
130144
NThing: typeof import('naive-ui')['NThing']
131145
NTree: typeof import('naive-ui')['NTree']
132-
OtherSetting: typeof import('./src/components/Setting/OtherSetting.vue')['default']
146+
OtherSetting: typeof import('./src/components/Setting/old/OtherSetting.vue')['default']
133147
PersonalFM: typeof import('./src/components/Player/PlayerComponents/PersonalFM.vue')['default']
134148
PlayerBackground: typeof import('./src/components/Player/PlayerMeta/PlayerBackground.vue')['default']
135149
PlayerComment: typeof import('./src/components/Player/PlayerComponents/PlayerComment.vue')['default']
@@ -142,15 +156,19 @@ declare module 'vue' {
142156
PlayerSlider: typeof import('./src/components/Player/PlayerComponents/PlayerSlider.vue')['default']
143157
PlayerSpectrum: typeof import('./src/components/Player/PlayerComponents/PlayerSpectrum.vue')['default']
144158
PlaylistAdd: typeof import('./src/components/Modal/PlaylistAdd.vue')['default']
145-
PlaySetting: typeof import('./src/components/Setting/PlaySetting.vue')['default']
159+
PlaySetting: typeof import('./src/components/Setting/old/PlaySetting.vue')['default']
146160
Provider: typeof import('./src/components/Global/Provider.vue')['default']
161+
ProxyConfig: typeof import('./src/components/Setting/components/ProxyConfig.vue')['default']
147162
RouterLink: typeof import('vue-router')['RouterLink']
148163
RouterView: typeof import('vue-router')['RouterView']
149164
ScalingModal: typeof import('./src/components/Modal/ScalingModal.vue')['default']
150165
SearchDefault: typeof import('./src/components/Search/SearchDefault.vue')['default']
151166
SearchInp: typeof import('./src/components/Search/SearchInp.vue')['default']
152167
SearchInpMenu: typeof import('./src/components/Menu/SearchInpMenu.vue')['default']
153168
SearchSuggest: typeof import('./src/components/Search/SearchSuggest.vue')['default']
169+
SettingItemRenderer: typeof import('./src/components/Setting/SettingItemRenderer.vue')['default']
170+
SettingSearch: typeof import('./src/components/Setting/SettingSearch.vue')['default']
171+
ShortcutRecorder: typeof import('./src/components/Setting/components/ShortcutRecorder.vue')['default']
154172
SidebarHideManager: typeof import('./src/components/Modal/Setting/SidebarHideManager.vue')['default']
155173
Sider: typeof import('./src/components/Layout/Sider.vue')['default']
156174
SImage: typeof import('./src/components/UI/s-image.vue')['default']
@@ -164,15 +182,18 @@ declare module 'vue' {
164182
SongPlayList: typeof import('./src/components/List/SongPlayList.vue')['default']
165183
SongUnlockManager: typeof import('./src/components/Modal/Setting/SongUnlockManager.vue')['default']
166184
StreamingServerConfig: typeof import('./src/components/Modal/Setting/StreamingServerConfig.vue')['default']
167-
StreamingSetting: typeof import('./src/components/Setting/StreamingSetting.vue')['default']
185+
StreamingServerList: typeof import('./src/components/Setting/components/StreamingServerList.vue')['default']
186+
StreamingSetting: typeof import('./src/components/Setting/old/StreamingSetting.vue')['default']
168187
SvgIcon: typeof import('./src/components/Global/SvgIcon.vue')['default']
169188
TextContainer: typeof import('./src/components/Global/TextContainer.vue')['default']
170189
ThemeConfig: typeof import('./src/components/Modal/ThemeConfig.vue')['default']
171-
ThirdSetting: typeof import('./src/components/Setting/ThirdSetting.vue')['default']
190+
ThirdSetting: typeof import('./src/components/Setting/old/ThirdSetting.vue')['default']
191+
UniversalSetting: typeof import('./src/components/Setting/UniversalSetting.vue')['default']
172192
UpdateApp: typeof import('./src/components/Modal/UpdateApp.vue')['default']
173193
UpdatePlaylist: typeof import('./src/components/Modal/UpdatePlaylist.vue')['default']
174194
User: typeof import('./src/components/Layout/User.vue')['default']
175195
UserAgreement: typeof import('./src/components/Modal/UserAgreement.vue')['default']
176196
VirtualScroll: typeof import('./src/components/UI/VirtualScroll.vue')['default']
197+
WebsocketConfig: typeof import('./src/components/Setting/components/WebsocketConfig.vue')['default']
177198
}
178199
}

electron/main/windows/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ export const createWindow = (
3232
},
3333
};
3434
// 合并参数
35+
if (options.webPreferences) {
36+
options.webPreferences = Object.assign(
37+
{},
38+
defaultOptions.webPreferences,
39+
options.webPreferences,
40+
);
41+
}
3542
options = Object.assign(defaultOptions, options);
3643
// 创建窗口
3744
const win = new BrowserWindow(options);

electron/main/windows/lyric-window.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class LyricWindow {
7474
maximizable: false,
7575
// 窗口不能进入全屏状态
7676
fullscreenable: false,
77+
webPreferences: {
78+
zoomFactor: 1.0,
79+
},
7780
});
7881
if (!this.win) return null;
7982
// 加载地址

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "splayer",
33
"productName": "SPlayer",
4-
"version": "3.0.0-beta.9",
4+
"version": "3.0.0-rc.1",
55
"description": "A minimalist music player",
66
"main": "./out/main/index.js",
77
"author": "imsyy",

src/App.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<template>
2-
<Provider>
2+
<Provider v-if="!isDesktopLyric">
33
<router-view />
44
</Provider>
5+
<router-view v-else />
56
</template>
7+
8+
<script setup lang="ts">
9+
const isDesktopLyric = location.hash.includes("desktop-lyric");
10+
</script>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<template>
2+
<div class="local-music-directory">
3+
<n-text class="local-list-tip">
4+
请选择本地音乐文件夹,将自动扫描您添加的目录,歌曲增删实时同步
5+
</n-text>
6+
<n-scrollbar style="max-height: 50vh">
7+
<n-list class="local-list" hoverable clickable bordered>
8+
<div v-if="!settingStore.localFilesPath.length" class="empty">
9+
<n-empty description="暂无目录" />
10+
</div>
11+
<n-list-item v-for="(path, index) in settingStore.localFilesPath" :key="index">
12+
<template #prefix>
13+
<SvgIcon :size="20" name="Folder" />
14+
</template>
15+
<template #suffix>
16+
<n-button :focusable="false" quaternary @click="changeLocalMusicPath(index)">
17+
<template #icon>
18+
<SvgIcon :size="20" name="Delete" />
19+
</template>
20+
</n-button>
21+
</template>
22+
<n-thing :title="path" />
23+
</n-list-item>
24+
</n-list>
25+
</n-scrollbar>
26+
<n-flex justify="center" style="margin-top: 20px">
27+
<n-button class="add-path" strong secondary @click="changeLocalMusicPath()">
28+
<template #icon>
29+
<SvgIcon name="FolderPlus" />
30+
</template>
31+
添加文件夹
32+
</n-button>
33+
</n-flex>
34+
</div>
35+
</template>
36+
37+
<script setup lang="ts">
38+
import { useSettingStore } from "@/stores";
39+
import { changeLocalMusicPath } from "@/utils/helper";
40+
import SvgIcon from "@/components/Global/SvgIcon.vue";
41+
42+
const settingStore = useSettingStore();
43+
</script>
44+
45+
<style scoped lang="scss">
46+
.local-list-tip {
47+
display: block;
48+
margin-bottom: 12px;
49+
opacity: 0.8;
50+
}
51+
.local-list {
52+
:deep(.n-list-item__prefix) {
53+
display: flex;
54+
align-items: center;
55+
justify-content: center;
56+
}
57+
:deep(.n-list-item__main) {
58+
.n-thing-main__description {
59+
font-size: 13px;
60+
opacity: 0.6;
61+
}
62+
}
63+
.empty {
64+
padding: 20px 0;
65+
}
66+
}
67+
</style>

0 commit comments

Comments
 (0)