Compare commits

...

266 Commits

Author SHA1 Message Date
jxxghp
229b7b0c12 chore: bump version to 2.8.5 in package.json 2025-11-20 19:37:58 +08:00
jxxghp
4b7b5ff8a4 fix #397 2025-11-20 19:37:33 +08:00
jxxghp
4906bde746 chore: bump version to 2.8.4 in package.json and refactor AccountSettingSystem.vue to streamline AI agent settings 2025-11-20 19:25:28 +08:00
jxxghp
a87a1a8988 Merge pull request #403 from madrays/v2 2025-11-20 19:11:51 +08:00
madrays
e05f45e681 增加自动拉取可用ai模型的易用性功能 2025-11-20 19:01:25 +08:00
jxxghp
b4acacea81 chore: bump version to 2.8.3 in package.json 2025-11-18 12:49:06 +08:00
jxxghp
fa9645b05b Merge pull request #402 from cddjr/trimemedia 2025-11-17 14:21:39 +08:00
景大侠
1ed4052814 fix #401 2025-11-17 14:08:51 +08:00
jxxghp
7dc814461f 更新 package.json 2025-11-16 06:31:32 +08:00
jxxghp
9154ec0e8c Merge pull request #400 from wikrin/cursor-move 2025-11-16 06:30:57 +08:00
jxxghp
3a2ea60583 Merge pull request #399 from wikrin/release_dates 2025-11-16 06:30:31 +08:00
Attente
b36bff3a1e feat(dashboard): 移除 Vue 渲染模式下的固定拖拽图标
更新`docs/module-federation-guide.md` 文档,使用 `v-hover` 实现仅在鼠标悬停时显示拖拽图标。
2025-11-15 18:03:29 +08:00
Attente
b3d8cbf280 feat: 为媒体信息添加数字/实体发行日期支持 2025-11-13 23:52:54 +08:00
jxxghp
38fb02d112 Merge pull request #398 from cddjr/trimemedia 2025-11-05 23:16:28 +08:00
景大侠
2597f893cd rename 2025-11-05 15:26:34 +08:00
景大侠
ebdd036654 避免飞牛媒体库的图片地址携带敏感数据 2025-11-05 15:15:36 +08:00
景大侠
5032f0e6a9 fix 飞牛影视无法显示图片
图片接口增加Cookies参数
2025-11-04 11:32:41 +08:00
jxxghp
ad963d718d refactor: Remove unused AI agent subheader from account settings 2025-11-01 10:39:25 +08:00
jxxghp
69d314bce3 feat: Add AI agent settings and localization support for LLM configuration 2025-10-31 11:46:45 +08:00
jxxghp
4a7425a947 feat: Add download count formatting function and update card components to use it 2025-10-18 20:13:41 +08:00
jxxghp
c172ac0d5c Merge pull request #395 from jxxghp/cursor/add-default-all-filter-for-subscription-styles-ad8f 2025-09-16 13:38:33 +08:00
Cursor Agent
01a66493a8 feat: Add "All" option to genre filter
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-16 05:37:47 +00:00
jxxghp
188f8b3faa 更新缓存版本至v13 2025-09-16 13:14:17 +08:00
jxxghp
ebcf5fad71 Merge pull request #394 from jxxghp/cursor/update-subscription-sorting-and-scoring-6aa9 2025-09-16 12:26:44 +08:00
Cursor Agent
d1a656db82 Refactor: Move sort filter to top in subscribe views
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-16 04:25:38 +00:00
Cursor Agent
4f6a11fd7c Refactor subscribe views to use VChipGroup for sorting
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-16 04:25:02 +00:00
jxxghp
1d09a946bb Merge pull request #393 from jxxghp/cursor/add-sorting-to-subscription-filters-b700 2025-09-16 12:02:21 +08:00
Cursor Agent
6c4eb7edbd Add sorting options to subscribe views and locales
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-16 03:46:35 +00:00
jxxghp
4f9f669ac6 Merge pull request #392 from jxxghp/cursor/translate-missing-string-and-adjust-slider-max-value-4d93 2025-09-16 11:12:31 +08:00
Cursor Agent
f9e0e78473 Refactor: Remove rating input, display max rating
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-16 03:10:14 +00:00
Cursor Agent
b004facfca Refactor: Improve rating filter UI and update locale text
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-16 02:36:16 +00:00
jxxghp
fb6ee2910f 更新 package.json 2025-09-16 09:00:54 +08:00
jxxghp
3fedc9b730 Merge pull request #391 from jxxghp/cursor/update-popular-subscriptions-api-with-filters-9c20 2025-09-16 08:47:41 +08:00
Cursor Agent
b260427312 feat: Add filtering and genre selection to subscribe share
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-16 00:46:08 +00:00
Cursor Agent
dd1447e93c feat: Add minSubscribers translation to zh-TW locale
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-16 00:20:27 +00:00
Cursor Agent
dbcc213562 feat: Add subscribe filtering and localization
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-16 00:17:40 +00:00
jxxghp
1c019cd5c8 重构离线页面组件 2025-09-13 14:00:03 +08:00
jxxghp
e37bde77a1 fix https://github.com/jxxghp/MoviePilot/issues/4922 2025-09-13 10:18:41 +08:00
jxxghp
57bf0d2021 优化快捷访问组件的滚动管理 2025-09-12 20:57:29 +08:00
jxxghp
88b00f7069 更新viewport设置 2025-09-12 08:25:21 +08:00
jxxghp
7b08cbb2f7 优化进度对话框 2025-09-11 20:33:14 +08:00
jxxghp
97c0ec184d Fix: Center cache statistics on mobile (#389)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-11 18:15:38 +08:00
jxxghp
d18c845088 Refactor cache view for better mobile responsiveness (#388)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-11 18:05:23 +08:00
jxxghp
a64d97774d 优化关于对话框和快捷栏的布局 2025-09-11 17:36:02 +08:00
jxxghp
2ddc51aa4f 调整词表、缓存、关于功能的位置 2025-09-11 15:29:24 +08:00
jxxghp
28afe2a922 统一图标导入方式 2025-09-11 15:03:12 +08:00
jxxghp
c2e97bf191 调整 Vite 配置,增加最大缓存文件大小至 10MB,以支持更大的文件。 2025-09-11 14:40:34 +08:00
jxxghp
c922752a1f Merge pull request #387 from jxxghp/setup-wizard
Setup wizard
2025-09-11 14:32:30 +08:00
jxxghp
08f36a74ca 增强配置向导功能 2025-09-11 14:30:52 +08:00
jxxghp
d7809dd00c 调整配置向导的布局,增加右侧按钮组 2025-09-11 12:36:12 +08:00
jxxghp
27582004da 增强配置向导功能 2025-09-11 08:31:13 +08:00
jxxghp
3d6a176cde 提升配置向导的样式,增加z-index和阴影效果 2025-09-10 17:10:01 +08:00
jxxghp
4a2073a038 优化配置向导 2025-09-10 16:56:06 +08:00
jxxghp
c8a65ecbe4 修复配置向导中的用户信息保存逻辑 2025-09-10 15:23:48 +08:00
jxxghp
3750d5cba0 增强配置向导功能 2025-09-10 14:46:02 +08:00
jxxghp
55b383780e Split setup vue into view components (#386)
* Refactor: Extract setup wizard into composable and components

This commit refactors the setup wizard by extracting its logic into a composable function `useSetupWizard` and breaking down the UI into individual components for better organization and reusability.

Co-authored-by: jxxghp <jxxghp@qq.com>

* Refactor: Move setup wizard components to separate files

This commit refactors the setup wizard by extracting individual steps into their own Vue components. This improves code organization and maintainability.

Co-authored-by: jxxghp <jxxghp@qq.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jxxghp <jxxghp@qq.com>
2025-09-10 11:48:09 +08:00
jxxghp
6aec0ddf88 更新配置向导 2025-09-10 08:51:05 +08:00
jxxghp
7c8e94d1df 更新用户配置 2025-09-10 08:30:19 +08:00
jxxghp
5ecbf626c8 更新用户配置向导 2025-09-09 20:31:00 +08:00
jxxghp
584f580e3b 实现配置向导功能 2025-09-09 13:50:37 +08:00
jxxghp
280de47dac 新增配置向导 2025-09-09 12:43:53 +08:00
jxxghp
c7c05f5897 Merge pull request #385 from cddjr/fix_calendar 2025-09-08 21:39:39 +08:00
景大侠
bb86180582 修复日历可能会空白的问题 2025-09-08 21:33:37 +08:00
jxxghp
aff228edd3 更新 Footer 组件以支持动态显示导航 2025-09-08 19:19:31 +08:00
jxxghp
f65ae6d703 更新 DefaultLayout.vue 2025-09-08 18:38:52 +08:00
jxxghp
0fccc06883 修改 ProgressDialog 组件 2025-09-08 17:38:44 +08:00
jxxghp
8652966645 调整 index.html 和默认布局样式,修改溢出属性以改善页面滚动体验 2025-09-08 16:49:58 +08:00
jxxghp
6d84eb9f09 更新 package.json 版本号至 2.8.0 2025-09-08 16:13:10 +08:00
jxxghp
1a3dccac29 更新 index.html 2025-09-08 16:12:28 +08:00
jxxghp
fa8de34fc5 更新页面样式 2025-09-08 08:49:00 +08:00
jxxghp
10cfd6be80 更新 service-worker.ts 2025-09-02 13:47:57 +08:00
jxxghp
a390b36e7c 更新 package.json 版本号至 2.7.9 2025-09-02 12:35:41 +08:00
jxxghp
d6b5994e22 添加搜索时间间隔选项 2025-09-02 11:48:24 +08:00
jxxghp
08611a97e7 Merge pull request #384 from Aqr-K/feat-v2.7.8-filelist-case-insensitive 2025-08-31 07:51:18 +08:00
Aqr-K
35bbb44ce3 更新 FileList.vue 2025-08-30 21:08:17 +08:00
Aqr-K
8ff879661a fix(file): Simplify the selectMode button. 2025-08-30 20:56:58 +08:00
Aqr-K
a8f01f099d feat(file): Add an ignoreCase button. 2025-08-30 20:54:17 +08:00
jxxghp
040ab1096b 更新 package.json 版本号至 2.7.8 2025-08-28 08:22:51 +08:00
jxxghp
0cbdf24315 fix https://github.com/jxxghp/MoviePilot/issues/4849 2025-08-27 12:32:19 +08:00
jxxghp
164ea79bd1 Use body-lock for quick access background scroll (#382)
* Checkpoint before follow-up message

Co-authored-by: jxxghp <jxxghp@live.cn>

* Replace custom BodyLock with body-scroll-lock library

Co-authored-by: jxxghp <jxxghp@live.cn>

* Fix scroll behavior in QuickAccess panel with targeted scroll disabling

Co-authored-by: jxxghp <jxxghp@live.cn>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jxxghp <jxxghp@live.cn>
2025-08-25 23:10:15 +08:00
jxxghp
97f3435bb3 Prevent scroll when QuickAccess overlay is open (#381)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jxxghp <jxxghp@live.cn>
2025-08-25 22:46:28 +08:00
jxxghp
63b108ff6b 更新 package.json 2025-08-25 22:19:02 +08:00
jxxghp
b0880cb369 更新 types.ts 2025-08-25 21:48:55 +08:00
jxxghp
5f70ee8e18 更新缓存版本至 v1.1.0 2025-08-25 13:18:38 +08:00
jxxghp
4c64f7a2c3 优化 HTML 结构,调整 CSS 样式 2025-08-25 13:03:45 +08:00
jxxghp
262927e459 fix:整理中的所以取消 2025-08-24 18:50:07 +08:00
jxxghp
b16c566004 fix ui 2025-08-24 18:32:29 +08:00
jxxghp
1af82dbee6 优化 TransferQueueDialog 组件,合并相同 title_year 的媒体记录和任务 2025-08-24 18:25:59 +08:00
jxxghp
2e9a5a4e13 更新 TransferQueueDialog 组件 2025-08-24 18:18:53 +08:00
jxxghp
b455f603dc 调整 TransferQueueDialog 组件 2025-08-24 18:11:36 +08:00
jxxghp
37c0c3e339 优化 TransferQueueDialog 组件的 SSE 连接管理 2025-08-24 18:02:15 +08:00
jxxghp
b6cb341082 fix 整理进度显示 2025-08-24 17:50:03 +08:00
jxxghp
1af1a06700 优化 SSE 管理器 2025-08-24 17:34:43 +08:00
jxxghp
79e4ecfdbe 引入 crypto-js 库以计算文件路径的 MD5 值 2025-08-24 17:05:36 +08:00
jxxghp
1585271e37 为 TransferQueueDialog 组件优化 SSE 监听管理 2025-08-24 16:16:33 +08:00
jxxghp
c240b171e4 更新 package.json 版本号至 2.7.6 2025-08-24 13:03:25 +08:00
jxxghp
9c405e90ac 重构 TransferQueueDialog 组件,添加整体和当前文件进度管理 2025-08-24 13:02:40 +08:00
jxxghp
3ec3212ca5 更新 service-worker.ts 2025-08-24 08:16:14 +08:00
jxxghp
b1289f6177 实现订阅批量管理功能 2025-08-23 21:20:09 +08:00
jxxghp
64b7ba48c8 fix ios 2025-08-23 20:39:40 +08:00
jxxghp
f093053ea4 优化对话框状态管理 2025-08-23 19:32:23 +08:00
jxxghp
9faa0ded59 为对话框组件添加防止滚动穿透的样式 2025-08-23 19:14:12 +08:00
jxxghp
0f7dafeb23 控制合集搜索项的显示 2025-08-23 19:03:50 +08:00
jxxghp
472d1960d9 重构对话框组件,将所有 DialogWrapper 替换为 VDialog,并更新缓存版本至 v1.1.0 2025-08-23 18:55:34 +08:00
jxxghp
6e50acf106 更新 service-worker.ts 2025-08-23 10:22:31 +08:00
jxxghp
a3fb4b1534 更新 package.json 版本号至 2.7.5 2025-08-23 08:56:14 +08:00
jxxghp
382cae32a2 fix site import dialog 2025-08-23 08:47:16 +08:00
jxxghp
0aa4851f8e Merge pull request #380 from jxxghp/cursor/implement-site-batch-import-and-export-2694 2025-08-23 07:32:40 +08:00
Cursor Agent
65271e6d13 Remove package-lock.json from version control
Co-authored-by: jxxghp <jxxghp@live.cn>
2025-08-22 23:13:47 +00:00
Cursor Agent
671cf8d588 Refactor site import/export feature with improved toast notifications
Co-authored-by: jxxghp <jxxghp@live.cn>
2025-08-22 23:12:01 +00:00
Cursor Agent
afc7c81028 Add site batch import/export functionality with preview and validation
Co-authored-by: jxxghp <jxxghp@live.cn>
2025-08-22 23:09:03 +00:00
jxxghp
c330aee560 增强消息视图的SSE连接管理 2025-08-21 09:22:57 +08:00
jxxghp
eafe63c886 更新 package.json 2025-08-20 10:34:29 +08:00
jxxghp
53206d05b8 更新 service-worker.ts 2025-08-20 10:34:10 +08:00
jxxghp
af085d457e 更新 PluginCardListView.vue 2025-08-20 10:33:52 +08:00
jxxghp
fb36033939 修复数据库类型判断 2025-08-19 13:18:02 +08:00
jxxghp
584e7672df 更新版本号至2.7.3 2025-08-19 13:08:23 +08:00
jxxghp
d4f7a5a1c0 fix https://github.com/jxxghp/MoviePilot/issues/4769 2025-08-17 11:38:17 +08:00
jxxghp
2a9ea81ad4 feat: 优化SSE连接延迟,添加初始化状态提示 2025-08-17 08:39:02 +08:00
jxxghp
276948dd68 feat: 修复成功率计算和统计总览功能 2025-08-12 15:28:58 +08:00
jxxghp
990c5583f2 移除不必要的 TMDB 图片域名选项 2025-08-12 14:27:01 +08:00
jxxghp
644f1b5640 Merge pull request #377 from Sowevo/v2 2025-08-12 06:52:26 +08:00
sowevo
5261fbe870 🚨 0 2025-08-12 05:44:27 +08:00
sowevo
e4f2d85e2b 🚨 多余参数 2025-08-12 05:18:23 +08:00
sowevo
8e3ccdc24a feat: 透明倒影 2025-08-12 05:09:58 +08:00
sowevo
cd6d93affd feat: 透明背景 2025-08-12 04:32:51 +08:00
sowevo
6096ab0c9b feat: 调整间距 2025-08-12 04:31:19 +08:00
sowevo
0a87bb1db1 canvas固定宽和高 2025-08-12 04:14:13 +08:00
jxxghp
a19042c655 在设置中添加浏览器仿真选项 2025-08-11 21:35:20 +08:00
jxxghp
a889687a6a 更新 package.json 2025-08-10 18:16:09 +08:00
jxxghp
e1cdc715aa 更新 GitHub Actions 配置,启用最新版本标记功能 2025-08-06 16:37:09 +08:00
jxxghp
a82b3a0a29 优化消息处理逻辑 2025-08-05 15:47:46 +08:00
jxxghp
d93a71f0be 更新 TorrentRowListView.vue 2025-08-03 11:56:32 +08:00
jxxghp
899dc765bc 更新 TorrentCardListView.vue 2025-08-03 11:55:53 +08:00
jxxghp
449490e52d 更新 SiteStatisticsDialog.vue 2025-08-02 14:53:49 +08:00
jxxghp
5541d7974e 更新 SiteStatisticsDialog.vue 2025-08-02 14:34:59 +08:00
jxxghp
ae3eb36183 添加站点耗时统计信息展示 2025-08-02 14:20:17 +08:00
jxxghp
d57e9a397c 优化样式以支持动态颜色显示。 2025-08-02 11:12:27 +08:00
jxxghp
9d4fd16d81 优化透明主题下的模糊度和透明度设置 2025-07-29 11:49:59 +08:00
jxxghp
3b16e7a123 优化透明主题的模糊度和透明度设置 2025-07-29 09:46:23 +08:00
jxxghp
1c4a2176e9 实现透明主题的透明度和模糊度设置功能 2025-07-29 08:20:16 +08:00
jxxghp
62f9243714 更新 service-worker.ts 2025-07-29 07:05:17 +08:00
jxxghp
03bd23d314 更新文件系统资源检查的相关提示信息 2025-07-26 23:11:29 +08:00
jxxghp
27497d1812 更新 SiteAddEditDialog.vue 2025-07-26 08:34:22 +08:00
jxxghp
f36c1bd2b5 整合主题管理器,优化主题切换逻辑 2025-07-25 13:39:47 +08:00
jxxghp
cf72b2cdb9 更新加载动画的样式和逻辑。 2025-07-23 20:33:02 +08:00
jxxghp
44f6950fea Merge pull request #376 from wumode/fix_recommend
fix: 修复推荐页面外部推荐源URL参数拼接问题
2025-07-23 20:24:32 +08:00
wumode
308ddfedea fix: 修复推荐页面外部推荐源URL参数拼接问题 2025-07-23 20:12:36 +08:00
jxxghp
ac7c330e2f 优化工作流卡片和对话框中的事件类型显示逻辑 2025-07-23 15:33:43 +08:00
jxxghp
1bde3492da 更新 package.json 2025-07-23 12:01:03 +08:00
jxxghp
f884518df3 优化工作流任务卡片的状态显示 2025-07-23 11:52:54 +08:00
jxxghp
1f7f9ce9db 新增工作流触发类型和事件类型支持 2025-07-22 20:58:55 +08:00
jxxghp
58acde2292 优化支持站点的显示逻辑 2025-07-21 12:49:55 +08:00
jxxghp
4e0fe2f449 更新 AccountSettingAbout.vue 2025-07-21 12:38:37 +08:00
jxxghp
536793ab25 新增支持站点折叠功能,并更新相关国际化文本 2025-07-21 11:53:29 +08:00
jxxghp
23a48e07a2 优化订阅列表视图的状态筛选逻辑 2025-07-21 09:57:10 +08:00
jxxghp
1e55557154 优化订阅列表视图的状态筛选逻辑 2025-07-21 09:53:38 +08:00
jxxghp
752231086d 新增订阅功能的状态筛选选项 2025-07-21 09:38:59 +08:00
jxxghp
6f315a408a 移除站点链接的 href 属性 2025-07-20 15:40:58 +08:00
jxxghp
6fa4caa85e fix https://github.com/jxxghp/MoviePilot/issues/4635 2025-07-20 12:34:22 +08:00
jxxghp
1b36c1752f 优化消息弹窗的滚动逻辑 2025-07-20 08:39:33 +08:00
jxxghp
cd58498971 加载消息时按时间排序以确保最新消息在最后 2025-07-20 08:32:10 +08:00
jxxghp
1586137a5d 优化离线状态管理逻辑 2025-07-20 08:25:20 +08:00
jxxghp
6cb8bf74df 在滚动锁定功能中添加事件传播停止,以增强用户体验 2025-07-19 17:45:43 +08:00
jxxghp
787802d0db 优化模块测试视图 2025-07-19 08:55:08 +08:00
jxxghp
b4ad39db12 优化全局滚动锁定功能 2025-07-18 16:39:25 +08:00
jxxghp
c13edbe017 更新 package.json 2025-07-18 11:07:29 +08:00
jxxghp
7546da4f90 新增订阅分享页面及相关搜索功能 2025-07-18 11:05:05 +08:00
jxxghp
76b9a8d9e7 新增支持站点查看功能 2025-07-17 20:46:46 +08:00
jxxghp
d6d52338e9 优化排名展示效果 2025-07-16 12:59:09 +08:00
jxxghp
caa67a0f49 新增订阅分享统计功能 2025-07-16 09:37:34 +08:00
jxxghp
6ddc3ea996 fix #375 2025-07-15 20:25:42 +08:00
jxxghp
7edbf7c724 更新用户资料和账户设置中的链接 2025-07-15 17:31:15 +08:00
jxxghp
4f233ca886 更新 package.json 版本号至 2.6.6 2025-07-15 14:54:49 +08:00
jxxghp
457831536a 移除AccountSettingSite.vue中的USER_AGENT字段 2025-07-14 12:30:54 +08:00
jxxghp
ccef0d87db 更新缓存版本至v1.0.3 2025-07-13 13:52:16 +08:00
jxxghp
584d290283 增强全局滚动锁定功能 2025-07-13 13:46:28 +08:00
jxxghp
2ab14fa33b fix 2025-07-13 13:35:25 +08:00
jxxghp
f0317e1d74 为明亮主题优化Footer组件的背景色透明度 2025-07-13 13:32:05 +08:00
jxxghp
17a206e0f4 更新 DownloadingCard.vue 2025-07-13 11:40:23 +08:00
jxxghp
8ea352cc2f 优化DownloadingCard组件 2025-07-13 11:31:26 +08:00
jxxghp
0f10920898 fix #374 2025-07-13 11:22:27 +08:00
jxxghp
eb098ca775 增强滚动锁定功能 2025-07-13 09:46:38 +08:00
jxxghp
e25caddfef 更新 package.json 2025-07-12 15:15:48 +08:00
jxxghp
c74cf6cf6e 移除构建Plex深度链接时的警告弹窗 2025-07-12 15:13:18 +08:00
jxxghp
ce2d04fa64 更新Plex深度链接构建逻辑 2025-07-12 15:04:36 +08:00
jxxghp
40a4e29c7e 重构深度链接功能 2025-07-12 14:57:03 +08:00
jxxghp
60385715e6 新增媒体服务器深度链接功能 2025-07-12 13:47:00 +08:00
jxxghp
3cce92e83d 优化媒体查询条件,增强响应式样式支持 2025-07-12 13:16:30 +08:00
jxxghp
602b0067d2 Merge pull request #373 from jtcymc/v2 2025-07-12 07:17:57 +08:00
shaw
51d07db99b refactor(dialog): 将日志输出级别从 log 改为 warn
- 在 SubscribeEditDialog.vue 和 SubscribeSeasonDialog.vue 组件中- 当 tmdbid 未设置或为空时,使用 console.warn替代 console.log
- 此修改提高了日志的可见性和严重性级别,以便更好地提醒开发者注意潜在问题
2025-07-12 00:01:55 +08:00
shaw
33d121fd64 fix(dialog): 修复剧集分组查询时 TMDBID 未设置或为空的问题
- 在 SubscribeEditDialog 和 SubscribeSeasonDialog 组件中添加了对 TMDBID 的空值检查
- 如果 TMDBID 未设置或为空,将不会执行剧集分组查询,避免出现错误
2025-07-11 23:57:01 +08:00
jxxghp
e409dbd5b8 优化可用高度计算 2025-07-11 15:14:16 +08:00
jxxghp
79d203470a 更新 service-worker.ts 2025-07-11 07:26:01 +08:00
jxxghp
0f1341615b fix size 2025-07-11 07:06:46 +08:00
jxxghp
97f5410b1c Add files via upload 2025-07-10 23:31:48 +08:00
jxxghp
195f6b7e50 优化卡片组件样式 2025-07-10 22:45:59 +08:00
jxxghp
6691f40c49 优化卡片组件样式 2025-07-10 22:00:06 +08:00
jxxghp
bc1849f0a0 fix 全屏弹窗背景 2025-07-10 21:06:54 +08:00
jxxghp
0f64ea1403 为垂直导航布局的固定导航栏添加内边距,以改善滚动时的视觉效果 2025-07-10 17:29:48 +08:00
jxxghp
320fc1604c 更新 SubscribeListView.vue 中的 Teleport 组件条件,以支持根据订阅类型动态渲染 2025-07-10 16:54:00 +08:00
jxxghp
a8eaf3b995 移除 vite.config.ts 中的缓存键处理逻辑以提高代码简洁性 2025-07-10 16:50:35 +08:00
jxxghp
308a951f78 修正 Vuetify 变量路径为相对路径 2025-07-10 16:40:49 +08:00
jxxghp
9f98b549e9 重构scss文件结构 2025-07-10 16:39:22 +08:00
jxxghp
0e2a259999 优化 WorkflowShareCard 组件 2025-07-10 15:08:10 +08:00
jxxghp
b3d3561111 将 useDialogScrollLock 替换为 useScrollLock 2025-07-10 12:56:51 +08:00
jxxghp
ad857b0810 删除 useScrollLock 组合式 API 2025-07-10 12:52:57 +08:00
jxxghp
0918fa1685 将所有 VDialog 组件替换为 DialogWrapper 组件 2025-07-10 12:44:37 +08:00
jxxghp
273d1f8ef2 更新 _misc.scss 文件,调整媒体查询条件 2025-07-10 11:25:59 +08:00
jxxghp
af1e0a2a60 在 PWAInstallPrompt.vue 中添加 HTTPS 环境检查 2025-07-10 10:59:02 +08:00
jxxghp
79ae772367 优化垂直导航栏样式 2025-07-09 19:53:14 +08:00
jxxghp
d57c8aa305 更新 FetchTorrentsAction.vue 2025-07-09 14:39:20 +08:00
jxxghp
bbd8c1b6d4 更新 yarn.lock 2025-07-09 13:17:30 +08:00
jxxghp
ced9288ed7 优化浏览器警告 2025-07-09 13:16:56 +08:00
jxxghp
cf87e2d5ac 添加工作流备注功能 2025-07-09 12:22:08 +08:00
jxxghp
153d4c1d01 更新工作流分享卡片和对话框 2025-07-09 11:44:52 +08:00
jxxghp
1c50fa228e 更新 ForkWorkflowDialog.vue 2025-07-09 11:28:02 +08:00
jxxghp
0067dc6be3 更新 package.json 2025-07-09 11:17:15 +08:00
jxxghp
36389a5b8c 优化 PWA 状态恢复逻辑 2025-07-09 11:07:24 +08:00
jxxghp
c7443d993e 更新工作流分享功能 2025-07-09 10:46:33 +08:00
jxxghp
9f8dbf3c75 fix workflow 2025-07-09 00:11:19 +08:00
jxxghp
35332544e4 Add workflow sharing functionality (#371)
* Add workflow sharing feature with share, fork, and browse functionality

Co-authored-by: jxxghp <jxxghp@163.com>

* Refactor workflow page with dynamic tabs and internationalization support

Co-authored-by: jxxghp <jxxghp@163.com>

* Remove workflow share implementation documentation

Co-authored-by: jxxghp <jxxghp@163.com>

* Fix indentation and structure in Chinese locale files

Co-authored-by: jxxghp <jxxghp@163.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-07-08 23:31:22 +08:00
jxxghp
f2bc832aca rollback service.js 2025-07-08 22:17:41 +08:00
jxxghp
a6847f7f53 Merge pull request #369 from jxxghp/cursor/fix-pwa-install-prompt-text-display-14c8
Fix PWA install prompt text display
2025-07-08 14:36:18 +08:00
Cursor Agent
396ab64874 Refactor PWA install steps to use dynamic translation keys
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-08 06:19:07 +00:00
jxxghp
59ee3d8ceb fix 订阅历史按钮 2025-07-08 13:48:45 +08:00
jxxghp
3e152bd389 优化 PWAInstallPrompt 组件中的文本提取逻辑 2025-07-08 13:37:18 +08:00
jxxghp
56e8f61bbf 将 PWAInstallPrompt 组件中的 div 替换为 VCard 2025-07-08 13:26:12 +08:00
jxxghp
83c00b0544 fix PWAInstallPrompt 2025-07-08 13:03:11 +08:00
jxxghp
5f82cc715e 优化 PWA 安装提示组件 2025-07-07 23:18:32 +08:00
jxxghp
3ce7fc34f0 fix PWAInstallPrompt 2025-07-07 23:11:27 +08:00
jxxghp
9fc5291fec 优化服务工作者 2025-07-07 22:56:36 +08:00
jxxghp
27c7a842db Merge pull request #367 from jxxghp/cursor/fix-sync-queue-data-corruption-issues-ee60
Cursor/fix sync queue data corruption issues ee60
2025-07-07 22:49:17 +08:00
jxxghp
ffe1992df1 Merge pull request #368 from jxxghp/cursor/fix-ios-detection-inconsistency-in-pwa-2971
Fix iOS detection inconsistency in PWA
2025-07-07 22:48:57 +08:00
Cursor Agent
a80877bab7 Fix PWA install detection on iOS with additional check for MSStream
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-07 14:48:00 +00:00
jxxghp
c787a3c786 Merge pull request #366 from jxxghp/cursor/fix-pwa-support-detection-bug-0f65 2025-07-07 22:43:47 +08:00
Cursor Agent
abda382b96 Refactor service worker types and extract type definitions
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-07 14:35:25 +00:00
Cursor Agent
c5ab0a2cc6 Refactor IndexedDB sync mechanism with dedicated store and improved handling
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-07 14:32:55 +00:00
Cursor Agent
15340dd550 Improve PWA install support detection for various platforms
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-07 14:25:12 +00:00
jxxghp
deaf444864 Merge pull request #364 from jxxghp/cursor/evaluate-app-shell-model-compliance-1502
Evaluate app shell model compliance
2025-07-07 22:09:11 +08:00
Cursor Agent
a5413d1116 Remove PWA optimization documentation files
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-07 14:05:12 +00:00
Cursor Agent
6cb6a5822b Implement PWA optimizations with advanced caching and install features
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-07 13:46:09 +00:00
Cursor Agent
2ffd6f7430 Enhance PWA caching strategy with offline support and optimization docs
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-07 13:35:58 +00:00
jxxghp
cd9eaf4fd7 fix Teleport 2025-07-07 17:24:58 +08:00
jxxghp
3cfe27b7b3 fix 2025-07-07 15:17:49 +08:00
jxxghp
44d78fd2ea Merge pull request #363 from cddjr/fix_top_level_await 2025-07-07 14:07:20 +08:00
jxxghp
0cf3342449 重构PWA状态管理 2025-07-07 14:05:11 +08:00
景大侠
7e4c6516c5 修复 Safari14兼容Top-level await特性
v2.4.4引入的问题
2025-07-07 13:57:35 +08:00
jxxghp
73d7eb65b8 移除可见性状态管理器 2025-07-07 11:32:38 +08:00
jxxghp
fca4afb606 优化PWA状态管理 2025-07-07 11:28:57 +08:00
jxxghp
b15672d593 fix 2025-07-07 11:19:45 +08:00
jxxghp
7a37a18f23 修复下拉快速访问 2025-07-07 11:17:01 +08:00
jxxghp
a14806e840 Merge pull request #361 from jxxghp/cursor/enhance-pwa-state-restoration-features-24b1 2025-07-07 07:50:41 +08:00
Cursor Agent
bbd2851f36 Improve element selector generation for scroll position tracking
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-06 23:34:58 +00:00
Cursor Agent
48418771d4 Remove PWA state management documentation files
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-06 23:27:03 +00:00
Cursor Agent
a81071a50a Refactor PWA state management to simplify and streamline implementation
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-06 23:24:31 +00:00
Cursor Agent
304b990994 Implement lightweight PWA state management with zero-overhead approach
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-06 23:14:50 +00:00
Cursor Agent
8824869cd1 Enhance PWA state management with advanced scroll, form, and modal tracking
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-06 23:03:42 +00:00
jxxghp
325cce5f82 Merge pull request #360 from jxxghp/cursor/analyze-factors-causing-ios-to-kill-pwa-ac82
Analyze factors causing iOS to kill PWA
2025-07-07 06:40:43 +08:00
jxxghp
85db26a704 Merge branch 'v2' into cursor/analyze-factors-causing-ios-to-kill-pwa-ac82 2025-07-06 23:41:42 +08:00
Cursor Agent
65b0acdcb4 Refactor data refresh mechanism with conditional timer support
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-06 15:29:44 +00:00
Cursor Agent
9a27af8c5a Bump version to 2.6.3 and remove optimization documentation files
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-06 15:13:08 +00:00
jxxghp
93ad0859e8 重构PWA状态管理,统一检测方法并优化状态恢复逻辑 2025-07-06 23:04:34 +08:00
Cursor Agent
5e62bac245 Implement background optimization composable for data refresh and SSE
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-06 15:01:17 +00:00
Cursor Agent
bea6c1e326 Optimize PWA background performance with SSE and timer management
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-06 14:52:58 +00:00
Cursor Agent
df76b01826 Add background and SSE managers for improved app lifecycle management
Co-authored-by: jxxghp <jxxghp@163.com>
2025-07-06 14:36:31 +00:00
200 changed files with 17688 additions and 6237 deletions

View File

@@ -57,7 +57,7 @@ jobs:
name: ${{ env.frontend_version }}
draft: false
prerelease: false
make_latest: false
make_latest: true
files: |
dist.zip
env:

View File

@@ -245,13 +245,21 @@ const props = defineProps({
<template>
<div class="dashboard-widget">
<!-- 仪表板内容 -->
<v-card>
<v-card-title>{{ config.title || '仪表板组件' }}</v-card-title>
<v-card-text>
<!-- 组件内容 -->
</v-card-text>
</v-card>
<v-hover>
<!-- 仪表板内容 -->
<template #default="{ isHovering, props: hoverProps }">
<v-card v-bind="hoverProps">
<v-card-title>{{ config.title || '仪表板组件' }}</v-card-title>
<v-card-text>
<!-- 组件内容 -->
</v-card-text>
<!-- 只在悬停时显示拖拽图标 -->
<div v-show="isHovering" class="absolute right-5 top-5">
<v-icon class="cursor-move">mdi-drag</v-icon>
</div>
</v-card>
</template>
</v-hover>
</div>
</template>
```

View File

@@ -1,7 +1,10 @@
<!DOCTYPE html>
<html lang="zh-CN" style="
overflow: hidden auto;
min-block-size: calc(100% + env(safe-area-inset-top) + env(safe-area-inset-bottom));
min-block-size: 100vh;
min-block-size: 100dvh;
--safe-area-inset-bottom: env(safe-area-inset-bottom);
--safe-area-inset-top: env(safe-area-inset-top);
background: var(--initial-loader-bg, #fff);
">
@@ -10,7 +13,7 @@
<meta charset="UTF-8" />
<!-- 核心viewport设置 - 针对PWA优化 -->
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover, shrink-to-fit=no" />
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover, shrink-to-fit=no, interactive-widget=resizes-content" />
<!-- 防止缩放和选择,提供原生应用体验 -->
<meta name="format-detection" content="telephone=no, date=no, email=no, address=no" />
@@ -81,23 +84,150 @@
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<!-- DNS预解析 -->
<!-- DNS预解析和预连接 -->
<link rel="dns-prefetch" href="//fonts.googleapis.com" />
<link rel="dns-prefetch" href="//cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="//image.tmdb.org" />
<link rel="preconnect" href="https://fonts.googleapis.com" crossorigin />
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin />
<!-- 预加载关键资源 -->
<link rel="preload" href="/loader.css" as="style" />
<link rel="preload" href="/logo.png" as="image" />
<link rel="modulepreload" href="/src/main.ts" />
<!-- 加载样式 -->
<link rel="stylesheet" type="text/css" href="/loader.css" />
<style>
#app {
block-size: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
overscroll-behavior: contain;
}
#loading-bg {
position: fixed;
z-index: 99999;
display: block;
background: var(--initial-loader-bg, #fff);
block-size: 100vh;
inline-size: 100vw;
transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
}
.loading-logo {
position: absolute;
inset-block-start: 35%;
inset-inline-start: calc(50% - 5rem);
transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
}
.loading-complete .loading-logo {
filter: blur(10px);
opacity: 0;
transform: scale(1.5);
}
.loading-complete {
filter: blur(15px);
opacity: 0;
transform: scale(1.2);
}
.loading {
position: absolute;
box-sizing: border-box;
border: 3px solid transparent;
border-radius: 50%;
block-size: 55px;
inline-size: 55px;
inset-block-start: 80%;
inset-inline-start: calc(50% - 27.5px);
transition: opacity 0.6s ease;
}
.loading-complete .loading {
opacity: 0;
}
.loading .effect-1,
.loading .effect-2,
.loading .effect-3 {
position: absolute;
box-sizing: border-box;
border: 3px solid transparent;
border-radius: 50%;
block-size: 100%;
border-inline-start: 3px solid var(--initial-loader-color, #eee);
inline-size: 100%;
}
.loading .effect-1 {
animation: rotate 1s ease infinite;
}
.loading .effect-2 {
animation: rotate-opacity 1s ease infinite 0.1s;
}
.loading .effect-3 {
animation: rotate-opacity 1s ease infinite 0.2s;
}
.loading .effects {
transition: all 0.3s ease;
}
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(1turn);
}
}
@keyframes rotate-opacity {
0% {
opacity: 0.1;
transform: rotate(0deg);
}
100% {
opacity: 1;
transform: rotate(1turn);
}
}
</style>
<!-- 初始化脚本 -->
<script>
// 检测系统主题是否为深色模式
function checkPrefersColorSchemeIsDark() {
try {
return window.matchMedia('(prefers-color-scheme: dark)').matches
} catch (e) {
return false
}
}
// 主题色彩初始化
const loaderColor = localStorage.getItem('materio-initial-loader-bg') || '#FFFFFF'
if (loaderColor) document.documentElement.style.setProperty('--initial-loader-bg', loaderColor)
const primaryColor = localStorage.getItem('materio-initial-loader-color') || '#9155FD'
if (primaryColor) document.documentElement.style.setProperty('--initial-loader-color', primaryColor)
let loaderColor = localStorage.getItem('materio-initial-loader-bg')
let primaryColor = localStorage.getItem('materio-initial-loader-color')
// 检查主题设置
const savedTheme = localStorage.getItem('theme')
const isAutoTheme = savedTheme === 'auto'
// 如果是自动主题或者没有保存的背景色,根据系统主题设置背景色
if (isAutoTheme || !loaderColor) {
loaderColor = checkPrefersColorSchemeIsDark() ? '#0E1116' : '#FFFFFF'
}
if (!primaryColor) {
primaryColor = '#9155FD'
}
// 应用主题色彩
document.documentElement.style.setProperty('--initial-loader-bg', loaderColor)
document.documentElement.style.setProperty('--initial-loader-color', primaryColor)
// 状态栏适配
if (window.navigator.standalone) {
@@ -107,7 +237,8 @@
// 安全区域适配
function updateSafeArea() {
const safeAreaTop = getComputedStyle(document.documentElement).getPropertyValue('env(safe-area-inset-top)')
const safeAreaBottom = getComputedStyle(document.documentElement).getPropertyValue('env(safe-area-inset-bottom)')
const safeAreaBottom = getComputedStyle(document.documentElement).getPropertyValue('env(safe-area-inset-bottom)',
)
if (safeAreaTop) document.documentElement.style.setProperty('--safe-area-top', safeAreaTop)
if (safeAreaBottom) document.documentElement.style.setProperty('--safe-area-bottom', safeAreaBottom)
@@ -119,7 +250,7 @@
</script>
</head>
<body style="margin: 0; overflow: hidden; overscroll-behavior: none; -webkit-overflow-scrolling: touch;">
<body style="margin: 0; overflow: hidden; overscroll-behavior: none; -webkit-overflow-scrolling: touch">
<div id="loading-bg">
<div class="loading-logo">
<!-- Logo -->
@@ -236,4 +367,4 @@
<script type="module" src="/src/main.ts"></script>
</body>
</html>
</html>

View File

@@ -1,6 +1,6 @@
{
"name": "moviepilot",
"version": "2.6.2",
"version": "2.8.5",
"private": true,
"type": "module",
"bin": "dist/service.js",
@@ -27,6 +27,7 @@
"@fullcalendar/timegrid": "^6.1.15",
"@fullcalendar/vue3": "^6.1.15",
"@iconify/utils": "^2.2.1",
"@types/crypto-js": "^4.2.2",
"@types/js-cookie": "^3.0.6",
"@vue-flow/background": "^1.3.2",
"@vue-flow/controls": "^1.1.2",
@@ -40,8 +41,10 @@
"ace-builds": "^1.37.4",
"apexcharts": "^4.0.0",
"axios": "^1.7.9",
"body-scroll-lock": "^3.1.5",
"colorthief": "^2.6.0",
"copy-to-clipboard": "^3.3.3",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.13",
"express": "^4.21.2",
"express-http-proxy": "^2.1.1",
@@ -72,6 +75,7 @@
"@intlify/unplugin-vue-i18n": "^6.0.3",
"@originjs/vite-plugin-federation": "^1.4.1",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@types/body-scroll-lock": "^3.1.2",
"@types/lodash-es": "^4.17.12",
"@types/mousetrap": "^1.6.15",
"@types/node": "^20.1.4",
@@ -105,6 +109,7 @@
"vite": "^5.4.11",
"vite-plugin-pages": "^0.32.1",
"vite-plugin-pwa": "^0.21.1",
"vite-plugin-top-level-await": "^1.5.0",
"vite-plugin-vue-layouts": "^0.11.0",
"vite-plugin-vuetify": "2.0.4",
"vue-shepherd": "^4.1.0",
@@ -113,4 +118,4 @@
"workbox-window": "^7.3.0"
},
"packageManager": "yarn@1.22.18"
}
}

View File

@@ -1,97 +0,0 @@
#loading-bg {
position: fixed;
z-index: 99999;
display: block;
background: var(--initial-loader-bg, #fff);
block-size: 100vh;
inline-size: 100vw;
transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
}
.loading-logo {
position: absolute;
inset-block-start: 35%;
inset-inline-start: calc(50% - 5rem);
transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
}
/* 添加logo完成动画 - 放大虚化效果 */
.loading-complete .loading-logo {
filter: blur(10px);
opacity: 0;
transform: scale(1.5);
}
/* 添加加载背景消失动画 - 放大虚化效果 */
.loading-complete {
filter: blur(15px);
opacity: 0;
transform: scale(1.2);
}
.loading {
position: absolute;
box-sizing: border-box;
border: 3px solid transparent;
border-radius: 50%;
block-size: 55px;
inline-size: 55px;
inset-block-start: 80%;
inset-inline-start: calc(50% - 27.5px);
transition: opacity 0.6s ease;
}
/* 完成时隐藏加载动画 */
.loading-complete .loading {
opacity: 0;
}
.loading .effect-1,
.loading .effect-2,
.loading .effect-3 {
position: absolute;
box-sizing: border-box;
border: 3px solid transparent;
border-radius: 50%;
block-size: 100%;
border-inline-start: 3px solid var(--initial-loader-color, #eee);
inline-size: 100%;
}
.loading .effect-1 {
animation: rotate 1s ease infinite;
}
.loading .effect-2 {
animation: rotate-opacity 1s ease infinite 0.1s;
}
.loading .effect-3 {
animation: rotate-opacity 1s ease infinite 0.2s;
}
.loading .effects {
transition: all 0.3s ease;
}
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(1turn);
}
}
@keyframes rotate-opacity {
0% {
opacity: 0.1;
transform: rotate(0deg);
}
100% {
opacity: 1;
transform: rotate(1turn);
}
}

53
public/logo.svg Normal file
View File

@@ -0,0 +1,53 @@
<svg width="3em" height="3em" viewBox="0 0 192 192" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1,0,0,1,-2606,-236)">
<g id="a2-c" transform="matrix(1,0,0,1,2606,236)">
<rect x="0" y="0" width="192" height="192" style="fill:none;"/>
<g transform="matrix(-0.800798,0.462341,-0.769972,-1.33363,1869.11,-896.718)">
<path d="M2241.27,-28.175C2238.86,-28.931 2236.64,-29.181 2234.48,-29.254L2159.78,-29.286L2165.01,-11.207C2167.16,-13.121 2169.64,-13.722 2172.26,-13.808L2222.12,-13.822C2223.52,-13.824 2225,-13.701 2226.78,-13.108L2241.27,-28.175Z" style="fill:url(#_Linear1);"/>
</g>
<g transform="matrix(1,0,0,1,-2157.67,-208.423)">
<path d="M2205.67,331.428L2205.67,332.25L2205.67,352.835C2205.67,354.263 2204.91,355.583 2203.67,356.298C2202.43,357.012 2200.91,357.013 2199.67,356.3L2190.78,351.174C2189.73,350.595 2188.83,350.083 2188.03,349.59L2187.45,349.257C2186.66,348.725 2185.91,348.142 2185.21,347.461C2185.08,347.331 2184.95,347.198 2184.82,347.061C2184.26,346.457 2183.75,345.778 2183.3,344.995C2182.16,343.05 2181.69,341.024 2181.68,338.948L2181.67,268.923L2209.77,274.425C2207.5,275.639 2205.68,278.3 2205.67,281.429L2205.67,331.428Z" style="fill:url(#_Linear2);"/>
</g>
<g transform="matrix(1,0,0,1,-2157.67,-208.423)">
<path d="M2295.93,363.064C2299.48,360.882 2301.46,357.55 2301.67,352.926L2301.67,277.879L2301.67,276.775L2301.67,252.515C2301.67,251.801 2302.05,251.14 2302.67,250.783C2303.29,250.426 2304.05,250.426 2304.67,250.784L2319.81,259.54C2321.59,260.617 2322.95,262.115 2324.04,263.875C2325.03,265.551 2325.56,267.37 2325.67,269.835L2325.67,339.91C2325.18,343.645 2323.51,346.705 2320.3,348.887L2295.93,363.064ZM2295.93,363.064C2295.73,363.184 2295.53,363.301 2295.32,363.414L2295.93,363.064Z" style="fill:rgb(141,81,249);"/>
</g>
<g transform="matrix(1,0,0,1,-2157.67,-208.423)">
<path d="M2295.93,363.064C2299.48,360.882 2301.46,357.55 2301.67,352.926L2301.67,277.879L2301.67,276.775L2301.67,252.515C2301.67,251.801 2302.05,251.14 2302.67,250.783C2303.29,250.426 2304.05,250.426 2304.67,250.784L2319.81,259.54C2321.59,260.617 2322.95,262.115 2324.04,263.875C2325.03,265.551 2325.56,267.37 2325.67,269.835L2325.67,339.91C2325.18,343.645 2323.51,346.705 2320.3,348.887L2295.93,363.064ZM2299.79,360.238C2299.79,360.238 2320.03,348.464 2320.04,348.461C2323.1,346.372 2324.69,343.444 2325.17,339.877C2325.17,339.877 2325.17,269.846 2325.17,269.839C2325.06,267.482 2324.56,265.739 2323.61,264.133C2322.56,262.445 2321.26,261.005 2319.55,259.97L2304.42,251.217C2303.96,250.949 2303.39,250.948 2302.92,251.216C2302.46,251.484 2302.17,251.979 2302.17,252.515L2302.17,276.775L2302.17,277.879L2302.17,352.926C2302.17,352.933 2302.17,352.941 2302.17,352.948C2302.04,355.861 2301.23,358.279 2299.79,360.238Z" style="fill:url(#_Linear3);"/>
</g>
<g transform="matrix(1,0,0,1,-2157.67,-208.423)">
<path d="M2253.67,223.256C2255.26,223.245 2257.02,223.56 2259.11,224.557L2275.67,234.102C2276.91,234.816 2277.67,236.138 2277.67,237.568L2277.67,259.508C2277.67,260.222 2277.29,260.882 2276.67,261.239C2276.05,261.597 2275.29,261.597 2274.67,261.24L2257.52,251.353C2256.38,250.731 2255.12,250.341 2253.67,250.347C2252.26,250.339 2250.99,250.721 2249.82,251.353L2187.87,287.04C2184.23,289.147 2181.96,292.478 2181.67,297.57L2181.68,269.865C2181.85,265.167 2183.93,261.653 2187.92,259.322L2248.23,224.557C2249.69,223.796 2251.5,223.29 2253.67,223.256Z" style="fill:rgb(165,118,255);"/>
</g>
<g transform="matrix(1,0,0,1,-2157.67,-208.423)">
<path d="M2253.67,223.256C2255.26,223.245 2257.02,223.56 2259.11,224.557L2275.67,234.102C2276.91,234.816 2277.67,236.138 2277.67,237.568L2277.67,259.508C2277.67,260.222 2277.29,260.882 2276.67,261.239C2276.05,261.597 2275.29,261.597 2274.67,261.24L2257.52,251.353C2256.38,250.731 2255.12,250.341 2253.67,250.347C2252.26,250.339 2250.99,250.721 2249.82,251.353L2187.87,287.04C2184.23,289.147 2181.96,292.478 2181.67,297.57L2181.68,269.865C2181.85,265.167 2183.93,261.653 2187.92,259.322L2248.23,224.557C2249.69,223.796 2251.5,223.29 2253.67,223.256ZM2253.68,223.756C2251.6,223.789 2249.87,224.269 2248.47,224.996L2188.17,259.754C2184.35,261.992 2182.35,265.367 2182.18,269.874C2182.18,269.874 2182.17,292.759 2182.17,292.757C2183.25,290.047 2185.13,288.051 2187.62,286.607L2249.57,250.919C2249.58,250.917 2249.58,250.915 2249.59,250.913C2250.83,250.243 2252.17,249.839 2253.67,249.847C2255.21,249.841 2256.54,250.253 2257.76,250.914C2257.76,250.916 2257.76,250.917 2257.76,250.919L2274.92,260.807C2275.38,261.075 2275.95,261.074 2276.42,260.806C2276.88,260.538 2277.17,260.043 2277.17,259.508L2277.17,237.568C2277.17,236.317 2276.5,235.16 2275.42,234.535C2275.42,234.535 2258.88,225 2258.87,224.996C2256.87,224.049 2255.2,223.746 2253.68,223.756Z" style="fill:url(#_Linear4);"/>
</g>
<g transform="matrix(0.800798,0.462341,0.769972,-1.33363,-1677.22,-896.858)">
<path d="M2241.55,-28.184C2239.1,-28.989 2236.83,-29.204 2234.68,-29.295C2234.68,-29.295 2220.82,-29.3 2215.03,-29.303C2213.48,-29.303 2212.05,-28.808 2211.28,-28.004C2208.65,-25.275 2202.56,-18.936 2199.45,-15.709C2199.07,-15.306 2199.07,-14.809 2199.46,-14.406C2199.85,-14.004 2200.57,-13.758 2201.34,-13.761C2208.36,-13.788 2222.72,-13.845 2222.72,-13.845C2223.98,-13.851 2225.44,-13.657 2227.06,-13.117L2241.55,-28.184Z" style="fill:rgb(141,81,249);"/>
</g>
<g transform="matrix(-4.32309,0,0,12.4454,9610.35,-1450.35)">
<path d="M2205.31,121.966C2205.31,121.88 2205.18,121.8 2204.96,121.757C2204.74,121.714 2204.48,121.714 2204.27,121.757C2201.75,122.263 2195.36,123.547 2192.85,124.052C2192.63,124.095 2192.5,124.174 2192.5,124.261C2192.5,124.347 2192.63,124.426 2192.85,124.469C2195.36,124.974 2201.75,126.255 2204.27,126.759C2204.48,126.802 2204.74,126.802 2204.96,126.759C2205.18,126.716 2205.31,126.636 2205.31,126.55C2205.31,125.541 2205.31,122.976 2205.31,121.966Z" style="fill:rgb(104,0,197);"/>
<clipPath id="_clip5">
<path d="M2205.31,121.966C2205.31,121.88 2205.18,121.8 2204.96,121.757C2204.74,121.714 2204.48,121.714 2204.27,121.757C2201.75,122.263 2195.36,123.547 2192.85,124.052C2192.63,124.095 2192.5,124.174 2192.5,124.261C2192.5,124.347 2192.63,124.426 2192.85,124.469C2195.36,124.974 2201.75,126.255 2204.27,126.759C2204.48,126.802 2204.74,126.802 2204.96,126.759C2205.18,126.716 2205.31,126.636 2205.31,126.55C2205.31,125.541 2205.31,122.976 2205.31,121.966Z"/>
</clipPath>
<g clip-path="url(#_clip5)">
<g transform="matrix(0.124502,0.074907,0.206623,-0.0414384,1997.62,-7.40235)">
<path d="M1726.17,-64.249L1708.16,-72.303L1708.05,-23.514L1721.88,-32.386C1722.96,-33.241 1723.09,-33.944 1723.15,-34.636L1723.15,-54.373C1723.19,-56.238 1724.96,-57.594 1726.87,-56.686L1726.17,-64.249Z" style="fill:url(#_Linear6);"/>
</g>
<g transform="matrix(-0.126036,0.0767377,0.569859,0.112933,2435.01,-3.09225)">
<path d="M1726.17,-45.661L1704.47,-40.254C1706.28,-40.527 1708.14,-40.212 1708.16,-39.416L1708.16,-18.976L1726.17,-18.976L1726.17,-45.661Z" style="fill:rgb(141,81,249);"/>
</g>
<g transform="matrix(-0.126036,0.0767377,0.569859,0.112933,2435.01,-3.09225)">
<path d="M1726.17,-45.661L1726.17,-18.976L1708.16,-18.976L1708.16,-39.416C1707.79,-40.732 1704.5,-40.298 1702.68,-40.025L1726.17,-45.661ZM1705.49,-40.491C1706.2,-40.507 1706.87,-40.464 1707.4,-40.327C1708.01,-40.173 1708.48,-39.899 1708.62,-39.436C1708.62,-39.429 1708.62,-39.423 1708.62,-39.416L1708.62,-19.152C1708.62,-19.152 1725.72,-19.152 1725.72,-19.152L1725.72,-45.345L1705.49,-40.491Z" style="fill:url(#_Radial7);"/>
</g>
</g>
</g>
</g>
</g>
<defs>
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-70.0711,-0.927611,1.54482,-42.0752,2233.59,-20.1891)"><stop offset="0" style="stop-color:rgb(141,81,249);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(116,50,223);stop-opacity:1"/></linearGradient>
<linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(4.78193e-15,-78.0949,78.0949,4.78193e-15,2195.72,354.021)"><stop offset="0" style="stop-color:rgb(141,81,249);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(116,50,223);stop-opacity:1"/></linearGradient>
<linearGradient id="_Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(41.6089,41.5866,-41.5866,41.6089,2282.31,262.837)"><stop offset="0" style="stop-color:rgb(211,187,255);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(211,187,255);stop-opacity:0"/></linearGradient>
<linearGradient id="_Linear4" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(9.25616,16.7005,-16.7005,9.25616,2215,243.712)"><stop offset="0" style="stop-color:rgb(211,187,255);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(211,187,255);stop-opacity:0"/></linearGradient>
<linearGradient id="_Linear6" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-0.130164,-61.9937,59.4003,-0.135847,1711.63,-25.7957)"><stop offset="0" style="stop-color:rgb(116,50,223);stop-opacity:1"/><stop offset="0.51" style="stop-color:rgb(110,38,217);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(91,0,197);stop-opacity:1"/></linearGradient>
<radialGradient id="_Radial7" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(13.8659,4.71436,-12.1609,5.37534,1708.16,-32.287)"><stop offset="0" style="stop-color:rgb(211,187,255);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(211,187,255);stop-opacity:0"/></radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

160
public/offline.html Normal file
View File

@@ -0,0 +1,160 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>MoviePilot - 离线</title>
<link rel="icon" href="/favicon.ico">
<style>
:root {
--primary-color: #9155FD;
--surface-color: #FFFFFF;
--text-color: #333333;
--border-color: rgba(0, 0, 0, 0.12);
}
@media (prefers-color-scheme: dark) {
:root {
--surface-color: #0E1116;
--text-color: #FFFFFF;
--border-color: rgba(255, 255, 255, 0.12);
}
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: var(--surface-color);
color: var(--text-color);
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
padding: 20px;
}
.offline-container {
text-align: center;
max-width: 400px;
width: 100%;
padding: 40px;
background: var(--surface-color);
border-radius: 24px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--border-color);
}
.icon-wrapper {
width: 120px;
height: 120px;
margin: 0 auto 32px;
background: rgba(145, 85, 253, 0.1);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.icon {
width: 64px;
height: 64px;
fill: var(--primary-color);
}
h1 {
font-size: 2rem;
margin-bottom: 16px;
font-weight: 600;
}
p {
font-size: 1.1rem;
line-height: 1.6;
opacity: 0.7;
margin-bottom: 32px;
}
.retry-button {
background: var(--primary-color);
color: white;
border: none;
padding: 12px 32px;
font-size: 1rem;
border-radius: 8px;
cursor: pointer;
font-weight: 500;
transition: opacity 0.2s;
}
.retry-button:hover {
opacity: 0.9;
}
.status-badge {
display: inline-flex;
align-items: center;
gap: 8px;
margin-top: 24px;
padding: 8px 16px;
background: rgba(145, 85, 253, 0.1);
border-radius: 20px;
font-size: 0.875rem;
}
.status-dot {
width: 8px;
height: 8px;
background: #EF5350;
border-radius: 50%;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { opacity: 1; }
50% { opacity: 0.5; }
100% { opacity: 1; }
}
</style>
</head>
<body>
<div class="offline-container">
<div class="icon-wrapper">
<svg class="icon" viewBox="0 0 24 24">
<path d="M12,2.03C17.73,2.5 22,7.08 22,12.75C22,13.84 21.79,14.89 21.4,15.86L19.53,14C19.5,13.83 19.5,13.67 19.5,13.5A2.5,2.5 0 0,0 17,11A2.5,2.5 0 0,0 14.5,13.5A2.5,2.5 0 0,0 17,16A2.5,2.5 0 0,0 19.5,13.5C19.5,13.67 19.5,13.83 19.53,14L21.4,15.86C20.04,19.09 16.9,21.47 13.19,21.97L11.75,20.53C11.83,20.5 11.92,20.5 12,20.5A2.5,2.5 0 0,0 14.5,18A2.5,2.5 0 0,0 12,15.5A2.5,2.5 0 0,0 9.5,18C9.5,18.08 9.5,18.17 9.53,18.25L7.66,16.38C7.25,15.96 6.86,15.5 6.5,15H8.17C8.06,14.7 8,14.35 8,14A3,3 0 0,1 11,11A3,3 0 0,1 14,14C14,14.35 13.94,14.7 13.83,15H15.5C15.14,15.5 14.75,15.96 14.34,16.38L12.47,14.5C12.5,14.42 12.5,14.33 12.47,14.25L10.6,12.38C10.18,11.97 9.72,11.59 9.23,11.25L7.36,9.38C6.94,8.96 6.5,8.61 6,8.31V6.64L4.14,4.78C3.6,5.55 3.17,6.4 2.86,7.31L1,5.45V4.46L2.05,3.41C2.5,2.86 3.05,2.41 3.66,2.06L20,18.4L18.73,19.67L12.47,13.41L11.75,20.53C11.83,20.5 11.92,20.5 12,20.5A2.5,2.5 0 0,0 14.5,18A2.5,2.5 0 0,0 12,15.5A2.5,2.5 0 0,0 9.5,18C9.5,18.08 9.5,18.17 9.53,18.25L7.66,16.38C7.25,15.96 6.86,15.5 6.5,15H8.17C8.06,14.7 8,14.35 8,14A3,3 0 0,1 11,11A3,3 0 0,1 14,14C14,14.35 13.94,14.7 13.83,15H15.5C15.14,15.5 14.75,15.96 14.34,16.38L2.46,4.5C3.5,3.17 4.9,2.15 6.5,1.58V3.25C5.43,3.7 4.47,4.33 3.66,5.11L2.61,6.16V8.03C3.16,7.33 3.82,6.73 4.57,6.25V8.31C3.57,9.14 2.75,10.19 2.21,11.39L1,10.18V8.65C1.5,6.16 3.03,4.03 5.11,2.71L6.39,4C8.97,2.73 12.03,2.24 14.97,3.03L16.84,4.9C18.17,5.86 19.25,7.16 19.94,8.68L18.07,6.81C17.07,5.5 15.66,4.5 14,4.04V5.71C15.93,6.17 17.5,7.53 18.33,9.3L16.46,7.43C15.46,6.61 14.2,6.08 12.82,6V7.67C13.69,7.79 14.47,8.11 15.14,8.58L13.27,6.71C12.94,6.66 12.6,6.63 12.25,6.63L10.38,4.76C10.87,4.66 11.37,4.59 11.88,4.56L10,2.68C10.66,2.56 11.33,2.5 12,2.5V2.03Z" />
</svg>
</div>
<h1>您当前处于离线状态</h1>
<p>无法连接到 MoviePilot 服务器。请检查您的网络连接后重试。</p>
<button class="retry-button" onclick="window.location.reload()">
重新加载
</button>
<div class="status-badge">
<span class="status-dot"></span>
<span>离线状态</span>
</div>
</div>
<script>
// 监听网络状态变化
window.addEventListener('online', function() {
window.location.reload();
});
// Service Worker 消息处理
if ('serviceWorker' in navigator) {
navigator.serviceWorker.addEventListener('message', function(event) {
if (event.data && event.data.type === 'OFFLINE_STATUS' && !event.data.offline) {
window.location.reload();
}
});
}
</script>
</body>
</html>

View File

@@ -1,7 +1,6 @@
const path = require('node:path')
const express = require('express')
const proxy = require('express-http-proxy')
const { createProxyMiddleware } = require('http-proxy-middleware')
const app = express()
const port = process.env.NGINX_PORT || 3000
@@ -15,141 +14,16 @@ const proxyConfig = {
// 静态文件服务目录
app.use(express.static(__dirname))
// 创建专门的SSE代理中间件
const sseProxyMiddleware = createProxyMiddleware({
target: `http://${proxyConfig.URL}:${proxyConfig.PORT}`,
changeOrigin: true,
ws: false,
timeout: 0, // 无超时
proxyTimeout: 0, // 无超时
headers: {
'Connection': 'keep-alive',
'Cache-Control': 'no-cache'
},
onProxyRes: (proxyRes, req, res) => {
// 检测SSE响应
const isSSE = proxyRes.headers['content-type'] &&
proxyRes.headers['content-type'].includes('text/event-stream');
if (isSSE) {
// 设置SSE响应头
res.writeHead(proxyRes.statusCode, {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'Cache-Control, Content-Type, Authorization'
});
// 直接将代理响应流式传输到客户端
proxyRes.pipe(res);
// 处理客户端断开连接
req.on('close', () => {
console.log('Client disconnected from SSE stream');
if (proxyRes.destroy) {
proxyRes.destroy();
}
});
// 处理代理响应结束
proxyRes.on('end', () => {
console.log('SSE stream ended');
if (!res.headersSent) {
res.end();
}
});
// 处理代理响应错误
proxyRes.on('error', (err) => {
console.error('SSE proxy response error:', err);
if (!res.headersSent) {
res.status(500).end();
}
});
// 配置代理中间件将请求转发给后端API
app.use(
'/api',
proxy(`${proxyConfig.URL}:${proxyConfig.PORT}`, {
// 路径加上 /api 前缀
proxyReqPathResolver: (req) => {
return `/api${req.url}`
}
},
onError: (err, req, res) => {
console.error('SSE proxy error:', err);
if (!res.headersSent) {
res.status(500).json({ error: 'Proxy error' });
}
}
});
// 创建普通API代理中间件
const apiProxyMiddleware = proxy(`${proxyConfig.URL}:${proxyConfig.PORT}`, {
// 路径加上 /api 前缀
proxyReqPathResolver: (req) => {
return `/api${req.url}`
},
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
proxyReqOpts.headers = proxyReqOpts.headers || {};
// 检测是否为SSE请求
const isSSE = srcReq.headers.accept && srcReq.headers.accept.includes('text/event-stream');
if (!isSSE) {
// 普通请求设置超时
proxyReqOpts.timeout = 600000; // 600秒超时
}
return proxyReqOpts;
},
userResDecorator: (proxyRes, proxyResData, userReq, userRes) => {
// 只处理非SSE响应
const isSSEResponse = proxyRes.headers['content-type'] &&
proxyRes.headers['content-type'].includes('text/event-stream');
if (!isSSEResponse) {
// 普通响应:正常处理
return proxyResData;
}
// SSE响应不在这里处理已经由专门的中间件处理
return proxyResData;
},
// 错误处理
proxyErrorHandler: (err, res, next) => {
// 客户端断开连接的正常情况
if (err.code === 'ECONNRESET' || err.code === 'EPIPE') {
console.log('Client disconnected:', err.code);
if (!res.headersSent) {
res.end();
}
return;
}
// 超时错误处理
if (err.code === 'ETIMEDOUT') {
console.log('Proxy request timed out:', err.code);
if (!res.headersSent) {
res.status(504).send('Gateway Timeout');
}
return;
}
// 其他错误
console.error('Proxy error:', err);
if (!res.headersSent) {
res.status(500).send('Internal Server Error');
}
}
});
// 配置API代理路由
app.use('/api', (req, res, next) => {
// 检测是否为SSE请求
const isSSE = req.headers.accept && req.headers.accept.includes('text/event-stream');
if (isSSE) {
// 使用专门的SSE代理中间件
sseProxyMiddleware(req, res, next);
} else {
// 使用普通API代理中间件
apiProxyMiddleware(req, res, next);
}
});
})
);
// 配置代理中间件将CookieCloud请求转发给后端API
app.use(

View File

@@ -51,8 +51,8 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
gap: 16px;
inset-block-end: 30px;
inset-inline-end: 30px;
inset-block-end: 2rem;
inset-inline-end: 2rem;
}
.global-action-button {

View File

@@ -3,6 +3,30 @@
@use "@layouts/styles/_placeholders";
@use "@configured-variables" as variables;
// 👉 Alert
.v-alert {
.v-alert__close {
.v-icon {
block-size: 20px !important;
font-size: 20px !important;
inline-size: 20px !important;
}
}
&:not(.v-alert--prominent) .v-alert__prepend {
.v-icon {
block-size: 1.375rem !important;
font-size: 1.375rem !important;
inline-size: 1.375rem !important;
}
}
.v-alert-title {
line-height: 1.5rem;
margin-block-end: 0.25rem;
}
}
// 👉 Avatar font-size
.v-avatar {
@include mixins.avatar-font-sizes($map: variables.$avatar-font-sizes);
@@ -33,6 +57,23 @@
}
}
// 👉 Button
.v-btn {
/* stylelint-disable-next-line no-descending-specificity */
&:not(.v-btn--icon) .v-icon {
--v-icon-size-multiplier: 0.9525 !important;
}
}
// 👉 Chip
.v-chip.v-chip--size-default .v-avatar {
--v-avatar-height: 24px;
}
.v-chip.v-chip--density-comfortable {
line-height: 1;
}
// Dialog responsive width
.v-dialog {
.v-card {
@@ -40,7 +81,7 @@
}
}
@media (min-width: 576px) {
@media (width >= 576px) {
.v-dialog {
&.v-dialog-sm,
&.v-dialog-lg,
@@ -50,7 +91,7 @@
}
}
@media (min-width: 992px) {
@media (width >= 992px) {
.v-dialog {
&.v-dialog-lg,
&.v-dialog-xl {
@@ -59,18 +100,32 @@
}
}
@media (min-width: 1200px) {
@media (width >= 1200px) {
.v-dialog.v-dialog-xl,
.v-dialog.v-dialog-xl .v-overlay__content > .v-card {
inline-size: 1165px !important;
}
}
// v-tab with pill support
// 👉 Expansion Panel
.v-expansion-panel {
.v-expansion-panel-text {
font-size: 1rem;
}
}
// 👉 Tooltip
.v-tooltip > .v-overlay__content {
font-weight: 500;
line-height: 0.875rem;
}
// 👉 List
// 👉 Tab with pill support
.v-tabs.v-tabs-pill {
.v-tab.v-btn {
border-radius: 0.375rem !important;
border-radius: 6px !important;
min-inline-size: 8.125rem;
transition: none;
@@ -94,7 +149,7 @@
}
}
// 👉 added box shadow
// 👉 Timeline added box shadow
.v-timeline-item {
.v-timeline-divider__dot {
.v-timeline-divider__inner-dot {
@@ -160,7 +215,6 @@
}
// 👉 Slider
.v-slider.v-input--horizontal .v-slider-track__fill {
block-size: var(--v-slider-track-size);
}
@@ -171,7 +225,19 @@
.v-slider-thumb {
.v-slider-thumb__label {
background: rgb(117, 117, 117);
color: rgb(var(--v-theme-on-primary));
&::before {
color: rgb(117, 117, 117);
}
}
}
// 👉 Switch
.v-switch {
.v-selection-control:not(.v-selection-control--dirty) .v-switch__thumb {
color: #fff;
}
}
@@ -179,5 +245,45 @@
.v-table--density-default > .v-table__wrapper > table > tbody > tr > td,
.v-table--density-default > .v-table__wrapper > table > thead > tr > td,
.v-table--density-default > .v-table__wrapper > table > tfoot > tr > td {
block-size: 50px;
block-size: 50px !important;
}
.v-table {
--v-table-header-height: 54px !important;
th {
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity)) !important;
font-size: 0.75rem;
.v-data-table-header__content {
display: flex;
justify-content: space-between;
}
}
.v-selection-control {
color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity)) !important;
font-size: 1rem;
}
}
.v-data-table {
th {
background: rgb(var(--v-table-header-background)) !important;
}
}
// 👉 Pagination
.v-pagination {
.v-btn {
border-radius: 4px;
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
font-size: 14px;
font-weight: 400;
}
}
// 👉 SnackBar
.v-snackbar--variant-elevated {
@include mixins.elevation(6);
}

View File

@@ -1,7 +1,7 @@
@use "@configured-variables" as variables;
@use "placeholders" as *;
@use "vuetify/lib/styles/tools/_elevation" as mixins_elevation;
@use "../misc";
@use "misc";
@use "mixins";
$header: ".layout-navbar";
@@ -28,13 +28,31 @@ $header: ".layout-navbar";
// Scrolled styles for sticky navbar
@at-root {
/* This html selector with not selector is required when:
dialog is opened and window don't have any scroll. This removes window-scrolled class from layout and out style broke
/* Only apply scrolled styles when window is actually scrolled,
not when dialog is opened without scroll
*/
html.v-overlay-scroll-blocked .layout-navbar-fixed,
&.window-scrolled.layout-navbar-fixed {
#{$header} {
padding-inline: 1rem;
@extend %default-layout-vertical-nav-scrolled-sticky-elevated-nav;
@extend %default-layout-vertical-nav-floating-navbar-and-sticky-elevated-navbar-scrolled;
}
.navbar-blur#{$header} {
@extend %blurry-bg;
}
}
/* Ensure header styles are preserved when dialog is opened,
but only if window was scrolled before dialog opened
*/
html.v-overlay-scroll-blocked &.window-scrolled.layout-navbar-fixed {
#{$header} {
padding-inline: 1rem;
@extend %default-layout-vertical-nav-scrolled-sticky-elevated-nav;
@extend %default-layout-vertical-nav-floating-navbar-and-sticky-elevated-navbar-scrolled;
}

View File

@@ -1,5 +1,5 @@
@use "@core/scss/placeholders";
@use "@core/scss/variables" as core-vars;
@use "placeholders";
@use "variables" as core-vars;
.layout-navbar {
@if core-vars.$navbar-high-emphasis-text {

View File

@@ -11,11 +11,58 @@
// adding styling for code tag
code {
background: rgba(var(--v-code-background-color), var(--v-focus-opacity));
border-radius: 3px;
background: rgba(var(--v-code-background-color), var(--v-focus-opacity));
color: currentcolor;
font-size: 85%;
font-weight: 400;
padding-block: 0.2em;
padding-inline: 0.4em;
}
%blurry-bg {
position: relative;
box-shadow: 0 1px 3px rgba(0, 0, 0, 4%), 0 1px 2px rgba(0, 0, 0, 2%);
@media (width >= 1280px) and (hover: hover) {
background: rgba(var(--v-theme-background), 1);
.v-theme--transparent & {
backdrop-filter: blur(var(--transparent-blur-light, 5px));
background: rgba(var(--v-theme-background), var(--transparent-opacity-light, 0.1)) !important;
}
}
@media (width < 1280px), (hover: none) {
background: transparent;
&::before {
position: absolute;
z-index: -1;
backdrop-filter: blur(24px);
block-size: calc(env(safe-area-inset-top, 0px) + var(--navbar-tab-height) + 4rem);
content: "";
inset-block-start: 0;
inset-inline: 0;
pointer-events: none;
transition: padding 0.3s ease-in-out;
.v-theme--light & {
background: rgba(var(--v-theme-surface), 0.6);
}
.v-theme--dark & {
background: rgba(var(--v-theme-background), 0.5);
}
.v-theme--purple & {
background: rgba(var(--v-theme-background), 0.5);
}
.v-theme--transparent & {
backdrop-filter: blur(var(--transparent-blur-heavy, 16px));
background: rgba(var(--v-theme-background), var(--transparent-opacity-heavy, 0.5));
}
}
}
}

View File

@@ -1,4 +1,6 @@
@use "sass:map";
@use "vuetify/lib/styles/settings" as vuetify_settings;
@use "@styles/variables/_vuetify.scss" as vuetify;
@mixin themed($property, $light-value, $dark-value) {
@at-root {
@@ -17,11 +19,12 @@
// This mixin is inspired from vuetify for adding hover styles via before pseudo element
@mixin before-pseudo() {
position: relative;
&::before {
position: absolute;
border-radius: inherit;
background: currentcolor;
block-size: 100%;
border-radius: inherit;
content: "";
inline-size: 100%;
inset: 0;
@@ -43,8 +46,8 @@
&::before {
position: absolute;
background-color: currentcolor;
border-radius: inherit;
background-color: currentcolor;
content: "";
inset: 0;
opacity: $opacity;
@@ -56,10 +59,81 @@
@mixin avatar-font-sizes($map: $avatar-sizes) {
@each $sizeName, $multiplier in vuetify_settings.$size-scales {
/* stylelint-disable-next-line scss/no-global-function-names */
$size: map-get($map, $sizeName);
$size: map.get($map, $sizeName);
&.v-avatar--size-#{$sizeName} {
font-size: #{$size}px;
}
}
}
@mixin elevation($z, $important: false) {
box-shadow: map.get(vuetify.$shadow-key-umbra, $z), map.get(vuetify.$shadow-key-penumbra, $z), map.get(vuetify.$shadow-key-ambient, $z) if($important, !important, null);
}
@mixin bordered-skin($component, $border-property: "border", $important: false) {
#{$component} {
box-shadow: none !important;
#{$border-property}: 1px solid rgba(var(--v-border-color), var(--v-border-opacity)) if($important, !important, null);
}
}
@mixin selected-states($selector) {
#{$selector} {
opacity: calc(var(--v-selected-opacity) * var(--v-theme-overlay-multiplier));
}
&:hover
#{$selector} {
opacity: calc(var(--v-selected-opacity) + var(--v-hover-opacity) * var(--v-theme-overlay-multiplier));
}
&:focus-visible
#{$selector} {
opacity: calc(var(--v-selected-opacity) + var(--v-focus-opacity) * var(--v-theme-overlay-multiplier));
}
@supports not selector(:focus-visible) {
&:focus {
#{$selector} {
opacity: calc(var(--v-selected-opacity) + var(--v-focus-opacity) * var(--v-theme-overlay-multiplier));
}
}
}
}
@mixin push-anchors() {
:target {
scroll-margin-block-start: 90px;
}
}
@mixin xs {
@media (width >= 0) and (width <= 599.98px) {
@content;
}
}
@mixin sm {
@media (width >= 600px) and (width <= 959.98px) {
@content;
}
}
@mixin md {
@media (width >= 960px) and (width <= 1279.98px) {
@content;
}
}
@mixin lg {
@media (width >= 1280px) and (width <= 1919.98px) {
@content;
}
}
@mixin xl {
@media (width >= 1920px) {
@content;
}
}

View File

@@ -1,73 +1,25 @@
@use "@configured-variables" as variables;
// 👉 Demo spacers
// TODO: Use vuetify SCSS variable here
$card-spacer-content: 16px;
.demo-space-x {
display: flex;
flex-wrap: wrap;
align-items: center;
margin-block-start: -$card-spacer-content;
& > * {
margin-block-start: $card-spacer-content;
margin-inline-end: $card-spacer-content;
}
}
.demo-space-y {
& > * {
margin-block-end: $card-spacer-content;
&:last-child {
margin-block-end: 0;
}
}
}
// 👉 Card match height
.match-height.v-row {
.v-card {
block-size: 100%;
}
}
// 👉 Whitespace
.whitespace-no-wrap {
white-space: nowrap;
}
// 👉 Colors
/*
Vuetify is applying `.text-white` class to badge icon but don't provide its styles
Moreover, we also use this class in some places
In vuetify 2 with `$color-pack: false` SCSS var config this class was getting generated but this is not the case in v3
We also need !important to get correct color in badge icon
*/
.text-white {
color: #fff !important;
}
.bg-var-theme-background {
background-color: rgba(var(--v-theme-on-surface), var(--v-hover-opacity)) !important;
}
// [/^bg-light-(\w+)$/, ([, w]) => ({ backgroundColor: `rgba(var(--v-theme-${w}), var(--v-activated-opacity))` })],
@each $color-name in variables.$theme-colors-name {
.bg-light-#{$color-name} {
background-color: rgba(var(--v-theme-#{$color-name}), var(--v-activated-opacity)) !important;
// 👉 Pagination small-select dropdown for table
// TODO: remove this class after vuetify datatable implememtation
.per-page-select {
margin-block: auto;
.v-field__input {
align-items: center;
padding: 2px;
font-size: 14px;
}
.v-field__append-inner {
align-items: center;
padding: 0;
.v-icon {
margin-inline-start: 0 !important;
}
}
}
// 👉 Typography
.font-weight-semibold {
font-weight: 600 !important;
}
.leading-normal {
line-height: normal !important;
}

View File

@@ -9,20 +9,53 @@
- You can also use variable for consistency (e.g. mx 1 rem should be applied to both vertical nav items and vertical nav header)
*/
@use "sass:map";
// 使用模板中的变量,不再进行配置
@use "@layouts/styles/variables" as layouts-vars;
@use "utils";
@use "vuetify/lib/styles/tools/functions" as *;
// 👉 Default layout
// 合并两个文件中的@forward配置
@forward "@layouts/styles/variables" with (
// 来自_variables.scss的配置
$layout-vertical-nav-collapsed-width: 68px !default,
// 来自template/_variables.scss的配置
$layout-vertical-nav-z-index: 1004,
$layout-overlay-z-index: 1003
);
$navbar-high-emphasis-text: true !default;
// 使用命名空间来避免变量冲突
@use "@layouts/styles/variables" as layouts-vars;
// 移除@forward配置已合并到template/_variables.scss
// @forward "@layouts/styles/variables" with (
// $layout-vertical-nav-collapsed-width: 68px !default,
// );
// @use "@layouts/styles/variables" as *;
$vertical-nav-horizontal-padding-custom: 1.375rem 1rem;
// We created this SCSS var to extract the start padding
// Docs: https://sass-lang.com/documentation/modules/string
// $vertical-nav-horizontal-padding => 0 8px;
// string.index(#{$vertical-nav-horizontal-padding}, " ") + 1 => 2
// string.index(#{$vertical-nav-horizontal-padding}, " ") => 1
// string.slice(0 8px, 2, -1) => 8px => $card-actions-padding-x
$vertical-nav-horizontal-padding-start: utils.get-first-value($vertical-nav-horizontal-padding-custom) !default;
$vertical-nav-items-icon-margin-inline-end: 0.625rem !default;
// Vertical Nav Configuration
$vertical-nav-collapsed-width: 68px !default;
// This is used to keep consistency between nav items and nav header left & right margin
// This is used by nav items & nav header
$vertical-nav-horizontal-spacing: 0 1.125rem !default;
$vertical-nav-horizontal-padding: $vertical-nav-horizontal-padding-custom !default;
// Vertical nav header padding
$vertical-nav-header-padding: 1rem 0.25rem 1rem $vertical-nav-horizontal-padding-start !default;
// 👉 Custom Variables
$avatar-font-sizes: (
"x-small":12,
"small":14,
"default":18,
"large":20,
"x-large":24
) !default;
$theme-colors-name: (
"primary",
@@ -41,31 +74,16 @@ $default-layout-with-vertical-nav-navbar-footer-roundness: 10px !default;
$vertical-nav-background-color-rgb: var(--v-theme-background) !default;
$vertical-nav-background-color: rgb(#{$vertical-nav-background-color-rgb}) !default;
// This is used to keep consistency between nav items and nav header left & right margin
// This is used by nav items & nav header
$vertical-nav-horizontal-spacing: 0 1.125rem !default;
$vertical-nav-horizontal-padding: 1.375rem 1rem !default;
/*
We created this SCSS var to extract the start padding
Docs: https://sass-lang.com/documentation/modules/string
$vertical-nav-horizontal-padding => 0 8px;
string.index(#{$vertical-nav-horizontal-padding}, " ") + 1 => 2
string.index(#{$vertical-nav-horizontal-padding}, " ") => 1
string.slice(0 8px, 2, -1) => 8px => $card-actions-padding-x
*/
$vertical-nav-horizontal-padding-start: utils.get-first-value($vertical-nav-horizontal-padding);
// Vertical nav header height. Mostly we will align it with navbar height;
$vertical-nav-header-height: layouts-vars.$layout-vertical-nav-navbar-height !default;
$vertical-nav-navbar-shadow: 0 4px 8px -4px rgb(94 86 105 / 42%);
$vertical-nav-navbar-elevation: 3 !default;
$vertical-nav-navbar-style: "elevated" !default; // options: elevated, floating
$vertical-nav-floating-navbar-top: 1rem !default;
// Vertical nav header padding
$vertical-nav-header-padding: 1rem 0.25rem 1rem $vertical-nav-horizontal-padding-start !default;
$vertical-nav-header-inline-spacing: $vertical-nav-horizontal-spacing !default;
// Move logo when vertical nav is mini (collapsed but not hovered)
$vertical-nav-header-logo-translate-x-when-vertical-nav-mini: -4px;
$vertical-nav-header-logo-translate-x-when-vertical-nav-mini: -4px !default;
// Space between logo and title
$vertical-nav-header-logo-title-spacing: 0.9rem !default;
@@ -77,22 +95,130 @@ $vertical-nav-section-title-mt: 1.5rem !default;
$vertical-nav-section-title-mb: 0.5rem !default;
// Vertical nav icons
$vertical-nav-items-icon-size: 1.5rem;
$vertical-nav-items-icon-margin-inline-end: 0.625rem;
$vertical-nav-items-icon-size: 1.5rem !default;
$vertical-nav-items-nested-icon-size: 0.9rem !default;
// Transition duration for nav group arrow
$vertical-nav-nav-group-arrow-transition-duration: 0.15s !default;
// Timing function for nav group arrow
$vertical-nav-nav-group-arrow-transition-timing-function: ease-in-out !default;
// 👉 Horizontal nav
/*
❗ Heads up
==================
Here we assume we will always use shorthand property which will apply same padding on four side
This is because this have been used as value of top property by `.popper-content`
*/
$horizontal-nav-padding: 0.6875rem !default;
// Gap between top level horizontal nav items
$horizontal-nav-top-level-items-gap: 4px !default;
// Horizontal nav icons
$horizontal-nav-items-icon-size: 1.5rem !default;
$horizontal-nav-third-level-icon-size: 0.9rem !default;
$horizontal-nav-items-icon-margin-inline-end: 0.625rem !default;
// We used SCSS variable because we want to allow users to update max height of popper content
// 120px is combined height of navbar & horizontal nav
$horizontal-nav-popper-content-max-height: calc((var(--vh, 1vh) * 100) - 120px - 4rem) !default;
// This variable is used for horizontal nav popper content's `margin-top` and "The bridge"'s height. We need to sync both values.
$horizontal-nav-popper-content-top: calc($horizontal-nav-padding + 0.375rem) !default;
// 👉 Plugins
$plugin-ps-thumb-y-dark: rgba(var(--v-theme-surface-variant), 0.35);
$plugin-ps-thumb-y-dark: rgba(var(--v-theme-surface-variant), 0.35) !default;
// 👉 Custom Variables
$avatar-font-sizes: () !default;
$avatar-font-sizes: map.deep-merge(
// 👉 Vuetify
// Used in src/@core/scss/base/libs/vuetify/_overrides.scss
$vuetify-reduce-default-compact-button-icon-size: true !default;
// 👉 Custom variables
// for utility classes
$font-sizes: () !default;
$font-sizes: map-deep-merge(
(
"x-small":12,
"small":14,
"default":18,
"large":20,
"x-large":24
"xs": 0.75rem,
"sm": 0.875rem,
"base": 1rem,
"lg": 1.125rem,
"xl": 1.25rem,
"2xl": 1.5rem,
"3xl": 1.875rem,
"4xl": 2.25rem,
"5xl": 3rem,
"6xl": 3.75rem,
"7xl": 4.5rem,
"8xl": 6rem,
"9xl": 8rem
),
$avatar-font-sizes
$font-sizes
);
// line height
$font-line-height: () !default;
$font-line-height: map-deep-merge(
(
"xs": 1rem,
"sm": 1.25rem,
"base": 1.5rem,
"lg": 1.75rem,
"xl": 1.75rem,
"2xl": 2rem,
"3xl": 2.25rem,
"4xl": 2.5rem,
"5xl": 1,
"6xl": 1,
"7xl": 1,
"8xl": 1,
"9xl": 1
),
$font-line-height
);
// gap utility class
$gap: () !default;
$gap: map-deep-merge(
(
"0": 0,
"1": 0.25rem,
"2": 0.5rem,
"3": 0.75rem,
"4": 1rem,
"5": 1.25rem,
"6":1.5rem,
"7": 1.75rem,
"8": 2rem,
"9": 2.25rem,
"10": 2.5rem,
"11": 2.75rem,
"12": 3rem,
"14": 3.5rem,
"16": 4rem,
"20": 5rem,
"24": 6rem,
"28": 7rem,
"32": 8rem,
"36": 9rem,
"40": 10rem,
"44": 11rem,
"48": 12rem,
"52": 13rem,
"56": 14rem,
"60": 15rem,
"64": 16rem,
"72": 18rem,
"80": 20rem,
"96": 24rem
),
$gap
);
// 👉 Default layout
$navbar-high-emphasis-text: true !default;

View File

@@ -1,6 +1,6 @@
@use "./placeholders";
@use "@configured-variables" as variables;
@use "@core/scss/mixins" as mixins;
@use "./mixins" as mixins;
@use "vuetify/lib/styles/tools/states" as vuetifyStates;
@use "vuetify/lib/styles/tools/elevation" as elevation;

View File

@@ -1,5 +1,44 @@
@use "sass:map";
@use "template/index";
// 保留这个引用以向后兼容但实际功能已经移至template/index.scss
// 基础变量和配置
@use "variables";
@use "mixins";
@use "utils";
// 布局相关
@use "default-layout";
@use "vertical-nav";
@use "default-layout-w-vertical-nav";
// 组件样式
@use "components";
// 工具类
@use "utilities";
// 其他样式
@use "misc";
@use "dark";
// 第三方库样式
@use "libs/perfect-scrollbar";
@use "libs/apex-chart";
@use "libs/full-calendar";
@use "libs/vuetify";
// 全局样式
a {
color: rgb(var(--v-theme-primary));
text-decoration: none;
}
// Vuetify 3 don't provide margin bottom style like vuetify 2
p {
margin-block-end: 1rem;
}
// Iconify icon size
svg.iconify {
block-size: 1em;
inline-size: 1em;
}

View File

@@ -1,67 +1,88 @@
@use "vuetify/lib/styles/tools/_elevation" as mixins_elevation;
@use "@configured-variables" as variables;
@use "../mixins";
// 👉 Apex chart
.apexcharts-canvas {
&line[stroke="transparent"] {
display: "none";
// For RTL alignment
.apexcharts-yaxis-texts-g {
text-align: start;
}
// Tooltip
.apexcharts-tooltip {
@include mixins_elevation.elevation(3);
border-color: rgba(var(--v-border-color), var(--v-border-opacity));
background: rgb(var(--v-theme-surface));
line-height: 1.5;
.apexcharts-tooltip-title {
border-color: rgba(var(--v-border-color), var(--v-border-opacity));
background: rgb(var(--v-theme-surface));
font-weight: 500;
margin-block-end: 0.25rem;
padding-inline: 1rem;
}
.apexcharts-tooltip-text {
display: flex;
align-items: center;
color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
font-size: inherit;
gap: 0.5rem;
line-height: inherit;
}
.apexcharts-tooltip-text-label,
.apexcharts-tooltip-text-value {
font-weight: 600;
line-height: 1.5;
}
.apexcharts-tooltip-series-group {
padding-block: 0 0.5rem;
padding-inline: 1rem;
&:last-child {
padding-block-end: 1rem;
}
&.active {
padding-block-start: 0;
}
}
&.apexcharts-theme-light {
color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
}
&.apexcharts-theme-dark {
color: white;
}
.apexcharts-tooltip-series-group:first-of-type {
padding-block-end: 0;
border-color: rgb(var(--v-border-color));
background: rgb(var(--v-theme-surface));
box-shadow: none;
.apexcharts-tooltip-text-label,
.apexcharts-tooltip-text-value {
color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
}
}
}
.apexcharts-xaxistooltip {
border-color: rgba(var(--v-border-color), var(--v-border-opacity));
background: rgb(var(--v-theme-grey-50));
color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
&::after {
border-block-end-color: rgb(var(--v-theme-grey-50));
}
&::before {
border-block-end-color: rgba(var(--v-border-color), var(--v-border-opacity));
}
.apexcharts-marker {
transition: none;
}
// 👉 stroke-dasharray
.apexcharts-radialbar,
.apexcharts-radialbar-slice-current {
stroke-linecap: round;
}
.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
border-color: rgba(var(--v-border-color), var(--v-border-opacity));
background: rgb(var(--v-theme-grey-50));
&::after {
border-inline-start-color: rgb(var(--v-theme-grey-50));
}
border-color: rgb(var(--v-border-color));
background: rgb(var(--v-theme-surface));
color: rgba(var(--v-theme-on-background), var(--v-medium-emphasis-opacity));
&::after,
&::before {
border-inline-start-color: rgba(var(--v-border-color), var(--v-border-opacity));
border-block-end-color: rgb(var(--v-border-color));
}
}
.apexcharts-xaxistooltip-text,
.apexcharts-yaxistooltip-text {
color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
}
// 👉 Text color
.apexcharts-text,
.apexcharts-tooltip-text,
.apexcharts-datalabel-label,
@@ -69,19 +90,16 @@
.apexcharts-xaxistooltip-text,
.apexcharts-yaxistooltip-text,
.apexcharts-legend-text {
color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity)) !important;
font-family: inherit !important;
}
.apexcharts-pie-label {
fill: white;
filter: none;
}
.apexcharts-marker {
box-shadow: none;
}
.apexcharts-legend-marker {
margin-inline-end: 0.3875rem;
// 👉 Annotation Label
.apexcharts-annotation-rect {
&.apexcharts-xaxis-annotation-rect,
&.apexcharts-yaxis-annotation-rect {
fill-opacity: 0.05;
stroke-opacity: 0;
}
}
}

View File

@@ -1,5 +1,5 @@
@use "@core/scss/utils";
@use "@configured-variables" as variables;
@use "../../utils";
// 👉 Application
// We need accurate vh in mobile devices as well
@@ -45,6 +45,17 @@ h6,
}
}
// 👉 Button
@if variables.$vuetify-reduce-default-compact-button-icon-size {
.v-btn--density-compact.v-btn--size-default {
.v-btn__content > svg {
block-size: 22px;
font-size: 22px;
inline-size: 22px;
}
}
}
// 👉 Card
// Removes padding-top for immediately placed v-card-text after itself
.v-card-text {
@@ -71,7 +82,9 @@ h6,
&.v-checkbox-btn,
&.v-radio,
&.v-radio-btn {
margin-inline-start: -0.5625rem;
.v-selection-control__wrapper {
margin-inline-start: -0.5625rem;
}
}
}
@@ -79,7 +92,9 @@ h6,
&.v-radio,
&.v-radio-btn,
&.v-checkbox-btn {
margin-inline-start: -0.3125rem;
.v-selection-control__wrapper {
margin-inline-start: -0.3125rem;
}
}
}
@@ -87,7 +102,9 @@ h6,
&.v-checkbox-btn,
&.v-radio,
&.v-radio-btn {
margin-inline-start: -0.6875rem;
.v-selection-control__wrapper {
margin-inline-start: -0.6875rem;
}
}
}
@@ -154,13 +171,141 @@ h6,
padding-block: 0 !important;
padding-inline: 0 !important;
> .v-ripple__container {
opacity: 0;
}
&:not(:last-child) {
padding-block-end: var(--v-card-list-gap) !important;
}
}
.v-list-item:hover,
.v-list-item:focus,
.v-list-item:active,
.v-list-item.active {
> .v-list-item__overlay {
opacity: 0 !important;
}
}
}
// 👉 Table
.v-table {
color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
// 👉 Divider
.v-divider {
color: rgb(var(--v-border-color));
}
// 👉 DataTable
.v-data-table {
/* stylelint-disable-next-line no-descending-specificity */
.v-checkbox-btn .v-selection-control__wrapper {
margin-inline-start: 0 !important;
}
.v-selection-control {
display: flex !important;
}
.v-pagination {
color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity));
}
}
// 👉 v-field
.v-field:hover .v-field__outline {
--v-field-border-opacity: var(--v-medium-emphasis-opacity);
}
// 👉 VLabel
.v-label {
opacity: 1 !important;
&:not(.v-field-label--floating) {
color: rgba(var(--v-theme-on-background), var(--v-medium-emphasis-opacity));
}
}
// 👉 Overlay
.v-overlay__scrim,
.v-navigation-drawer__scrim {
background: rgba(var(--v-overlay-scrim-background), var(--v-overlay-scrim-opacity));
opacity: 1;
}
// 透明主题下全屏弹窗的overlay背景透明度调整
html[data-theme="transparent"] .v-dialog--fullscreen .v-overlay__scrim {
background: rgba(var(--v-overlay-scrim-background), 0.3);
}
// 👉 VMessages
.v-messages {
color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity));
opacity: 1;
}
// 👉 Alert close btn
.v-alert__close {
.v-btn--icon .v-icon {
--v-icon-size-multiplier: 1.5;
}
}
// 👉 Badge icon alignment
.v-badge__badge {
display: flex;
align-items: center;
justify-content: center;
}
// 👉 Dialog
.v-dialog--fullscreen {
background-color: rgb(var(--v-theme-surface));
}
// 透明主题下全屏弹窗背景透明
html[data-theme="transparent"] .v-dialog--fullscreen {
background-color: transparent !important;
}
// For dialog card title
.v-card-item + .v-card-text {
padding-block-start: 0 !important;
}
// 👉 v-slide-group (List of chips)
.v-slide-group {
.v-slide-group__container {
display: flex;
flex-wrap: wrap;
// Spacing between buttons in v-slide-group
.v-slide-group-item:not(:last-child) {
margin-inline-end: 0.5rem;
}
}
}
// 👉 Expansion Panel
.v-expansion-panels {
.v-expansion-panel-title {
min-block-size: unset !important;
padding-block: 1rem !important;
}
}
// 👉 v-textarea
.v-textarea {
textarea {
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
&:hover,
&:focus {
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
}
}
}
// 👉 Cursor
.cursor-pointer {
cursor: pointer;
}

View File

@@ -1,22 +1,24 @@
$shadow-key-umbra-opacity-custom: var(--v-shadow-key-umbra-opacity);
$shadow-key-penumbra-opacity-custom: var(--v-shadow-key-penumbra-opacity);
$shadow-key-ambient-opacity-custom: var(--v-shadow-key-ambient-opacity);
/* stylelint-disable-next-line max-line-length */
$font-family-custom: 'Inter', 'Noto Sans SC', sans-serif, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
// 👉 Card transition properties
$card-transition-property-custom: box-shadow, opacity;
@forward "vuetify/settings" with (
// 👉 General settings
// 👉 General settings
$color-pack: false !default,
$body-font-family: $font-family-custom !default,
$border-radius-root: 6px !default,
// 👉 Shadow opacity
// 👉 Shadow opacity
$shadow-key-umbra-opacity: $shadow-key-umbra-opacity-custom !default,
$shadow-key-penumbra-opacity: $shadow-key-penumbra-opacity-custom !default,
$shadow-key-ambient-opacity: $shadow-key-ambient-opacity-custom !default,
$body-font-family: $font-family-custom !default,
$border-radius-root: 6px !default,
$shadow-key-umbra: (
0: (0 0 0 0 var(--v-shadow-key-umbra-opacity)),
1: (0 2px 1px -1px var(--v-shadow-key-umbra-opacity)),
@@ -119,6 +121,18 @@ $card-transition-property-custom: box-shadow, opacity;
24: (0 9px 46px 8px $shadow-key-ambient-opacity-custom)
) !default,
// 👉 Card
$card-color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity)) !default,
$card-elevation: 6 !default,
$card-title-line-height: 2rem !default,
$card-actions-min-height: unset !default,
$card-text-padding: 1.25rem !default,
$card-item-padding: 1.25rem !default,
$card-actions-padding: 0 12px 12px !default,
$card-transition-property: $card-transition-property-custom !default,
$card-subtitle-opacity: 1 !default,
$card-title-letter-spacing: 0.0094rem !default,
// 👉 Typography
$typography: (
"h1": (
@@ -170,29 +184,14 @@ $card-transition-property-custom: box-shadow, opacity;
)
) !default,
// 👉 States
$states: ("activated": 0.08) !default,
// 👉 Card
$card-color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity)) !default,
$card-elevation: 6 !default,
$card-title-line-height: 1.6 !default,
$card-actions-min-height: unset !default,
$card-text-padding: 20px !default,
$card-item-padding: 15px 20px !default,
$card-actions-padding: 0 12px 12px !default,
$card-title-letter-spacing: 0.0094rem !default,
$card-subtitle-opacity: 1 !default,
$card-transition-property: $card-transition-property-custom !default,
// 👉 Navigation Drawer
$navigation-drawer-color: rgba(var(--v-theme-on-surface), var(--v-high-medium-opacity)) !default,
// 👉 Table
$table-color: rgba(var(--v-theme-on-surface), var(--v-high-medium-opacity)) !default,
// 👉 List
$list-item-icon-margin-end: 16px !default,
$list-item-icon-margin-start: 16px !default,
$list-item-subtitle-opacity: 1 !default,
$list-subheader-text-opacity: 1 !default,
// 👉 Tooltip
$tooltip-background-color:#212121 !default,
$tooltip-background-color: #212121 !default,
$tooltip-text-color: rgb(var(--v-theme-on-primary)) !default,
$tooltip-font-size: 0.75rem !default,
$tooltip-border-radius: 4px !default,
@@ -205,6 +204,8 @@ $card-transition-property-custom: box-shadow, opacity;
// 👉 Badge
$badge-border-color:rgb(var(--v-theme-surface)) !default,
$badge-dot-height: 0.5rem !default,
$badge-dot-width: 0.5rem !default,
// 👉 Button
$button-height: 38px !default,
@@ -212,6 +213,7 @@ $card-transition-property-custom: box-shadow, opacity;
$button-border-radius: 5px !default,
$button-padding-ratio: 1.7 !default,
$button-text-letter-spacing: 0.025rem !default,
$button-icon-density: ("default": 0.5, "comfortable": -2, "compact": -3) !default,
// 👉 Dialog
$dialog-card-header-padding: 20px !default,
@@ -220,6 +222,7 @@ $card-transition-property-custom: box-shadow, opacity;
// 👉 Chip
$chip-label-border-radius: 4px !default,
$chip-close-size: 20px !default,
// 👉 Expansion panel
$expansion-panel-title-padding: 16px 20px !default,
@@ -232,9 +235,6 @@ $card-transition-property-custom: box-shadow, opacity;
// 👉 Menu
$menu-content-border-radius: 5px !default,
// 👉 List
$list-subheader-text-opacity: 1 !default,
// 👉 Snackbar
$snackbar-background:#212121 !default,
$snackbar-border-radius: 4px !default,
@@ -243,7 +243,12 @@ $card-transition-property-custom: box-shadow, opacity;
// 👉 Tabs
$tabs-height: 40px !default,
// 👉 Timeline
// 👉 Slider
$slider-track-active-size: 4px !default,
$slider-thumb-label-padding: 4px 12px !default,
$slider-thumb-label-font-size: 0.875rem !default,
// 👉 Timeline
$timeline-dot-size: 34px !default,
$timeline-dot-divider-background: transparent !default,
@@ -252,4 +257,7 @@ $card-transition-property-custom: box-shadow, opacity;
// 👉 Navigation Drawer
$navigation-drawer-scrim-opacity:0.5 !default,
// 👉 Table
$table-color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity)),
);

