diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..da9331c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar", "esbenp.prettier-vscode"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 6cb0d2f..6a55cc8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,5 @@ { - "cSpell.words": [ - "IPTV", - "iptv", - "liyanyan", - "tauri" - ], + "cSpell.words": ["IPTV", "iptv", "liyanyan", "tauri"], "cSpell.ignorePaths": [ "package-lock.json", "public/api", @@ -14,5 +9,16 @@ ".git/{index,*refs,*HEAD}", ".vscode", ".vscode-insiders" - ] -} \ No newline at end of file + ], + "explorer.fileNesting.enabled": true, + "explorer.fileNesting.patterns": { + "tsconfig.json": "tsconfig.*.json, env.d.ts", + "vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*", + "package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .oxlint*, oxlint*, .oxfmt*, .prettier*, prettier*, .editorconfig" + }, + "editor.codeActionsOnSave": { + "source.fixAll": "explicit" + }, + "editor.formatOnSave": false, + "editor.defaultFormatter": "esbenp.prettier-vscode" +} diff --git a/ui/src/components/ConfigPanel.vue b/ui/src/components/ConfigPanel.vue deleted file mode 100644 index b33f430..0000000 --- a/ui/src/components/ConfigPanel.vue +++ /dev/null @@ -1,483 +0,0 @@ - - - - - - 应用设置 - ✕ - - - - - - {{ tab.name }} - - - - - - - - 数据源类型 - - 📁 本地文件 - 🌐 在线接口 - ✏️ 自定义 - - - - - 选择文件 - - result.txt(完整) - IPv4 专线 - IPv6 专线 - - - - - 接口地址 - - - - - EPG 数据源 - - 📁 本地文件 - ✏️ 自定义 - - - - - - - - 自动播放 - - - - - - - - 默认音量 {{ Math.round(config.defaultVolume * 100) }}% - - - - - 检测超时 {{ config.checkTimeout / 1000 }}s - - - - - 缓存过期 {{ Math.round(config.cacheExpire / 1000 / 60 / 60) }}h - - - - - - - - 主题 - - - 🌙 - 深色 - - - ☀ - 浅色 - - - 💻 - 跟随系统 - - - - - - 快捷键 - S 打开设置 | M 菜单 | I 信息 | F 收藏 - ←→ 切换线路 | ↑↓ 切换频道 - - - - - - - - - - - - diff --git a/ui/src/components/Layout/ChannelList.vue b/ui/src/components/Layout/ChannelList.vue deleted file mode 100644 index f6eb179..0000000 --- a/ui/src/components/Layout/ChannelList.vue +++ /dev/null @@ -1,160 +0,0 @@ - - - - - {{ getChannelLogo(channel.name) }} - - - {{ channel.name }} - - - {{ getValidCount(channel) }}/{{ channel.urls?.length || 0 }}线路 - - ★ - - - - - - - - - diff --git a/ui/src/components/Layout/DateList.vue b/ui/src/components/Layout/DateList.vue deleted file mode 100644 index 42f6780..0000000 --- a/ui/src/components/Layout/DateList.vue +++ /dev/null @@ -1,108 +0,0 @@ - - - - {{ date.day }} - {{ date.label }} - - - - - - - diff --git a/ui/src/components/Layout/GroupList.vue b/ui/src/components/Layout/GroupList.vue deleted file mode 100644 index 2fb49f5..0000000 --- a/ui/src/components/Layout/GroupList.vue +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - {{ group.icon }} - - {{ group.name }} - {{ group.count }}个 - - - - - - - - - - - {{ group.icon }} - - {{ group.name }} - {{ group.count }}个 - - - - - - - - - diff --git a/ui/src/components/Layout/ProgramList.vue b/ui/src/components/Layout/ProgramList.vue deleted file mode 100644 index 040eb45..0000000 --- a/ui/src/components/Layout/ProgramList.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - {{ program.time }} - - {{ program.title }} - 当前 - - - - - - - - diff --git a/ui/src/main.js b/ui/src/main.js index 27b8b78..43d27f6 100644 --- a/ui/src/main.js +++ b/ui/src/main.js @@ -1,7 +1,5 @@ import { createApp } from 'vue' -import { createPinia } from 'pinia' import App from './App.vue' const app = createApp(App) -app.use(createPinia()) app.mount('#app') diff --git a/ui/src/stores/useStore.js b/ui/src/stores/useStore.js deleted file mode 100644 index 6764a68..0000000 --- a/ui/src/stores/useStore.js +++ /dev/null @@ -1,118 +0,0 @@ -import { defineStore } from 'pinia' -import { ref, computed } from 'vue' - -// 收藏 & 历史记录 状态管理 -export const useStore = defineStore('iptv', () => { - // ============ 收藏 ============ - const favorites = ref(new Set()) - - const loadFavorites = () => { - try { - const saved = localStorage.getItem('iptv_favorites') - if (saved) { - favorites.value = new Set(JSON.parse(saved)) - } - } catch (e) { - console.error('加载收藏失败:', e) - } - } - - const saveFavorites = () => { - localStorage.setItem('iptv_favorites', JSON.stringify([...favorites.value])) - } - - const toggleFavorite = (channelId) => { - if (favorites.value.has(channelId)) { - favorites.value.delete(channelId) - } else { - favorites.value.add(channelId) - } - saveFavorites() - } - - const isFavorite = (channelId) => favorites.value.has(channelId) - - // ============ 播放历史 ============ - const history = ref([]) - const MAX_HISTORY = 10 - - const loadHistory = () => { - try { - const saved = localStorage.getItem('iptv_history') - if (saved) { - history.value = JSON.parse(saved) - } - } catch (e) { - console.error('加载历史失败:', e) - } - } - - const saveHistory = () => { - localStorage.setItem('iptv_history', JSON.stringify(history.value.slice(0, MAX_HISTORY))) - } - - const addToHistory = (channel) => { - // 移除重复项 - history.value = history.value.filter(h => h.id !== channel.id) - // 添加到开头 - history.value.unshift({ - ...channel, - playedAt: Date.now() - }) - saveHistory() - } - - const clearHistory = () => { - history.value = [] - saveHistory() - } - - // ============ 设置 ============ - const settings = ref({ - autoPlay: true, - defaultVolume: 0.8, - showEpg: true, - theme: 'dark', - checkTimeout: 2000, // 检测超时时间(ms) - checkConcurrency: 5 // 并发数 - }) - - const loadSettings = () => { - try { - const saved = localStorage.getItem('iptv_settings') - if (saved) { - settings.value = { ...settings.value, ...JSON.parse(saved) } - } - } catch (e) { - console.error('加载设置失败:', e) - } - } - - const saveSettings = () => { - localStorage.setItem('iptv_settings', JSON.stringify(settings.value)) - } - - const updateSetting = (key, value) => { - settings.value[key] = value - saveSettings() - } - - // 初始化 - loadFavorites() - loadHistory() - loadSettings() - - return { - // 收藏 - favorites, - toggleFavorite, - isFavorite, - // 历史 - history, - addToHistory, - clearHistory, - // 设置 - settings, - updateSetting - } -})
S 打开设置 | M 菜单 | I 信息 | F 收藏
←→ 切换线路 | ↑↓ 切换频道