View File

@@ -1 +1,2 @@
@use "variables";
@use "overrides";

View File

@@ -1,5 +1,7 @@
.auth-wrapper {
min-block-size: calc(var(--vh, 1vh) * 100 + env(safe-area-inset-top) + env(safe-area-inset-bottom));
min-block-size: 100%;
min-block-size: 100vh;
min-block-size: 100dvh;
}
.auth-footer-mask {

View File

@@ -1,3 +1,21 @@
%layout-navbar {
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
}
// Vertical nav scrolled sticky elevated nav
%default-layout-vertical-nav-scrolled-sticky-elevated-nav {
background-color: rgb(var(--v-theme-surface));
box-shadow: 0 4px 8px -4px rgb(94 86 105 / 42%);
}
// Floating navbar and sticky elevated navbar scrolled
%default-layout-vertical-nav-floating-navbar-and-sticky-elevated-navbar-scrolled {
background-color: rgb(var(--v-theme-surface));
box-shadow: 0 4px 8px -4px rgb(94 86 105 / 42%);
}
// Floating navbar overlay
%default-layout-vertical-nav-floating-navbar-overlay {
backdrop-filter: blur(8px);
background-color: rgba(var(--v-theme-surface), 0.9);
}

View File

@@ -1,7 +1,7 @@
@use "@core/scss/mixins";
@use "../mixins";
@use "@configured-variables" as variables;
@use "vuetify/lib/styles/tools/states" as vuetifyStates;
@use "@core/scss/utils";
@use "../utils";
// Nav items styles (including section title)
%vertical-nav-item {

View File

@@ -1,193 +0,0 @@
@use "vuetify/lib/styles/tools/_elevation" as mixins_elevation;
@use "@configured-variables" as variables;
@use "mixins";
// 👉 Alert
.v-alert {
.v-alert__close {
.v-icon {
block-size: 20px !important;
font-size: 20px !important;
inline-size: 20px !important;
}
}
&:not(.v-alert--prominent) .v-alert__prepend {
.v-icon {
block-size: 1.375rem !important;
font-size: 1.375rem !important;
inline-size: 1.375rem !important;
}
}
.v-alert-title {
line-height: 1.5rem;
margin-block-end: 0.25rem;
}
}
// 👉 Avatar font-size
.v-avatar {
@include mixins.avatar-font-sizes($map: variables.$avatar-font-sizes);
}
// 👉 Button
.v-btn {
/* stylelint-disable-next-line no-descending-specificity */
&:not(.v-btn--icon) .v-icon {
--v-icon-size-multiplier: 0.9525 !important;
}
}
// 👉 Chip
.v-chip.v-chip--size-default .v-avatar {
--v-avatar-height: 24px;
}
.v-chip.v-chip--density-comfortable {
line-height: 1;
}
// 👉 Expansion Panel
.v-expansion-panel {
.v-expansion-panel-text {
font-size: 1rem;
}
}
// 👉 Tooltip
.v-tooltip > .v-overlay__content {
font-weight: 500;
line-height: 0.875rem;
}
// 👉 List
// 👉 Tab with pill support
.v-tabs.v-tabs-pill {
.v-tab.v-btn {
border-radius: 6px !important;
}
}
// 👉 Timeline added box shadow
.v-timeline-item {
.v-timeline-divider__dot {
.v-timeline-divider__inner-dot {
box-shadow: 0 0 0 0.1875rem rgb(var(--v-theme-on-surface-variant));
@each $color-name in variables.$theme-colors-name {
&.bg-#{$color-name} {
box-shadow: 0 0 0 0.1875rem rgba(var(--v-theme-#{$color-name}), 0.12);
}
}
}
}
}
// 👉 Timeline Outlined style
.v-timeline-variant-outlined.v-timeline {
.v-timeline-divider__dot {
.v-timeline-divider__inner-dot {
box-shadow: inset 0 0 0 0.125rem rgb(var(--v-theme-on-surface-variant));
@each $color-name in variables.$theme-colors-name {
background-color: rgb(var(--v-theme-surface)) !important;
&.bg-#{$color-name} {
box-shadow: inset 0 0 0 0.125rem rgb(var(--v-theme-#{$color-name}));
}
}
}
}
}
// 👉 Expansion panels
.v-expansion-panel-title,
.v-expansion-panel-title--active,
.v-expansion-panel-title:hover,
.v-expansion-panel-title:focus,
.v-expansion-panel-title:focus-visible,
.v-expansion-panel-title--active:focus,
.v-expansion-panel-title--active:hover {
.v-expansion-panel-title__overlay {
opacity: 0 !important;
}
}
// 👉 Set Elevation when panel open
.v-expansion-panels:not(.v-expansion-panels--variant-accordion) {
.v-expansion-panel.v-expansion-panel--active {
.v-expansion-panel__shadow {
@include mixins_elevation.elevation(3);
}
}
}
// 👉 Slider
.v-slider-thumb {
.v-slider-thumb__label {
background: rgb(117, 117, 117);
color: rgb(var(--v-theme-on-primary));
&::before {
color: rgb(117, 117, 117);
}
}
}
// 👉 Switch
.v-switch {
.v-selection-control:not(.v-selection-control--dirty) .v-switch__thumb {
color: #fff;
}
}
// 👉 Table
.v-table--density-default > .v-table__wrapper > table > tbody > tr > td,
.v-table--density-default > .v-table__wrapper > table > thead > tr > td,
.v-table--density-default > .v-table__wrapper > table > tfoot > tr > td {
block-size: 50px !important;
}
.v-table {
--v-table-header-height: 54px !important;
th {
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity)) !important;
font-size: 0.75rem;
.v-data-table-header__content {
display: flex;
justify-content: space-between;
}
}
.v-selection-control {
color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity)) !important;
font-size: 1rem;
}
}
.v-data-table {
th {
background: rgb(var(--v-table-header-background)) !important;
}
}
// 👉 Pagination
.v-pagination {
.v-btn {
border-radius: 4px;
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
font-size: 14px;
font-weight: 400;
}
}
// 👉 SnackBar
.v-snackbar--variant-elevated {
@include mixins.elevation(6);
}

View File

@@ -1,101 +0,0 @@
@use "sass:map";
@use "vuetify/lib/styles/settings" as vuetify_settings;
@use "@styles/variables/_vuetify.scss" as vuetify;
@mixin avatar-font-sizes($map: $avatar-sizes) {
@each $sizeName, $multiplier in vuetify_settings.$size-scales {
/* stylelint-disable-next-line scss/no-global-function-names */
$size: map.get($map, $sizeName);
&.v-avatar--size-#{$sizeName} {
font-size: #{$size}px;
}
}
}
@mixin elevation($z, $important: false) {
box-shadow: map.get(vuetify.$shadow-key-umbra, $z), map.get(vuetify.$shadow-key-penumbra, $z), map.get(vuetify.$shadow-key-ambient, $z) if($important, !important, null);
}
@mixin before-pseudo() {
position: relative;
&::before {
position: absolute;
border-radius: inherit;
background: currentcolor;
block-size: 100%;
content: "";
inline-size: 100%;
inset: 0;
opacity: 0;
pointer-events: none;
}
}
@mixin bordered-skin($component, $border-property: "border", $important: false) {
#{$component} {
box-shadow: none !important;
#{$border-property}: 1px solid rgba(var(--v-border-color), var(--v-border-opacity)) if($important, !important, null);
}
}
@mixin selected-states($selector) {
#{$selector} {
opacity: calc(var(--v-selected-opacity) * var(--v-theme-overlay-multiplier));
}
&:hover
#{$selector} {
opacity: calc(var(--v-selected-opacity) + var(--v-hover-opacity) * var(--v-theme-overlay-multiplier));
}
&:focus-visible
#{$selector} {
opacity: calc(var(--v-selected-opacity) + var(--v-focus-opacity) * var(--v-theme-overlay-multiplier));
}
@supports not selector(:focus-visible) {
&:focus {
#{$selector} {
opacity: calc(var(--v-selected-opacity) + var(--v-focus-opacity) * var(--v-theme-overlay-multiplier));
}
}
}
}
@mixin push-anchors() {
:target {
scroll-margin-block-start: 90px;
}
}
@mixin xs {
@media (width >= 0) and (width <= 599.98px) {
@content;
}
}
@mixin sm {
@media (width >= 600px) and (width <= 959.98px) {
@content;
}
}
@mixin md {
@media (width >= 960px) and (width <= 1279.98px) {
@content;
}
}
@mixin lg {
@media (width >= 1280px) and (width <= 1919.98px) {
@content;
}
}
@mixin xl {
@media (width >= 1920px) {
@content;
}
}

View File

@@ -1,25 +0,0 @@
.bg-var-theme-background {
background-color: rgba(var(--v-theme-on-surface), var(--v-hover-opacity)) !important;
}
// 👉 Pagination small-select dropdown for table
// TODO: remove this class after vuetify datatable implememtation
.per-page-select {
margin-block: auto;
.v-field__input {
align-items: center;
padding: 2px;
font-size: 14px;
}
.v-field__append-inner {
align-items: center;
padding: 0;
.v-icon {
margin-inline-start: 0 !important;
}
}
}

View File

@@ -1,41 +0,0 @@
@use "sass:string";
/*
This function is helpful when we have multi dimensional value
Assume we have padding variable `$nav-padding-horizontal: 10px;`
With above variable let's say we use it in some style:
```scss
.selector {
margin-left: $nav-padding-horizontal;
}
```
Now, problem is we can also have value as `$nav-padding-horizontal: 10px 15px;`
In this case above style will be invalid.
This function will extract the left most value from the variable value.
$nav-padding-horizontal: 10px; => 10px;
$nav-padding-horizontal: 10px 15px; => 10px;
This is safe:
```scss
.selector {
margin-left: get-first-value($nav-padding-horizontal);
}
```
*/
@function get-first-value($var) {
$start-at: string.index(#{$var}, " ");
@if $start-at {
@return string.slice(
#{$var},
0,
$start-at
);
} @else {
@return $var;
}
}

View File

@@ -1,227 +0,0 @@
@use "sass:map";
@use "utils";
@use "vuetify/lib/styles/tools/functions" as *;
$vertical-nav-horizontal-padding-custom: 1.375rem 1rem;
// We created this SCSS var to extract the start padding
// Docs: https://sass-lang.com/documentation/modules/string
// $vertical-nav-horizontal-padding => 0 8px;
// string.index(#{$vertical-nav-horizontal-padding}, " ") + 1 => 2
// string.index(#{$vertical-nav-horizontal-padding}, " ") => 1
// string.slice(0 8px, 2, -1) => 8px => $card-actions-padding-x
$vertical-nav-horizontal-padding-start: utils.get-first-value($vertical-nav-horizontal-padding-custom) !default;
$vertical-nav-items-icon-margin-inline-end: 0.625rem !default;
// Vertical Nav Configuration
$vertical-nav-collapsed-width: 68px !default;
// This is used to keep consistency between nav items and nav header left & right margin
// This is used by nav items & nav header
$vertical-nav-horizontal-spacing: 0 1.125rem !default;
$vertical-nav-horizontal-padding: $vertical-nav-horizontal-padding-custom !default;
// Vertical nav header padding
$vertical-nav-header-padding: 1rem 0.25rem 1rem $vertical-nav-horizontal-padding-start !default;
// 👉 Custom Variables
$avatar-font-sizes: (
"x-small":12,
"small":14,
"default":18,
"large":20,
"x-large":24
) !default;
// 合并两个文件中的@forward配置
@forward "@layouts/styles/variables" with (
// 来自_variables.scss的配置
$layout-vertical-nav-collapsed-width: 68px !default,
// 来自template/_variables.scss的配置
$layout-vertical-nav-z-index: 1004,
$layout-overlay-z-index: 1003
);
// 使用命名空间来避免变量冲突
@use "@layouts/styles/variables" as layouts-vars;
$theme-colors-name: (
"primary",
"secondary",
"error",
"info",
"success",
"warning"
) !default;
// 👉 Default layout with vertical nav
$default-layout-with-vertical-nav-navbar-footer-roundness: 10px !default;
// 👉 Vertical nav
$vertical-nav-background-color-rgb: var(--v-theme-background) !default;
$vertical-nav-background-color: rgb(#{$vertical-nav-background-color-rgb}) !default;
// This is used to keep consistency between nav items and nav header left & right margin
// This is used by nav items & nav header
$vertical-nav-horizontal-spacing: 1rem !default;
$vertical-nav-horizontal-padding: 0.75rem !default;
// Vertical nav header height. Mostly we will align it with navbar height;
$vertical-nav-header-height: layouts-vars.$layout-vertical-nav-navbar-height !default;
$vertical-nav-navbar-elevation: 3 !default;
$vertical-nav-navbar-style: "elevated" !default; // options: elevated, floating
$vertical-nav-floating-navbar-top: 1rem !default;
// Vertical nav header padding
$vertical-nav-header-padding: 1rem $vertical-nav-horizontal-padding !default;
$vertical-nav-header-inline-spacing: $vertical-nav-horizontal-spacing !default;
// Move logo when vertical nav is mini (collapsed but not hovered)
$vertical-nav-header-logo-translate-x-when-vertical-nav-mini: -4px !default;
// Space between logo and title
$vertical-nav-header-logo-title-spacing: 0.9rem !default;
// Section title margin top (when its not first child)
$vertical-nav-section-title-mt: 1.5rem !default;
// Section title margin bottom
$vertical-nav-section-title-mb: 0.5rem !default;
// Vertical nav icons
$vertical-nav-items-icon-size: 1.5rem !default;
$vertical-nav-items-nested-icon-size: 0.9rem !default;
$vertical-nav-items-icon-margin-inline-end: 0.5rem !default;
// Transition duration for nav group arrow
$vertical-nav-nav-group-arrow-transition-duration: 0.15s !default;
// Timing function for nav group arrow
$vertical-nav-nav-group-arrow-transition-timing-function: ease-in-out !default;
// 👉 Horizontal nav
/*
❗ Heads up
==================
Here we assume we will always use shorthand property which will apply same padding on four side
This is because this have been used as value of top property by `.popper-content`
*/
$horizontal-nav-padding: 0.6875rem !default;
// Gap between top level horizontal nav items
$horizontal-nav-top-level-items-gap: 4px !default;
// Horizontal nav icons
$horizontal-nav-items-icon-size: 1.5rem !default;
$horizontal-nav-third-level-icon-size: 0.9rem !default;
$horizontal-nav-items-icon-margin-inline-end: 0.625rem !default;
// We used SCSS variable because we want to allow users to update max height of popper content
// 120px is combined height of navbar & horizontal nav
$horizontal-nav-popper-content-max-height: calc((var(--vh, 1vh) * 100) - 120px - 4rem) !default;
// This variable is used for horizontal nav popper content's `margin-top` and "The bridge"'s height. We need to sync both values.
$horizontal-nav-popper-content-top: calc($horizontal-nav-padding + 0.375rem) !default;
// 👉 Plugins
$plugin-ps-thumb-y-dark: rgba(var(--v-theme-surface-variant), 0.35) !default;
// 👉 Vuetify
// Used in src/@core/scss/base/libs/vuetify/_overrides.scss
$vuetify-reduce-default-compact-button-icon-size: true !default;
// 👉 Custom variables
// for utility classes
$font-sizes: () !default;
$font-sizes: map-deep-merge(
(
"xs": 0.75rem,
"sm": 0.875rem,
"base": 1rem,
"lg": 1.125rem,
"xl": 1.25rem,
"2xl": 1.5rem,
"3xl": 1.875rem,
"4xl": 2.25rem,
"5xl": 3rem,
"6xl": 3.75rem,
"7xl": 4.5rem,
"8xl": 6rem,
"9xl": 8rem
),
$font-sizes
);
// line height
$font-line-height: () !default;
$font-line-height: map-deep-merge(
(
"xs": 1rem,
"sm": 1.25rem,
"base": 1.5rem,
"lg": 1.75rem,
"xl": 1.75rem,
"2xl": 2rem,
"3xl": 2.25rem,
"4xl": 2.5rem,
"5xl": 1,
"6xl": 1,
"7xl": 1,
"8xl": 1,
"9xl": 1
),
$font-line-height
);
// gap utility class
$gap: () !default;
$gap: map-deep-merge(
(
"0": 0,
"1": 0.25rem,
"2": 0.5rem,
"3": 0.75rem,
"4": 1rem,
"5": 1.25rem,
"6":1.5rem,
"7": 1.75rem,
"8": 2rem,
"9": 2.25rem,
"10": 2.5rem,
"11": 2.75rem,
"12": 3rem,
"14": 3.5rem,
"16": 4rem,
"20": 5rem,
"24": 6rem,
"28": 7rem,
"32": 8rem,
"36": 9rem,
"40": 10rem,
"44": 11rem,
"48": 12rem,
"52": 13rem,
"56": 14rem,
"60": 15rem,
"64": 16rem,
"72": 18rem,
"80": 20rem,
"96": 24rem
),
$gap
);
// Avatar sizes map
$avatar-font-sizes: (
"x-small": 0.625rem,
"small": 0.75rem,
"default": 0.875rem,
"large": 1rem,
"x-large": 1.125rem,
) !default;

View File

@@ -1,42 +0,0 @@
@use "sass:map";
// Layout
@use "../vertical-nav";
@use "../default-layout";
@use "default-layout-w-vertical-nav";
// Components
@use "components";
// Utilities
@use "utilities";
@use "../utils";
// Misc
@use "../misc";
// Dark
@use "../dark";
// Variables
@use "variables";
// libs
@use "libs/perfect-scrollbar";
@use "libs/vuetify";
a {
color: rgb(var(--v-theme-primary));
text-decoration: none;
}
// Vuetify 3 don't provide margin bottom style like vuetify 2
p {
margin-block-end: 1rem;
}
// Iconify icon size
svg.iconify {
block-size: 1em;
inline-size: 1em;
}

View File

@@ -1,106 +0,0 @@
@use "@configureTheme" as theme;
@use "@configured-variables" as variables;
@use "../mixins";
// 👉 Apex chart
.apexcharts-canvas {
// For RTL alignment
.apexcharts-yaxis-texts-g {
text-align: start;
}
// Tooltip
.apexcharts-tooltip {
line-height: 1.5;
.apexcharts-tooltip-title {
border-color: rgba(var(--v-border-color), var(--v-border-opacity));
background: rgb(var(--v-theme-surface));
font-weight: 500;
margin-block-end: 0.25rem;
padding-inline: 1rem;
}
.apexcharts-tooltip-text {
display: flex;
align-items: center;
color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
font-size: inherit;
gap: 0.5rem;
line-height: inherit;
}
.apexcharts-tooltip-text-label,
.apexcharts-tooltip-text-value {
font-weight: 600;
line-height: 1.5;
}
.apexcharts-tooltip-series-group {
padding-block: 0 0.5rem;
padding-inline: 1rem;
&:last-child {
padding-block-end: 1rem;
}
&.active {
padding-block-start: 0;
}
}
&.apexcharts-theme-light {
border-color: rgb(var(--v-border-color));
background: rgb(var(--v-theme-surface));
box-shadow: none;
.apexcharts-tooltip-text-label,
.apexcharts-tooltip-text-value {
color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
}
}
}
.apexcharts-marker {
transition: none;
}
// 👉 stroke-dasharray
.apexcharts-radialbar,
.apexcharts-radialbar-slice-current {
stroke-linecap: round;
}
.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
border-color: rgb(var(--v-border-color));
background: rgb(var(--v-theme-surface));
color: rgba(var(--v-theme-on-background), var(--v-medium-emphasis-opacity));
&::after,
&::before {
border-block-end-color: rgb(var(--v-border-color));
}
}
// 👉 Text color
.apexcharts-text,
.apexcharts-tooltip-text,
.apexcharts-datalabel-label,
.apexcharts-datalabel,
.apexcharts-xaxistooltip-text,
.apexcharts-yaxistooltip-text,
.apexcharts-legend-text {
color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity)) !important;
font-family: inherit !important;
}
// 👉 Annotation Label
.apexcharts-annotation-rect {
&.apexcharts-xaxis-annotation-rect,
&.apexcharts-yaxis-annotation-rect {
fill-opacity: 0.05;
stroke-opacity: 0;
}
}
}

View File

@@ -1,301 +0,0 @@
@use "@configured-variables" as variables;
@use "../../../utils";
// 👉 Application
// We need accurate vh in mobile devices as well
.v-application__wrap {
/* stylelint-disable-next-line liberty/use-logical-spec */
min-height: calc(var(--vh, 1vh) * 100);
}
// 👉 Typography
h1,
h2,
h3,
h4,
h5,
h6,
.text-h1,
.text-h2,
.text-h3,
.text-h4,
.text-h5,
.text-h6,
.text-button,
.text-overline,
.v-card-title {
color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
}
.text-body-1,
.text-body-2,
.text-subtitle-1,
.text-subtitle-2 {
color: rgba(var(--v-theme-on-background), var(--v-medium-emphasis-opacity));
}
// 👉 Grid
// Remove margin-bottom of v-input_details inside grid (validation error message)
.v-row {
.v-col,
[class^="v-col-*"] {
.v-input__details {
margin-block-end: 0;
}
}
}
// 👉 Button
@if variables.$vuetify-reduce-default-compact-button-icon-size {
.v-btn--density-compact.v-btn--size-default {
.v-btn__content > svg {
block-size: 22px;
font-size: 22px;
inline-size: 22px;
}
}
}
// 👉 Card
// Removes padding-top for immediately placed v-card-text after itself
.v-card-text {
& + & {
padding-block-start: 0 !important;
}
}
/*
👉 Checkbox & Radio Ripple
TODO Checkbox and switch component. Remove it when vuetify resolve the extra spacing: https://github.com/vuetifyjs/vuetify/issues/15519
We need this because form elements likes checkbox and switches are by default set to height of textfield height which is way big than we want
Tested with checkbox & switches
*/
.v-checkbox.v-input,
.v-switch.v-input {
--v-input-control-height: auto;
flex: unset;
}
.v-selection-control--density-comfortable {
&.v-checkbox-btn,
&.v-radio,
&.v-radio-btn {
.v-selection-control__wrapper {
margin-inline-start: -0.5625rem;
}
}
}
.v-selection-control--density-compact {
&.v-radio,
&.v-radio-btn,
&.v-checkbox-btn {
.v-selection-control__wrapper {
margin-inline-start: -0.3125rem;
}
}
}
.v-selection-control--density-default {
&.v-checkbox-btn,
&.v-radio,
&.v-radio-btn {
.v-selection-control__wrapper {
margin-inline-start: -0.6875rem;
}
}
}
.v-radio-group {
.v-selection-control-group {
.v-radio:not(:last-child) {
margin-inline-end: 0.9rem;
}
}
}
/*
👉 Tabs
Disable tab transition
This is for tabs where we don't have card wrapper to tabs and have multiple cards as tab content.
This class will disable transition and adds `overflow: unset` on `VWindow` to allow spreading shadow
*/
.disable-tab-transition {
overflow: unset !important;
.v-window__container {
block-size: auto !important;
}
.v-window-item:not(.v-window-item--active) {
display: none !important;
}
.v-window__container .v-window-item {
transform: none !important;
}
}
// 👉 List
.v-list {
// Set icons opacity to .87
.v-list-item__prepend > .v-icon,
.v-list-item__append > .v-icon {
opacity: var(--v-high-emphasis-opacity);
}
}
// 👉 Card list
/*
Custom class
Remove list spacing inside card
This is because card title gets padding of 20px and list item have padding of 16px. Moreover, list container have padding-bottom as well.
*/
.card-list {
--v-card-list-gap: 20px;
&.v-list {
padding-block: 0;
}
.v-list-item {
min-block-size: unset;
min-block-size: auto !important;
padding-block: 0 !important;
padding-inline: 0 !important;
> .v-ripple__container {
opacity: 0;
}
&:not(:last-child) {
padding-block-end: var(--v-card-list-gap) !important;
}
}
.v-list-item:hover,
.v-list-item:focus,
.v-list-item:active,
.v-list-item.active {
> .v-list-item__overlay {
opacity: 0 !important;
}
}
}
// 👉 Divider
.v-divider {
color: rgb(var(--v-border-color));
}
// 👉 DataTable
.v-data-table {
/* stylelint-disable-next-line no-descending-specificity */
.v-checkbox-btn .v-selection-control__wrapper {
margin-inline-start: 0 !important;
}
.v-selection-control {
display: flex !important;
}
.v-pagination {
color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity));
}
}
// 👉 v-field
.v-field:hover .v-field__outline {
--v-field-border-opacity: var(--v-medium-emphasis-opacity);
}
// 👉 VLabel
.v-label {
opacity: 1 !important;
&:not(.v-field-label--floating) {
color: rgba(var(--v-theme-on-background), var(--v-medium-emphasis-opacity));
}
}
// 👉 Overlay
.v-overlay__scrim,
.v-navigation-drawer__scrim {
background: rgba(var(--v-overlay-scrim-background), var(--v-overlay-scrim-opacity)) !important;
opacity: 1 !important;
}
// 👉 VMessages
.v-messages {
color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity));
opacity: 1;
}
// 👉 Alert close btn
.v-alert__close {
.v-btn--icon .v-icon {
--v-icon-size-multiplier: 1.5;
}
}
// 👉 Badge icon alignment
.v-badge__badge {
display: flex;
align-items: center;
justify-content: center;
}
// 👉 Dialog
.v-dialog--fullscreen {
background-color: rgb(var(--v-theme-surface));
}
// For dialog card title
.v-card-item + .v-card-text {
padding-block-start: 0 !important;
}
// 👉 v-slide-group (List of chips)
.v-slide-group {
.v-slide-group__container {
display: flex;
flex-wrap: wrap;
// Spacing between buttons in v-slide-group
.v-slide-group-item:not(:last-child) {
margin-inline-end: 0.5rem;
}
}
}
// 👉 Expansion Panel
.v-expansion-panels {
.v-expansion-panel-title {
min-block-size: unset !important;
padding-block: 1rem !important;
}
}
// 👉 v-textarea
.v-textarea {
textarea {
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
&:hover,
&:focus {
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
}
}
}
// 👉 Cursor
.cursor-pointer {
cursor: pointer;
}

View File

@@ -1,263 +0,0 @@
$shadow-key-umbra-opacity-custom: var(--v-shadow-key-umbra-opacity);
$shadow-key-penumbra-opacity-custom: var(--v-shadow-key-penumbra-opacity);
$shadow-key-ambient-opacity-custom: var(--v-shadow-key-ambient-opacity);
/* stylelint-disable-next-line max-line-length */
$font-family-custom: 'Inter', 'Noto Sans SC', sans-serif, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
// 👉 Card transition properties
$card-transition-property-custom: box-shadow, opacity;
@forward "vuetify/settings" with (
// 👉 General settings
$color-pack: false !default,
// 👉 Shadow opacity
$shadow-key-umbra-opacity: $shadow-key-umbra-opacity-custom !default,
$shadow-key-penumbra-opacity: $shadow-key-penumbra-opacity-custom !default,
$shadow-key-ambient-opacity: $shadow-key-ambient-opacity-custom !default,
$body-font-family: $font-family-custom !default,
$border-radius-root: 6px !default,
$shadow-key-umbra: (
0: (0 0 0 0 var(--v-shadow-key-umbra-opacity)),
1: (0 2px 1px -1px var(--v-shadow-key-umbra-opacity)),
2: (0 3px 1px -2px var(--v-shadow-key-umbra-opacity)),
// Modified
3: (0 4px 14px -4px var(--v-shadow-key-umbra-opacity)),
4: (0 2px 4px -1px var(--v-shadow-key-umbra-opacity)),
5: (0 3px 5px -1px var(--v-shadow-key-umbra-opacity)),
// Modified
6: (0 4px 5px -2px var(--v-shadow-key-umbra-opacity)),
7: (0 4px 5px -2px var(--v-shadow-key-umbra-opacity)),
8: (0 5px 5px -3px var(--v-shadow-key-umbra-opacity)),
9: (0 5px 6px -3px var(--v-shadow-key-umbra-opacity)),
10: (0 6px 6px -3px var(--v-shadow-key-umbra-opacity)),
11: (0 6px 7px -4px var(--v-shadow-key-umbra-opacity)),
12: (0 7px 8px -4px var(--v-shadow-key-umbra-opacity)),
13: (0 7px 8px -4px var(--v-shadow-key-umbra-opacity)),
14: (0 7px 9px -4px var(--v-shadow-key-umbra-opacity)),
15: (0 8px 9px -5px var(--v-shadow-key-umbra-opacity)),
16: (0 8px 10px -5px var(--v-shadow-key-umbra-opacity)),
17: (0 8px 11px -5px var(--v-shadow-key-umbra-opacity)),
18: (0 9px 11px -5px var(--v-shadow-key-umbra-opacity)),
19: (0 9px 12px -6px var(--v-shadow-key-umbra-opacity)),
20: (0 10px 13px -6px var(--v-shadow-key-umbra-opacity)),
21: (0 10px 13px -6px var(--v-shadow-key-umbra-opacity)),
22: (0 10px 14px -6px var(--v-shadow-key-umbra-opacity)),
23: (0 11px 14px -7px var(--v-shadow-key-umbra-opacity)),
24: (0 11px 15px -7px var(--v-shadow-key-umbra-opacity))
) !default,
$shadow-key-penumbra: (
0: (0 0 0 0 $shadow-key-penumbra-opacity-custom),
1: (0 1px 1px 0 $shadow-key-penumbra-opacity-custom),
2: (0 2px 2px 0 $shadow-key-penumbra-opacity-custom),
// Modified
3: (0 4px 8px -4px $shadow-key-penumbra-opacity-custom),
4: (0 4px 5px 0 $shadow-key-penumbra-opacity-custom),
5: (0 5px 8px 0 $shadow-key-penumbra-opacity-custom),
// Modified
6: (0 2px 10px 1px $shadow-key-penumbra-opacity-custom),
7: (0 7px 10px 1px $shadow-key-penumbra-opacity-custom),
8: (0 8px 10px 1px $shadow-key-penumbra-opacity-custom),
9: (0 9px 12px 1px $shadow-key-penumbra-opacity-custom),
10: (0 10px 14px 1px $shadow-key-penumbra-opacity-custom),
11: (0 11px 15px 1px $shadow-key-penumbra-opacity-custom),
12: (0 12px 17px 2px $shadow-key-penumbra-opacity-custom),
13: (0 13px 19px 2px $shadow-key-penumbra-opacity-custom),
14: (0 14px 21px 2px $shadow-key-penumbra-opacity-custom),
15: (0 15px 22px 2px $shadow-key-penumbra-opacity-custom),
16: (0 16px 24px 2px $shadow-key-penumbra-opacity-custom),
17: (0 17px 26px 2px $shadow-key-penumbra-opacity-custom),
18: (0 18px 28px 2px $shadow-key-penumbra-opacity-custom),
19: (0 19px 29px 2px $shadow-key-penumbra-opacity-custom),
20: (0 20px 31px 3px $shadow-key-penumbra-opacity-custom),
21: (0 21px 33px 3px $shadow-key-penumbra-opacity-custom),
22: (0 22px 35px 3px $shadow-key-penumbra-opacity-custom),
23: (0 23px 36px 3px $shadow-key-penumbra-opacity-custom),
24: (0 24px 38px 3px $shadow-key-penumbra-opacity-custom)
) !default,
$shadow-key-ambient: (
0: (0 0 0 0 $shadow-key-ambient-opacity-custom),
1: (0 1px 3px 0 $shadow-key-ambient-opacity-custom),
2: (0 1px 5px 0 $shadow-key-ambient-opacity-custom),
// Modified
3: (0 4px 8px -4px $shadow-key-ambient-opacity-custom),
4: (0 1px 10px 0 $shadow-key-ambient-opacity-custom),
5: (0 1px 14px 0 $shadow-key-ambient-opacity-custom),
// Modified
6: (0 2px 16px 1px $shadow-key-ambient-opacity-custom),
7: (0 2px 16px 1px $shadow-key-ambient-opacity-custom),
8: (0 3px 14px 2px $shadow-key-ambient-opacity-custom),
9: (0 3px 16px 2px $shadow-key-ambient-opacity-custom),
10: (0 4px 18px 3px $shadow-key-ambient-opacity-custom),
11: (0 4px 20px 3px $shadow-key-ambient-opacity-custom),
12: (0 5px 22px 4px $shadow-key-ambient-opacity-custom),
13: (0 5px 24px 4px $shadow-key-ambient-opacity-custom),
14: (0 5px 26px 4px $shadow-key-ambient-opacity-custom),
15: (0 6px 28px 5px $shadow-key-ambient-opacity-custom),
16: (0 6px 30px 5px $shadow-key-ambient-opacity-custom),
17: (0 6px 32px 5px $shadow-key-ambient-opacity-custom),
18: (0 7px 34px 6px $shadow-key-ambient-opacity-custom),
19: (0 7px 36px 6px $shadow-key-ambient-opacity-custom),
20: (0 8px 38px 7px $shadow-key-ambient-opacity-custom),
21: (0 8px 40px 7px $shadow-key-ambient-opacity-custom),
22: (0 8px 42px 7px $shadow-key-ambient-opacity-custom),
23: (0 9px 44px 8px $shadow-key-ambient-opacity-custom),
24: (0 9px 46px 8px $shadow-key-ambient-opacity-custom)
) !default,
// 👉 Card
$card-color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity)) !default,
$card-elevation: 6 !default,
$card-title-line-height: 2rem !default,
$card-actions-min-height: unset !default,
$card-text-padding: 1.25rem !default,
$card-item-padding: 1.25rem !default,
$card-actions-padding: 0 12px 12px !default,
$card-transition-property: $card-transition-property-custom !default,
$card-subtitle-opacity: 1 !default,
$card-title-letter-spacing: 0.0094rem !default,
// 👉 Typography
$typography: (
"h1": (
"weight": 500,
"line-height": 7rem,
"letter-spacing": -0.0938rem
),
"h2": (
"weight": 500,
"line-height": 4.5rem,
"letter-spacing": -0.0313rem
),
"h3": (
"weight": 500,
"line-height": 3.5rem
),
"h4": (
"weight": 500,
"line-height": 2.625rem,
"letter-spacing": 0.0156rem
),
"h5": (
"weight": 500,
"line-height": 2rem
),
"h6": (
"letter-spacing": 0.0094rem
),
"subtitle-1": (
"letter-spacing": 0.0094rem
),
"subtitle-2": (
"line-height": 1.375rem,
"letter-spacing": 0.0063rem,
),
"body-1": (
"letter-spacing": 0.0094rem,
),
"body-2": (
"letter-spacing": 0.0094rem,
),
"caption": (
"letter-spacing": 0.025rem,
),
"overline": (
"weight": 400,
"line-height": 1.125rem,
"letter-spacing": 0.0625rem,
)
) !default,
// 👉 List
$list-item-icon-margin-end: 16px !default,
$list-item-icon-margin-start: 16px !default,
$list-item-subtitle-opacity: 1 !default,
$list-subheader-text-opacity: 1 !default,
// 👉 Tooltip
$tooltip-background-color: #212121 !default,
$tooltip-text-color: rgb(var(--v-theme-on-primary)) !default,
$tooltip-font-size: 0.75rem !default,
$tooltip-border-radius: 4px !default,
$tooltip-padding: 4px 8px !default,
// 👉 Alert
$alert-title-font-size: 1rem !default,
$alert-border-radius: 5px !default,
$alert-title-letter-spacing: 0.15px !default,
// 👉 Badge
$badge-border-color:rgb(var(--v-theme-surface)) !default,
$badge-dot-height: 0.5rem !default,
$badge-dot-width: 0.5rem !default,
// 👉 Button
$button-height: 38px !default,
$button-elevation: ("default": 3, "hover": 4, "active": 8) !default,
$button-border-radius: 5px !default,
$button-padding-ratio: 1.7 !default,
$button-text-letter-spacing: 0.025rem !default,
$button-icon-density: ("default": 0.5, "comfortable": -2, "compact": -3) !default,
// 👉 Dialog
$dialog-card-header-padding: 20px !default,
$dialog-card-header-text-padding-top: 0 !default,
$dialog-card-text-padding: 20px !default,
// 👉 Chip
$chip-label-border-radius: 4px !default,
$chip-close-size: 20px !default,
// 👉 Expansion panel
$expansion-panel-title-padding: 16px 20px !default,
$expansion-panel-title-font-size: 1rem !default,
$expansion-panel-disabled-overlay: 0 !default,
$expansion-panel-active-title-min-height: 51px !default,
$expansion-panel-title-min-height: 51px !default,
$expansion-panel-text-padding: 0 20px 20px !default,
// 👉 Menu
$menu-content-border-radius: 5px !default,
// 👉 Snackbar
$snackbar-background:#212121 !default,
$snackbar-border-radius: 4px !default,
$snackbar-color: rgb(var(--v-theme-on-primary)) !default,
// 👉 Tabs
$tabs-height: 40px !default,
// 👉 Slider
$slider-track-active-size: 4px !default,
$slider-thumb-label-padding: 4px 12px !default,
$slider-thumb-label-font-size: 0.875rem !default,
// 👉 Timeline
$timeline-dot-size: 34px !default,
$timeline-dot-divider-background: transparent !default,
// 👉 Overlay
$overlay-opacity: 0.5 !default,
// 👉 Navigation Drawer
$navigation-drawer-scrim-opacity:0.5 !default,
// 👉 Table
$table-color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity)),
);

View File

@@ -1,2 +0,0 @@
@use "variables";
@use "overrides";

View File

@@ -1,25 +0,0 @@
.layout-blank {
.misc-wrapper {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 1.25rem;
overflow: hidden;
.misc-footer-img {
position: absolute;
inline-size: 100%;
inset-block-end: 0;
}
.misc-footer-tree {
position: absolute;
z-index: 1;
}
}
.misc-avatar {
z-index: 1;
}
}

View File

@@ -1,54 +0,0 @@
.layout-blank {
.auth-wrapper {
min-block-size: calc(var(--vh, 1vh) * 100);
.auth-footer-mask {
position: absolute;
inset-block-end: 0;
min-inline-size: 100%;
}
.auth-footer-start-tree,
.auth-footer-end-tree {
position: absolute;
z-index: 1;
}
.auth-footer-start-tree {
inset-block-end: 0;
inset-inline-start: 0;
}
.auth-footer-end-tree {
inset-block-end: 0;
inset-inline-end: 0;
}
.auth-illustration {
z-index: 1;
}
}
.auth-card {
z-index: 1 !important;
}
}
@media (min-width: 960px) {
.skin--bordered {
.auth-card-v2 {
border-inline-start: 1px solid rgba(var(--v-border-color), var(--v-border-opacity)) !important;
}
}
}
.auth-logo {
position: absolute;
z-index: 1;
inset-block-start: 2rem;
inset-inline-start: 2.3rem;
}
.auth-card-v2 {
background-color: rgb(var(--v-theme-surface));
}

View File

@@ -1,45 +0,0 @@
@use "@configured-variables" as variables;
@use "misc";
@use "../mixins";
%default-layout-vertical-nav-scrolled-sticky-elevated-nav {
background-color: rgb(var(--v-theme-surface));
}
%default-layout-vertical-nav-floating-navbar-and-sticky-elevated-navbar-scrolled {
// @include mixins.elevation(variables.$vertical-nav-navbar-elevation);
// If navbar is contained => Squeeze navbar content on scroll
@if variables.$layout-vertical-nav-navbar-is-contained {
padding-inline: 1rem;
}
}
%default-layout-vertical-nav-floating-navbar-overlay {
isolation: isolate;
&::after {
position: absolute;
z-index: -1;
/* stylelint-disable property-no-vendor-prefix */
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
/* stylelint-enable */
background:
linear-gradient(
180deg,
rgba(var(--v-theme-background), 70%) 44%,
rgba(var(--v-theme-background), 43%) 73%,
rgba(var(--v-theme-background), 0%)
);
background-repeat: repeat;
block-size: calc(variables.$layout-vertical-nav-navbar-height + variables.$vertical-nav-floating-navbar-top + 0.5rem);
content: "";
inset-block-start: -(variables.$vertical-nav-floating-navbar-top);
inset-inline: 0;
/* stylelint-disable property-no-vendor-prefix */
-webkit-mask: linear-gradient(black, black 18%, transparent 100%);
mask: linear-gradient(black, black 18%, transparent 100%);
/* stylelint-enable */
}
}

View File

@@ -1,3 +0,0 @@
%layout-navbar {
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
}

View File

@@ -1,5 +0,0 @@
@forward "nav";
@forward "vertical-nav";
@forward "default-layout";
@forward "default-layout-vertical-nav";
@forward "misc";

View File

@@ -1,45 +0,0 @@
%blurry-bg {
position: relative;
background: rgba(var(--v-theme-background), 1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 4%), 0 1px 2px rgba(0, 0, 0, 2%);
@media (width > 768px) {
.v-theme--transparent & {
backdrop-filter: blur(5px);
background: rgba(var(--v-theme-background), 0.1);
}
}
@media (width <= 768px) {
background: transparent;
&::before {
position: absolute;
z-index: -1;
backdrop-filter: blur(24px);
block-size: calc(env(safe-area-inset-top, 0px) + var(--navbar-tab-height) + 4rem);
content: "";
inset-block-start: 0;
inset-inline: 0;
pointer-events: none;
transition: all 0.3s ease-in-out;
.v-theme--light & {
background: rgba(var(--v-theme-surface), 0.6);
}
.v-theme--dark & {
background: rgba(var(--v-theme-background), 0.5);
}
.v-theme--purple & {
background: rgba(var(--v-theme-background), 0.5);
}
.v-theme--transparent & {
background: rgba(var(--v-theme-background), 0.3);
}
}
}
}

View File

@@ -1,8 +0,0 @@
%nav-link-active {
background:
linear-gradient(
-72.47deg,
rgb(var(--v-theme-primary)) 22.16%,
rgba(var(--v-theme-primary), 0.7) 76.47%
) !important;
}

View File

@@ -1,64 +0,0 @@
@use "@configured-variables" as variables;
// Add divider around section title
%vertical-nav-section-title {
/*
We will use this to add gap between divider and text.
Moreover, we will use this to adjust the `flex-basis` property of left divider
*/
$divider-gap: 0.625rem;
// Thanks: https://stackoverflow.com/a/62359101/10796681
.title-text {
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-start;
column-gap: $divider-gap;
&::before,
&::after {
border-block-end: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
content: "";
}
&::after {
flex: 1 1 auto;
}
&::before {
flex: 0 1 calc(variables.$vertical-nav-horizontal-padding-start - $divider-gap);
margin-inline-start: -#{variables.$vertical-nav-horizontal-padding-start};
}
}
// Update the margin-inline-end when vertical nav is in mini state. We done same for link & group.
@at-root {
.layout-nav-type-vertical.layout-vertical-nav-collapsed .layout-vertical-nav:not(.hovered) .nav-section-title {
margin-inline: 4px 0;
}
}
}
%vertical-nav-item-interactive {
// Add pill shape styles
block-size: 2.625rem !important;
border-end-end-radius: 3.125rem !important;
border-end-start-radius: 0 !important;
border-start-end-radius: 3.125rem !important;
border-start-start-radius: 0 !important;
}
%vertical-nav-item-interactive {
// Wobble effect
// transition: margin-inline 0.4s ease-in-out;
// will-change: margin-inline;
transition: margin-inline 0.15s ease-in-out;
will-change: margin-inline;
// Reduce margin inline end when vertical nav is in collapsed mode and not hovered
.layout-nav-type-vertical.layout-vertical-nav-collapsed .layout-vertical-nav:not(.hovered) & {
margin-inline: 0 5px;
}
}

View File

@@ -23,6 +23,13 @@ export function kFormatter(num: number) {
: Math.abs(num).toFixed(0).replace(regex, ',')
}
// 格式化下载量显示超过1000显示为x.xk格式
export function formatDownloadCount(num: number): string {
if (!num || num < 1000) return num?.toLocaleString() || '0'
return `${(num / 1000).toFixed(1)}k`
}
/**
* Format and return date in Humanize format
* Intl docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format

View File

@@ -65,3 +65,6 @@ export function getQueryValue(key: string, url = window.location.href): string {
const res = reg.exec(url)
return res ? res[1] : ''
}
// 导出 navigator 相关函数
export { isMobileDevice, isIOSDevice, isAndroidDevice } from './navigator'

View File

@@ -43,3 +43,56 @@ export const isPWA = async (): Promise<boolean> => {
}
return (window.navigator as any).standalone === true
}
// 同步检测PWA显示模式
export const isPWADisplayMode = (): boolean => {
return (
window.matchMedia('(display-mode: standalone)').matches ||
(window.navigator as any).standalone ||
document.referrer.includes('android-app://')
)
}
// 全面的PWA检测推荐使用
export const checkPWAStatus = async () => {
const hasServiceWorker = await isPWA()
const isStandaloneMode = isPWADisplayMode()
return {
// 是否有PWA功能Service Worker
hasPWAFeatures: hasServiceWorker,
// 是否在独立显示模式下运行
isStandaloneMode,
// 综合判断更宽松的检测在移动设备上默认启用PWA功能
isPWAEnvironment: hasServiceWorker || isStandaloneMode || isMobileDevice(),
// 完整的PWA体验既有功能又在独立模式下运行
isFullPWA: hasServiceWorker && isStandaloneMode,
}
}
// 检测是否为移动设备
export const isMobileDevice = (): boolean => {
// 检查用户代理字符串
const userAgent = navigator.userAgent || ''
const mobileRegex = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i
// 检查触摸屏支持
const hasTouchScreen = 'ontouchstart' in window || navigator.maxTouchPoints > 0
// 检查屏幕尺寸小于768px认为是移动设备
const isMobileSize = window.innerWidth < 768
return mobileRegex.test(userAgent) || hasTouchScreen || isMobileSize
}
// 检测是否为iOS设备
export const isIOSDevice = (): boolean => {
const userAgent = navigator.userAgent.toLowerCase()
return /iphone|ipad|ipod/.test(userAgent) && !(window as any).MSStream
}
// 检测是否为Android设备
export const isAndroidDevice = (): boolean => {
const userAgent = navigator.userAgent.toLowerCase()
return /android/.test(userAgent)
}

View File

@@ -17,11 +17,34 @@ export default defineComponent({
syncRef(isOverlayNavActive, isLayoutOverlayVisible)
const scrollDistance = ref(window.scrollY)
const isDialogOpen = ref(false)
const wasScrolledBeforeDialog = ref(false)
// 监听弹窗状态变化
const checkDialogState = () => {
const wasDialogOpen = isDialogOpen.value
isDialogOpen.value = document.documentElement.classList.contains('v-overlay-scroll-blocked')
// 当弹窗刚打开时,记录当前的滚动状态
if (!wasDialogOpen && isDialogOpen.value) {
wasScrolledBeforeDialog.value = scrollDistance.value > 0
}
}
onMounted(() => {
window.addEventListener('scroll', () => {
scrollDistance.value = window.scrollY
})
// 初始检查弹窗状态
checkDialogState()
// 监听 DOM 变化以检测弹窗状态
const observer = new MutationObserver(checkDialogState)
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['class'],
})
})
return () => {
@@ -96,7 +119,7 @@ export default defineComponent({
'layout-navbar-fixed',
mdAndDown.value && 'layout-overlay-nav',
route.meta.layoutWrapperClasses,
scrollDistance.value && 'window-scrolled',
(scrollDistance.value > 5 || (isDialogOpen.value && wasScrolledBeforeDialog.value)) && 'window-scrolled',
],
},
[verticalNav, h('div', { class: 'layout-content-wrapper' }, [navbar, main, footer]), layoutOverlay],

View File

@@ -6,8 +6,8 @@
html {
background: rgb(var(--v-theme-background));
min-block-size: calc(100% + env(safe-area-inset-top) + env(safe-area-inset-bottom));
overflow-y: overlay;
min-block-size: 100vh;
min-block-size: 100dvh;
}
body {
@@ -40,8 +40,8 @@ body,
// TODO: Use grid gutter variable here;
padding-block: 1.5rem;
padding-inline: 0.5rem;
padding-block-start: calc(env(safe-area-inset-top) + 4.5rem);
padding-inline: 0.5rem;
// display: flex;display

View File

@@ -7,5 +7,7 @@
html {
box-sizing: border-box;
min-height: calc(100% + env(safe-area-inset-top) + env(safe-area-inset-bottom))
min-block-size: 100%;
min-block-size: 100vh;
min-block-size: 100dvh;
}

View File

@@ -9,6 +9,9 @@ import { SupportedLocale } from '@/types/i18n'
import { checkAndEmitUnreadMessages } from '@/utils/badge'
import { preloadImage } from './@core/utils/image'
import { globalLoadingStateManager } from '@/utils/loadingStateManager'
import { addBackgroundTimer, removeBackgroundTimer } from '@/utils/backgroundManager'
import PWAInstallPrompt from '@/components/PWAInstallPrompt.vue'
import { themeManager } from '@/utils/themeManager'
// 生效主题
const { global: globalTheme } = useTheme()
@@ -34,9 +37,6 @@ const loginStateKey = computed(() => (isLogin.value ? 'logged-in' : 'logged-out'
const backgroundImages = ref<string[]>([])
const activeImageIndex = ref(0)
const isTransparentTheme = computed(() => globalTheme.name.value === 'transparent')
let backgroundRotationTimer: NodeJS.Timeout | null = null
// ApexCharts 全局配置
declare global {
@@ -102,23 +102,37 @@ async function fetchBackgroundImages() {
}
}
// 背景图片轮换函数
function rotateBackgroundImage() {
if (backgroundImages.value.length > 1) {
// 计算下一个图片索引
const nextIndex = (activeImageIndex.value + 1) % backgroundImages.value.length
// 预加载下一张图片
preloadImage(backgroundImages.value[nextIndex]).then(success => {
// 只有图片成功加载才切换
if (success) {
activeImageIndex.value = nextIndex
}
})
}
}
// 开始背景图片轮换
function startBackgroundRotation() {
// 清除轮换定时器
if (backgroundRotationTimer) clearInterval(backgroundRotationTimer)
// 清除现有定时器
removeBackgroundTimer('background-rotation')
if (backgroundImages.value.length > 1) {
// 每10秒切换一次
backgroundRotationTimer = setInterval(() => {
// 计算下一个图片索引
const nextIndex = (activeImageIndex.value + 1) % backgroundImages.value.length
// 预加载下一张图片
preloadImage(backgroundImages.value[nextIndex]).then(success => {
// 只有图片成功加载才切换
if (success) {
activeImageIndex.value = nextIndex
}
})
}, 10000)
// 使用优化的定时器管理器,后台时自动暂停
addBackgroundTimer(
'background-rotation',
rotateBackgroundImage,
10000, // 每10秒切换一次
{
runInBackground: false, // 后台时不运行
skipInitialRun: true, // 不需要立即执行
},
)
}
}
@@ -138,14 +152,14 @@ async function removeLoadingWithStateCheck() {
globalLoadingStateManager.setLoadingState('pwa-state', true)
globalLoadingStateManager.setLoadingState('global-settings', true)
globalLoadingStateManager.setLoadingState('background-images', true)
// 静默检查PWA状态恢复
const pwaController = (window as any).pwaStateController
if (pwaController) {
await pwaController.waitForStateRestore()
}
globalLoadingStateManager.setLoadingState('pwa-state', false)
// 并行加载关键资源
await Promise.all([
globalSettingsStore.initialize().then(() => {
@@ -156,15 +170,15 @@ async function removeLoadingWithStateCheck() {
globalLoadingStateManager.setLoadingState('background-images', false)
resolve(void 0)
}, 50)
})
}),
])
// 等待所有加载完成
await globalLoadingStateManager.waitForAllComplete()
// 移除加载界面
animateAndRemoveLoader()
// 检查未读消息
checkAndEmitUnreadMessages()
} catch (error) {
@@ -199,6 +213,9 @@ onMounted(async () => {
// 初始化data-theme属性
updateHtmlThemeAttribute(globalTheme.name.value)
// 初始化主题管理器 - 统一处理主题初始化
await themeManager.setTheme(themeValue)
// 监听主题变化
watch(
() => globalTheme.name.value,
@@ -220,11 +237,8 @@ onMounted(async () => {
})
onUnmounted(() => {
// 清除轮换定时器
if (backgroundRotationTimer) {
clearInterval(backgroundRotationTimer)
backgroundRotationTimer = null
}
// 清除背景轮换定时器
removeBackgroundTimer('background-rotation')
})
</script>
@@ -243,8 +257,10 @@ onUnmounted(() => {
<div v-if="isLogin && isTransparentTheme" class="global-blur-layer"></div>
</div>
<!-- 页面内容 -->
<VApp :class="{ 'transparent-app': isTransparentTheme }">
<VApp>
<RouterView />
<!-- PWA安装提示 -->
<PWAInstallPrompt />
</VApp>
</div>
</template>
@@ -305,29 +321,4 @@ onUnmounted(() => {
inset-block-start: 0;
inset-inline-start: 0;
}
/* 优化加载完成动画 */
.loading-complete {
animation: fadeOutScale 0.8s ease-out forwards;
}
@keyframes fadeOutScale {
0% {
opacity: 1;
transform: scale(1);
filter: blur(0px);
}
70% {
opacity: 0.3;
transform: scale(1.05);
filter: blur(2px);
}
100% {
opacity: 0;
transform: scale(1.1);
filter: blur(5px);
}
}
</style>

View File

@@ -344,6 +344,10 @@ export const actionStepOptions = [
title: i18n.global.t('actionStep.invokePlugin'),
value: '调用插件',
},
{
title: i18n.global.t('actionStep.note'),
value: '备注',
},
]
// 操作步骤字典

View File

@@ -39,8 +39,9 @@ const globalOfflineStatus = useGlobalOfflineStatus()
// 添加响应拦截器
api.interceptors.response.use(
response => {
// 成功响应时,清除应用离线状态
// 成功响应时,清除应用离线状态并重置连续错误计数
globalOfflineStatus.setAppOffline(false)
globalOfflineStatus.resetConsecutiveErrors()
return response.data
},
error => {
@@ -57,7 +58,8 @@ api.interceptors.response.use(
if (error.code === 'ECONNABORTED') {
reason = 'Request timeout'
}
globalOfflineStatus.setAppOffline(true, reason)
// 记录网络错误,只有连续三次才会设置为离线模式
globalOfflineStatus.recordNetworkError(reason)
}
if (error.code === 'NETWORK_ERROR' || error.code === 'ERR_NETWORK') {

View File

@@ -144,6 +144,42 @@ export interface SubscribeShare {
episode_group?: string
}
// 工作流分享
export interface WorkflowShare {
// 分享ID
id?: string
// 工作流ID
workflow_id?: string
// 分享标题
share_title?: string
// 分享说明
share_comment?: string
// 分享人
share_user?: string
// 分享人唯一ID
share_uid?: string
// 工作流名称
name?: string
// 工作流描述
description?: string
// 定时器
timer?: string
// 触发类型timer-定时触发 event-事件触发 manual-手动触发
trigger_type?: string
// 事件类型当trigger_type为event时使用
event_type?: string
// 动作列表
actions?: any[]
// 动作流
flows?: any[]
// 上下文
context?: string
// 时间
date?: string
// 复用次数
count?: number
}
// 历史记录
export interface TransferHistory {
// ID
@@ -278,6 +314,8 @@ export interface MediaInfo {
production_countries?: any[]
// 语种
spoken_languages?: string[]
// 数字/实体发行日期
release_dates?: MediaRelease[]
// 状态
status?: string
// 标签
@@ -332,6 +370,18 @@ export interface TmdbSeason {
vote_average?: number
}
// 发行信息
export interface MediaRelease {
// 发行日期
date: string
// 发行地区
iso_code: string
// 备注
note?: string
// 发行类型
type: number
}
// TMDB集信息
export interface TmdbEpisode {
// 上映日期
@@ -484,7 +534,7 @@ export interface SiteUserData {
// 用户名
username?: string
// 用户ID
userid?: number
userid?: string
// 用户等级
user_level?: string
// 加入时间
@@ -954,6 +1004,10 @@ export interface MediaServerPlayItem {
link?: string
// 播放百分比
percent?: number
// 媒体服务器类型
server_type?: string
// 图片是否需要Cookies
use_cookies?: boolean
}
// 媒体服务器媒体库
@@ -974,6 +1028,10 @@ export interface MediaServerLibrary {
image_list?: string[]
// 链接
link?: string
// 媒体服务器类型
server_type?: string
// 图片是否需要Cookies
use_cookies?: boolean
}
// 消息通知
@@ -1292,6 +1350,10 @@ export interface Workflow {
description?: string
// 定时器
timer?: string
// 触发类型timer-定时触发 event-事件触发 manual-手动触发
trigger_type?: string
// 事件类型当trigger_type为event时使用
event_type?: string
// 状态
state?: string
// 当前执行动作
@@ -1355,3 +1417,13 @@ export interface TorrentCacheData {
// 缓存数据
data: TorrentCacheItem[]
}
// 订阅分享统计
export interface SubscribeShareStatistics {
// 分享人
share_user?: string
// 分享数量
share_count?: number
// 总复用人次
total_reuse_count?: number
}

View File

@@ -3,9 +3,7 @@ import FileList from './filebrowser/FileList.vue'
import FileToolbar from './filebrowser/FileToolbar.vue'
import FileNavigator from './filebrowser/FileNavigator.vue'
import type { EndPoints, FileItem, StorageConf } from '@/api/types'
import { useDisplay } from 'vuetify'
import { storageIconDict } from '@/api/constants'
import { usePWA } from '@/composables/usePWA'
// 输入参数
const props = defineProps({
@@ -30,13 +28,6 @@ const props = defineProps({
// 对外事件
const emit = defineEmits(['pathchanged'])
// 显示器宽度
const display = useDisplay()
// APP
// PWA模式检测
const { appMode } = usePWA()
const fileIcons = {
// 压缩包
zip: 'mdi-folder-zip-outline',
@@ -240,20 +231,6 @@ function stopDrag() {
;(document.body.style as any).webkitUserSelect = ''
;(document.body.style as any).mozUserSelect = ''
}
// 外层DIV大小控制
const scrollStyle = computed(() => {
return appMode.value
? 'height: calc(100vh - 10.5rem - env(safe-area-inset-bottom) - 7rem)'
: 'height: calc(100vh - 10.5rem - env(safe-area-inset-bottom)'
})
// 文件列表大小限制
const fileListStyle = computed(() => {
return appMode.value
? 'height: calc(100vh - 14rem - env(safe-area-inset-bottom) - 7rem)'
: 'height: calc(100vh - 14rem - env(safe-area-inset-bottom)'
})
</script>
<template>
@@ -271,7 +248,7 @@ const fileListStyle = computed(() => {
@foldercreated="refreshPending = true"
@sortchanged="sortChanged"
/>
<div class="flex" :style="scrollStyle">
<div class="flex">
<FileNavigator
v-if="showDirTree"
:storage="activeStorage"
@@ -295,7 +272,6 @@ const fileListStyle = computed(() => {
:axios="axios"
:refreshpending="refreshPending"
:sort="sort"
:listStyle="fileListStyle"
:showTree="showDirTree"
:style="{ flex: 1 }"
@pathchanged="pathChanged"

View File

@@ -0,0 +1,201 @@
<script setup lang="ts">
import { usePWAInstall } from '@/composables/usePWAInstall'
import { useAuthStore } from '@/stores'
import { useI18n } from 'vue-i18n'
import { useToast } from 'vue-toastification'
const { t, locale, messages } = useI18n()
const { isInstalled, showInstallPrompt, getInstallInstructions } = usePWAInstall()
const showBanner = ref(false)
const showInstructions = ref(false)
const dismissed = ref(false)
// 检查是否登录
const authStore = useAuthStore()
const isLogin = computed(() => authStore.token)
// 检查当前是不是https环境
const isHttps = computed(() => {
return window.location.protocol === 'https:'
})
// 检查是否应该显示横幅
const shouldShowBanner = computed(() => {
return !isInstalled.value && !dismissed.value && !showInstructions.value && isLogin.value && isHttps.value
})
// 显示延迟(避免立即显示)
onMounted(() => {
setTimeout(() => {
// 检查本地存储,看用户是否已经关闭过提示
const dismissedTime = localStorage.getItem('pwa-install-dismissed')
if (dismissedTime) {
const dismissedDate = new Date(dismissedTime)
const now = new Date()
const daysDiff = (now.getTime() - dismissedDate.getTime()) / (1000 * 60 * 60 * 24)
// 如果距离上次关闭不到30天不显示
if (daysDiff < 30) {
dismissed.value = true
return
}
}
showBanner.value = true
}, 5000) // 5秒后显示
})
// 处理安装
const handleInstall = async () => {
const installed = await showInstallPrompt()
if (installed) {
showBanner.value = false
// 显示成功消息
useToast().success(t('pwa.installSuccess'))
} else {
// 如果用户拒绝,显示手动安装说明
showInstructions.value = true
}
}
// 关闭横幅
const dismissBanner = () => {
showBanner.value = false
dismissed.value = true
// 记录关闭时间
localStorage.setItem('pwa-install-dismissed', new Date().toISOString())
}
// 获取平台特定的安装说明
const instructions = computed(() => {
const rawInstructions = getInstallInstructions()
const platformKey = rawInstructions.platformKey
// 获取平台显示名称
const platformName = t(`pwa.platforms.${platformKey}`)
// 直接使用t函数获取安装步骤避免编译对象的问题
const steps = []
const maxSteps = 10 // 最大步骤数,防止无限循环
for (let i = 0; i < maxSteps; i++) {
try {
const stepKey = `pwa.installSteps.${platformKey}.${i}`
const stepText = t(stepKey)
// 如果返回的是键名本身,说明没有找到对应的翻译
if (stepText === stepKey) {
break
}
steps.push(stepText)
} catch (error) {
// 如果出现错误,说明没有更多步骤
break
}
}
return {
platform: platformName,
steps,
}
})
</script>
<template>
<!-- 安装横幅 -->
<Teleport to="body">
<Transition
enter-active-class="transition-all duration-300"
enter-from-class="translate-y-full opacity-0"
enter-to-class="translate-y-0 opacity-100"
leave-active-class="transition-all duration-300"
leave-from-class="translate-y-0 opacity-100"
leave-to-class="translate-y-full opacity-0"
>
<VCard v-if="shouldShowBanner && showBanner" class="pwa-install-banner">
<div class="banner-content">
<VIcon icon="mdi-cellphone-link" size="24" class="me-3" />
<div class="flex-grow-1">
<div class="font-weight-medium">{{ t('pwa.installApp') }}</div>
<div class="text-sm opacity-70">{{ t('pwa.installDescription') }}</div>
</div>
<VBtn color="primary" size="small" variant="flat" @click="handleInstall">
{{ t('pwa.install') }}
</VBtn>
<VBtn icon size="small" variant="text" @click="dismissBanner">
<VIcon icon="mdi-close" />
</VBtn>
</div>
</VCard>
</Transition>
</Teleport>
<!-- 手动安装说明对话框 -->
<VDialog v-model="showInstructions" max-width="500">
<VCard>
<VCardItem>
<VCardTitle class="d-flex align-center">
<VIcon icon="mdi-information-outline" class="me-2" />
{{ t('pwa.installGuide') }}
</VCardTitle>
</VCardItem>
<VCardText>
<div class="mb-4">
<div class="text-subtitle-1 mb-2">
{{ t('pwa.installInstructions', { platform: instructions.platform }) }}
</div>
<VList density="compact">
<VListItem
v-for="(step, index) in instructions.steps"
:key="index"
:prepend-icon="`mdi-numeric-${index + 1}-circle`"
>
<VListItemTitle>{{ step }}</VListItemTitle>
</VListItem>
</VList>
</div>
<VAlert type="info" variant="tonal" density="compact">
{{ t('pwa.installNote') }}
</VAlert>
</VCardText>
<VCardActions>
<VSpacer />
<VBtn color="primary" variant="text" @click="showInstructions = false">
{{ t('pwa.gotIt') }}
</VBtn>
</VCardActions>
</VCard>
</VDialog>
</template>
<style scoped>
.pwa-install-banner {
position: fixed;
z-index: 1000;
border: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
border-radius: 12px;
background: rgb(var(--v-theme-surface));
box-shadow: 0 4px 20px rgba(0, 0, 0, 10%);
inset-block-end: 5rem;
inset-inline: 20px;
}
.banner-content {
display: flex;
align-items: center;
padding: 16px;
gap: 8px;
}
@media (width >= 600px) {
.pwa-install-banner {
inset-inline: auto 20px;
max-inline-size: 400px;
}
}
</style>

View File

@@ -1,5 +1,6 @@
<script lang="ts" setup>
import type { MediaServerPlayItem } from '@/api/types'
import { openMediaServerWithAutoDetect } from '@/utils/appDeepLink'
// 输入参数
const props = defineProps({
media: Object as PropType<MediaServerPlayItem>,
@@ -16,14 +17,21 @@ function imageLoadHandler() {
}
// 跳转播放
function goPlay() {
if (props.media?.link) window.open(props.media?.link, '_blank')
async function goPlay() {
if (props.media?.link) {
await openMediaServerWithAutoDetect(props.media.link, undefined, props.media.server_type)
}
}
// 计算图片地址
const getImgUrl = computed(() => {
const image = props.media?.image || ''
return `${import.meta.env.VITE_API_BASE_URL}system/img/0?imgurl=${encodeURIComponent(image)}`
let url = `${import.meta.env.VITE_API_BASE_URL}system/img/0?imgurl=${encodeURIComponent(image)}`
const use_cookies = props.media?.use_cookies
if (use_cookies) {
url += `&use_cookies=${encodeURIComponent(use_cookies)}`
}
return url
})
</script>
@@ -48,16 +56,18 @@ const getImgUrl = computed(() => {
<VSkeletonLoader class="object-cover aspect-w-3 aspect-h-2" />
</div>
</template>
<VCardText
class="w-full flex flex-col flex-wrap justify-end align-left text-white absolute bottom-0 cursor-pointer pa-2"
>
<h1
class="mb-1 text-white text-shadow font-extrabold text-xl line-clamp-2 overflow-hidden text-ellipsis ..."
<template #default>
<VCardText
class="w-full flex flex-col flex-wrap justify-end align-left text-white absolute bottom-0 cursor-pointer pa-2"
>
{{ props.media?.title }}
</h1>
<span class="text-shadow">{{ props.media?.subtitle }}</span>
</VCardText>
<h1
class="mb-1 text-white text-shadow font-bold text-lg line-clamp-2 overflow-hidden text-ellipsis ..."
>
{{ props.media?.title }}
</h1>
<span class="text-shadow text-sm">{{ props.media?.subtitle }}</span>
</VCardText>
</template>
</VImg>
</template>
<div class="w-full absolute bottom-0">

View File

@@ -87,6 +87,12 @@ function saveRuleInfo() {
emit('done')
}
// 验证规则ID输入
function validateRuleId() {
// 只允许英文和数字,不允许空格
ruleInfo.value.id = ruleInfo.value.id.replace(/[^a-zA-Z0-9]/g, '')
}
// 按钮点击
function onClose() {
emit('close')
@@ -138,6 +144,7 @@ function onClose() {
persistent-hint
active
prepend-inner-icon="mdi-identifier"
@input="validateRuleId"
/>
</VCol>
<VCol cols="12" md="6">

View File

@@ -4,19 +4,19 @@ import { formatFileSize } from '@/@core/utils/formatters'
import { DownloaderConf } from '@/api/types'
import { useToast } from 'vue-toastification'
import type { DownloaderInfo } from '@/api/types'
import qbittorrent_image from '@images/logos/qbittorrent.png'
import transmission_image from '@images/logos/transmission.png'
import custom_image from '@images/logos/downloader.png'
import { getLogoUrl } from '@/utils/imageUtils'
import { cloneDeep } from 'lodash-es'
import { useI18n } from 'vue-i18n'
import { downloaderDict } from '@/api/constants'
import { useDisplay } from 'vuetify'
import { useBackgroundOptimization } from '@/composables/useBackgroundOptimization'
// 显示器宽度
const display = useDisplay()
// 获取i18n实例
const { t } = useI18n()
const { useConditionalDataRefresh } = useBackgroundOptimization()
// 定义输入
const props = defineProps({
@@ -43,9 +43,6 @@ const emit = defineEmits(['close', 'done', 'change'])
// 提示框
const $toast = useToast()
// timeout定时器
let timeoutTimer: NodeJS.Timeout | undefined = undefined
// 上传速率
const upload_rate = ref(0)
@@ -64,9 +61,15 @@ const downloaderInfo = ref<DownloaderConf>({
config: {},
})
// 下载器是否应该刷新数据的计算属性
const shouldRefresh = computed(() => props.allowRefresh && props.downloader.enabled)
// 调用API查询下载器数据
async function loadDownloaderInfo() {
if (!props.allowRefresh) {
if (!shouldRefresh.value) {
// 当下载器被禁用时,重置速率数据
upload_rate.value = 0
download_rate.value = 0
return
}
try {
@@ -79,11 +82,6 @@ async function loadDownloaderInfo() {
if (res) {
upload_rate.value = res.upload_speed
download_rate.value = res.download_speed
// 定时查询
clearTimeout(timeoutTimer)
if (props.downloader.enabled) {
timeoutTimer = setTimeout(loadDownloaderInfo, 3000)
}
}
} catch (e) {
console.log(e)
@@ -128,11 +126,11 @@ function saveDownloaderInfo() {
const getIcon = computed(() => {
switch (props.downloader.type) {
case 'qbittorrent':
return qbittorrent_image
return getLogoUrl('qbittorrent')
case 'transmission':
return transmission_image
return getLogoUrl('transmission')
default:
return custom_image
return getLogoUrl('downloader')
}
})
@@ -141,14 +139,17 @@ function onClose() {
emit('close')
}
onMounted(async () => {
if (props.downloader.enabled) {
await loadDownloaderInfo()
}
})
// 使用条件性数据刷新定时器(只在下载器启用时运行)
const { stop: stopRefresh } = useConditionalDataRefresh(
`downloader-${props.downloader.name}`,
loadDownloaderInfo,
shouldRefresh, // 响应式条件只有当allowRefresh为true且downloader启用时才运行
3000, // 3秒间隔
true, // 立即执行一次
)
onUnmounted(() => {
if (timeoutTimer) clearTimeout(timeoutTimer)
stopRefresh()
})
</script>
<template>

View File

@@ -43,19 +43,14 @@ function imageLoadHandler() {
imageLoaded.value = true
}
// 计算文本类
function getTextClass() {
return imageLoaded.value ? 'text-white' : ''
}
// 下载状态控制
async function toggleDownload() {
const operation = isDownloading.value ? 'stop' : 'start'
try {
const result: { [key: string]: any } = await api.get(`download/${operation}/${props.info?.hash}`, {
params: {
name: props.downloaderName
}
name: props.downloaderName,
},
})
if (result.success) isDownloading.value = !isDownloading.value
@@ -67,7 +62,7 @@ async function toggleDownload() {
// 删除下截
async function deleteDownload() {
try {
await api.delete(`download/${props.info?.hash}`, {params: {name: props.downloaderName}})
await api.delete(`download/${props.info?.hash}`, { params: { name: props.downloaderName } })
cardState.value = false
} catch (error) {
console.error(error)
@@ -76,35 +71,52 @@ async function deleteDownload() {
</script>
<template>
<VCard v-if="cardState" :key="props.info?.hash">
<VCard v-if="cardState" :key="props.info?.hash" class="flex flex-col h-full" min-height="150">
<template #image>
<VImg :src="props.info?.media.image" aspect-ratio="2/3" cover class="brightness-50" @load="imageLoadHandler" />
<VImg :src="props.info?.media.image" aspect-ratio="2/3" cover @load="imageLoadHandler" position="top">
<template #placeholder>
<div class="w-full h-full">
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
</div>
</template>
<template #default>
<div class="absolute inset-0 outline-none downloading-card-background"></div>
</template>
</VImg>
</template>
<VCardTitle class="break-words whitespace-normal" :class="getTextClass()">
{{ props.info?.media.title || props.info?.name }}
{{
props.info?.media.episode
? `${props.info?.media.season} ${props.info?.media.episode}`
: props.info?.season_episode
}}
</VCardTitle>
<div>
<VCardTitle class="break-words whitespace-normal text-white">
{{ props.info?.media.title || props.info?.name }}
{{
props.info?.media.episode
? `${props.info?.media.season} ${props.info?.media.episode}`
: props.info?.season_episode
}}
</VCardTitle>
<VCardSubtitle class="break-words whitespace-normal" :class="getTextClass()">
{{ props.info?.title }}
</VCardSubtitle>
<VCardSubtitle class="break-words whitespace-normal text-white">
{{ props.info?.title }}
</VCardSubtitle>
<VCardText class="text-subtitle-1 pt-3 pb-1" :class="getTextClass()">
{{ getSpeedText() }}
</VCardText>
<VCardText class="text-subtitle-1 pt-3 pb-1 text-white">
{{ getSpeedText() }}
</VCardText>
<VCardText v-if="getPercentage() > 0" :class="getTextClass()">
<VProgressLinear :model-value="getPercentage()" />
</VCardText>
<VCardText v-if="getPercentage() > 0" class="text-white">
<VProgressLinear :model-value="getPercentage()" bg-color="success" color="success" />
</VCardText>
<VCardActions class="justify-space-between">
<VBtn :icon="`${isDownloading ? 'mdi-pause' : 'mdi-play'}`" @click="toggleDownload" />
<VBtn color="error" icon="mdi-trash-can-outline" @click="deleteDownload" />
</VCardActions>
<VCardActions class="justify-space-between">
<VBtn :icon="`${isDownloading ? 'mdi-pause' : 'mdi-play'}`" @click="toggleDownload" />
<VBtn color="error" icon="mdi-trash-can-outline" @click="deleteDownload" />
</VCardActions>
</div>
</VCard>
</template>
<style lang="scss" scoped>
.downloading-card-background {
background-image: linear-gradient(180deg, rgba(31, 41, 55, 47%) 0%, rgb(31, 41, 55) 100%);
}
</style>

View File

@@ -3,7 +3,8 @@ import type { MediaServerLibrary } from '@/api/types'
import plex from '@images/misc/plex.png'
import emby from '@images/misc/emby.png'
import jellyfin from '@images/misc/jellyfin.png'
import trimemedia from '@images/logos/trimemedia.png'
import { getLogoUrl } from '@/utils/imageUtils'
import { openMediaServerWithAutoDetect } from '@/utils/appDeepLink'
// 输入参数
const props = defineProps({
@@ -36,53 +37,61 @@ function imageErrorHandler() {
// 默认图片
function getDefaultImage() {
if (props.media?.server === 'plex') return plex
else if (props.media?.server === 'emby') return emby
else if (props.media?.server === 'jellyfin') return jellyfin
else if (props.media?.server === 'trimemedia') return trimemedia
if (props.media?.server_type === 'plex') return plex
else if (props.media?.server_type === 'emby') return emby
else if (props.media?.server_type === 'jellyfin') return jellyfin
else if (props.media?.server_type === 'trimemedia') return getLogoUrl('trimemedia')
else return plex
}
// 跳转播放
function goPlay() {
if (props.media?.link) window.open(props.media?.link, '_blank')
async function goPlay() {
if (props.media?.link) {
await openMediaServerWithAutoDetect(props.media.link, undefined, props.media.server_type)
}
}
// 生成图片代理路径
function getImgUrl(url: string) {
function getImgUrl(url: string, use_cookies?: boolean) {
if (!url) return getDefaultImage()
else return `${import.meta.env.VITE_API_BASE_URL}system/img/0?imgurl=${encodeURIComponent(url)}`
let imgurl = `${import.meta.env.VITE_API_BASE_URL}system/img/0?imgurl=${encodeURIComponent(url)}`
if (use_cookies) {
imgurl += `&use_cookies=${encodeURIComponent(use_cookies)}`
}
return imgurl
}
// 根据多张图片生成媒体库封面
async function drawImages(imageList: string[]) {
async function drawImages(imageList: string[], use_cookies?: boolean) {
// 图片
const IMAGES = imageList
if (IMAGES.length === 0) return getDefaultImage()
// 为所有图片添加system/img前缀
for (let i = 0; i < IMAGES.length; i++)
for (let i = 0; i < IMAGES.length; i++) {
IMAGES[i] = `${import.meta.env.VITE_API_BASE_URL}system/img/0?imgurl=${encodeURIComponent(IMAGES[i])}`
if (use_cookies) {
IMAGES[i] += `&use_cookies=${encodeURIComponent(use_cookies)}`
}
}
// canvas
const canvas = canvasRef.value
if (!canvas) return getDefaultImage()
// 画布参数
const POSTER_WIDTH = (canvas.width - 32) / 4
const POSTER_HEIGHT = canvas.height * 0.75 - 8
const MARGIN_WIDTH = 4
const MARGIN_HEIGHT = 4
const REFLECTION_HEIGHT = POSTER_HEIGHT / 2
const REFLECTION_SHOW_HEIGHT = canvas.height / 4
const POSTER_WIDTH = (canvas.width - 40) / 4 // 左右边框8px + 3个间隔24px = 40px
const POSTER_HEIGHT = 256 // 上方海报高256
const MARGIN_WIDTH = 8 // 左右间隔为8
const MARGIN_HEIGHT = 4 // 海报和倒影之间的间隔为4
const REFLECTION_HEIGHT = canvas.height - POSTER_HEIGHT - MARGIN_HEIGHT // 下方倒影使用剩余全部高度
// 获取画布上下文
const ctx = canvas.getContext('2d')
if (!ctx) return getDefaultImage()
// 设置背景色为黑色
ctx.fillStyle = '#000000'
ctx.fillRect(0, 0, canvas.width, canvas.height)
// 设置背景色为透明
ctx.clearRect(0, 0, canvas.width, canvas.height)
// 绘制图片
async function drawImageWithReflection(imgSrc: string, index: number) {
@@ -101,36 +110,27 @@ async function drawImages(imageList: string[]) {
} catch (error) {
console.error(error)
ctx.fillStyle = '#e5e7eb'
ctx.fillRect(MARGIN_WIDTH * index + POSTER_WIDTH * (index - 1), MARGIN_HEIGHT, POSTER_WIDTH, POSTER_HEIGHT)
ctx.fillRect(MARGIN_WIDTH * index + POSTER_WIDTH * (index - 1), 0, POSTER_WIDTH, POSTER_HEIGHT)
return
}
const x = MARGIN_WIDTH * index + POSTER_WIDTH * (index - 1)
const y = MARGIN_HEIGHT
const y = 0 // 海报紧贴顶部
ctx.drawImage(img, x, y, POSTER_WIDTH, POSTER_HEIGHT)
ctx.save()
ctx.translate(0, canvas.height)
ctx.scale(1, -1)
ctx.drawImage(
img,
0,
0,
img.width,
img.height,
x,
REFLECTION_SHOW_HEIGHT - REFLECTION_HEIGHT,
POSTER_WIDTH,
REFLECTION_HEIGHT,
)
ctx.drawImage(img, 0, 0, img.width, img.height, x, 0, POSTER_WIDTH, REFLECTION_HEIGHT)
const gradient = ctx.createLinearGradient(0, REFLECTION_SHOW_HEIGHT - REFLECTION_HEIGHT, 0, REFLECTION_HEIGHT)
const gradient = ctx.createLinearGradient(0, 0, 0, canvas.height - (POSTER_HEIGHT + MARGIN_HEIGHT))
gradient.addColorStop(0, 'rgba(0, 0, 0, 1)')
gradient.addColorStop(1, 'rgba(0, 0, 0, 0.3)')
gradient.addColorStop(1, 'rgba(0, 0, 0, 0.7)')
ctx.globalCompositeOperation = 'destination-out'
ctx.fillStyle = gradient
ctx.fillRect(x, 0, POSTER_WIDTH, REFLECTION_SHOW_HEIGHT)
ctx.fillRect(x, 0, POSTER_WIDTH, REFLECTION_HEIGHT)
ctx.restore()
}
@@ -145,8 +145,8 @@ async function drawImages(imageList: string[]) {
onMounted(async () => {
if (props.media?.image_list && props.media?.image_list.length > 0)
imgUrl.value = await drawImages(props.media?.image_list || [])
else imgUrl.value = getImgUrl(props.media?.image || '')
imgUrl.value = await drawImages(props.media?.image_list || [], props.media?.use_cookies)
else imgUrl.value = getImgUrl(props.media?.image || '', props.media?.use_cookies)
})
</script>
@@ -163,20 +163,22 @@ onMounted(async () => {
@click="goPlay"
>
<template #image>
<canvas ref="canvasRef" class="w-full h-full hidden" />
<canvas ref="canvasRef" width="640" height="360" class="w-full h-full hidden" />
<VImg :src="imgUrl" aspect-ratio="2/3" cover @load="imageLoadHandler" @error="imageErrorHandler">
<template #placeholder>
<div class="w-full h-full">
<VSkeletonLoader class="object-cover aspect-w-3 aspect-h-2" />
</div>
</template>
<VCardText
class="w-full flex flex-col flex-wrap justify-end align-center text-white absolute bottom-0 cursor-pointer pa-2"
>
<h1 class="mb-1 text-white text-shadow font-bold line-clamp-2 overflow-hidden text-ellipsis ...">
{{ props.media?.name }}
</h1>
</VCardText>
<template #default>
<VCardText
class="w-full flex flex-col flex-wrap justify-end align-center text-white absolute bottom-0 cursor-pointer pa-2"
>
<h1 class="mb-1 text-white text-shadow font-bold line-clamp-2 overflow-hidden text-ellipsis ...">
{{ props.media?.name }}
</h1>
</VCardText>
</template>
</VImg>
</template>
</VCard>

View File

@@ -1,8 +1,6 @@
<script lang="ts" setup>
import noImage from '@images/no-image.jpeg'
import tmdbImage from '@images/logos/tmdb.png'
import doubanImage from '@images/logos/douban-black.png'
import bangumiImage from '@images/logos/bangumi.png'
import { getLogoUrl } from '@/utils/imageUtils'
import api from '@/api'
import { useToast } from 'vue-toastification'
import { formatSeason, formatRating } from '@/@core/utils/formatters'
@@ -64,9 +62,9 @@ const seasonsSelected = ref<MediaSeason[]>([])
// 来源角标字典
const sourceIconDict: { [key: string]: any } = {
themoviedb: tmdbImage,
douban: doubanImage,
bangumi: bangumiImage,
themoviedb: getLogoUrl('tmdb'),
douban: getLogoUrl('douban-black'),
bangumi: getLogoUrl('bangumi'),
}
// 绑定MediaCard元素
@@ -468,11 +466,11 @@ onBeforeUnmount(() => {
class="w-full h-full flex flex-col flex-wrap justify-end align-left text-white absolute bottom-0 cursor-pointer pa-2"
style="background: linear-gradient(rgba(45, 55, 72, 40%) 0%, rgba(45, 55, 72, 90%) 100%)"
>
<span class="font-bold">{{ props.media?.year }}</span>
<h1 class="mb-1 text-white font-extrabold text-xl line-clamp-2 overflow-hidden text-ellipsis ...">
<span class="font-semibold text-sm">{{ props.media?.year }}</span>
<h1 class="media-card-title font-bold mb-2 text-white line-clamp-2 overflow-hidden text-ellipsis ...">
{{ props.media?.title }}
</h1>
<p class="leading-4 line-clamp-4 overflow-hidden text-ellipsis ...">
<p class="media-card-overview line-clamp-3 overflow-hidden text-ellipsis ...">
{{ props.media?.overview }}
</p>
<div v-if="props.media?.collection_id" class="mb-3" @click.stop=""></div>
@@ -481,10 +479,16 @@ onBeforeUnmount(() => {
v-if="hasPermission({ is_superuser: userStore.superUser, ...userStore.permissions }, 'search')"
icon="mdi-magnify"
color="white"
size="small"
@click.stop="clickSearch"
/>
<VSpacer />
<IconBtn icon="mdi-heart" :color="isSubscribed ? 'error' : 'white'" @click.stop="handleSubscribe" />
<IconBtn
icon="mdi-heart"
:color="isSubscribed ? 'error' : 'white'"
size="small"
@click.stop="handleSubscribe"
/>
</div>
</VCardText>
<!-- 类型角标 -->
@@ -550,3 +554,14 @@ onBeforeUnmount(() => {
@close="chooseSiteDialog = false"
/>
</template>
<style scoped>
.media-card-title {
font-size: 1.125rem;
line-height: 1.25rem;
}
.media-card-overview {
font-size: 0.875rem;
line-height: 1rem;
}
</style>

View File

@@ -47,10 +47,12 @@ function openTmdbPage(type: string, tmdbId: number) {
</div>
<div class="flex-grow">
<VCardItem class="pb-1">
<VCardTitle class="text-center text-md-left">
<div class="text-center text-md-left text-h6 font-weight-bold line-clamp-2 overflow-hidden text-ellipsis">
{{ context?.media_info?.title || context?.meta_info?.name }}
{{ context?.meta_info?.season_episode }}
</VCardTitle>
<span v-if="context?.meta_info?.season_episode" class="text-sm text-medium-emphasis align-top">
{{ context?.meta_info?.season_episode }}
</span>
</div>
<VCardSubtitle class="text-center text-md-left">
{{ context?.media_info?.year || context?.meta_info?.year }}
</VCardSubtitle>

View File

@@ -1,11 +1,7 @@
<script setup lang="ts">
import { MediaServerConf, MediaServerLibrary, MediaStatistic } from '@/api/types'
import { useToast } from 'vue-toastification'
import emby_image from '@images/logos/emby.png'
import jellyfin_image from '@images/logos/jellyfin.png'
import plex_image from '@images/logos/plex.png'
import trimemedia_image from '@images/logos/trimemedia.png'
import custom_image from '@images/logos/mediaserver.png'
import { getLogoUrl } from '@/utils/imageUtils'
import api from '@/api'
import { cloneDeep } from 'lodash-es'
import { useI18n } from 'vue-i18n'
@@ -109,15 +105,15 @@ function saveMediaServerInfo() {
const getIcon = computed(() => {
switch (props.mediaserver.type) {
case 'emby':
return emby_image
return getLogoUrl('emby')
case 'jellyfin':
return jellyfin_image
return getLogoUrl('jellyfin')
case 'trimemedia':
return trimemedia_image
return getLogoUrl('trimemedia')
case 'plex':
return plex_image
return getLogoUrl('plex')
default:
return custom_image
return getLogoUrl('mediaserver')
}
})
@@ -262,6 +258,16 @@ onMounted(() => {
prepend-inner-icon="mdi-play-network"
/>
</VCol>
<VCol cols="12" md="6">
<VTextField
v-model="mediaServerInfo.config.username"
:label="t('mediaserver.username')"
:hint="t('mediaserver.usernameHint')"
persistent-hint
active
prepend-inner-icon="mdi-account"
/>
</VCol>
<VCol cols="12" md="6">
<VTextField
v-model="mediaServerInfo.config.apikey"

View File

@@ -1,12 +1,6 @@
<script setup lang="ts">
import { NotificationConf } from '@/api/types'
import wechat_image from '@images/logos/wechat.png'
import telegram_image from '@images/logos/telegram.webp'
import vocechat_image from '@images/logos/vocechat.png'
import synologychat_image from '@images/logos/synologychat.png'
import slack_image from '@images/logos/slack.webp'
import chrome_image from '@images/logos/chrome.png'
import custom_image from '@images/logos/notification.png'
import { getLogoUrl } from '@/utils/imageUtils'
import { useToast } from 'vue-toastification'
import { cloneDeep } from 'lodash-es'
import { useI18n } from 'vue-i18n'
@@ -99,19 +93,19 @@ function saveNotificationInfo() {
const getIcon = computed(() => {
switch (props.notification.type) {
case 'wechat':
return wechat_image
return getLogoUrl('wechat')
case 'telegram':
return telegram_image
return getLogoUrl('telegram')
case 'vocechat':
return vocechat_image
return getLogoUrl('vocechat')
case 'synologychat':
return synologychat_image
return getLogoUrl('synologychat')
case 'slack':
return slack_image
return getLogoUrl('slack')
case 'webpush':
return chrome_image
return getLogoUrl('chrome')
default:
return custom_image
return getLogoUrl('notification')
}
})

View File

@@ -90,7 +90,7 @@ function goPersonDetail() {
<div class="absolute inset-0 flex h-full w-full flex-col items-center p-2">
<div class="relative mt-2 mb-4 flex h-1/2 w-full justify-center">
<VAvatar
size="120"
size="100"
:class="{
'ring-1 ring-gray-700': isImageLoaded,
}"

View File

@@ -3,9 +3,10 @@ import { useToast } from 'vue-toastification'
import VersionHistory from '../misc/VersionHistory.vue'
import api from '@/api'
import type { Plugin } from '@/api/types'
import noImage from '@images/logos/plugin.png'
import { getLogoUrl } from '@/utils/imageUtils'
import { getDominantColor } from '@/@core/utils/image'
import { isNullOrEmptyObject } from '@/@core/utils'
import { formatDownloadCount } from '@/@core/utils/formatters'
import ProgressDialog from '@/components/dialog/ProgressDialog.vue'
import { useI18n } from 'vue-i18n'
@@ -103,10 +104,12 @@ async function installPlugin() {
// 计算图标路径
const iconPath: Ref<string> = computed(() => {
if (imageLoadError.value) return noImage
if (imageLoadError.value) return getLogoUrl('plugin')
// 如果是网络图片则使用代理后返回
if (props.plugin?.plugin_icon?.startsWith('http'))
return `${import.meta.env.VITE_API_BASE_URL}system/img/1?imgurl=${encodeURIComponent(props.plugin?.plugin_icon)}&cache=true`
return `${import.meta.env.VITE_API_BASE_URL}system/img/1?imgurl=${encodeURIComponent(
props.plugin?.plugin_icon,
)}&cache=true`
return `./plugin_icon/${props.plugin?.plugin_icon}`
})
@@ -242,7 +245,7 @@ const dropdownItems = ref([
</div>
<div v-if="props.count" class="ms-2 flex-shrink-0 download-count align-middle items-center">
<VIcon size="small" icon="mdi-download" />
<span class="text-sm">{{ props.count?.toLocaleString() }}</span>
<span class="text-sm">{{ formatDownloadCount(props.count) }}</span>
</div>
</div>
<div class="absolute bottom-0 right-0">
@@ -325,7 +328,7 @@ const dropdownItems = ref([
}}</VBtn>
<div class="text-xs mt-2" v-if="props.count">
<VIcon icon="mdi-fire" />{{
t('plugin.totalDownloads', { count: props.count?.toLocaleString() })
t('plugin.totalDownloads', { count: formatDownloadCount(props.count) })
}}
</div>
</div>

View File

@@ -4,8 +4,9 @@ import { useConfirm } from '@/composables/useConfirm'
import api from '@/api'
import type { Plugin } from '@/api/types'
import { isNullOrEmptyObject } from '@core/utils'
import noImage from '@images/logos/plugin.png'
import { getLogoUrl } from '@/utils/imageUtils'
import { getDominantColor } from '@/@core/utils/image'
import { formatDownloadCount } from '@/@core/utils/formatters'
import VersionHistory from '@/components/misc/VersionHistory.vue'
import ProgressDialog from '../dialog/ProgressDialog.vue'
import PluginConfigDialog from '../dialog/PluginConfigDialog.vue'
@@ -167,10 +168,12 @@ async function showPluginConfig() {
// 计算图标路径
const iconPath: Ref<string> = computed(() => {
if (imageLoadError.value) return noImage
if (imageLoadError.value) return getLogoUrl('plugin')
// 如果是网络图片则使用代理后返回
if (props.plugin?.plugin_icon?.startsWith('http'))
return `${import.meta.env.VITE_API_BASE_URL}system/img/1?imgurl=${encodeURIComponent(props.plugin?.plugin_icon)}&cache=true`
return `${import.meta.env.VITE_API_BASE_URL}system/img/1?imgurl=${encodeURIComponent(
props.plugin?.plugin_icon,
)}&cache=true`
return `./plugin_icon/${props.plugin?.plugin_icon}`
})
@@ -475,7 +478,9 @@ watch(
<div class="flex flex-nowrap items-center w-full pe-10">
<div class="flex flex-nowrap max-w-40 items-center align-middle">
<VImg :src="authorPath" class="author-avatar" @load="isAvatarLoaded = true">
<VIcon v-if="!isAvatarLoaded" size="small" icon="mdi-github" class="me-1" />
<template #default>
<VIcon v-if="!isAvatarLoaded" size="small" icon="mdi-github" class="me-1" />
</template>
</VImg>
<a
:href="props.plugin?.author_url"
@@ -488,7 +493,7 @@ watch(
</div>
<span v-if="props.count" class="ms-2 flex-shrink-0 download-count items-center align-middle">
<VIcon size="small" icon="mdi-download" />
<span class="text-sm">{{ props.count?.toLocaleString() }}</span>
<span class="text-sm">{{ formatDownloadCount(props.count) }}</span>
</span>
</div>
<div class="absolute bottom-0 right-0">

View File

@@ -2,6 +2,7 @@
import type { PropType } from 'vue'
import type { MediaServerPlayItem } from '@/api/types'
import noImage from '@images/no-image.jpeg'
import { openMediaServerWithAutoDetect } from '@/utils/appDeepLink'
// 输入参数
const props = defineProps({
@@ -27,12 +28,19 @@ function getChipColor(type: string) {
const getImgUrl = computed(() => {
if (imageLoadError.value) return noImage
const image = props.media?.image || ''
return `${import.meta.env.VITE_API_BASE_URL}system/img/0?imgurl=${encodeURIComponent(image)}`
let url = `${import.meta.env.VITE_API_BASE_URL}system/img/0?imgurl=${encodeURIComponent(image)}`
const use_cookies = props.media?.use_cookies
if (use_cookies) {
url += `&use_cookies=${encodeURIComponent(use_cookies)}`
}
return url
})
// 跳转播放
function goPlay(isHovering: boolean | null = false) {
if (props.media?.link && isHovering) window.open(props.media?.link, '_blank')
async function goPlay(isHovering: boolean | null = false) {
if (props.media?.link && isHovering) {
await openMediaServerWithAutoDetect(props.media.link, undefined, props.media.server_type)
}
}
</script>
@@ -80,8 +88,8 @@ function goPlay(isHovering: boolean | null = false) {
style="background: linear-gradient(rgba(45, 55, 72, 40%) 0%, rgba(45, 55, 72, 90%) 100%)"
@click.stop="goPlay(hover.isHovering)"
>
<span class="font-bold">{{ props.media?.subtitle }}</span>
<h1 class="mb-1 text-white font-extrabold text-xl line-clamp-2 overflow-hidden text-ellipsis ...">
<span class="font-semibold text-sm">{{ props.media?.subtitle }}</span>
<h1 class="mb-1 text-white font-bold text-lg line-clamp-2 overflow-hidden text-ellipsis ...">
{{ props.media?.title }}
</h1>
</VCardText>

View File

@@ -1,6 +1,6 @@
<script lang="ts" setup>
import type { PropType } from 'vue'
import noImage from '@images/logos/site.webp'
import { getLogoUrl } from '@/utils/imageUtils'
import { useToast } from 'vue-toastification'
import { useI18n } from 'vue-i18n'
import SiteAddEditDialog from '../dialog/SiteAddEditDialog.vue'
@@ -62,7 +62,7 @@ async function getSiteIcon() {
try {
siteIcon.value = (await api.get(`site/icon/${cardProps.site?.id}`)).data.icon
if (!siteIcon.value) {
siteIcon.value = noImage
siteIcon.value = getLogoUrl('site')
}
} catch (error) {
console.error(error)

View File

@@ -21,6 +21,14 @@ const { t } = useI18n()
// 输入参数
const props = defineProps({
media: Object as PropType<Subscribe>,
batchMode: {
type: Boolean,
default: false,
},
selected: {
type: Boolean,
default: false,
},
})
// 从 provide 中获取全局设置
@@ -29,7 +37,7 @@ const globalSettingsStore = useGlobalSettingsStore()
const globalSettings = globalSettingsStore.globalSettings
// 定义触发的自定义事件
const emit = defineEmits(['remove', 'save'])
const emit = defineEmits(['remove', 'save', 'select'])
// 确认框
const createConfirm = useConfirm()
@@ -297,6 +305,17 @@ function onSubscribeEditRemove() {
subscribeEditDialog.value = false
emit('remove')
}
// 处理卡片点击事件
function handleCardClick() {
if (props.batchMode) {
// 批量模式下触发选择事件
emit('select')
} else {
// 非批量模式下打开编辑弹窗
editSubscribeDialog()
}
}
</script>
<template>
@@ -308,6 +327,7 @@ function onSubscribeEditRemove() {
:class="{
'transition transform-cpu duration-300 -translate-y-1': hover.isHovering,
'outline-dashed outline-1': props.media?.best_version && imageLoaded,
'outline-dotted outline-pink-500 outline-2': props.batchMode && props.selected,
}"
>
<VCard
@@ -319,8 +339,8 @@ function onSubscribeEditRemove() {
}"
rounded="0"
min-height="150"
@click="editSubscribeDialog"
:ripple="false"
@click="handleCardClick"
:ripple="!props.batchMode"
>
<div class="me-n3 absolute top-1 right-4">
<IconBtn>
@@ -346,7 +366,9 @@ function onSubscribeEditRemove() {
<VSkeletonLoader class="object-cover aspect-w-3 aspect-h-2" />
</div>
</template>
<div class="absolute inset-0 outline-none subscribe-card-background"></div>
<template #default>
<div class="absolute inset-0 outline-none subscribe-card-background"></div>
</template>
</VImg>
<div
v-if="subscribeState === 'P'"
@@ -443,6 +465,6 @@ function onSubscribeEditRemove() {
</template>
<style lang="scss" scoped>
.subscribe-card-background {
background-image: linear-gradient(90deg, rgba(31, 41, 55, 47%) 0%, rgb(31, 41, 55) 100%);
background-image: linear-gradient(180deg, rgba(31, 41, 55, 47%) 0%, rgb(31, 41, 55) 100%);
}
</style>

View File

@@ -121,7 +121,9 @@ function doDelete() {
<VSkeletonLoader class="object-cover aspect-w-3 aspect-h-2" />
</div>
</template>
<div class="absolute inset-0 subscribe-card-background"></div>
<template #default>
<div class="absolute inset-0 subscribe-card-background"></div>
</template>
</VImg>
</template>
<div class="h-full flex flex-col">
@@ -187,6 +189,6 @@ function doDelete() {
</template>
<style lang="scss" scoped>
.subscribe-card-background {
background-image: linear-gradient(90deg, rgba(31, 41, 55, 47%) 0%, rgb(31, 41, 55) 100%);
background-image: linear-gradient(180deg, rgba(31, 41, 55, 47%) 0%, rgb(31, 41, 55) 100%);
}
</style>

View File

@@ -418,7 +418,7 @@ onMounted(() => {
}
.chip-web-source {
background-color: #8000FF;
background-color: #8000ff;
color: white;
}

View File

@@ -121,12 +121,22 @@ onMounted(() => {
</div>
<template v-slot:prepend>
<div class="d-flex flex-column align-center pr-3">
<VImg v-if="siteIcon" :src="siteIcon" :alt="torrent?.site_name" class="rounded mb-1" width="32" height="32" />
<VAvatar v-else size="24" class="mb-1 text-caption bg-primary-lighten-4 text-primary font-weight-bold">
<div class="d-flex flex-column align-center pr-3" :title="torrent?.site_name">
<VImg
v-if="siteIcon"
:src="siteIcon"
:alt="torrent?.site_name"
class="rounded mb-1 site-icon"
width="32"
height="32"
/>
<VAvatar
v-else
size="32"
class="mb-1 text-caption bg-primary-lighten-4 text-primary font-weight-bold site-icon"
>
{{ torrent?.site_name?.substring(0, 1) }}
</VAvatar>
<div class="font-weight-bold text-body-2 text-center d-none d-sm-block">{{ torrent?.site_name }}</div>
</div>
</template>
@@ -332,4 +342,12 @@ onMounted(() => {
background-color: #9c27b0;
color: white;
}
.site-icon {
transition: transform 0.2s ease;
}
.site-icon:hover {
transform: scale(1.1);
}
</style>

View File

@@ -0,0 +1,148 @@
<script lang="ts" setup>
import { formatDateDifference } from '@/@core/utils/formatters'
import type { WorkflowShare } from '@/api/types'
import ForkWorkflowDialog from '../dialog/ForkWorkflowDialog.vue'
// 输入参数
const props = defineProps({
workflow: Object as PropType<WorkflowShare>,
eventTypes: {
type: Array as PropType<Array<{ title: string; value: string }>>,
default: () => [],
},
})
// 定义删除事件
const emit = defineEmits(['delete', 'update'])
// 复用工作流弹窗
const forkWorkflowDialog = ref(false)
// 工作流ID
const workflowId = ref<string>()
// 分享时间
const dateText = ref(props.workflow && props.workflow?.date ? formatDateDifference(props.workflow.date) : '')
// 随机渐变背景
const gradientStyle = ref('')
// 生成随机渐变背景
function generateRandomGradient() {
const gradients = [
'linear-gradient(135deg, #4a5568 0%, #2d3748 100%)',
'linear-gradient(135deg, #553c9a 0%, #b794f4 100%)',
'linear-gradient(135deg, #2c5aa0 0%, #1a365d 100%)',
'linear-gradient(135deg, #2f855a 0%, #22543d 100%)',
'linear-gradient(135deg, #c53030 0%, #742a2a 100%)',
'linear-gradient(135deg, #d69e2e 0%, #975a16 100%)',
'linear-gradient(135deg, #805ad5 0%, #553c9a 100%)',
'linear-gradient(135deg, #3182ce 0%, #2c5282 100%)',
'linear-gradient(135deg, #38a169 0%, #276749 100%)',
'linear-gradient(135deg, #e53e3e 0%, #c53030 100%)',
'linear-gradient(135deg, #dd6b20 0%, #c05621 100%)',
'linear-gradient(135deg, #6b46c1 0%, #553c9a 100%)',
'linear-gradient(135deg, #2b6cb0 0%, #2c5282 100%)',
'linear-gradient(135deg, #38a169 0%, #2f855a 100%)',
'linear-gradient(135deg, #d53f8c 0%, #97266d 100%)',
]
// 基于工作流ID生成固定的随机数确保同一工作流总是显示相同的渐变
const seed = String(props.workflow?.id || Math.random())
const hash = seed.split('').reduce((a, b) => {
a = (a << 5) - a + b.charCodeAt(0)
return a & a
}, 0)
const index = Math.abs(hash) % gradients.length
return gradients[index]
}
// 初始化渐变背景
onMounted(() => {
gradientStyle.value = generateRandomGradient()
})
// 复用工作流
function showForkWorkflow() {
forkWorkflowDialog.value = true
}
// 完成复用工作流
function finishForkWorkflow(wid: string) {
workflowId.value = wid
forkWorkflowDialog.value = false
emit('update')
}
// 删除工作流分享时处理
function doDelete() {
forkWorkflowDialog.value = false
// 通知父组件刷新
emit('delete')
}
</script>
<template>
<div class="h-full">
<VHover>
<template #default="hover">
<div
class="w-full h-full rounded-lg overflow-hidden"
:class="{
'transition transform-cpu duration-300 -translate-y-1': hover.isHovering,
}"
>
<VCard
v-bind="hover.props"
:key="props.workflow?.id"
class="flex flex-col h-full"
rounded="0"
min-height="150"
:style="{ background: gradientStyle }"
@click="showForkWorkflow"
>
<div class="h-full flex flex-col">
<VCardText class="flex items-center pa-3 pb-1 grow">
<div class="flex flex-col justify-center w-full">
<VCardTitle class="text-lg text-bold text-white line-clamp-2 break-words">
{{ props.workflow?.share_title }}
</VCardTitle>
<div class="px-4 text-white text-opacity-90 overflow-hidden line-clamp-3 break-all ...">
{{ props.workflow?.share_comment }}
</div>
</div>
</VCardText>
<VCardText class="flex justify-space-between align-center flex-wrap py-2">
<div class="flex align-center">
<IconBtn v-bind="props" icon="mdi-account" class="me-1 text-white" />
<div class="text-subtitle-2 me-4 text-white text-opacity-90">
{{ props.workflow?.share_user }}
</div>
<IconBtn v-if="props.workflow?.count" icon="mdi-fire" class="me-1 text-white" />
<span v-if="props.workflow?.count" class="text-subtitle-2 me-4 text-white text-opacity-90">
{{ props.workflow?.count.toLocaleString() }}
</span>
</div>
</VCardText>
<VCardText class="absolute right-0 bottom-0 d-flex align-center p-2 text-white text-sm text-opacity-75">
<VIcon icon="mdi-calendar" size="small" class="me-1" />
{{ dateText }}
</VCardText>
</div>
</VCard>
</div>
</template>
</VHover>
<!-- 复用工作流弹窗 -->
<ForkWorkflowDialog
v-if="forkWorkflowDialog"
v-model="forkWorkflowDialog"
:workflow="props.workflow"
:event-types="props.eventTypes"
@close="forkWorkflowDialog = false"
@fork="finishForkWorkflow"
@delete="doDelete"
/>
</div>
</template>

View File

@@ -4,6 +4,7 @@ import { useToast } from 'vue-toastification'
import { useConfirm } from '@/composables/useConfirm'
import WorkflowAddEditDialog from '@/components/dialog/WorkflowAddEditDialog.vue'
import WorkflowActionsDialog from '@/components/dialog/WorkflowActionsDialog.vue'
import WorkflowShareDialog from '@/components/dialog/WorkflowShareDialog.vue'
import api from '@/api'
import { useI18n } from 'vue-i18n'
@@ -15,6 +16,10 @@ const props = defineProps({
required: true,
type: Object as PropType<Workflow>,
},
eventTypes: {
type: Array as PropType<Array<{ title: string; value: string }>>,
default: () => [],
},
})
// 定义事件
@@ -32,9 +37,18 @@ const editDialog = ref(false)
// 流程对话框
const flowDialog = ref(false)
// 分享对话框
const shareDialog = ref(false)
// 加载中
const loading = ref(false)
// 根据事件类型值获取显示文本
const getEventTypeText = (eventTypeValue: string) => {
const eventType = props.eventTypes.find(item => item.value === eventTypeValue)
return eventType ? eventType.title : eventTypeValue
}
// 编辑任务
function handleEdit(item: Workflow) {
editDialog.value = true
@@ -45,10 +59,16 @@ function handleFlow(item: Workflow) {
flowDialog.value = true
}
// 分享工作流
function handleShare(item: Workflow) {
shareDialog.value = true
}
// 编辑完成
function editDone() {
editDialog.value = false
flowDialog.value = false
shareDialog.value = false
emit('refresh')
}
@@ -155,11 +175,36 @@ async function handleReset(item: Workflow) {
// 计算状态颜色
const resolveStatusVariant = (status: string | undefined) => {
if (status === 'S') return { color: 'success', text: t('workflow.task.status.success') }
else if (status === 'R') return { color: 'primary', text: t('workflow.task.status.running') }
else if (status === 'F') return { color: 'error', text: t('workflow.task.status.failed') }
else if (status === 'P') return { color: 'secondary', text: t('workflow.task.status.paused') }
else return { color: 'info', text: t('workflow.task.status.waiting') }
if (status === 'S')
return {
color: 'success',
bgColor: 'linear-gradient(to bottom right, rgba(76, 175, 80, 0.9), rgba(76, 175, 80, 0.7))',
text: t('workflow.task.status.success'),
}
else if (status === 'R')
return {
color: 'primary',
bgColor: 'linear-gradient(to bottom right, rgba(33, 150, 243, 0.9), rgba(33, 150, 243, 0.7))',
text: t('workflow.task.status.running'),
}
else if (status === 'F')
return {
color: 'error',
bgColor: 'linear-gradient(to bottom right, rgba(244, 67, 54, 0.9), rgba(244, 67, 54, 0.7))',
text: t('workflow.task.status.failed'),
}
else if (status === 'P')
return {
color: 'warning',
bgColor: 'linear-gradient(to bottom right, rgba(255, 152, 0, 0.9), rgba(255, 152, 0, 0.7))',
text: t('workflow.task.status.paused'),
}
else
return {
color: 'info',
bgColor: 'linear-gradient(to bottom right, rgba(33, 150, 243, 0.9), rgba(33, 150, 243, 0.7))',
text: t('workflow.task.status.waiting'),
}
}
// 计算当前动作占比
@@ -180,32 +225,26 @@ const resolveProgress = (item: Workflow) => {
:class="{ 'transition transform-cpu duration-300 -translate-y-1': hover.isHovering }"
>
<VCardItem
:class="{
'py-1': workflow?.description,
'py-3': !workflow?.description,
[`bg-${resolveStatusVariant(workflow?.state).color}`]: true,
class="px-2 py-2"
:style="{
background: resolveStatusVariant(workflow?.state).bgColor,
}"
>
<template #prepend>
<VAvatar variant="text" class="me-2">
<VAvatar variant="text" size="small">
<VIcon
v-if="workflow?.state === 'P'"
color="success"
size="x-large"
icon="mdi-play"
@click.stop="handleEnable(workflow)"
/>
<VIcon v-else color="warning" icon="mdi-pause" size="x-large" @click.stop="handlePause(workflow)" />
<VIcon v-else color="warning" icon="mdi-pause" @click.stop="handlePause(workflow)" />
</VAvatar>
</template>
<VCardTitle class="text-white">
{{ workflow?.name }}
<VCardTitle class="text-white text-lg">
<span :title="workflow?.description">{{ workflow?.name }}</span>
</VCardTitle>
<VCardSubtitle class="text-white">{{ workflow?.description }}</VCardSubtitle>
<template #append>
<IconBtn>
<VIcon icon="mdi-vector-polyline-edit" @click.stop="handleFlow(workflow)" />
</IconBtn>
<IconBtn>
<VIcon icon="mdi-dots-vertical" />
<VMenu activator="parent" close-on-content-click>
@@ -216,6 +255,12 @@ const resolveProgress = (item: Workflow) => {
</template>
<VListItemTitle>{{ t('workflow.task.edit') }}</VListItemTitle>
</VListItem>
<VListItem base-color="success" @click="handleFlow(workflow)">
<template #prepend>
<VIcon icon="mdi-vector-polyline" />
</template>
<VListItemTitle>{{ t('workflow.task.editFlow') }}</VListItemTitle>
</VListItem>
<VListItem v-if="workflow.current_action" base-color="info" @click="handleRun(workflow, false)">
<template #prepend>
<VIcon icon="mdi-play-speed" />
@@ -240,6 +285,12 @@ const resolveProgress = (item: Workflow) => {
</template>
<VListItemTitle>{{ t('workflow.task.reset') }}</VListItemTitle>
</VListItem>
<VListItem base-color="info" @click="handleShare(workflow)">
<template #prepend>
<VIcon icon="mdi-share" />
</template>
<VListItemTitle>{{ t('workflow.task.share') }}</VListItemTitle>
</VListItem>
<VListItem base-color="error" @click="handleDelete(workflow)">
<template #prepend>
<VIcon icon="mdi-delete" />
@@ -252,35 +303,48 @@ const resolveProgress = (item: Workflow) => {
</template>
</VCardItem>
<VDivider />
<VCardText>
<div class="d-flex flex-column gap-y-4">
<div class="d-flex flex-wrap gap-x-6">
<VCardText class="pa-3">
<div class="d-flex flex-column gap-y-3">
<div class="d-flex flex-wrap gap-x-3">
<div class="flex-1">
<div class="mb-1">{{ t('workflow.task.info.timer') }}</div>
<h5 class="text-h6">{{ workflow?.timer }}</h5>
<div class="mb-1">{{ t('workflow.task.info.trigger') }}</div>
<h5>
<span v-if="workflow?.trigger_type === 'timer' || !workflow?.trigger_type">
<VIcon icon="mdi-clock-outline" size="small" class="me-1" />
{{ workflow?.timer }}
</span>
<span v-else-if="workflow?.trigger_type === 'event'">
<VIcon icon="mdi-calendar-check" size="small" class="me-1" />
{{ getEventTypeText(workflow?.event_type || '') }}
</span>
<span v-else-if="workflow?.trigger_type === 'manual'">
<VIcon icon="mdi-hand-pointing-up" size="small" class="me-1" />
{{ t('workflow.task.info.manualTrigger') }}
</span>
</h5>
</div>
<div class="flex-1">
<div class="mb-1">{{ t('workflow.task.info.status') }}</div>
<h5 class="text-h6" :class="`text-${resolveStatusVariant(workflow?.state).color}`">
<h5 :class="`text-${resolveStatusVariant(workflow?.state).color}`">
{{ resolveStatusVariant(workflow?.state).text }}
</h5>
</div>
</div>
<div class="d-flex flex-wrap gap-x-6">
<div class="d-flex flex-wrap gap-x-3">
<div class="flex-1">
<div class="mb-1">{{ t('workflow.task.info.actionCount') }}</div>
<div>
<VAvatar size="32" color="primary" variant="tonal">
<span class="text-sm">{{ workflow?.actions?.length }}</span>
<VAvatar size="24" color="primary" variant="tonal">
<span class="text-xs">{{ workflow?.actions?.length }}</span>
</VAvatar>
</div>
</div>
<div class="flex-1">
<div class="mb-1">{{ t('workflow.task.info.runCount') }}</div>
<h5 class="text-h6">{{ workflow?.run_count }}</h5>
<h5>{{ workflow?.run_count }}</h5>
</div>
</div>
<div class="d-flex flex-wrap gap-x-6">
<div class="d-flex flex-wrap gap-x-3">
<div class="flex-1">
<div class="mb-1">{{ t('workflow.task.info.progress') }}</div>
<div class="d-flex align-center gap-5">
@@ -291,7 +355,7 @@ const resolveProgress = (item: Workflow) => {
</div>
</div>
</div>
<div class="d-flex flex-wrap gap-x-6" v-if="workflow?.result">
<div class="d-flex flex-wrap gap-x-3" v-if="workflow?.result">
<div class="flex-1">
<div class="mb-1">{{ t('workflow.task.info.error') }}</div>
<div class="text-error">{{ workflow?.result }}</div>
@@ -317,5 +381,7 @@ const resolveProgress = (item: Workflow) => {
@save="editDone"
:workflow="workflow"
/>
<!-- 分享对话框 -->
<WorkflowShareDialog v-if="shareDialog" v-model="shareDialog" :workflow="workflow" @close="shareDialog = false" />
</div>
</template>

View File

@@ -0,0 +1,382 @@
<script lang="ts" setup>
import { formatDateDifference } from '@/@core/utils/formatters'
import api from '@/api'
import { useI18n } from 'vue-i18n'
import { useDisplay } from 'vuetify'
// 国际化
const { t } = useI18n()
// 定义事件
const emit = defineEmits(['close'])
// 显示器
const display = useDisplay()
// 系统环境变量
const systemEnv = ref<any>({})
// 所有Release
const allRelease = ref<any>([])
// 支持站点
const supportingSites = ref<any>({})
// 支持站点折叠状态
const sitesExpanded = ref(false)
// 去重后的支持站点
const uniqueSupportingSites = computed(() => {
const sitesMap = new Map()
Object.entries(supportingSites.value).forEach(([domain, site]: [string, any]) => {
if (!sitesMap.has(site.name)) {
sitesMap.set(site.name, {
name: site.name,
urls: [{ domain, url: site.url }],
})
} else {
sitesMap.get(site.name).urls.push({ domain, url: site.url })
}
})
return Array.from(sitesMap.values())
})
// 显示的支持站点折叠时只显示前5个
const displayedSites = computed(() => {
if (sitesExpanded.value) {
return uniqueSupportingSites.value
}
return uniqueSupportingSites.value.slice(0, 5)
})
// 变更日志对话框
const releaseDialog = ref(false)
// 最新版本
const latestRelease = ref('')
// 变更日志对话框标题
const releaseDialogTitle = ref('')
// 变更日志对话框内容
const releaseDialogBody = ref('')
// 打开日志对话框
function showReleaseDialog(title: string, body: string) {
releaseDialogTitle.value = title
releaseDialogBody.value = body.replaceAll('\r\n', '<br />')
releaseDialog.value = true
}
// 查询系统环境变量
async function querySystemEnv() {
try {
const result: { [key: string]: any } = await api.get('system/env')
systemEnv.value = result.data
} catch (error) {
console.log(error)
}
}
// 查询所有Release
async function queryAllRelease() {
try {
const result: { [key: string]: any } = await api.get('system/versions')
allRelease.value = result.data ?? []
// 最新版本
if (allRelease.value.length > 0) latestRelease.value = allRelease.value[0].tag_name
} catch (error) {
console.log(error)
}
}
// 查询支持站点
async function querySupportingSites() {
try {
supportingSites.value = await api.get('site/supporting')
} catch (error) {
console.log(error)
}
}
// 切换站点列表展开状态
function toggleSitesExpanded() {
sitesExpanded.value = !sitesExpanded.value
}
// 计算发布时间
function releaseTime(releaseDate: string) {
// 上一次更新时间
return formatDateDifference(releaseDate)
}
onMounted(() => {
querySystemEnv()
queryAllRelease()
querySupportingSites()
})
</script>
<template>
<VDialog max-width="50rem" scrollable :fullscreen="!display.mdAndUp.value">
<VCard>
<VCardItem>
<VCardTitle>
<VIcon icon="mdi-information" class="me-2" />
{{ t('setting.about.title') }}
</VCardTitle>
<VDialogCloseBtn @click="emit('close')" />
</VCardItem>
<VDivider />
<VCardText>
<div class="px-3">
<div class="section">
<div class="section border-gray-800">
<dl>
<div>
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="block text-sm font-bold">{{ t('setting.about.softwareVersion') }}</dt>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<span class="flex-grow flex flex-row items-center truncate">
<code class="truncate">{{ systemEnv.VERSION }}</code>
<a
v-if="latestRelease === systemEnv.VERSION"
href="https://github.com/jxxghp/MoviePilot/releases"
target="_blank"
rel="noopener noreferrer"
>
<span
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full whitespace-nowrap bg-green-500 bg-opacity-80 border border-green-500 !text-green-100 ml-2 !cursor-pointer transition hover:bg-green-400"
>
{{ t('setting.about.latest') }}
</span>
</a>
</span>
</dd>
</div>
</div>
<div v-if="systemEnv.FRONTEND_VERSION">
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="block text-sm font-bold">{{ t('setting.about.frontendVersion') }}</dt>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<span class="flex-grow flex flex-row items-center truncate">
<code class="truncate">{{ systemEnv.FRONTEND_VERSION }}</code>
</span>
</dd>
</div>
</div>
<div>
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="block text-sm font-bold">{{ t('setting.about.authVersion') }}</dt>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<span class="flex-grow flex flex-row items-center truncate">
<code class="truncate">{{ systemEnv.AUTH_VERSION }}</code>
</span>
</dd>
</div>
</div>
<div>
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="block text-sm font-bold">{{ t('setting.about.indexerVersion') }}</dt>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<span class="flex-grow flex flex-row items-center truncate">
<code class="truncate">{{ systemEnv.INDEXER_VERSION }}</code>
</span>
</dd>
</div>
</div>
<div>
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="block text-sm font-bold">{{ t('setting.about.configDir') }}</dt>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<span class="flex-grow undefined">
<code>{{ systemEnv.CONFIG_DIR }}</code>
</span>
</dd>
</div>
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="block text-sm font-bold">{{ t('setting.about.dataDir') }}</dt>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<span class="flex-grow undefined"
><code>{{ t('setting.about.dataDirectory') }}</code></span
>
</dd>
</div>
</div>
<div>
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="block text-sm font-bold">{{ t('setting.about.timezone') }}</dt>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<span class="flex-grow undefined">
<code>{{ systemEnv.TZ }}</code>
</span>
</dd>
</div>
</div>
<div>
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="block text-sm font-bold">{{ t('setting.about.supportingSites') }}</dt>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<div class="flex flex-col gap-2">
<div class="flex flex-wrap gap-2 mt-1 ms-1">
<VChip v-for="site in displayedSites" :key="site.name" variant="outlined" size="small">
<span class="truncate max-w-32">{{ site.name }}</span>
</VChip>
<VChip
v-if="!sitesExpanded && uniqueSupportingSites.length > 5"
variant="tonal"
size="small"
@click="toggleSitesExpanded"
>
<span> {{ uniqueSupportingSites.length }}+ ...</span>
</VChip>
<VChip
v-if="sitesExpanded && uniqueSupportingSites.length > 5"
variant="tonal"
size="small"
@click="toggleSitesExpanded"
>
<span>< {{ t('setting.about.collapse') }}</span>
</VChip>
</div>
</div>
</dd>
</div>
</div>
</dl>
</div>
</div>
<div class="section">
<div>
<h3 class="heading">{{ t('setting.about.support') }}</h3>
</div>
<div class="section border-t border-gray-800">
<dl>
<div>
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="block text-sm font-bold">{{ t('setting.about.documentation') }}</dt>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<span class="flex-grow undefined">
<a
href="https://movie-pilot.org"
target="_blank"
rel="noreferrer"
class="text-indigo-500 transition duration-300 hover:underline"
>
https://movie-pilot.org
</a>
</span>
</dd>
</div>
</div>
<div>
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="block text-sm font-bold">{{ t('setting.about.feedback') }}</dt>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<span class="flex-grow undefined">
<a
href="https://github.com/jxxghp/MoviePilot/issues/new/choose"
target="_blank"
rel="noreferrer"
class="text-indigo-500 transition duration-300 hover:underline"
>
https://github.com/jxxghp/MoviePilot/issues/new/choose
</a>
</span>
</dd>
</div>
</div>
<div>
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="block text-sm font-bold">{{ t('setting.about.channel') }}</dt>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<span class="flex-grow undefined">
<a
href="https://t.me/moviepilot_channel"
target="_blank"
rel="noreferrer"
class="text-indigo-500 transition duration-300 hover:underline"
>
https://t.me/moviepilot_channel
</a>
</span>
</dd>
</div>
</div>
</dl>
</div>
</div>
<div class="section">
<div>
<h3 class="heading">{{ t('setting.about.versions') }}</h3>
<div class="section space-y-3">
<div>
<div
v-for="release in allRelease"
:key="release.tag_name"
class="mb-3 flex w-full flex-col space-y-3 rounded-md px-4 py-2 ring-1 ring-gray-400 sm:flex-row sm:space-y-0 sm:space-x-3"
>
<div class="flex w-full flex-grow items-center justify-start space-x-2 truncate sm:justify-start">
<span class="truncate text-lg font-bold">
<span class="mr-2 whitespace-nowrap text-xs font-normal">{{
releaseTime(release.published_at)
}}</span>
{{ release.tag_name }}
</span>
<span
v-if="release.tag_name === latestRelease"
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full whitespace-nowrap cursor-default bg-green-500 bg-opacity-80 border border-green-500 !text-green-100"
>
{{ t('setting.about.latestVersion') }}
</span>
<span
v-if="release.tag_name === systemEnv.VERSION"
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full whitespace-nowrap cursor-default bg-indigo-500 bg-opacity-80 border border-indigo-500 !text-indigo-100"
>
{{ t('setting.about.currentVersion') }}
</span>
</div>
<VBtn @click.stop="showReleaseDialog(release.tag_name, release.body)">
<template #prepend>
<VIcon icon="mdi-text-box-outline" />
</template>
{{ t('setting.about.viewChangelog') }}
</VBtn>
</div>
</div>
</div>
</div>
</div>
</div>
</VCardText>
</VCard>
<VDialog v-if="releaseDialog" v-model="releaseDialog" width="600" scrollable>
<VCard>
<VCardItem>
<VDialogCloseBtn @click="releaseDialog = false" />
<VCardTitle>{{ releaseDialogTitle }} {{ t('setting.about.changelog') }}</VCardTitle>
</VCardItem>
<VCardText v-html="releaseDialogBody" />
</VCard>
</VDialog>
</VDialog>
</template>
<style type="scss" scoped>
.heading {
font-size: 1.5rem;
font-weight: 700;
line-height: 2rem;
--tw-text-opacity: 1;
}
.section {
margin-block: 0.5rem 2.5rem;
}
</style>

View File

@@ -6,10 +6,20 @@ import type { DownloaderConf, MediaInfo, TorrentInfo, TransferDirectoryConf } fr
import { formatFileSize } from '@/@core/utils/formatters'
import { VCardTitle, VChip } from 'vuetify/lib/components/index.mjs'
import { useI18n } from 'vue-i18n'
import MediaIdSelector from '../misc/MediaIdSelector.vue'
import { numberValidator } from '@/@validators'
import { useGlobalSettingsStore } from '@/stores'
// 多语言支持
const { t } = useI18n()
// 从 provide 中获取全局设置
const globalSettingsStore = useGlobalSettingsStore()
const globalSettings = globalSettingsStore.globalSettings
// 当前识别类型
const mediaSource = ref(globalSettings.RECOGNIZE_SOURCE || 'themoviedb')
// 输入参数
const props = defineProps({
title: String,
@@ -38,6 +48,18 @@ const directories = ref<TransferDirectoryConf[]>([])
// 是否正在加载
const loading = ref(false)
// 是否显示高级选项
const showAdvancedOptions = ref(false)
// TMDB ID
const tmdbid = ref<number | undefined>(undefined)
// 豆瓣ID
const doubanId = ref<string | undefined>(undefined)
// TMDB选择对话框
const mediaSelectorDialog = ref(false)
// 计算按钮图标
const icon = computed(() => (loading.value ? 'mdi-progress-download' : 'mdi-download'))
@@ -96,6 +118,14 @@ async function addDownload() {
payload.media_in = props.media
}
// 添加媒体ID辅助识别
if (tmdbid.value) {
payload.tmdbid = tmdbid.value
}
if (doubanId.value) {
payload.doubanid = doubanId.value
}
const endpoint = props.media ? 'download/' : 'download/add'
result = await api.post(endpoint, payload)
@@ -202,6 +232,56 @@ onMounted(() => {
/>
</VCol>
</VRow>
<VRow class="px-5 mt-2">
<VCol cols="12">
<VBtn
variant="text"
size="small"
:prepend-icon="showAdvancedOptions ? 'mdi-chevron-up' : 'mdi-chevron-down'"
@click="showAdvancedOptions = !showAdvancedOptions"
>
{{
showAdvancedOptions
? t('dialog.addDownload.hideAdvancedOptions')
: t('dialog.addDownload.showAdvancedOptions')
}}
</VBtn>
</VCol>
</VRow>
<VRow v-show="showAdvancedOptions" class="px-5">
<VCol cols="12">
<VTextField
v-if="mediaSource === 'themoviedb'"
v-model="tmdbid"
:label="t('dialog.reorganize.tmdbId')"
:placeholder="t('dialog.reorganize.mediaIdPlaceholder')"
:rules="[numberValidator]"
append-inner-icon="mdi-magnify"
:hint="t('dialog.reorganize.mediaIdHint')"
persistent-hint
prepend-inner-icon="mdi-identifier"
size="small"
variant="underlined"
density="comfortable"
@click:append-inner="mediaSelectorDialog = true"
/>
<VTextField
v-else
v-model="doubanId"
:label="t('dialog.reorganize.doubanId')"
:placeholder="t('dialog.reorganize.mediaIdPlaceholder')"
:rules="[numberValidator]"
append-inner-icon="mdi-magnify"
:hint="t('dialog.reorganize.mediaIdHint')"
persistent-hint
prepend-inner-icon="mdi-identifier"
size="small"
variant="underlined"
density="comfortable"
@click:append-inner="mediaSelectorDialog = true"
/>
</VCol>
</VRow>
</VCardText>
<VCardText class="text-center">
<VBtn variant="elevated" :disabled="loading" @click="addDownload" :prepend-icon="icon" class="px-5">
@@ -209,5 +289,15 @@ onMounted(() => {
</VBtn>
</VCardText>
</VCard>
<!-- 媒体ID选择器 -->
<VDialog v-model="mediaSelectorDialog" width="40rem" scrollable max-height="85vh">
<MediaIdSelector
v-if="mediaSource === 'themoviedb'"
v-model="tmdbid"
@close="mediaSelectorDialog = false"
:type="mediaSource"
/>
<MediaIdSelector v-else v-model="doubanId" @close="mediaSelectorDialog = false" :type="mediaSource" />
</VDialog>
</VDialog>
</template>

View File

@@ -172,7 +172,6 @@ onMounted(() => {
<template>
<VDialog max-width="40rem" scrollable>
<VCard>
<VDialogCloseBtn @click="emit('close')" />
<VCardText>
<VCol>
<div class="d-flex justify-space-between flex-wrap flex-md-nowrap flex-column flex-md-row">
@@ -285,6 +284,7 @@ onMounted(() => {
</div>
</VCol>
</VCardText>
<VDialogCloseBtn @click="emit('close')" />
</VCard>
</VDialog>
</template>

View File

@@ -0,0 +1,338 @@
<script setup lang="ts">
import api from '@/api'
import { doneNProgress, startNProgress } from '@/api/nprogress'
import { WorkflowShare } from '@/api/types'
import { useToast } from 'vue-toastification'
import { useI18n } from 'vue-i18n'
import { useGlobalSettingsStore } from '@/stores'
import { VueFlow, useVueFlow } from '@vue-flow/core'
// 国际化
const { t } = useI18n()
// 输入参数
const props = defineProps({
workflow: Object as PropType<WorkflowShare>,
eventTypes: {
type: Array as PropType<Array<{ title: string; value: string }>>,
default: () => [],
},
})
// 定义事件
const emit = defineEmits(['fork', 'delete', 'close'])
// 从 provide 中获取全局设置
// 全局设置
const globalSettingsStore = useGlobalSettingsStore()
const globalSettings = globalSettingsStore.globalSettings
// 提示框
const $toast = useToast()
// 处理中
const processing = ref(false)
// 删除中
const deleting = ref(false)
// 根据事件类型值获取显示文本
const getEventTypeText = (eventTypeValue: string) => {
const eventType = props.eventTypes.find(item => item.value === eventTypeValue)
return eventType ? eventType.title : eventTypeValue
}
// 流程图相关
const { nodes, edges } = useVueFlow()
// 自定义节点类型
const nodeTypes: Record<string, any> = ref({})
// 自动扫描目录下所有的 .vue 文件
const components = import.meta.glob('../workflow/*Action.vue')
// 动态加载某个组件
const loadComponent = async (componentName: string) => {
const component = components[`../workflow/${componentName}.vue`]
if (component) {
return ((await component()) as any).default
}
throw new Error(t('dialog.workflowActions.componentNotFound', { component: componentName }))
}
// 将所有components中的组件加载到nodeTypes中
for (const path in components) {
const componentName = path.match(/\.\/workflow\/(.*).vue$/)?.[1]
if (!componentName) {
continue
}
loadComponent(componentName).then(component => {
nodeTypes.value[componentName] = markRaw(component)
})
}
// 解析工作流数据
const parsedWorkflow = computed(() => {
if (!props.workflow) return null
try {
const workflow = { ...props.workflow }
// 解析actions
if (typeof workflow.actions === 'string') {
workflow.actions = JSON.parse(workflow.actions)
}
// 解析flows
if (typeof workflow.flows === 'string') {
workflow.flows = JSON.parse(workflow.flows)
}
return workflow
} catch (error) {
console.error('解析工作流数据失败:', error)
return props.workflow
}
})
// 初始化流程图数据
onMounted(() => {
if (parsedWorkflow.value) {
nodes.value = parsedWorkflow.value.actions ?? []
edges.value = parsedWorkflow.value.flows ?? []
}
})
// 复用工作流
async function doFork() {
// 开始处理
startNProgress()
try {
processing.value = true
// 请求API
const result: { [key: string]: any } = await api.post('workflow/fork', props.workflow)
// 工作流状态
if (result.success) {
$toast.success(t('workflow.addSuccess', { name: props.workflow?.share_title }))
// 完成
emit('fork', result.data.id)
} else {
$toast.error(t('workflow.addFailed', { name: props.workflow?.share_title, message: result.message }))
}
} catch (error) {
console.error(error)
} finally {
processing.value = false
doneNProgress()
}
}
// 删除工作流分享
async function doDelete() {
// 开始处理
startNProgress()
try {
deleting.value = true
// 请求API
const result: { [key: string]: any } = await api.delete(`workflow/share/${props.workflow?.id}`, {
params: {
share_uid: globalSettings.USER_UNIQUE_ID,
},
})
// 工作流状态
if (result.success) {
$toast.success(t('workflow.cancelSuccess'))
// 完成
emit('delete', result.data.id)
} else {
$toast.error(t('workflow.cancelFailed', { message: result.message }))
}
} catch (error) {
console.error(error)
} finally {
deleting.value = false
doneNProgress()
}
}
</script>
<template>
<VDialog max-width="40rem" scrollable>
<VCard>
<VCardText>
<VCol>
<div class="d-flex justify-space-between flex-wrap flex-md-nowrap flex-column flex-md-row">
<div class="ma-auto mt-5">
<div class="workflow-preview">
<VueFlow
:nodes="nodes"
:edges="edges"
:nodeTypes="nodeTypes"
:default-edge-options="{ type: 'animation', animated: true }"
:delete-key-code="null"
:select-nodes-on-drag="false"
:nodes-draggable="false"
:nodes-connectable="false"
:fit-view="true"
:fit-view-options="{ padding: 0.1, minZoom: 0.2, maxZoom: 1 }"
:default-viewport="{ x: 0, y: 0, zoom: 0.2 }"
class="workflow-preview-flow"
/>
</div>
</div>
<!-- 右侧内容 -->
<div class="flex-grow">
<VCardItem>
<VCardTitle
class="text-center text-md-left break-words whitespace-break-spaces line-clamp-2 overflow-hidden text-ellipsis"
>
{{ props.workflow?.share_title }}
</VCardTitle>
<VCardSubtitle
class="text-center text-md-left break-words whitespace-break-spaces line-clamp-4 overflow-hidden text-ellipsis"
>
{{ props.workflow?.share_comment }}
</VCardSubtitle>
<VList lines="one">
<VListItem class="ps-0">
<VListItemTitle class="text-center text-md-left">
<span class="font-weight-medium">{{ t('workflow.sharer') }}</span>
<span class="text-body-1"> {{ props.workflow?.share_user }}</span>
</VListItemTitle>
</VListItem>
<VListItem class="ps-0" v-if="props.workflow?.trigger_type || props.workflow?.timer">
<VListItemTitle class="text-center text-md-left">
<span class="font-weight-medium">{{ t('workflow.trigger') }}</span>
<span class="text-body-1">
<span v-if="props.workflow?.trigger_type === 'timer' || !props.workflow?.trigger_type">
<VIcon icon="mdi-clock-outline" size="small" class="me-1" />
{{ props.workflow?.timer }}
</span>
<span v-else-if="props.workflow?.trigger_type === 'event'">
<VIcon icon="mdi-calendar-check" size="small" class="me-1" />
{{ getEventTypeText(props.workflow?.event_type || '') }}
</span>
<span v-else-if="props.workflow?.trigger_type === 'manual'">
<VIcon icon="mdi-hand-pointing-up" size="small" class="me-1" />
{{ t('workflow.manualTrigger') }}
</span>
</span>
</VListItemTitle>
</VListItem>
<VListItem class="ps-0" v-if="parsedWorkflow?.actions">
<VListItemTitle class="text-center text-md-left">
<span class="font-weight-medium">{{ t('workflow.actionCount') }}</span>
<span class="text-body-1"> {{ parsedWorkflow?.actions?.length }}</span>
</VListItemTitle>
</VListItem>
</VList>
<div class="text-center text-md-left">
<div>
<VBtn
color="primary"
:disabled="processing"
@click="doFork"
prepend-icon="mdi-heart"
:loading="processing"
class="mb-2 me-2"
>
{{ t('workflow.normalFork') }}
</VBtn>
<VBtn
v-if="
(props.workflow?.share_uid && props.workflow?.share_uid === globalSettings.USER_UNIQUE_ID) ||
globalSettings.WORKFLOW_SHARE_MANAGE
"
color="error"
:disabled="deleting"
@click="doDelete"
prepend-icon="mdi-delete"
:loading="deleting"
class="mb-2 me-2"
>
{{ t('workflow.cancelShare') }}
</VBtn>
</div>
<div class="text-xs mt-2" v-if="props.workflow?.count">
<VIcon icon="mdi-fire" />{{
t('workflow.usageCount', { count: props.workflow?.count?.toLocaleString() })
}}
</div>
</div>
</VCardItem>
</div>
</div>
</VCol>
</VCardText>
<VDialogCloseBtn @click="emit('close')" />
</VCard>
</VDialog>
</template>
<style lang="scss">
@import '@vue-flow/core/dist/style.css';
@import '@vue-flow/core/dist/theme-default.css';
@import '@vue-flow/minimap/dist/style.css';
.workflow-preview {
position: relative;
overflow: hidden;
border: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
border-radius: 8px;
background-color: rgba(var(--v-theme-surface), 0.8);
block-size: 280px;
inline-size: 240px;
}
.workflow-preview-flow {
block-size: 100%;
inline-size: 100%;
.vue-flow__node {
border: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
border-radius: 8px;
font-size: 10px;
&:hover {
box-shadow: none;
transform: none;
}
&.selected {
box-shadow: none;
}
}
.vue-flow__edge-path,
.vue-flow__connection-path {
stroke-width: 2;
}
.vue-flow__handle {
border-radius: 2px;
block-size: 12px;
inline-size: 4px;
}
// 自定义动作连线样式
.vue-flow__edge.animation {
.vue-flow__edge-path {
stroke: rgb(var(--v-theme-primary));
}
&.selected {
.vue-flow__edge-path {
stroke: rgb(var(--v-theme-primary));
stroke-width: 3;
}
}
}
}
@media screen and (width <= 600px) {
.workflow-preview {
block-size: 240px;
inline-size: 240px;
}
}
</style>

View File

@@ -9,9 +9,11 @@ import ProgressDialog from './ProgressDialog.vue'
import { FileItem, StorageConf, TransferDirectoryConf, TransferForm } from '@/api/types'
import { useI18n } from 'vue-i18n'
import { useGlobalSettingsStore } from '@/stores'
import { useBackgroundOptimization } from '@/composables/useBackgroundOptimization'
// 国际化
const { t } = useI18n()
const { useProgressSSE } = useBackgroundOptimization()
// 显示器宽度
const display = useDisplay()
@@ -49,8 +51,8 @@ const $toast = useToast()
// TMDB选择对话框
const mediaSelectorDialog = ref(false)
// 加载进度SSE
const progressEventSource = ref<EventSource>()
// 进度是否激活
const progressActive = ref(false)
// 整理进度条
const progressDialog = ref(false)
@@ -189,34 +191,34 @@ async function handleTransferLog(logid: number, background: boolean = false) {
}
}
// 进度SSE消息处理函数
function handleProgressMessage(event: MessageEvent) {
const progress = JSON.parse(event.data)
if (progress) {
progressText.value = progress.text
progressValue.value = progress.value
}
}
// 使用优化的进度SSE连接
const progressSSE = useProgressSSE(
`${import.meta.env.VITE_API_BASE_URL}system/progress/filetransfer`,
handleProgressMessage,
'reorganize-progress',
progressActive,
)
// 使用SSE监听加载进度
function startLoadingProgress() {
// 在创建新连接之前,先确保任何可能存在的旧连接都被关闭了,防止因快速重复点击而产生孤儿连接。
if (progressEventSource.value) {
progressEventSource.value.close()
}
progressText.value = t('dialog.reorganize.processing')
progressEventSource.value = new EventSource(`${import.meta.env.VITE_API_BASE_URL}system/progress/filetransfer`)
progressEventSource.value.onmessage = event => {
const progress = JSON.parse(event.data)
if (progress) {
progressText.value = progress.text
progressValue.value = progress.value
}
}
// 发生错误时,也确保连接被关闭,避免重试等意外行为
progressEventSource.value.onerror = () => {
if (progressEventSource.value) {
progressEventSource.value.close()
}
}
progressActive.value = true
progressSSE.start()
}
// 停止监听加载进度
function stopLoadingProgress() {
progressEventSource.value?.close()
progressActive.value = false
progressSSE.stop()
}
// 整理文件

View File

@@ -3,7 +3,7 @@ import api from '@/api'
import type { Site, Plugin, Subscribe } from '@/api/types'
import { getNavMenus, getSettingTabs } from '@/router/i18n-menu'
import { NavMenu } from '@/@layouts/types'
import { useUserStore } from '@/stores'
import { useUserStore, useGlobalSettingsStore } from '@/stores'
import SearchSiteDialog from '@/components/dialog/SearchSiteDialog.vue'
import { useI18n } from 'vue-i18n'
import { useDisplay } from 'vuetify'
@@ -26,6 +26,10 @@ const router = useRouter()
// 用户 Store
const userStore = useUserStore()
// 全局设置 Store
const globalSettingsStore = useGlobalSettingsStore()
const globalSettings = globalSettingsStore.globalSettings
// 超级用户
const superUser = userStore.superUser
@@ -63,6 +67,11 @@ const hasManagePermission = computed(() => {
)
})
// 是否显示合集搜索项当SEARCH_SOURCE包含themoviedb时显示
const showCollectionSearch = computed(() => {
return globalSettings.SEARCH_SOURCE?.includes('themoviedb') || false
})
// 所有订阅数据
const SubscribeItems = ref<Subscribe[]>([])
@@ -298,6 +307,19 @@ function searchHistory() {
emit('close')
}
// 跳转到订阅分享页面
function searchSubscribeShares() {
if (!searchWord.value) return
saveRecentSearches(searchWord.value)
router.push({
path: '/subscribe-share',
query: {
keyword: searchWord.value,
},
})
emit('close')
}
// 跳转插件页面
function showPlugin(pluginId: string) {
router.push({
@@ -422,7 +444,7 @@ onMounted(() => {
</template>
</VHover>
<VHover>
<VHover v-if="showCollectionSearch">
<template #default="hover">
<VListItem
density="comfortable"
@@ -484,6 +506,37 @@ onMounted(() => {
</template>
</VHover>
<VHover v-if="hasSubscribePermission">
<template #default="hover">
<VListItem
density="comfortable"
link
rounded="xl"
v-bind="hover.props"
@click="searchSubscribeShares"
class="search-option mx-2 mx-sm-4 my-1"
>
<template #prepend>
<div class="option-icon-wrapper d-flex align-center justify-center">
<VIcon
icon="mdi-share-variant"
:color="hover.isHovering ? 'primary' : 'medium-emphasis'"
size="small"
/>
</div>
</template>
<VListItemTitle class="font-weight-medium">{{ t('subscribe.searchShares') }}</VListItemTitle>
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
{{ t('common.search') }} <span class="primary-text font-weight-medium">{{ searchWord }}</span>
{{ t('dialog.searchBar.subscribeShareSearch') }}
</VListItemSubtitle>
<template #append>
<VIcon v-if="hover.isHovering" icon="mdi-chevron-right" color="primary" />
</template>
</VListItem>
</template>
</VHover>
<VHover v-if="hasManagePermission">
<template #default="hover">
<VListItem

View File

@@ -203,7 +203,7 @@ onMounted(async () => {
prepend-inner-icon="mdi-rss"
/>
</VCol>
<VCol cols="12" md="3">
<VCol cols="6" md="3">
<VTextField
v-model="siteForm.timeout"
:label="t('site.fields.timeout')"

View File

@@ -0,0 +1,423 @@
<script lang="ts" setup>
import { useToast } from 'vue-toastification'
import type { Site } from '@/api/types'
import { doneNProgress, startNProgress } from '@/api/nprogress'
import api from '@/api'
import { useDisplay } from 'vuetify'
import { useI18n } from 'vue-i18n'
// 国际化
const { t } = useI18n()
// 显示器宽度
const display = useDisplay()
// 提示框
const $toast = useToast()
// 注册事件
const emit = defineEmits(['update:modelValue', 'import-success'])
// 界面阶段枚举
enum ImportStage {
SELECT_FILE = 'select_file', // 选择文件阶段
PREVIEW_FILE = 'preview_file', // 文件预览阶段
IMPORTING = 'importing', // 正在导入阶段
IMPORT_COMPLETE = 'import_complete', // 导入完成阶段
}
// 当前阶段
const currentStage = ref<ImportStage>(ImportStage.SELECT_FILE)
// 是否拖拽中
const isDragging = ref(false)
// 导入的文件数据
const importData = ref<Site[]>([])
// 导入进度
const importProgress = ref(0)
// 预览数据
const previewData = ref<Site[]>([])
// 选中的文件
const selectedFile = ref<File | null>(null)
// 导入错误信息
const importErrors = ref<Array<{ site: Site; error: string }>>([])
// 导入成功的站点
const importSuccesses = ref<Site[]>([])
// 是否显示错误详情
const showErrorDetails = ref(false)
// 处理拖拽事件
function handleDragOver(event: DragEvent) {
event.preventDefault()
isDragging.value = true
}
function handleDragLeave(event: DragEvent) {
event.preventDefault()
isDragging.value = false
}
async function handleDrop(event: DragEvent) {
event.preventDefault()
isDragging.value = false
const files = event.dataTransfer?.files
if (files && files.length > 0) {
const file = files[0]
if (file.type === 'application/json' || file.name.endsWith('.json')) {
selectedFile.value = file
await processFile(file)
} else {
$toast.error(t('site.messages.invalidFileType'))
}
}
}
// 处理文件
async function processFile(file: File) {
try {
const text = await file.text()
const data = JSON.parse(text)
if (Array.isArray(data)) {
importData.value = data
previewData.value = data.slice(0, 5) // 只显示前5个站点作为预览
currentStage.value = ImportStage.PREVIEW_FILE
} else {
$toast.error(t('site.messages.invalidFileFormat'))
}
} catch (error) {
console.error('Parse file error:', error)
$toast.error(t('site.messages.parseFileError'))
}
}
// 验证站点数据
function validateSiteData(site: any): boolean {
const requiredFields = ['name', 'domain', 'url']
return requiredFields.every(field => site[field])
}
// 批量导入站点
async function importSites() {
if (importData.value.length === 0) {
$toast.error(t('site.messages.noDataToImport'))
return
}
// 验证数据
const validSites = importData.value.filter(validateSiteData)
if (validSites.length === 0) {
$toast.error(t('site.messages.noValidData'))
return
}
if (validSites.length !== importData.value.length) {
$toast.warning(t('site.messages.someInvalidData', { valid: validSites.length, total: importData.value.length }))
}
// 进入导入阶段
currentStage.value = ImportStage.IMPORTING
startNProgress()
importProgress.value = 0
try {
let successCount = 0
let failCount = 0
importErrors.value = [] // 清空之前的错误信息
importSuccesses.value = [] // 清空之前的成功信息
for (let i = 0; i < validSites.length; i++) {
const site = validSites[i]
try {
// 移除id字段避免冲突
const { id, ...siteData } = site
const result: { success: boolean; message?: string } = await api.post('site/', siteData)
if (result.success) {
// 记录成功的站点
successCount++
importSuccesses.value.push(site)
} else {
failCount++
// 记录失败信息
importErrors.value.push({
site,
error: result.message || t('site.messages.importFailed'),
})
}
} catch (error) {
console.error(`Import site ${site.name} failed:`, error)
failCount++
// 记录错误信息
importErrors.value.push({
site,
error: error instanceof Error ? error.message : t('site.messages.importFailed'),
})
}
// 更新进度
importProgress.value = Math.round(((i + 1) / validSites.length) * 100)
}
// 进入完成阶段
currentStage.value = ImportStage.IMPORT_COMPLETE
// 显示导入结果
if (failCount === 0 && successCount > 0) {
// 全部成功,直接关闭对话框
$toast.success(t('site.messages.importSuccess', { count: successCount }))
closeDialog(true)
} else if (successCount === 0 && failCount > 0) {
// 全部失败的情况
$toast.error(t('site.messages.importAllFailed', { count: failCount }))
showErrorDetails.value = true
} else {
// 部分成功部分失败的情况
$toast.error(t('site.messages.importPartialFailed', { success: successCount, failed: failCount }))
showErrorDetails.value = true
}
} catch (error) {
console.error('Import sites failed:', error)
$toast.error(t('site.messages.importFailed'))
// 出错时回到预览阶段
currentStage.value = ImportStage.PREVIEW_FILE
} finally {
doneNProgress()
}
}
// 重置到文件选择阶段
function resetToFileSelection() {
currentStage.value = ImportStage.SELECT_FILE
importData.value = []
previewData.value = []
importProgress.value = 0
isDragging.value = false
selectedFile.value = null
importErrors.value = []
importSuccesses.value = []
showErrorDetails.value = false
}
// 关闭对话框
function closeDialog(success: boolean = false) {
if (success) {
emit('import-success')
}
emit('update:modelValue', false)
}
// 监听文件选择
watch(selectedFile, async newFile => {
if (newFile) {
await processFile(newFile)
}
})
</script>
<template>
<VDialog scrollable max-width="50rem" :fullscreen="!display.mdAndUp.value">
<VCard>
<VCardItem class="py-2">
<template #prepend>
<VIcon icon="mdi-upload" class="me-2" />
</template>
<VCardTitle>{{ t('site.actions.import') }}</VCardTitle>
<VCardSubtitle>{{ t('site.hints.import') }}</VCardSubtitle>
</VCardItem>
<VDialogCloseBtn @click="closeDialog" />
<VDivider />
<VCardText>
<!-- 阶段1选择文件阶段 -->
<div v-if="currentStage === ImportStage.SELECT_FILE" class="upload-area">
<div
class="upload-zone"
:class="{ 'dragging': isDragging }"
@dragover="handleDragOver"
@dragleave="handleDragLeave"
@drop="handleDrop"
>
<VFileInput
v-model="selectedFile"
accept=".json"
:label="t('site.fields.selectFile')"
:hint="t('site.hints.selectFile')"
persistent-hint
prepend-icon="mdi-file-upload"
/>
<div class="text-center mt-4">
<VIcon icon="mdi-cloud-upload" size="48" color="primary" />
<p class="text-body-1 mt-2">{{ t('site.hints.dragDropFile') }}</p>
<p class="text-caption text-medium-emphasis">{{ t('site.hints.supportedFormat') }}</p>
</div>
</div>
</div>
<!-- 阶段2文件预览阶段 -->
<div v-if="currentStage === ImportStage.PREVIEW_FILE" class="preview-area">
<VAlert
type="info"
variant="tonal"
class="mb-4"
:text="t('site.messages.previewData', { count: importData.length })"
/>
<!-- 预览列表 -->
<VCard variant="outlined" class="mb-4">
<VCardTitle class="text-subtitle-1">
{{ t('site.preview.title') }} ({{
t('site.preview.showing', { count: previewData.length, total: importData.length })
}})
</VCardTitle>
<VCardText>
<VList>
<VListItem
v-for="(site, index) in previewData"
:key="index"
:class="{ 'border-error': !validateSiteData(site) }"
>
<template #prepend>
<VIcon
:icon="validateSiteData(site) ? 'mdi-check-circle' : 'mdi-alert-circle'"
:color="validateSiteData(site) ? 'success' : 'error'"
/>
</template>
<VListItemTitle>{{ site.name || t('site.preview.unnamed') }}</VListItemTitle>
<VListItemSubtitle>{{ site.url || t('site.preview.noUrl') }}</VListItemSubtitle>
<template #append>
<VChip v-if="!validateSiteData(site)" size="small" color="error" variant="tonal">
{{ t('site.preview.invalid') }}
</VChip>
</template>
</VListItem>
</VList>
</VCardText>
</VCard>
<!-- 操作按钮 -->
<div class="d-flex justify-end gap-2">
<VBtn variant="text" @click="resetToFileSelection">
{{ t('common.reset') }}
</VBtn>
<VBtn color="primary" @click="importSites" :disabled="importData.length === 0">
{{ t('site.actions.startImport') }}
</VBtn>
</div>
</div>
<!-- 阶段3正在导入阶段 -->
<div v-if="currentStage === ImportStage.IMPORTING" class="importing-area">
<VAlert
type="info"
variant="tonal"
class="mb-4"
:text="t('site.messages.importing', { progress: importProgress })"
/>
<!-- 导入进度 -->
<VCard variant="outlined" class="mb-4">
<VCardTitle class="text-subtitle-1">
{{ t('site.messages.importing', { progress: importProgress }) }}
</VCardTitle>
<VCardText>
<VProgressLinear v-model="importProgress" color="primary" height="8" rounded class="mb-2" />
<p class="text-caption text-center">{{ importProgress }}%</p>
</VCardText>
</VCard>
</div>
<!-- 阶段4导入完成阶段 -->
<div v-if="currentStage === ImportStage.IMPORT_COMPLETE" class="result-area">
<!-- 成功导入的站点 -->
<div v-if="importSuccesses.length > 0" class="success-sites mb-4">
<VAlert
type="success"
variant="tonal"
class="mb-4"
:text="t('site.messages.importSuccess', { count: importSuccesses.length })"
/>
</div>
<!-- 错误详情 -->
<div v-if="showErrorDetails && importErrors.length > 0" class="error-details">
<VAlert
type="error"
variant="tonal"
class="mb-4"
:text="t('site.messages.importErrors', { count: importErrors.length })"
/>
<VCard variant="outlined" class="mb-4">
<VCardTitle class="text-subtitle-1 d-flex align-center justify-space-between">
{{ t('site.errors.title') }}
</VCardTitle>
<!-- 错误信息详情 -->
<VExpansionPanels class="mt-4">
<VExpansionPanel v-for="(error, index) in importErrors" :key="index">
<VExpansionPanelTitle>
{{ error.site.name || t('site.preview.unnamed') }} - {{ t('site.errors.details') }}
</VExpansionPanelTitle>
<VExpansionPanelText>
<VAlert type="error" variant="text" :text="error.error" class="mb-0" />
</VExpansionPanelText>
</VExpansionPanel>
</VExpansionPanels>
</VCard>
</div>
<!-- 操作按钮 -->
<div class="d-flex justify-end gap-2">
<VBtn variant="text" @click="resetToFileSelection">
{{ t('common.reset') }}
</VBtn>
<VBtn color="primary" @click="closeDialog(false)">
{{ t('common.close') }}
</VBtn>
</div>
</div>
</VCardText>
</VCard>
</VDialog>
</template>
<style scoped>
.upload-area {
padding: 2rem;
}
.upload-zone {
padding: 2rem;
border: 2px dashed #ccc;
border-radius: 8px;
text-align: center;
transition: all 0.3s ease;
}
.upload-zone.dragging {
border-color: rgb(var(--v-theme-primary));
background-color: rgba(var(--v-theme-primary), 0.05);
}
.error-details {
margin-block: 1rem;
margin-inline: 0;
}
.error-details .v-expansion-panels {
background: transparent;
}
.border-success {
border-inline-start: 4px solid rgb(var(--v-theme-success));
}
.border-error {
border-inline-start: 4px solid rgb(var(--v-theme-error));
}
</style>

View File

@@ -0,0 +1,478 @@
<script lang="ts" setup>
import type { PropType } from 'vue'
import api from '@/api'
import type { Site, SiteStatistic } from '@/api/types'
import { useI18n } from 'vue-i18n'
import { useDisplay } from 'vuetify'
// 国际化
const { t } = useI18n()
// 显示器宽度
const display = useDisplay()
// 输入参数
const props = defineProps({
sites: {
type: Array as PropType<Site[]>,
default: () => [],
},
})
// 定义触发的自定义事件
const emit = defineEmits(['update:modelValue'])
// 站点统计数据
const siteStats = ref<SiteStatistic[]>([])
// 是否加载中
const loading = ref(false)
// 当前选中的站点
const selectedSite = ref<Site | null>(null)
// 耗时记录详情弹窗
const detailDialog = ref(false)
// 获取站点统计数据
async function fetchSiteStats() {
try {
loading.value = true
const response = await api.get('site/statistic')
siteStats.value = Array.isArray(response) ? response : response.data || []
loading.value = false
} catch (error) {
console.error('Failed to fetch site statistics:', error)
loading.value = false
}
}
// 根据站点域名获取统计数据
function getSiteStats(domain: string): SiteStatistic | undefined {
return siteStats.value.find(stat => stat.domain === domain)
}
// 获取站点连接状态
function getConnectionStatus(stats: SiteStatistic | undefined): string {
if (!stats || Object.keys(stats).length === 0) {
return 'unknown'
}
if (stats.lst_state === 1) {
return 'failed'
} else if (stats.lst_state === 0) {
if (!stats.seconds) return 'unknown'
if (stats.seconds >= 5) return 'slow'
return 'connected'
}
return 'unknown'
}
// 获取状态颜色
function getStatusColor(status: string): string {
switch (status) {
case 'connected':
return 'success'
case 'slow':
return 'warning'
case 'failed':
return 'error'
default:
return 'secondary'
}
}
// 获取状态图标
function getStatusIcon(status: string): string {
switch (status) {
case 'connected':
return 'mdi-wifi'
case 'slow':
return 'mdi-wifi-strength-2'
case 'failed':
return 'mdi-wifi-off'
default:
return 'mdi-help-circle'
}
}
// 获取状态文本
function getStatusText(status: string): string {
switch (status) {
case 'connected':
return t('site.connectionNormal')
case 'slow':
return t('site.connectionSlow')
case 'failed':
return t('site.connectionFailed')
default:
return t('site.connectionUnknown')
}
}
// 获取耗时颜色
function getTimeColor(seconds: number | undefined): string {
if (!seconds) return 'secondary'
if (seconds < 2) return 'success'
if (seconds < 5) return 'warning'
return 'error'
}
// 获取成功率(与列表/概览口径一致)
function getSuccessRate(stats: SiteStatistic | undefined): string {
if (!stats) return '-'
const success = Number(stats.success ?? 0)
const fail = Number(stats.fail ?? 0)
const total = success + fail
if (total <= 0) return '-'
return String(Math.round((success / total) * 100))
}
// 解析耗时记录
function parseTimeRecords(note: any): Array<{ time: string; duration: number }> {
if (!note) return []
try {
// note可能是字符串或对象如果是字符串则解析
const records = typeof note === 'string' ? JSON.parse(note) : note
if (typeof records === 'object' && records !== null) {
const result = Object.entries(records)
.map(([time, duration]) => ({
time,
duration: Number(duration) || 0,
}))
.sort((a, b) => new Date(b.time).getTime() - new Date(a.time).getTime())
.slice(0, 10) // 只显示最近10条记录
return result
}
} catch (error) {
console.error('Failed to parse time records:', error)
}
return []
}
// 查看详情
function viewDetail(site: Site) {
selectedSite.value = site
detailDialog.value = true
}
// 关闭弹窗
function closeDialog() {
emit('update:modelValue', false)
}
// 计算属性:按平均耗时排序的站点列表
const sortedSites = computed(() => {
return props.sites
.map(site => {
const stats = getSiteStats(site.domain)
return {
site,
stats,
status: getConnectionStatus(stats),
avgTime: stats?.seconds || 0,
}
})
.sort((a, b) => {
// 先按状态排序connected > slow > failed > unknown
const statusOrder = { connected: 0, slow: 1, failed: 2, unknown: 3 }
const statusDiff =
statusOrder[a.status as keyof typeof statusOrder] - statusOrder[b.status as keyof typeof statusOrder]
if (statusDiff !== 0) return statusDiff
// 再按平均耗时排序
return a.avgTime - b.avgTime
})
})
// 统计总览(与列表口径一致)
const overviewCounts = computed(() => {
const items = sortedSites.value
const total = items.length
const connected = items.filter(i => i.status === 'connected').length
const slow = items.filter(i => i.status === 'slow').length
const failed = items.filter(i => i.status === 'failed').length
const unknown = total - connected - slow - failed
return { total, connected, slow, failed, unknown }
})
onMounted(() => {
fetchSiteStats()
})
</script>
<template>
<VDialog max-width="50rem" :fullscreen="display.smAndDown.value" scrollable>
<VCard>
<!-- 标题栏 -->
<VCardItem>
<VDialogCloseBtn @click="closeDialog" />
<template #prepend>
<VIcon icon="mdi-chart-line" class="me-2" />
</template>
<VCardTitle>
{{ t('site.statistics') }}
</VCardTitle>
</VCardItem>
<VDivider />
<!-- 内容区域 -->
<VCardText class="pa-0">
<LoadingBanner v-if="loading" class="my-8" />
<div v-else class="site-statistics-content">
<!-- 统计概览 -->
<div class="statistics-overview pa-4">
<div class="d-flex flex-wrap gap-4">
<div class="stat-card">
<div class="stat-number">{{ overviewCounts.total }}</div>
<div class="stat-label">{{ t('site.totalSites') }}</div>
</div>
<div class="stat-card">
<div class="stat-number success--text">{{ overviewCounts.connected }}</div>
<div class="stat-label">{{ t('site.normalSites') }}</div>
</div>
<div class="stat-card">
<div class="stat-number warning--text">{{ overviewCounts.slow }}</div>
<div class="stat-label">{{ t('site.slowSites') }}</div>
</div>
<div class="stat-card">
<div class="stat-number error--text">{{ overviewCounts.failed }}</div>
<div class="stat-label">{{ t('site.failedSites') }}</div>
</div>
</div>
</div>
<!-- 站点列表 -->
<div class="sites-list">
<div
v-for="item in sortedSites"
:key="item.site.id"
class="site-item pa-4 border-b"
:class="`border-${getStatusColor(item.status)}`"
>
<div class="d-flex align-center justify-space-between">
<!-- 左侧站点信息 -->
<div class="d-flex align-center flex-1 min-w-0">
<!-- 状态指示器 -->
<div class="status-indicator me-3" :class="getStatusColor(item.status)">
<VIcon :icon="getStatusIcon(item.status)" size="20" />
</div>
<!-- 站点名称和状态 -->
<div class="flex-1 min-w-0">
<div class="d-flex align-center">
<h4 class="text-h6 mb-1 truncate">{{ item.site.name }}</h4>
<VChip :color="getStatusColor(item.status)" size="small" class="ml-2" variant="tonal">
{{ getStatusText(item.status) }}
</VChip>
</div>
<div class="text-caption text-medium-emphasis">{{ item.site.domain }}</div>
</div>
</div>
<!-- 右侧统计信息 -->
<div class="d-flex align-center gap-4">
<!-- 平均耗时 -->
<div class="text-center">
<div class="text-h6 font-weight-bold" :class="`text-${getTimeColor(item.stats?.seconds)}`">
{{ item.stats?.seconds || '-' }}s
</div>
<div class="text-caption text-medium-emphasis">{{ t('site.averageTime') }}</div>
</div>
<!-- 成功率 -->
<div class="text-center">
<div class="text-h6 font-weight-bold">{{ getSuccessRate(item.stats) }}%</div>
<div class="text-caption text-medium-emphasis">{{ t('site.successRate') }}</div>
</div>
<!-- 详情按钮 -->
<VBtn icon variant="text" size="small" @click="viewDetail(item.site)">
<VIcon icon="mdi-information-outline" />
</VBtn>
</div>
</div>
</div>
</div>
</div>
</VCardText>
</VCard>
<!-- 详情弹窗 -->
<VDialog v-model="detailDialog" :max-width="display.mdAndUp.value ? 600 : '95%'" scrollable>
<VCard v-if="selectedSite">
<VCardItem class="py-3">
<template #prepend>
<VIcon icon="mdi-information-outline" class="me-2" />
</template>
<VCardTitle> {{ selectedSite.name }} - {{ t('site.timeRecords') }} </VCardTitle>
<VDialogCloseBtn @click="detailDialog = false" />
</VCardItem>
<VDivider />
<VCardText>
<div v-if="getSiteStats(selectedSite.domain)">
<div class="mb-4">
<h5 class="text-h6 mb-2">{{ t('site.statistics') }}</h5>
<div class="d-flex flex-wrap gap-4">
<div class="stat-item">
<span class="stat-label">{{ t('site.successCount') }}:</span>
<span class="stat-value success--text">
{{ getSiteStats(selectedSite.domain)?.success || 0 }}
</span>
</div>
<div class="stat-item">
<span class="stat-label">{{ t('site.failCount') }}:</span>
<span class="stat-value error--text">
{{ getSiteStats(selectedSite.domain)?.fail || 0 }}
</span>
</div>
<div class="stat-item">
<span class="stat-label">{{ t('site.averageTime') }}:</span>
<span class="stat-value" :class="`text-${getTimeColor(getSiteStats(selectedSite.domain)?.seconds)}`">
{{ getSiteStats(selectedSite.domain)?.seconds || '-' }}s
</span>
</div>
<div class="stat-item">
<span class="stat-label">{{ t('site.lastAccess') }}:</span>
<span class="stat-value">
{{ getSiteStats(selectedSite.domain)?.lst_mod_date || '-' }}
</span>
</div>
</div>
</div>
<div>
<h5 class="text-h6 mb-2">{{ t('site.recentTimeRecords') }}</h5>
<div class="time-records">
<div
v-for="(record, index) in parseTimeRecords(getSiteStats(selectedSite.domain)?.note)"
:key="index"
class="time-record-item pa-3 border rounded mb-2"
:class="`border-${getTimeColor(record.duration)}`"
>
<div class="d-flex justify-space-between align-center">
<div>
<div class="text-body-2 font-weight-medium">{{ record.time }}</div>
<div class="text-caption text-medium-emphasis">{{ t('site.accessTime') }}</div>
</div>
<div class="text-end">
<div class="text-h6 font-weight-bold" :class="`text-${getTimeColor(record.duration)}`">
{{ record.duration }}s
</div>
<div class="text-caption text-medium-emphasis">{{ t('site.responseTime') }}</div>
</div>
</div>
</div>
<div
v-if="parseTimeRecords(getSiteStats(selectedSite.domain)?.note).length === 0"
class="text-center pa-4"
>
<VIcon icon="mdi-information-outline" size="48" color="secondary" class="mb-2" />
<div class="text-body-1 text-medium-emphasis">{{ t('site.noTimeRecords') }}</div>
</div>
</div>
</div>
</div>
</VCardText>
</VCard>
</VDialog>
</VDialog>
</template>
<style scoped>
.statistics-overview {
background: linear-gradient(135deg, var(--v-theme-surface) 0%, var(--v-theme-surface-variant) 100%);
border-block-end: 1px solid var(--v-border-color);
}
.stat-card {
padding: 16px;
border: 1px solid var(--v-border-color);
border-radius: 8px;
background: var(--v-theme-surface);
min-inline-size: 100px;
text-align: center;
}
.stat-number {
font-size: 24px;
font-weight: bold;
line-height: 1;
margin-block-end: 4px;
}
.stat-label {
color: var(--v-theme-on-surface-variant);
font-size: 12px;
}
.sites-list {
background: var(--v-theme-surface);
}
.site-item {
transition: background-color 0.2s ease;
}
.site-item:hover {
background: var(--v-theme-surface-variant);
}
.status-indicator {
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: var(--v-theme-surface-variant);
block-size: 40px;
inline-size: 40px;
}
.status-indicator.success {
background: rgba(var(--v-theme-success), 0.1);
color: rgb(var(--v-theme-success));
}
.status-indicator.warning {
background: rgba(var(--v-theme-warning), 0.1);
color: rgb(var(--v-theme-warning));
}
.status-indicator.error {
background: rgba(var(--v-theme-error), 0.1);
color: rgb(var(--v-theme-error));
}
.status-indicator.secondary {
background: rgba(var(--v-theme-secondary), 0.1);
color: rgb(var(--v-theme-secondary));
}
.stat-item {
display: flex;
align-items: center;
gap: 8px;
}
.stat-item .stat-label {
color: var(--v-theme-on-surface-variant);
font-weight: 500;
}
.stat-value {
font-weight: bold;
}
.time-records {
max-block-size: 300px;
overflow-y: auto;
}
.time-record-item {
transition: all 0.2s ease;
}
</style>

View File

@@ -290,8 +290,8 @@ onBeforeMount(() => {
<VDialog scrollable eager max-width="80rem" :fullscreen="!display.mdAndUp.value">
<VCard>
<VCardItem>
<VCardTitle
>{{ t('dialog.siteUserData.title') }} - {{ props.site?.name }}
<VCardTitle>
{{ t('dialog.siteUserData.title') }} - {{ props.site?.name }}
<IconBtn @click.stop="refreshSiteData" color="info"><VIcon icon="mdi-refresh" /></IconBtn>
</VCardTitle>
<VDialogCloseBtn @click="emit('close')" />

View File

@@ -99,6 +99,10 @@ function episodeGroupItemProps(item: { title: string; subtitle: string }) {
// 查询所有剧集组
async function getEpisodeGroups() {
if (!subscribeForm.value.tmdbid) {
console.warn('tmdbid is not set or is empty')
return
}
try {
episodeGroups.value = await api.get(`media/groups/${subscribeForm.value.tmdbid}`)
} catch (error) {
@@ -283,7 +287,7 @@ onMounted(() => {
<VDialog scrollable max-width="45rem" :fullscreen="!display.mdAndUp.value">
<VCard>
<VCardItem class="py-2">
<VDialogCloseBtn @click="emit('close')" />
<VDialogCloseBtn @click="emit('close')" />
<template #prepend>
<VIcon icon="mdi-clipboard-list-outline" class="me-2" />
</template>

View File

@@ -81,6 +81,10 @@ function getMediaId() {
// 查询所有剧集组
async function getEpisodeGroups() {
if (!props.media?.tmdb_id) {
console.warn('tmdbid is not set or is empty')
return
}
try {
episodeGroups.value = await api.get(`media/groups/${props.media?.tmdb_id}`)
} catch (error) {

View File

@@ -0,0 +1,477 @@
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import api from '@/api'
import type { SubscribeShareStatistics } from '@/api/types'
import { useI18n } from 'vue-i18n'
import { useDisplay, useTheme } from 'vuetify'
// 国际化
const { t } = useI18n()
// 显示器宽度
const display = useDisplay()
// 主题
const theme = useTheme()
// 定义事件
const emit = defineEmits(['close'])
// 统计数据
const statistics = ref<SubscribeShareStatistics[]>([])
// 是否加载中
const loading = ref(false)
// 获取统计数据
async function fetchStatistics() {
try {
loading.value = true
const data: SubscribeShareStatistics[] = await api.get('subscribe/share/statistics')
statistics.value = data
} catch (error) {
console.error('获取分享统计数据失败:', error)
} finally {
loading.value = false
}
}
// 计算排名
const rankedStatistics = computed(() => {
return statistics.value
.sort((a, b) => (b.total_reuse_count || 0) - (a.total_reuse_count || 0))
.map((item, index) => ({
...item,
rank: index + 1,
}))
})
// 获取排名样式
function getRankStyle(rank: number) {
if (rank === 1) {
return {
background: 'linear-gradient(135deg, #FFD700 0%, #FFA500 100%)',
color: '#fff',
fontWeight: 'bold',
}
} else if (rank === 2) {
return {
background: 'linear-gradient(135deg, #CD7F32 0%, #B8860B 100%)',
color: '#fff',
fontWeight: 'bold',
}
} else if (rank === 3) {
return {
background: 'linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%)',
color: '#fff',
fontWeight: 'bold',
}
}
return {}
}
// 获取前三名文字颜色
function getPodiumTextColor() {
return theme.global.current.value.dark ? '#fff' : '#000'
}
// 获取前三名统计背景样式
function getPodiumStatStyle() {
const isDark = theme.global.current.value.dark
return {
border: `1px solid ${isDark ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 0, 0, 0.2)'}`,
background: isDark ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)',
}
}
// 获取前三名区域背景样式
function getPodiumAreaBackgroundStyle() {
const isDark = theme.global.current.value.dark
return {
background: isDark
? 'linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 69, 0, 0.2) 25%, rgba(255, 20, 147, 0.15) 50%, rgba(138, 43, 226, 0.1) 75%, rgba(0, 191, 255, 0.08) 100%), linear-gradient(to bottom, transparent 0%, transparent 70%, rgba(255, 215, 0, 0.1) 85%, transparent 100%)'
: 'linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 69, 0, 0.15) 25%, rgba(255, 20, 147, 0.12) 50%, rgba(138, 43, 226, 0.08) 75%, rgba(0, 191, 255, 0.05) 100%), linear-gradient(to bottom, transparent 0%, transparent 70%, rgba(255, 215, 0, 0.08) 85%, transparent 100%)',
border: 'none',
borderRadius: '0',
padding: '32px 24px 48px 24px',
margin: '0 -24px 0 -',
boxShadow: isDark
? '0 16px 48px rgba(255, 215, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1)'
: '0 16px 48px rgba(255, 215, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3)',
position: 'relative' as const,
overflow: 'hidden',
}
}
// 获取排名图标
function getRankIcon(rank: number) {
if (rank === 1) return 'mdi-trophy'
if (rank === 2) return 'mdi-medal-outline'
if (rank === 3) return 'mdi-medal'
return ''
}
// 组件挂载时获取数据
onMounted(() => {
fetchStatistics()
})
</script>
<template>
<VDialog scrollable max-width="40rem" :fullscreen="!display.mdAndUp.value">
<VCard>
<VCardItem>
<template #prepend>
<VIcon icon="mdi-chart-line" class="me-2" />
</template>
<VCardTitle>{{ t('subscribe.shareStatistics') }}</VCardTitle>
</VCardItem>
<VDialogCloseBtn @click="emit('close')" />
<VDivider />
<VCardText class="pa-0">
<LoadingBanner v-if="loading" class="mt-4" />
<div v-else-if="rankedStatistics.length === 0" class="text-center py-8">
<VIcon icon="mdi-chart-line" size="64" color="grey" class="mb-4" />
<div class="text-h6 text-grey">{{ t('subscribe.noStatisticsData') }}</div>
</div>
<div v-else>
<!-- 前三名特殊展示 -->
<div class="podium-area" :style="getPodiumAreaBackgroundStyle()">
<!-- 装饰性背景元素 -->
<div class="podium-decoration">
<div class="decoration-circle decoration-1"></div>
<div class="decoration-circle decoration-2"></div>
<div class="decoration-circle decoration-3"></div>
</div>
<div class="text-h6 mb-4 text-center podium-title">{{ t('subscribe.ranking') }}</div>
<!-- 大屏幕横向排列 -->
<div class="d-none d-md-flex justify-center align-center gap-4 flex-wrap">
<!-- 第二名 -->
<div v-if="rankedStatistics[1]" class="text-center">
<div class="rank-circle mb-2" :style="getRankStyle(2)">
<VIcon :icon="getRankIcon(2)" size="24" />
</div>
<div class="text-h6 font-weight-bold" :style="{ color: getPodiumTextColor() }">
{{ rankedStatistics[1].share_user || '未知' }}
</div>
<div class="d-flex align-center justify-center gap-2 mt-1">
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-share-outline" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span class="font-weight-bold" :style="{ color: getPodiumTextColor() }">{{
rankedStatistics[1].share_count || 0
}}</span>
</div>
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-fire" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span class="font-weight-bold" :style="{ color: getPodiumTextColor() }">{{
rankedStatistics[1].total_reuse_count || 0
}}</span>
</div>
</div>
</div>
<!-- 第一名 -->
<div v-if="rankedStatistics[0]" class="text-center">
<div class="rank-circle mb-2 first-place" :style="getRankStyle(1)">
<VIcon :icon="getRankIcon(1)" size="32" />
</div>
<div class="text-h5 font-weight-bold" :style="{ color: getPodiumTextColor() }">
{{ rankedStatistics[0].share_user || '未知' }}
</div>
<div class="d-flex align-center justify-center gap-3 mt-1">
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-share-outline" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span class="font-weight-bold" :style="{ color: getPodiumTextColor() }">{{
rankedStatistics[0].share_count || 0
}}</span>
</div>
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-fire" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span class="font-weight-bold" :style="{ color: getPodiumTextColor() }">{{
rankedStatistics[0].total_reuse_count || 0
}}</span>
</div>
</div>
</div>
<!-- 第三名 -->
<div v-if="rankedStatistics[2]" class="text-center">
<div class="rank-circle mb-2" :style="getRankStyle(3)">
<VIcon :icon="getRankIcon(3)" size="24" />
</div>
<div class="text-h6 font-weight-bold" :style="{ color: getPodiumTextColor() }">
{{ rankedStatistics[2].share_user || '未知' }}
</div>
<div class="d-flex align-center justify-center gap-2 mt-1">
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-share-outline" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span class="font-weight-bold" :style="{ color: getPodiumTextColor() }">{{
rankedStatistics[2].share_count || 0
}}</span>
</div>
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-fire" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span class="font-weight-bold" :style="{ color: getPodiumTextColor() }">{{
rankedStatistics[2].total_reuse_count || 0
}}</span>
</div>
</div>
</div>
</div>
<!-- 小屏幕垂直排列 -->
<div class="d-flex d-md-none flex-column align-center gap-4">
<!-- 第一名 -->
<div v-if="rankedStatistics[0]" class="text-center">
<div class="rank-circle mb-2 first-place" :style="getRankStyle(1)">
<VIcon :icon="getRankIcon(1)" size="32" />
</div>
<div class="text-h5 font-weight-bold" :style="{ color: getPodiumTextColor() }">
{{ rankedStatistics[0].share_user || '未知' }}
</div>
<div class="d-flex align-center justify-center gap-3 mt-1">
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-share-outline" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span :style="{ color: getPodiumTextColor() }">{{ rankedStatistics[0].share_count || 0 }}</span>
</div>
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-fire" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span :style="{ color: getPodiumTextColor() }">{{
rankedStatistics[0].total_reuse_count || 0
}}</span>
</div>
</div>
</div>
<!-- 第二名 -->
<div v-if="rankedStatistics[1]" class="text-center">
<div class="rank-circle mb-2" :style="getRankStyle(2)">
<VIcon :icon="getRankIcon(2)" size="24" />
</div>
<div class="text-h6 font-weight-bold" :style="{ color: getPodiumTextColor() }">
{{ rankedStatistics[1].share_user || '未知' }}
</div>
<div class="d-flex align-center justify-center gap-2 mt-1">
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-share-outline" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span :style="{ color: getPodiumTextColor() }">{{ rankedStatistics[1].share_count || 0 }}</span>
</div>
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-fire" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span :style="{ color: getPodiumTextColor() }">{{
rankedStatistics[1].total_reuse_count || 0
}}</span>
</div>
</div>
</div>
<!-- 第三名 -->
<div v-if="rankedStatistics[2]" class="text-center">
<div class="rank-circle mb-2" :style="getRankStyle(3)">
<VIcon :icon="getRankIcon(3)" size="24" />
</div>
<div class="text-h6 font-weight-bold" :style="{ color: getPodiumTextColor() }">
{{ rankedStatistics[2].share_user || '未知' }}
</div>
<div class="d-flex align-center justify-center gap-2 mt-1">
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-share-outline" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span :style="{ color: getPodiumTextColor() }">
{{ rankedStatistics[2].share_count || 0 }}
</span>
</div>
<div class="d-flex align-center podium-stat" :style="getPodiumStatStyle()">
<VIcon icon="mdi-fire" size="14" :color="getPodiumTextColor()" class="mr-1" />
<span :style="{ color: getPodiumTextColor() }">
{{ rankedStatistics[2].total_reuse_count || 0 }}
</span>
</div>
</div>
</div>
</div>
</div>
<!-- 完整排行榜 -->
<VList class="bg-transparent px-3">
<VListItem
v-for="item in rankedStatistics.filter(item => item.rank > 3)"
:key="item.share_user"
class="mb-2 rounded-lg"
>
<VListItemTitle class="font-weight-bold text-h6 mb-1">
{{ item.share_user || '未知' }}
</VListItemTitle>
<VListItemSubtitle class="d-flex align-center gap-3 mt-1">
<div class="stat-badge share-badge">
<VIcon icon="mdi-share-outline" size="14" color="primary" class="mr-1" />
<span class="text-primary font-weight-bold">{{ item.share_count || 0 }}</span>
<span class="text-grey text-caption ml-1">{{ t('subscribe.shareCount') }}</span>
</div>
<div class="stat-badge reuse-badge">
<VIcon icon="mdi-fire" size="14" color="warning" class="mr-1" />
<span class="text-warning font-weight-bold">{{ item.total_reuse_count || 0 }}</span>
<span class="text-grey text-caption ml-1">{{ t('subscribe.totalReuseCount') }}</span>
</div>
</VListItemSubtitle>
<template #append>
<div class="text-right">
<div
class="text-h6 font-weight-bold"
:style="{ color: item.rank <= 3 ? 'var(--v-primary-base)' : 'inherit' }"
>
#{{ item.rank }}
</div>
</div>
</template>
</VListItem>
</VList>
</div>
</VCardText>
</VCard>
</VDialog>
</template>
<style scoped>
.rank-circle {
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
block-size: 60px;
inline-size: 60px;
margin-block: 0;
margin-inline: auto;
}
.first-place {
block-size: 80px;
box-shadow: 0 4px 12px rgba(255, 215, 0, 30%);
inline-size: 80px;
}
.rank-badge {
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
block-size: 32px;
inline-size: 32px;
}
.stat-badge {
display: flex;
align-items: center;
border: 1px solid rgba(var(--v-theme-outline), 0.2);
border-radius: 6px;
background: rgba(var(--v-theme-surface), 0.8);
padding-block: 4px;
padding-inline: 8px;
transition: all 0.2s ease;
}
.share-badge {
border-inline-start: 3px solid rgb(var(--v-theme-primary));
}
.reuse-badge {
border-inline-start: 3px solid rgb(var(--v-theme-warning));
}
.podium-stat {
border-radius: 6px;
backdrop-filter: blur(4px);
padding-block: 4px;
padding-inline: 8px;
transition: all 0.2s ease;
}
.podium-stat:hover {
transform: scale(1.05);
}
/* 前三名区域样式 */
.podium-area {
position: relative;
z-index: 1;
}
.podium-title {
position: relative;
z-index: 2;
color: #fff !important;
font-weight: bold;
text-shadow: 0 2px 4px rgba(0, 0, 0, 30%);
}
/* 装饰性元素 */
.podium-decoration {
position: absolute;
z-index: 0;
inset: 0;
pointer-events: none;
}
.decoration-circle {
position: absolute;
border-radius: 50%;
animation: float 6s ease-in-out infinite;
background: radial-gradient(circle, rgba(255, 255, 255, 10%) 0%, transparent 70%);
}
.decoration-1 {
animation-delay: 0s;
block-size: 80px;
inline-size: 80px;
inset-block-start: 10%;
inset-inline-start: 10%;
}
.decoration-2 {
animation-delay: 2s;
block-size: 60px;
inline-size: 60px;
inset-block-start: 20%;
inset-inline-end: 15%;
}
.decoration-3 {
animation-delay: 4s;
block-size: 40px;
inline-size: 40px;
inset-block-end: 20%;
inset-inline-start: 20%;
}
@keyframes float {
0%,
100% {
opacity: 0.6;
transform: translateY(0) rotate(0deg);
}
50% {
opacity: 1;
transform: translateY(-10px) rotate(180deg);
}
}
/* 增强前三名文字效果 */
.podium-area .text-h6,
.podium-area .text-h5 {
font-weight: bold;
text-shadow: 0 2px 4px rgba(0, 0, 0, 30%);
}
.podium-area .rank-circle {
border: 2px solid rgba(255, 255, 255, 20%);
box-shadow: 0 8px 24px rgba(0, 0, 0, 30%);
}
.podium-area .first-place {
border: 3px solid rgba(255, 215, 0, 50%);
box-shadow: 0 12px 32px rgba(255, 215, 0, 40%);
}
</style>

View File

@@ -1,12 +1,16 @@
<script lang="ts" setup>
import { ref, computed, watch, onMounted, onUnmounted } from 'vue'
import { formatFileSize } from '@/@core/utils/formatters'
import api from '@/api'
import { FileItem, TransferQueue } from '@/api/types'
import { useDisplay } from 'vuetify'
import { useI18n } from 'vue-i18n'
import { useBackgroundOptimization } from '@/composables/useBackgroundOptimization'
import CryptoJS from 'crypto-js'
// 多语言支持
const { t } = useI18n()
const { useProgressSSE } = useBackgroundOptimization()
// 显示器宽度
const display = useDisplay()
@@ -16,21 +20,27 @@ const emit = defineEmits(['close'])
// 数据列表
const dataList = ref<TransferQueue[]>([])
// 加载进度SSE
const progressEventSource = ref<EventSource>()
// 整体进度相关 - 根据完成的文件计算
const overallProgress = ref({
value: 0,
text: t('dialog.transferQueue.processing'),
})
// 整理进度文本
const progressText = ref(t('dialog.transferQueue.processing'))
// 整理进度
const progressValue = ref(0)
// 文件进度映射
const fileProgressMap = ref<Map<string, { enable: boolean; value: number }>>(new Map())
// 数据可刷新标志
const refreshFlag = ref(false)
// 进度是否激活
const progressActive = ref(false)
// 活动标签
const activeTab = ref('')
// 定时器引用
const queueTimer = ref<NodeJS.Timeout | null>(null)
// 状态标签
const stateDict: { [key: string]: string } = {
'waiting': t('dialog.transferQueue.waitingState'),
@@ -48,9 +58,18 @@ function getStateColor(state: string) {
else return 'error'
}
// 从dataList中提取所有的媒体信息
// 从dataList中提取所有的媒体信息合并相同title_year的记录
const mediaList = computed(() => {
return dataList.value.map(item => item.media)
const mediaMap = new Map<string, any>()
dataList.value.forEach(item => {
const titleYear = item.media.title_year || ''
if (!mediaMap.has(titleYear)) {
mediaMap.set(titleYear, item.media)
}
})
return Array.from(mediaMap.values())
})
// 按media计算总数和完成数返回 x/x
@@ -64,17 +83,49 @@ function getMediaCount(title_year: string) {
return `${completed} / ${total}`
}
// 根据媒体信息获取对应的整理任务
// 根据媒体信息获取对应的整理任务合并相同title_year的所有任务
const activeTasks = computed(() => {
return dataList.value.find(item => item.media.title_year === activeTab.value)?.tasks
const tasks = dataList.value.filter(item => item.media.title_year === activeTab.value).flatMap(item => item.tasks)
return tasks
})
// 根据媒体title_year获取对应的任务列表
function getTasksByMedia(title_year: string) {
return dataList.value.filter(item => item.media.title_year === title_year).flatMap(item => item.tasks)
}
// 计算整体进度
const overallProgressComputed = computed(() => {
if (dataList.value.length === 0) return 0
const allTasks = dataList.value.flatMap(item => item.tasks)
const totalTasks = allTasks.length
const completedTasks = allTasks.filter(task => task.state === 'completed').length
return totalTasks > 0 ? (completedTasks / totalTasks) * 100 : 0
})
// 获取文件进度
function getFileProgress(filePath: string) {
return fileProgressMap.value.get(filePath) || { enable: false, value: 0 }
}
// 调用API获取队列信息
async function get_transfer_queue() {
try {
dataList.value = await api.get('transfer/queue')
if (dataList.value.length > 0) {
if (!activeTab.value || activeTasks.value?.length == 0) activeTab.value = dataList.value[0].media.title_year || ''
// 如果有数据且SSE未启动则启动SSE监听
if (!progressActive.value) {
startLoadingProgress()
}
} else {
// 如果没有数据停止SSE监听
if (progressActive.value) {
stopLoadingProgress()
}
}
} catch (error) {
console.error(error)
@@ -91,73 +142,164 @@ async function remove_queue_task(fileitem: FileItem) {
}
}
// 使用SSE监听加载进度
function startLoadingProgress() {
progressText.value = t('dialog.transferQueue.processing')
progressEventSource.value = new EventSource(`${import.meta.env.VITE_API_BASE_URL}system/progress/filetransfer`)
progressEventSource.value.onmessage = event => {
const progress = JSON.parse(event.data)
if (progress) {
if (!progress.enable) {
progressText.value = t('dialog.transferQueue.processing')
progressValue.value = 0
if (refreshFlag.value) {
refreshFlag.value = false
get_transfer_queue()
}
return
}
progressText.value = progress.text
progressValue.value = progress.value
if (progress.value >= 100 && refreshFlag.value) {
refreshFlag.value = false
get_transfer_queue()
} else {
if (progress.value > 0 && refreshFlag.value && progress.text?.includes('整理完成')) {
refreshFlag.value = false
get_transfer_queue()
} else {
refreshFlag.value = true
}
// 文件进度SSE消息处理函数
function createFileProgressHandler(filePath: string) {
return function handleFileProgressMessage(event: MessageEvent) {
try {
const progress = JSON.parse(event.data)
if (progress) {
fileProgressMap.value.set(filePath, {
enable: progress.enable || false,
value: progress.value || 0,
})
}
} catch (error) {
console.error('解析文件进度消息失败:', error)
}
}
}
// 文件进度SSE连接映射
const fileProgressSSEMap = ref<Map<string, any>>(new Map())
// 启动文件进度监听
function startFileProgress(filePath: string) {
if (fileProgressSSEMap.value.has(filePath)) {
return // 已经存在连接
}
// filePath计算md5
const filePathMd5 = CryptoJS.MD5(filePath).toString()
// 使用包含文件路径的唯一监听器ID
const uniqueListenerId = `transfer-queue-file-progress-${filePathMd5}`
const fileProgressUrl = `${import.meta.env.VITE_API_BASE_URL}system/progress/${filePathMd5}`
const fileProgressSSE = useProgressSSE(
fileProgressUrl,
createFileProgressHandler(filePath),
uniqueListenerId,
progressActive,
)
fileProgressSSE.start()
fileProgressSSEMap.value.set(filePath, fileProgressSSE)
}
// 停止所有文件进度监听
function stopAllFileProgress() {
fileProgressSSEMap.value.forEach((sse, filePath) => {
sse.stop()
})
fileProgressSSEMap.value.clear()
fileProgressMap.value.clear()
}
// 监听队列变化自动管理文件进度SSE
watch(
dataList,
newDataList => {
// 获取当前正在运行的文件路径集合
const currentRunningFiles = new Set<string>()
newDataList.forEach(item => {
item.tasks.forEach(task => {
if (task.state === 'running') {
currentRunningFiles.add(task.fileitem.path)
}
})
})
// 获取当前已建立SSE连接的文件路径集合
const currentSSEFiles = new Set(fileProgressSSEMap.value.keys())
// 停止不再需要的SSE连接
currentSSEFiles.forEach(filePath => {
if (!currentRunningFiles.has(filePath)) {
const sse = fileProgressSSEMap.value.get(filePath)
if (sse) {
sse.stop()
fileProgressSSEMap.value.delete(filePath)
}
// 清除对应的进度数据
fileProgressMap.value.delete(filePath)
}
})
// 为新的运行中文件建立SSE连接
currentRunningFiles.forEach(filePath => {
if (!fileProgressSSEMap.value.has(filePath)) {
startFileProgress(filePath)
}
})
},
{ deep: true },
)
// 使用SSE监听加载进度
function startLoadingProgress() {
overallProgress.value.text = t('dialog.transferQueue.processing')
progressActive.value = true
}
// 停止监听加载进度
function stopLoadingProgress() {
progressEventSource.value?.close()
progressActive.value = false
// 只有在没有数据时才停止所有文件进度监听
if (dataList.value.length === 0) {
stopAllFileProgress()
}
}
// 启动定时获取队列
function startQueueTimer() {
// 清除可能存在的定时器
if (queueTimer.value) {
clearInterval(queueTimer.value)
}
// 立即执行一次
get_transfer_queue()
// 设置3秒定时器
queueTimer.value = setInterval(() => {
get_transfer_queue()
}, 3000)
}
// 停止定时获取队列
function stopQueueTimer() {
if (queueTimer.value) {
clearInterval(queueTimer.value)
queueTimer.value = null
}
}
onMounted(() => {
get_transfer_queue()
startLoadingProgress()
startQueueTimer()
})
onUnmounted(() => {
stopQueueTimer()
stopLoadingProgress()
})
</script>
<template>
<VDialog scrollable max-width="50rem" :fullscreen="!display.mdAndUp.value">
<VDialog scrollable max-width="60rem" :fullscreen="!display.mdAndUp.value">
<VCard class="mx-auto" width="100%">
<VCardItem>
<VCardTitle>{{ t('dialog.transferQueue.title') }}</VCardTitle>
</VCardItem>
<VDialogCloseBtn @click="emit('close')" />
<VDivider />
<VProgressLinear
v-if="dataList.length > 0 && progressValue > 0"
:value="progressValue"
color="primary"
indeterminate
/>
<VCardItem v-if="dataList.length > 0 && progressValue > 0" class="text-center pt-2">
<span class="text-sm">{{ progressText }}</span>
</VCardItem>
<VCardText v-if="dataList.length === 0" class="text-center"> {{ t('dialog.transferQueue.noTasks') }} </VCardText>
<VCardText>
<!-- 整体进度显示 -->
<VProgressLinear v-if="dataList.length > 0" :model-value="overallProgressComputed" color="primary" />
<VDivider v-else />
<VCardText v-if="dataList.length === 0" class="text-center">
{{ t('dialog.transferQueue.noTasks') }}
</VCardText>
<VCardText v-if="dataList.length > 0">
<VTabs v-model="activeTab" show-arrows class="v-tabs-pill" stacked>
<VTab
v-for="media in mediaList"
@@ -171,16 +313,34 @@ onUnmounted(() => {
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
<VWindowItem v-for="media in mediaList" :value="media.title_year">
<VList>
<VListItem v-for="task in activeTasks">
<VListItem v-for="task in getTasksByMedia(media.title_year || '')" :key="task.fileitem.path">
<VListItemTitle>{{ task.fileitem.name }}</VListItemTitle>
<VListItemSubtitle>
<VListItemSubtitle class="py-1">
{{ t('dialog.transferQueue.sizeTitle') }}{{ formatFileSize(task.fileitem.size || 0) }}
<VChip size="small" :color="getStateColor(task.state)" class="ms-2">
<VChip size="small" :color="getStateColor(task.state)" class="mx-2">
{{ stateDict[task.state] }}
</VChip>
</VListItemSubtitle>
<!-- 文件进度显示 -->
<div v-if="task.state === 'running' && getFileProgress(task.fileitem.path).enable" class="mt-2">
<VProgressLinear
:model-value="getFileProgress(task.fileitem.path).value"
color="success"
class="mb-1"
:height="3"
/>
<div class="text-xs text-medium-emphasis text-center">
{{ getFileProgress(task.fileitem.path).value.toFixed(1) }}%
</div>
</div>
<template #append>
<IconBtn size="small" icon="mdi-cancel" @click="remove_queue_task(task.fileitem)" />
<IconBtn
size="small"
icon="mdi-cancel"
@click="remove_queue_task(task.fileitem)"
:disabled="task.state === 'completed'"
/>
</template>
</VListItem>
</VList>

View File

@@ -4,7 +4,6 @@ import api from '@/api'
import { useToast } from 'vue-toastification'
import { useI18n } from 'vue-i18n'
// 多语言支持
const { t } = useI18n()

View File

@@ -33,20 +33,95 @@ const workflowForm = ref<Workflow>(
name: undefined,
timer: undefined,
description: undefined,
trigger_type: 'timer',
event_type: undefined,
state: 'P',
run_count: 0,
},
)
// 监听props变化处理存量数据
watch(
() => props.workflow,
newWorkflow => {
if (newWorkflow) {
// 如果trigger_type为空默认为timer
if (!newWorkflow.trigger_type) {
newWorkflow.trigger_type = 'timer'
}
workflowForm.value = { ...newWorkflow }
}
},
{ immediate: true },
)
// 事件类型列表
const eventTypes = ref<Array<{ title: string; value: string }>>([])
// 触发类型选项
const triggerTypeOptions = computed(() => [
{
title: t('dialog.workflowAddEdit.triggerTypeTimer'),
value: 'timer',
prependIcon: 'mdi-clock-outline',
},
{
title: t('dialog.workflowAddEdit.triggerTypeEvent'),
value: 'event',
prependIcon: 'mdi-calendar-check',
},
{
title: t('dialog.workflowAddEdit.triggerTypeManual'),
value: 'manual',
prependIcon: 'mdi-hand-pointing-up',
},
])
// 加载事件类型列表
async function loadEventTypes() {
try {
eventTypes.value = await api.get('workflow/event_types')
} catch (error) {
console.error('Failed to load event types:', error)
}
}
// 监听触发类型变化
watch(
() => workflowForm.value.trigger_type,
newType => {
if (newType !== 'event') {
workflowForm.value.event_type = undefined
}
},
)
// 提示框
const $toast = useToast()
// 调用API 新增任务
async function addWorkflow() {
if (!workflowForm.value.name || !workflowForm.value.timer) {
if (!workflowForm.value.name) {
$toast.error(t('dialog.workflowAddEdit.nameRequired'))
return
}
if (!workflowForm.value.trigger_type) {
$toast.error(t('dialog.workflowAddEdit.triggerRequired'))
return
}
// 根据触发类型验证必填字段
if (workflowForm.value.trigger_type === 'timer' && !workflowForm.value.timer) {
$toast.error(t('dialog.workflowAddEdit.timerRequired'))
return
}
if (workflowForm.value.trigger_type === 'event' && !workflowForm.value.event_type) {
$toast.error(t('dialog.workflowAddEdit.eventTypeRequired'))
return
}
startNProgress()
try {
const result: { [key: string]: string } = await api.post('workflow/', workflowForm.value)
@@ -64,10 +139,27 @@ async function addWorkflow() {
// 调用API 编辑任务
async function editWorkflow() {
if (!workflowForm.value.name || !workflowForm.value.timer) {
if (!workflowForm.value.name) {
$toast.error(t('dialog.workflowAddEdit.nameRequired'))
return
}
if (!workflowForm.value.trigger_type) {
$toast.error(t('dialog.workflowAddEdit.triggerRequired'))
return
}
// 根据触发类型验证必填字段
if (workflowForm.value.trigger_type === 'timer' && !workflowForm.value.timer) {
$toast.error(t('dialog.workflowAddEdit.timerRequired'))
return
}
if (workflowForm.value.trigger_type === 'event' && !workflowForm.value.event_type) {
$toast.error(t('dialog.workflowAddEdit.eventTypeRequired'))
return
}
startNProgress()
try {
const result: { [key: string]: string } = await api.put(`workflow/${workflowForm.value.id}`, workflowForm.value)
@@ -82,6 +174,11 @@ async function editWorkflow() {
}
doneNProgress()
}
// 组件挂载时加载事件类型
onMounted(() => {
loadEventTypes()
})
</script>
<template>
@@ -89,7 +186,7 @@ async function editWorkflow() {
<VCard>
<VCardItem>
<template #prepend>
<VIcon icon="mdi-clock-outline" class="me-2" />
<VIcon icon="mdi-workflow-outline" class="me-2" />
</template>
<VCardTitle>{{ title }}</VCardTitle>
</VCardItem>
@@ -109,6 +206,25 @@ async function editWorkflow() {
/>
</VCol>
<VCol cols="12">
<VSelect
v-model="workflowForm.trigger_type"
:label="t('dialog.workflowAddEdit.triggerType')"
:items="triggerTypeOptions"
item-title="title"
item-value="value"
:rules="[requiredValidator]"
prepend-inner-icon="mdi-run"
>
<template #item="{ item, props: itemProps }">
<VListItem v-bind="itemProps">
<template #prepend>
<VIcon :icon="item.raw.prependIcon" />
</template>
</VListItem>
</template>
</VSelect>
</VCol>
<VCol v-if="workflowForm.trigger_type === 'timer'" cols="12">
<VCronField
v-model="workflowForm.timer"
:label="t('dialog.workflowAddEdit.schedule')"
@@ -119,6 +235,19 @@ async function editWorkflow() {
prepend-inner-icon="mdi-clock-outline"
/>
</VCol>
<VCol v-if="workflowForm.trigger_type === 'event'" cols="12">
<VSelect
v-model="workflowForm.event_type"
:label="t('dialog.workflowAddEdit.eventType')"
:items="eventTypes"
item-title="title"
item-value="value"
:rules="[requiredValidator]"
persistent-hint
:hint="t('dialog.workflowAddEdit.eventTypePlaceholder')"
prepend-inner-icon="mdi-calendar-check"
/>
</VCol>
<VCol cols="12">
<VTextarea
v-model="workflowForm.description"

View File

@@ -0,0 +1,136 @@
<script lang="ts" setup>
import { useToast } from 'vue-toastification'
import { requiredValidator } from '@/@validators'
import api from '@/api'
import type { Workflow, WorkflowShare } from '@/api/types'
import { useDisplay } from 'vuetify'
import { useI18n } from 'vue-i18n'
// 多语言支持
const { t } = useI18n()
// 显示器宽度
const display = useDisplay()
// 输入参数
const props = defineProps({
workflow: Object as PropType<Workflow>,
})
// 定义触发的自定义事件
const emit = defineEmits(['close'])
// 分享处理状态
const shareDoing = ref(false)
// 工作流分享表单
const shareForm = ref<WorkflowShare>({
id: props.workflow?.id ?? '',
share_title: props.workflow?.name ?? '',
share_comment: '',
share_user: '',
})
// 监听props变化
watch(
() => props.workflow,
newWorkflow => {
if (newWorkflow) {
shareForm.value.id = newWorkflow.id ?? ''
shareForm.value.share_title = newWorkflow.name ?? ''
}
},
{ immediate: true },
)
// 分享工作流
async function doShare() {
if (!shareForm.value.share_title || !shareForm.value.share_comment || !shareForm.value.share_user) return
try {
shareDoing.value = true
const result: { [key: string]: any } = await api.post('workflow/share', shareForm.value)
shareDoing.value = false
// 提示
if (result.success) {
$toast.success(t('dialog.workflowShare.shareSuccess', { name: props.workflow?.name }))
// 通知父组件刷新
emit('close')
} else {
$toast.error(t('dialog.workflowShare.shareFailed', { name: props.workflow?.name, message: result.message }))
}
} catch (e) {
console.log(e)
}
}
// 提示框
const $toast = useToast()
</script>
<template>
<VDialog scrollable max-width="30rem" :fullscreen="!display.mdAndUp.value">
<VCard>
<VCardItem class="py-2">
<template #prepend>
<VIcon icon="mdi-share-outline" class="me-2" />
</template>
<VCardTitle>{{ t('dialog.workflowShare.shareWorkflow') }}</VCardTitle>
<VCardSubtitle>
{{ props.workflow?.name }}
</VCardSubtitle>
</VCardItem>
<VDivider />
<VCardText>
<VDialogCloseBtn @click="emit('close')" />
<!-- 安全警告信息 -->
<VAlert
type="warning"
variant="tonal"
class="mb-4"
:title="t('dialog.workflowShare.securityWarning')"
:text="t('dialog.workflowShare.securityWarningMessage')"
prepend-icon="mdi-alert-circle-outline"
/>
<VForm @submit.prevent="() => {}" class="pt-2">
<VRow>
<VCol cols="12">
<VTextField
v-model="shareForm.share_title"
:label="t('dialog.workflowShare.title')"
:rules="[requiredValidator]"
persistent-hint
prepend-inner-icon="mdi-format-title"
/>
</VCol>
<VCol cols="12">
<VTextarea
v-model="shareForm.share_comment"
:label="t('dialog.workflowShare.description')"
:rules="[requiredValidator]"
:hint="t('dialog.workflowShare.descriptionHint')"
persistent-hint
prepend-inner-icon="mdi-comment-text-outline"
/>
</VCol>
<VCol cols="12">
<VTextField
v-model="shareForm.share_user"
:label="t('dialog.workflowShare.shareUser')"
:rules="[requiredValidator]"
:hint="t('dialog.workflowShare.shareUserHint')"
persistent-hint
prepend-inner-icon="mdi-account-outline"
/>
</VCol>
</VRow>
</VForm>
</VCardText>
<VCardActions class="pt-3">
<VSpacer />
<VBtn :disabled="shareDoing" @click="doShare" prepend-icon="mdi-share" class="px-5" :loading="shareDoing">
{{ t('dialog.workflowShare.confirmShare') }}
</VBtn>
</VCardActions>
</VCard>
</VDialog>
</template>

View File

@@ -11,13 +11,18 @@ import ProgressDialog from '../dialog/ProgressDialog.vue'
import { useDisplay } from 'vuetify'
import MediaInfoDialog from '../dialog/MediaInfoDialog.vue'
import { useI18n } from 'vue-i18n'
import { useBackgroundOptimization } from '@/composables/useBackgroundOptimization'
import { usePWA } from '@/composables/usePWA'
// 国际化
const { t } = useI18n()
const { useProgressSSE } = useBackgroundOptimization()
// 显示器宽度
const display = useDisplay()
const { appMode } = usePWA()
// 输入参数
const inProps = defineProps({
icons: Object,
@@ -33,7 +38,6 @@ const inProps = defineProps({
required: true,
},
sort: String,
listStyle: String,
showTree: Boolean,
})
@@ -78,6 +82,9 @@ const items = ref<FileItem[]>([])
// 过滤条件
const filter = ref('')
// 是否忽略大小写
const ignoreCase = ref(true)
// 重命名弹窗
const renamePopper = ref(false)
@@ -105,15 +112,29 @@ const nameTestDialog = ref(false)
// 弹出菜单
const dropdownItems = ref<{ [key: string]: any }[]>([])
// 加载进度SSE
const progressEventSource = ref<EventSource>()
// 进度是否激活
const progressActive = ref(false)
// 通用过滤
const getFilteredItems = (type: 'dir' | 'file') => {
const filterValue = filter.value
if (!filterValue) {
return items.value.filter(item => item.type === type)
}
if (ignoreCase.value) {
const lowerCaseFilter = filterValue.toLowerCase()
return items.value.filter(item => item.type === type && item.name.toLowerCase().includes(lowerCaseFilter))
} else {
return items.value.filter(item => item.type === type && item.name.includes(filterValue))
}
}
// 目录过滤
const dirs = computed(() => items.value.filter(item => item.type === 'dir' && item.name.includes(filter.value)))
const dirs = computed(() => getFilteredItems('dir'))
// 文件过滤
const files = computed(() => items.value.filter(item => item.type === 'file' && item.name.includes(filter.value)))
const files = computed(() => getFilteredItems('file'))
// 是否文件
const isFile = computed(() => inProps.item.type == 'file')
@@ -123,6 +144,30 @@ const transferItems = ref<FileItem[]>([])
// 当前图片地址
const currentImgLink = ref('')
// 计算列表可用高度
const listAvailableHeight = computed(() => {
// 获取视口高度
const viewportHeight = window.innerHeight || document.documentElement.clientHeight
// navbar高度
const navbarHeight = 72
// 工具栏高度(包含搜索框和按钮)
const toolbarHeight = 64
// 底部导航栏高度
const footerHeight = appMode.value ? 80 : 16
// 安全区域高度
const safeAreaHeight =
parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--safe-area-inset-bottom')) ||
parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--safe-area-inset-top')) ||
0
// 计算可用高度,预留一些边距
const availableHeight = viewportHeight - navbarHeight - toolbarHeight - footerHeight - safeAreaHeight - 40
// 确保最小高度
return Math.max(availableHeight, 300)
})
// 是否为图片文件
const isImage = computed(() => {
const ext = inProps.item.path?.split('.').pop()?.toLowerCase()
@@ -530,22 +575,34 @@ async function batchScrape() {
})
}
// 进度SSE消息处理函数
function handleProgressMessage(event: MessageEvent) {
const progress = JSON.parse(event.data)
if (progress) {
progressText.value = progress.text
progressValue.value = progress.value
}
}
// 使用优化的进度SSE连接
const progressSSE = useProgressSSE(
`${import.meta.env.VITE_API_BASE_URL}system/progress/batchrename`,
handleProgressMessage,
'file-batch-rename-progress',
progressActive,
)
// 使用SSE监听加载进度
function startLoadingProgress() {
progressText.value = t('common.pleaseWait')
progressEventSource.value = new EventSource(`${import.meta.env.VITE_API_BASE_URL}system/progress/batchrename`)
progressEventSource.value.onmessage = event => {
const progress = JSON.parse(event.data)
if (progress) {
progressText.value = progress.text
progressValue.value = progress.value
}
}
progressActive.value = true
progressSSE.start()
}
// 停止监听加载进度
function stopLoadingProgress() {
progressEventSource.value?.close()
progressActive.value = false
progressSSE.stop()
}
onMounted(() => {
@@ -553,6 +610,14 @@ onMounted(() => {
})
</script>
<style scoped>
.file-list-container {
overflow: hidden auto;
block-size: 100%;
max-block-size: 100%;
}
</style>
<template>
<div>
<VCard class="d-flex flex-column w-full h-full rounded-t-0" :class="{ 'rounded-s-0': showTree }">
@@ -574,9 +639,11 @@ onMounted(() => {
rounded
/>
<VSpacer v-if="isFile" />
<IconBtn v-if="!isFile" @click="ignoreCase = !ignoreCase">
<VIcon :color="ignoreCase ? 'primary' : 'error'" icon="mdi-format-letter-case" />
</IconBtn>
<IconBtn v-if="!isFile" @click="changeSelectMode">
<VIcon color="primary" v-if="selectMode"> mdi-selection-remove </VIcon>
<VIcon color="primary" v-else>mdi-select</VIcon>
<VIcon color="primary" :icon="selectMode ? 'mdi-selection-remove' : 'mdi-select'" />
</IconBtn>
<IconBtn v-if="isFile" @click="recognize(inProps.item.path || '')">
<VIcon color="primary"> mdi-text-recognition </VIcon>
@@ -621,9 +688,12 @@ onMounted(() => {
<VImg :src="currentImgLink" max-width="100%" max-height="100%" />
</VCardText>
<!-- 目录和文件列表 -->
<VCardText v-else-if="dirs.length || files.length" class="p-0">
<VList class="text-high-emphasis">
<VVirtualScroll :items="[...dirs, ...files]" :style="listStyle">
<VCardText v-else-if="dirs.length || files.length" class="p-0 flex-grow-1 overflow-hidden">
<VList
class="text-high-emphasis file-list-container"
:style="{ height: `${listAvailableHeight}px`, maxHeight: `${listAvailableHeight}px` }"
>
<VVirtualScroll :items="[...dirs, ...files]" style="block-size: 100%">
<template #default="{ item }">
<VHover>
<template #default="hover">

View File

@@ -4,6 +4,7 @@ import type { FileItem } from '@/api/types'
import { useDisplay } from 'vuetify'
import type { AxiosRequestConfig } from 'axios'
import { useI18n } from 'vue-i18n'
import { usePWA } from '@/composables/usePWA'
// 国际化
const { t } = useI18n()
@@ -11,6 +12,32 @@ const { t } = useI18n()
// 显示器宽度
const display = useDisplay()
const { appMode } = usePWA()
// 计算列表可用高度
const availableHeight = computed(() => {
// 获取视口高度
const viewportHeight = window.innerHeight || document.documentElement.clientHeight
// navbar高度
const navbarHeight = 72
// 工具栏高度
const toolbarHeight = 25
// 底部导航栏高度
const footerHeight = appMode.value ? 80 : 16
// 安全区域高度
const safeAreaHeight =
parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--safe-area-inset-bottom')) ||
parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--safe-area-inset-top')) ||
0
// 计算可用高度,预留一些边距
const availableHeight = viewportHeight - navbarHeight - toolbarHeight - footerHeight - safeAreaHeight - 40
// 确保最小高度
return Math.max(availableHeight, 300)
})
// 输入参数
const props = defineProps({
storage: {
@@ -125,11 +152,6 @@ async function loadRootDirectories() {
await loadSubdirectories('/')
}
// 获取目录层级深度
function getDirectoryDepth(path: string) {
return path.split('/').filter(p => p).length
}
// 检索所有目录节点
function getAllDirectories() {
const allDirs: { dir: FileItem; level: number; parentPath: string }[] = []
@@ -227,11 +249,6 @@ const flattenedDirectories = computed(() => {
return getAllDirectories()
})
// 组件挂载时初始加载
onMounted(async () => {
await loadRootDirectories()
})
// 检查路径是否为指定目录的子目录或后代
function isChildOrDescendant(path: string, ancestorPath: string) {
if (!path || !ancestorPath) return false
@@ -260,10 +277,19 @@ function getIndentLevel(path: string, ancestorPath: string) {
return pathParts - ancestorParts
}
// 组件挂载时初始加载
onMounted(async () => {
await loadRootDirectories()
})
onActivated(() => {
updateHeight()
})
</script>
<template>
<VCard class="file-navigator rounded-e-0 rounded-t-0" v-if="!isMobile">
<VCard class="file-navigator rounded-e-0 rounded-t-0" v-if="!isMobile" :height="`${availableHeight}px`">
<div class="tree-container">
<!-- 根目录项 -->
<div

View File

@@ -10,7 +10,6 @@ const props = defineProps({
root: {
type: String,
default: '/',
required: true,
},
storage: {
type: String,

View File

@@ -91,10 +91,6 @@ onUnmounted(() => {
<!-- Vue 渲染模式 -->
<div v-if="pluginRenderMode === 'vue'">
<component :is="dynamicPluginComponent" :config="props.config" :allow-refresh="props.allowRefresh" :api="api" />
<!-- Vue 模式下也可以显示拖拽句柄 -->
<div class="absolute right-5 top-5">
<VIcon class="cursor-move">mdi-drag</VIcon>
</div>
</div>
<!-- Vuetify 渲染模式 -->
<VHover v-else-if="pluginRenderMode === 'vuetify'">

View File

@@ -179,15 +179,15 @@ onActivated(() => {
<style lang="scss" scoped>
.slider-container {
position: relative;
margin-block-end: 24px;
margin-block-end: 8px;
}
.slider-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-block-end: 12px;
gap: 8px;
margin-block-end: 8px;
padding-block: 0;
padding-inline: 8px;
@@ -260,6 +260,7 @@ onActivated(() => {
inset-block-start: 50%;
opacity: 0;
pointer-events: none;
text-shadow: 0 1px 2px rgba(0, 0, 0, 10%);
transform: translateY(-50%);
transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s ease,
box-shadow 0.3s ease, border-color 0.3s ease;

View File

@@ -132,6 +132,7 @@ onMounted(() => {
multiple
outlined
dense
clearable
/>
</VCol>
</VRow>

Some files were not shown because too many files have changed in this diff Show More