mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-09 09:40:14 +08:00
Compare commits
295 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5fe39b2d2 | ||
|
|
51beb53f51 | ||
|
|
9d3f03c83a | ||
|
|
3eda1e4ef7 | ||
|
|
7181f83d66 | ||
|
|
fffad6e1b8 | ||
|
|
7f3906e5cb | ||
|
|
f836d175f0 | ||
|
|
f49cafc0cc | ||
|
|
a3ecad3436 | ||
|
|
a019dbd44e | ||
|
|
b316f960a1 | ||
|
|
d049b26825 | ||
|
|
852579c6ee | ||
|
|
5adcfa1877 | ||
|
|
f74458629e | ||
|
|
798f9249f8 | ||
|
|
6b4383643f | ||
|
|
256e8d0452 | ||
|
|
4112214c1f | ||
|
|
c183158ffe | ||
|
|
d523790c0f | ||
|
|
615ce34a72 | ||
|
|
1d59b3566c | ||
|
|
8071b90a2b | ||
|
|
8966584ca0 | ||
|
|
822711a530 | ||
|
|
1fe8aeb9e1 | ||
|
|
f021ba8a98 | ||
|
|
e4af05cd56 | ||
|
|
43d1cdb91c | ||
|
|
ed3f66681f | ||
|
|
c718d57e77 | ||
|
|
ce2e88a532 | ||
|
|
e60015a477 | ||
|
|
761e3ac76d | ||
|
|
2cf5535376 | ||
|
|
1a3d76d7b9 | ||
|
|
942a536289 | ||
|
|
fb1f6abf2e | ||
|
|
61ecb421e6 | ||
|
|
0098f9db2f | ||
|
|
2a348a7f18 | ||
|
|
838dff4758 | ||
|
|
7fb78a86ba | ||
|
|
07c815e943 | ||
|
|
9a4392eceb | ||
|
|
dc25e457eb | ||
|
|
d65ed9725c | ||
|
|
41ce095505 | ||
|
|
0e2290ce8a | ||
|
|
1b8db5b7f1 | ||
|
|
0cb42c1117 | ||
|
|
a289fe3da5 | ||
|
|
f53192cfa2 | ||
|
|
235e014542 | ||
|
|
211b05c643 | ||
|
|
3e1bd687f1 | ||
|
|
072fb01a04 | ||
|
|
81fbf4f5ba | ||
|
|
88c86f49bf | ||
|
|
3023214072 | ||
|
|
6ea6f89ab2 | ||
|
|
43c6672ab1 | ||
|
|
5cb56127d5 | ||
|
|
afa333243f | ||
|
|
047e99e27c | ||
|
|
eef6f37ace | ||
|
|
e8ede6e606 | ||
|
|
bfb4ea4123 | ||
|
|
51b0403f64 | ||
|
|
a5cd396de6 | ||
|
|
754bc3d3c9 | ||
|
|
07a2bcfb97 | ||
|
|
20222201ae | ||
|
|
a2a5ddd66c | ||
|
|
7bfc7602a7 | ||
|
|
b52b2cedad | ||
|
|
e93df6ba2c | ||
|
|
f9f29ccc3c | ||
|
|
3bd63ab7c8 | ||
|
|
301ea445bb | ||
|
|
475bee28c6 | ||
|
|
cd69920b41 | ||
|
|
83aab4e47d | ||
|
|
e12093c966 | ||
|
|
f21d546d18 | ||
|
|
26c8a6ba43 | ||
|
|
827bb8ba69 | ||
|
|
d1d2ef37d2 | ||
|
|
659594898b | ||
|
|
7569401fe0 | ||
|
|
dc9c86273d | ||
|
|
0e816e678a | ||
|
|
ff1c2a890c | ||
|
|
b802ad8a75 | ||
|
|
c11fb54b0b | ||
|
|
856dec3991 | ||
|
|
1d8c71da3f | ||
|
|
4152d0f715 | ||
|
|
0ead8cc052 | ||
|
|
2b5ecf3f8a | ||
|
|
de7aeeaeb3 | ||
|
|
994c52f6aa | ||
|
|
c6eb744257 | ||
|
|
4f462c5cfd | ||
|
|
60850970a8 | ||
|
|
3b2d5e45bb | ||
|
|
a604d3223a | ||
|
|
00bd1c45a1 | ||
|
|
4bc6dc7af7 | ||
|
|
3a8effd01f | ||
|
|
da67088e9c | ||
|
|
bacd4d23a3 | ||
|
|
020f667749 | ||
|
|
84652e8c82 | ||
|
|
565ebd936e | ||
|
|
3af127c66f | ||
|
|
849bb04249 | ||
|
|
09d647877f | ||
|
|
c868afbcbf | ||
|
|
3f033bfdec | ||
|
|
eca2f43e0e | ||
|
|
eeb17040f7 | ||
|
|
11dee1ed62 | ||
|
|
11a6232f83 | ||
|
|
9eded24e0e | ||
|
|
7548882148 | ||
|
|
4ad89955d4 | ||
|
|
a53553d658 | ||
|
|
2602cb0998 | ||
|
|
e402de29d5 | ||
|
|
a4cc1cc615 | ||
|
|
2d900baad1 | ||
|
|
17d6f6db05 | ||
|
|
7f3ba543b7 | ||
|
|
b33cb8a12c | ||
|
|
cfa8b78c2e | ||
|
|
4024daf189 | ||
|
|
77d7c3bb61 | ||
|
|
868ad57e12 | ||
|
|
eaf9724295 | ||
|
|
30e98de38a | ||
|
|
79c606370c | ||
|
|
b70597b5f5 | ||
|
|
a469282730 | ||
|
|
c3708360fa | ||
|
|
80f0560e0f | ||
|
|
84951cdc44 | ||
|
|
a72cb797ab | ||
|
|
6898e6b816 | ||
|
|
adb0b966ff | ||
|
|
81284b8d21 | ||
|
|
1a2b112e64 | ||
|
|
442c484dc9 | ||
|
|
2368c2f25f | ||
|
|
2320c58254 | ||
|
|
c9a4f36414 | ||
|
|
1df9a981b2 | ||
|
|
cbc917b834 | ||
|
|
240a568d16 | ||
|
|
eb1a847faa | ||
|
|
e09e57879b | ||
|
|
ddd2982971 | ||
|
|
621da7e4ef | ||
|
|
420827c389 | ||
|
|
ce9399b894 | ||
|
|
1bdd08c59a | ||
|
|
52d62dda81 | ||
|
|
d69e3cedae | ||
|
|
648bfcdd0d | ||
|
|
e4b8ff0a64 | ||
|
|
4576ef854d | ||
|
|
7323668db5 | ||
|
|
b11d709070 | ||
|
|
e25ac006c2 | ||
|
|
9e85e7edce | ||
|
|
804bcd440c | ||
|
|
6e4c896cb7 | ||
|
|
0cae89f8e3 | ||
|
|
59a7607c07 | ||
|
|
6dca0c157f | ||
|
|
d2aa5a64aa | ||
|
|
2620a55c5a | ||
|
|
14e33215f8 | ||
|
|
6862c2a744 | ||
|
|
fb215e8d87 | ||
|
|
f52ad2151b | ||
|
|
1a47b7d09d | ||
|
|
f292071a34 | ||
|
|
dd616d29e8 | ||
|
|
0509f18d66 | ||
|
|
f59fb119e4 | ||
|
|
46127cac1f | ||
|
|
c1abf76211 | ||
|
|
fe5b45d48d | ||
|
|
10ac1ebf7b | ||
|
|
e5d8144510 | ||
|
|
f9a65fba7a | ||
|
|
9b4138349b | ||
|
|
db9c9db5a9 | ||
|
|
24e992339f | ||
|
|
f26d1babf7 | ||
|
|
de3347cea1 | ||
|
|
e900fac4bd | ||
|
|
396218a467 | ||
|
|
d3a66ffa8c | ||
|
|
1e7ffb4c2e | ||
|
|
3df5d4c690 | ||
|
|
02a8331996 | ||
|
|
a29ad6a091 | ||
|
|
3ef1e65412 | ||
|
|
2deaec1fc6 | ||
|
|
c9b0b23d36 | ||
|
|
f06cca4ead | ||
|
|
a1990ce3e4 | ||
|
|
cbbf023030 | ||
|
|
307aa724eb | ||
|
|
cd6f37d80f | ||
|
|
b903134770 | ||
|
|
11effdd297 | ||
|
|
8873d8372d | ||
|
|
964aa29d12 | ||
|
|
b45a3c6539 | ||
|
|
b72b7ad0fb | ||
|
|
0e3106d8c1 | ||
|
|
71a6626fa9 | ||
|
|
68006bac88 | ||
|
|
34cbcc38a6 | ||
|
|
f4daee85c7 | ||
|
|
dd347039b5 | ||
|
|
0c9367d58a | ||
|
|
af10c4f1c3 | ||
|
|
52fbeda941 | ||
|
|
ace23af363 | ||
|
|
a097d89d68 | ||
|
|
77cb817523 | ||
|
|
c956e271a2 | ||
|
|
6413f30d18 | ||
|
|
789e748df0 | ||
|
|
c89edae375 | ||
|
|
f4dca4922b | ||
|
|
73b9ef5ee7 | ||
|
|
462742961a | ||
|
|
5a647fabfa | ||
|
|
2580ceac20 | ||
|
|
6905391785 | ||
|
|
7406226e68 | ||
|
|
af9ee00ad3 | ||
|
|
01f63a4b6b | ||
|
|
45e48755d3 | ||
|
|
f6c740738f | ||
|
|
29780cd4b7 | ||
|
|
a050b7c7d5 | ||
|
|
1f25387f81 | ||
|
|
36fb7b53ba | ||
|
|
354295ffda | ||
|
|
4f28018f4f | ||
|
|
5d37666bea | ||
|
|
705e81db7f | ||
|
|
57d5859727 | ||
|
|
06387ab33e | ||
|
|
5f0c3b3639 | ||
|
|
414fb8afd1 | ||
|
|
58fbaaa8f4 | ||
|
|
040790a672 | ||
|
|
bf36e39f3b | ||
|
|
a780946915 | ||
|
|
1d537c2799 | ||
|
|
6a3e383f30 | ||
|
|
cb72c6b586 | ||
|
|
384e1a63b3 | ||
|
|
e6357d0a54 | ||
|
|
a0ebb42e1e | ||
|
|
324fec8f94 | ||
|
|
226efc3d85 | ||
|
|
e785997d99 | ||
|
|
7998b51e6b | ||
|
|
e54384fcd7 | ||
|
|
39946cad1b | ||
|
|
6041ae9344 | ||
|
|
dc9fda8d86 | ||
|
|
7dd3877955 | ||
|
|
5386fc54ff | ||
|
|
c3839f092f | ||
|
|
4c8207ef9a | ||
|
|
539a7de1ad | ||
|
|
935b2c4edb | ||
|
|
e1a03166b0 | ||
|
|
c7be304085 | ||
|
|
2f8c815053 | ||
|
|
249e1c6ebd | ||
|
|
22c97d1c01 | ||
|
|
ff3d45ec91 | ||
|
|
4caf671e1c |
45
.github/ISSUE_TEMPLATE/rfc.yml
vendored
Normal file
45
.github/ISSUE_TEMPLATE/rfc.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
name: 功能提案
|
||||||
|
description: Request for Comments
|
||||||
|
title: '[RFC]'
|
||||||
|
labels: ['RFC']
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
一份提案(RFC)定位为 **「在某功能/重构的具体开发前,用于开发者间 review 技术设计/方案的文档」**,
|
||||||
|
目的是让协作的开发者间清晰的知道「要做什么」和「具体会怎么做」,以及所有的开发者都能公开透明的参与讨论;
|
||||||
|
以便评估和讨论产生的影响 (遗漏的考虑、向后兼容性、与现有功能的冲突),
|
||||||
|
因此提案侧重在对解决问题的 **方案、设计、步骤** 的描述上。
|
||||||
|
|
||||||
|
如果仅希望讨论是否添加或改进某功能本身,请使用 -> [Issue: 功能改进](https://github.com/jxxghp/MoviePilot/issues/new?assignees=&labels=feature+request&projects=&template=feature_request.yml&title=%5BFeature+Request%5D%3A+)
|
||||||
|
- type: textarea
|
||||||
|
id: background
|
||||||
|
attributes:
|
||||||
|
label: 背景 or 问题
|
||||||
|
description: 简单描述遇到的什么问题或需要改动什么。可以引用其他 issue、讨论、文档等。
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: goal
|
||||||
|
attributes:
|
||||||
|
label: '目标 & 方案简述'
|
||||||
|
description: 简单描述提案此提案实现后,**预期的目标效果**,以及简单大致描述会采取的方案/步骤,可能会/不会产生什么影响。
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: design
|
||||||
|
attributes:
|
||||||
|
label: '方案设计 & 实现步骤'
|
||||||
|
description: |
|
||||||
|
详细描述你设计的具体方案,可以考虑拆分列表或要点,一步步描述具体打算如何实现的步骤和相关细节。
|
||||||
|
这部份不需要一次性写完整,即使在创建完此提案 issue 后,依旧可以再次编辑修改。
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: alternative
|
||||||
|
attributes:
|
||||||
|
label: '替代方案 & 对比'
|
||||||
|
description: |
|
||||||
|
[可选] 为来实现目标效果,还考虑过什么其他方案,有什么对比?
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
327
auto-imports.d.ts
vendored
327
auto-imports.d.ts
vendored
@@ -3,6 +3,7 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
// noinspection JSUnusedGlobalSymbols
|
// noinspection JSUnusedGlobalSymbols
|
||||||
// Generated by unplugin-auto-import
|
// Generated by unplugin-auto-import
|
||||||
|
// biome-ignore lint: disable
|
||||||
export {}
|
export {}
|
||||||
declare global {
|
declare global {
|
||||||
const EffectScope: typeof import('vue')['EffectScope']
|
const EffectScope: typeof import('vue')['EffectScope']
|
||||||
@@ -66,6 +67,7 @@ declare global {
|
|||||||
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
||||||
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
|
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
|
||||||
const onDeactivated: typeof import('vue')['onDeactivated']
|
const onDeactivated: typeof import('vue')['onDeactivated']
|
||||||
|
const onElementRemoval: typeof import('@vueuse/core')['onElementRemoval']
|
||||||
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
||||||
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
|
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
|
||||||
const onLongPress: typeof import('@vueuse/core')['onLongPress']
|
const onLongPress: typeof import('@vueuse/core')['onLongPress']
|
||||||
@@ -77,6 +79,7 @@ declare global {
|
|||||||
const onStartTyping: typeof import('@vueuse/core')['onStartTyping']
|
const onStartTyping: typeof import('@vueuse/core')['onStartTyping']
|
||||||
const onUnmounted: typeof import('vue')['onUnmounted']
|
const onUnmounted: typeof import('vue')['onUnmounted']
|
||||||
const onUpdated: typeof import('vue')['onUpdated']
|
const onUpdated: typeof import('vue')['onUpdated']
|
||||||
|
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
|
||||||
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
|
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
|
||||||
const provide: typeof import('vue')['provide']
|
const provide: typeof import('vue')['provide']
|
||||||
const provideLocal: typeof import('@vueuse/core')['provideLocal']
|
const provideLocal: typeof import('@vueuse/core')['provideLocal']
|
||||||
@@ -190,6 +193,7 @@ declare global {
|
|||||||
const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
|
const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
|
||||||
const useGamepad: typeof import('@vueuse/core')['useGamepad']
|
const useGamepad: typeof import('@vueuse/core')['useGamepad']
|
||||||
const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
|
const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
|
||||||
|
const useId: typeof import('vue')['useId']
|
||||||
const useIdle: typeof import('@vueuse/core')['useIdle']
|
const useIdle: typeof import('@vueuse/core')['useIdle']
|
||||||
const useImage: typeof import('@vueuse/core')['useImage']
|
const useImage: typeof import('@vueuse/core')['useImage']
|
||||||
const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
|
const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
|
||||||
@@ -209,6 +213,7 @@ declare global {
|
|||||||
const useMemoize: typeof import('@vueuse/core')['useMemoize']
|
const useMemoize: typeof import('@vueuse/core')['useMemoize']
|
||||||
const useMemory: typeof import('@vueuse/core')['useMemory']
|
const useMemory: typeof import('@vueuse/core')['useMemory']
|
||||||
const useMin: typeof import('@vueuse/math')['useMin']
|
const useMin: typeof import('@vueuse/math')['useMin']
|
||||||
|
const useModel: typeof import('vue')['useModel']
|
||||||
const useMounted: typeof import('@vueuse/core')['useMounted']
|
const useMounted: typeof import('@vueuse/core')['useMounted']
|
||||||
const useMouse: typeof import('@vueuse/core')['useMouse']
|
const useMouse: typeof import('@vueuse/core')['useMouse']
|
||||||
const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
|
const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
|
||||||
@@ -234,6 +239,7 @@ declare global {
|
|||||||
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
|
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
|
||||||
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
|
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
|
||||||
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
|
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
|
||||||
|
const usePreferredReducedTransparency: typeof import('@vueuse/core')['usePreferredReducedTransparency']
|
||||||
const usePrevious: typeof import('@vueuse/core')['usePrevious']
|
const usePrevious: typeof import('@vueuse/core')['usePrevious']
|
||||||
const useProjection: typeof import('@vueuse/math')['useProjection']
|
const useProjection: typeof import('@vueuse/math')['useProjection']
|
||||||
const useRafFn: typeof import('@vueuse/core')['useRafFn']
|
const useRafFn: typeof import('@vueuse/core')['useRafFn']
|
||||||
@@ -242,6 +248,7 @@ declare global {
|
|||||||
const useRound: typeof import('@vueuse/math')['useRound']
|
const useRound: typeof import('@vueuse/math')['useRound']
|
||||||
const useRoute: typeof import('vue-router')['useRoute']
|
const useRoute: typeof import('vue-router')['useRoute']
|
||||||
const useRouter: typeof import('vue-router')['useRouter']
|
const useRouter: typeof import('vue-router')['useRouter']
|
||||||
|
const useSSRWidth: typeof import('@vueuse/core')['useSSRWidth']
|
||||||
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
|
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
|
||||||
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
|
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
|
||||||
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
|
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
|
||||||
@@ -261,6 +268,7 @@ declare global {
|
|||||||
const useSum: typeof import('@vueuse/math')['useSum']
|
const useSum: typeof import('@vueuse/math')['useSum']
|
||||||
const useSupported: typeof import('@vueuse/core')['useSupported']
|
const useSupported: typeof import('@vueuse/core')['useSupported']
|
||||||
const useSwipe: typeof import('@vueuse/core')['useSwipe']
|
const useSwipe: typeof import('@vueuse/core')['useSwipe']
|
||||||
|
const useTemplateRef: typeof import('vue')['useTemplateRef']
|
||||||
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
|
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
|
||||||
const useTextDirection: typeof import('@vueuse/core')['useTextDirection']
|
const useTextDirection: typeof import('@vueuse/core')['useTextDirection']
|
||||||
const useTextSelection: typeof import('@vueuse/core')['useTextSelection']
|
const useTextSelection: typeof import('@vueuse/core')['useTextSelection']
|
||||||
@@ -313,9 +321,10 @@ declare global {
|
|||||||
// for type re-export
|
// for type re-export
|
||||||
declare global {
|
declare global {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
|
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
|
||||||
import('vue')
|
import('vue')
|
||||||
}
|
}
|
||||||
|
|
||||||
// for vue template auto import
|
// for vue template auto import
|
||||||
import { UnwrapRef } from 'vue'
|
import { UnwrapRef } from 'vue'
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
@@ -382,6 +391,7 @@ declare module 'vue' {
|
|||||||
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
|
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
|
||||||
readonly onClickOutside: UnwrapRef<typeof import('@vueuse/core')['onClickOutside']>
|
readonly onClickOutside: UnwrapRef<typeof import('@vueuse/core')['onClickOutside']>
|
||||||
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
|
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
|
||||||
|
readonly onElementRemoval: UnwrapRef<typeof import('@vueuse/core')['onElementRemoval']>
|
||||||
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
|
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
|
||||||
readonly onKeyStroke: UnwrapRef<typeof import('@vueuse/core')['onKeyStroke']>
|
readonly onKeyStroke: UnwrapRef<typeof import('@vueuse/core')['onKeyStroke']>
|
||||||
readonly onLongPress: UnwrapRef<typeof import('@vueuse/core')['onLongPress']>
|
readonly onLongPress: UnwrapRef<typeof import('@vueuse/core')['onLongPress']>
|
||||||
@@ -393,6 +403,7 @@ declare module 'vue' {
|
|||||||
readonly onStartTyping: UnwrapRef<typeof import('@vueuse/core')['onStartTyping']>
|
readonly onStartTyping: UnwrapRef<typeof import('@vueuse/core')['onStartTyping']>
|
||||||
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
|
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
|
||||||
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
|
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
|
||||||
|
readonly onWatcherCleanup: UnwrapRef<typeof import('vue')['onWatcherCleanup']>
|
||||||
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
|
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
|
||||||
readonly provide: UnwrapRef<typeof import('vue')['provide']>
|
readonly provide: UnwrapRef<typeof import('vue')['provide']>
|
||||||
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
|
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
|
||||||
@@ -506,6 +517,7 @@ declare module 'vue' {
|
|||||||
readonly useFullscreen: UnwrapRef<typeof import('@vueuse/core')['useFullscreen']>
|
readonly useFullscreen: UnwrapRef<typeof import('@vueuse/core')['useFullscreen']>
|
||||||
readonly useGamepad: UnwrapRef<typeof import('@vueuse/core')['useGamepad']>
|
readonly useGamepad: UnwrapRef<typeof import('@vueuse/core')['useGamepad']>
|
||||||
readonly useGeolocation: UnwrapRef<typeof import('@vueuse/core')['useGeolocation']>
|
readonly useGeolocation: UnwrapRef<typeof import('@vueuse/core')['useGeolocation']>
|
||||||
|
readonly useId: UnwrapRef<typeof import('vue')['useId']>
|
||||||
readonly useIdle: UnwrapRef<typeof import('@vueuse/core')['useIdle']>
|
readonly useIdle: UnwrapRef<typeof import('@vueuse/core')['useIdle']>
|
||||||
readonly useImage: UnwrapRef<typeof import('@vueuse/core')['useImage']>
|
readonly useImage: UnwrapRef<typeof import('@vueuse/core')['useImage']>
|
||||||
readonly useInfiniteScroll: UnwrapRef<typeof import('@vueuse/core')['useInfiniteScroll']>
|
readonly useInfiniteScroll: UnwrapRef<typeof import('@vueuse/core')['useInfiniteScroll']>
|
||||||
@@ -525,6 +537,7 @@ declare module 'vue' {
|
|||||||
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
|
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
|
||||||
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
|
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
|
||||||
readonly useMin: UnwrapRef<typeof import('@vueuse/math')['useMin']>
|
readonly useMin: UnwrapRef<typeof import('@vueuse/math')['useMin']>
|
||||||
|
readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
|
||||||
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
|
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
|
||||||
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
|
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
|
||||||
readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
|
readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
|
||||||
@@ -550,6 +563,7 @@ declare module 'vue' {
|
|||||||
readonly usePreferredDark: UnwrapRef<typeof import('@vueuse/core')['usePreferredDark']>
|
readonly usePreferredDark: UnwrapRef<typeof import('@vueuse/core')['usePreferredDark']>
|
||||||
readonly usePreferredLanguages: UnwrapRef<typeof import('@vueuse/core')['usePreferredLanguages']>
|
readonly usePreferredLanguages: UnwrapRef<typeof import('@vueuse/core')['usePreferredLanguages']>
|
||||||
readonly usePreferredReducedMotion: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedMotion']>
|
readonly usePreferredReducedMotion: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedMotion']>
|
||||||
|
readonly usePreferredReducedTransparency: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedTransparency']>
|
||||||
readonly usePrevious: UnwrapRef<typeof import('@vueuse/core')['usePrevious']>
|
readonly usePrevious: UnwrapRef<typeof import('@vueuse/core')['usePrevious']>
|
||||||
readonly useProjection: UnwrapRef<typeof import('@vueuse/math')['useProjection']>
|
readonly useProjection: UnwrapRef<typeof import('@vueuse/math')['useProjection']>
|
||||||
readonly useRafFn: UnwrapRef<typeof import('@vueuse/core')['useRafFn']>
|
readonly useRafFn: UnwrapRef<typeof import('@vueuse/core')['useRafFn']>
|
||||||
@@ -558,6 +572,7 @@ declare module 'vue' {
|
|||||||
readonly useRound: UnwrapRef<typeof import('@vueuse/math')['useRound']>
|
readonly useRound: UnwrapRef<typeof import('@vueuse/math')['useRound']>
|
||||||
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
|
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
|
||||||
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
|
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
|
||||||
|
readonly useSSRWidth: UnwrapRef<typeof import('@vueuse/core')['useSSRWidth']>
|
||||||
readonly useScreenOrientation: UnwrapRef<typeof import('@vueuse/core')['useScreenOrientation']>
|
readonly useScreenOrientation: UnwrapRef<typeof import('@vueuse/core')['useScreenOrientation']>
|
||||||
readonly useScreenSafeArea: UnwrapRef<typeof import('@vueuse/core')['useScreenSafeArea']>
|
readonly useScreenSafeArea: UnwrapRef<typeof import('@vueuse/core')['useScreenSafeArea']>
|
||||||
readonly useScriptTag: UnwrapRef<typeof import('@vueuse/core')['useScriptTag']>
|
readonly useScriptTag: UnwrapRef<typeof import('@vueuse/core')['useScriptTag']>
|
||||||
@@ -577,315 +592,7 @@ declare module 'vue' {
|
|||||||
readonly useSum: UnwrapRef<typeof import('@vueuse/math')['useSum']>
|
readonly useSum: UnwrapRef<typeof import('@vueuse/math')['useSum']>
|
||||||
readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
|
readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
|
||||||
readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
|
readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
|
||||||
readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
|
readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
|
||||||
readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
|
|
||||||
readonly useTextSelection: UnwrapRef<typeof import('@vueuse/core')['useTextSelection']>
|
|
||||||
readonly useTextareaAutosize: UnwrapRef<typeof import('@vueuse/core')['useTextareaAutosize']>
|
|
||||||
readonly useThrottle: UnwrapRef<typeof import('@vueuse/core')['useThrottle']>
|
|
||||||
readonly useThrottleFn: UnwrapRef<typeof import('@vueuse/core')['useThrottleFn']>
|
|
||||||
readonly useThrottledRefHistory: UnwrapRef<typeof import('@vueuse/core')['useThrottledRefHistory']>
|
|
||||||
readonly useTimeAgo: UnwrapRef<typeof import('@vueuse/core')['useTimeAgo']>
|
|
||||||
readonly useTimeout: UnwrapRef<typeof import('@vueuse/core')['useTimeout']>
|
|
||||||
readonly useTimeoutFn: UnwrapRef<typeof import('@vueuse/core')['useTimeoutFn']>
|
|
||||||
readonly useTimeoutPoll: UnwrapRef<typeof import('@vueuse/core')['useTimeoutPoll']>
|
|
||||||
readonly useTimestamp: UnwrapRef<typeof import('@vueuse/core')['useTimestamp']>
|
|
||||||
readonly useTitle: UnwrapRef<typeof import('@vueuse/core')['useTitle']>
|
|
||||||
readonly useToNumber: UnwrapRef<typeof import('@vueuse/core')['useToNumber']>
|
|
||||||
readonly useToString: UnwrapRef<typeof import('@vueuse/core')['useToString']>
|
|
||||||
readonly useToggle: UnwrapRef<typeof import('@vueuse/core')['useToggle']>
|
|
||||||
readonly useTransition: UnwrapRef<typeof import('@vueuse/core')['useTransition']>
|
|
||||||
readonly useTrunc: UnwrapRef<typeof import('@vueuse/math')['useTrunc']>
|
|
||||||
readonly useUrlSearchParams: UnwrapRef<typeof import('@vueuse/core')['useUrlSearchParams']>
|
|
||||||
readonly useUserMedia: UnwrapRef<typeof import('@vueuse/core')['useUserMedia']>
|
|
||||||
readonly useVModel: UnwrapRef<typeof import('@vueuse/core')['useVModel']>
|
|
||||||
readonly useVModels: UnwrapRef<typeof import('@vueuse/core')['useVModels']>
|
|
||||||
readonly useVibrate: UnwrapRef<typeof import('@vueuse/core')['useVibrate']>
|
|
||||||
readonly useVirtualList: UnwrapRef<typeof import('@vueuse/core')['useVirtualList']>
|
|
||||||
readonly useWakeLock: UnwrapRef<typeof import('@vueuse/core')['useWakeLock']>
|
|
||||||
readonly useWebNotification: UnwrapRef<typeof import('@vueuse/core')['useWebNotification']>
|
|
||||||
readonly useWebSocket: UnwrapRef<typeof import('@vueuse/core')['useWebSocket']>
|
|
||||||
readonly useWebWorker: UnwrapRef<typeof import('@vueuse/core')['useWebWorker']>
|
|
||||||
readonly useWebWorkerFn: UnwrapRef<typeof import('@vueuse/core')['useWebWorkerFn']>
|
|
||||||
readonly useWindowFocus: UnwrapRef<typeof import('@vueuse/core')['useWindowFocus']>
|
|
||||||
readonly useWindowScroll: UnwrapRef<typeof import('@vueuse/core')['useWindowScroll']>
|
|
||||||
readonly useWindowSize: UnwrapRef<typeof import('@vueuse/core')['useWindowSize']>
|
|
||||||
readonly watch: UnwrapRef<typeof import('vue')['watch']>
|
|
||||||
readonly watchArray: UnwrapRef<typeof import('@vueuse/core')['watchArray']>
|
|
||||||
readonly watchAtMost: UnwrapRef<typeof import('@vueuse/core')['watchAtMost']>
|
|
||||||
readonly watchDebounced: UnwrapRef<typeof import('@vueuse/core')['watchDebounced']>
|
|
||||||
readonly watchDeep: UnwrapRef<typeof import('@vueuse/core')['watchDeep']>
|
|
||||||
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
|
|
||||||
readonly watchIgnorable: UnwrapRef<typeof import('@vueuse/core')['watchIgnorable']>
|
|
||||||
readonly watchImmediate: UnwrapRef<typeof import('@vueuse/core')['watchImmediate']>
|
|
||||||
readonly watchOnce: UnwrapRef<typeof import('@vueuse/core')['watchOnce']>
|
|
||||||
readonly watchPausable: UnwrapRef<typeof import('@vueuse/core')['watchPausable']>
|
|
||||||
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
|
|
||||||
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
|
|
||||||
readonly watchThrottled: UnwrapRef<typeof import('@vueuse/core')['watchThrottled']>
|
|
||||||
readonly watchTriggerable: UnwrapRef<typeof import('@vueuse/core')['watchTriggerable']>
|
|
||||||
readonly watchWithFilter: UnwrapRef<typeof import('@vueuse/core')['watchWithFilter']>
|
|
||||||
readonly whenever: UnwrapRef<typeof import('@vueuse/core')['whenever']>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module '@vue/runtime-core' {
|
|
||||||
interface GlobalComponents {}
|
|
||||||
interface ComponentCustomProperties {
|
|
||||||
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
|
||||||
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
|
|
||||||
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
|
|
||||||
readonly computed: UnwrapRef<typeof import('vue')['computed']>
|
|
||||||
readonly computedAsync: UnwrapRef<typeof import('@vueuse/core')['computedAsync']>
|
|
||||||
readonly computedEager: UnwrapRef<typeof import('@vueuse/core')['computedEager']>
|
|
||||||
readonly computedInject: UnwrapRef<typeof import('@vueuse/core')['computedInject']>
|
|
||||||
readonly computedWithControl: UnwrapRef<typeof import('@vueuse/core')['computedWithControl']>
|
|
||||||
readonly controlledComputed: UnwrapRef<typeof import('@vueuse/core')['controlledComputed']>
|
|
||||||
readonly controlledRef: UnwrapRef<typeof import('@vueuse/core')['controlledRef']>
|
|
||||||
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
|
|
||||||
readonly createEventHook: UnwrapRef<typeof import('@vueuse/core')['createEventHook']>
|
|
||||||
readonly createGenericProjection: UnwrapRef<typeof import('@vueuse/math')['createGenericProjection']>
|
|
||||||
readonly createGlobalState: UnwrapRef<typeof import('@vueuse/core')['createGlobalState']>
|
|
||||||
readonly createInjectionState: UnwrapRef<typeof import('@vueuse/core')['createInjectionState']>
|
|
||||||
readonly createLogger: UnwrapRef<typeof import('vuex')['createLogger']>
|
|
||||||
readonly createNamespacedHelpers: UnwrapRef<typeof import('vuex')['createNamespacedHelpers']>
|
|
||||||
readonly createProjection: UnwrapRef<typeof import('@vueuse/math')['createProjection']>
|
|
||||||
readonly createReactiveFn: UnwrapRef<typeof import('@vueuse/core')['createReactiveFn']>
|
|
||||||
readonly createReusableTemplate: UnwrapRef<typeof import('@vueuse/core')['createReusableTemplate']>
|
|
||||||
readonly createSharedComposable: UnwrapRef<typeof import('@vueuse/core')['createSharedComposable']>
|
|
||||||
readonly createStore: UnwrapRef<typeof import('vuex')['createStore']>
|
|
||||||
readonly createTemplatePromise: UnwrapRef<typeof import('@vueuse/core')['createTemplatePromise']>
|
|
||||||
readonly createUnrefFn: UnwrapRef<typeof import('@vueuse/core')['createUnrefFn']>
|
|
||||||
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
|
|
||||||
readonly debouncedRef: UnwrapRef<typeof import('@vueuse/core')['debouncedRef']>
|
|
||||||
readonly debouncedWatch: UnwrapRef<typeof import('@vueuse/core')['debouncedWatch']>
|
|
||||||
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
|
|
||||||
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
|
|
||||||
readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']>
|
|
||||||
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
|
|
||||||
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
|
|
||||||
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
|
|
||||||
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
|
|
||||||
readonly h: UnwrapRef<typeof import('vue')['h']>
|
|
||||||
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
|
|
||||||
readonly inject: UnwrapRef<typeof import('vue')['inject']>
|
|
||||||
readonly injectLocal: UnwrapRef<typeof import('@vueuse/core')['injectLocal']>
|
|
||||||
readonly isDefined: UnwrapRef<typeof import('@vueuse/core')['isDefined']>
|
|
||||||
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
|
|
||||||
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
|
|
||||||
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
|
|
||||||
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
|
|
||||||
readonly logicAnd: UnwrapRef<typeof import('@vueuse/math')['logicAnd']>
|
|
||||||
readonly logicNot: UnwrapRef<typeof import('@vueuse/math')['logicNot']>
|
|
||||||
readonly logicOr: UnwrapRef<typeof import('@vueuse/math')['logicOr']>
|
|
||||||
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
|
|
||||||
readonly mapActions: UnwrapRef<typeof import('vuex')['mapActions']>
|
|
||||||
readonly mapGetters: UnwrapRef<typeof import('vuex')['mapGetters']>
|
|
||||||
readonly mapMutations: UnwrapRef<typeof import('vuex')['mapMutations']>
|
|
||||||
readonly mapState: UnwrapRef<typeof import('vuex')['mapState']>
|
|
||||||
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
|
|
||||||
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
|
|
||||||
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
|
|
||||||
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
|
|
||||||
readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']>
|
|
||||||
readonly onBeforeRouteUpdate: UnwrapRef<typeof import('vue-router')['onBeforeRouteUpdate']>
|
|
||||||
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
|
|
||||||
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
|
|
||||||
readonly onClickOutside: UnwrapRef<typeof import('@vueuse/core')['onClickOutside']>
|
|
||||||
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
|
|
||||||
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
|
|
||||||
readonly onKeyStroke: UnwrapRef<typeof import('@vueuse/core')['onKeyStroke']>
|
|
||||||
readonly onLongPress: UnwrapRef<typeof import('@vueuse/core')['onLongPress']>
|
|
||||||
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
|
|
||||||
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
|
|
||||||
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
|
|
||||||
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
|
|
||||||
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
|
|
||||||
readonly onStartTyping: UnwrapRef<typeof import('@vueuse/core')['onStartTyping']>
|
|
||||||
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
|
|
||||||
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
|
|
||||||
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
|
|
||||||
readonly provide: UnwrapRef<typeof import('vue')['provide']>
|
|
||||||
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
|
|
||||||
readonly reactify: UnwrapRef<typeof import('@vueuse/core')['reactify']>
|
|
||||||
readonly reactifyObject: UnwrapRef<typeof import('@vueuse/core')['reactifyObject']>
|
|
||||||
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
|
|
||||||
readonly reactiveComputed: UnwrapRef<typeof import('@vueuse/core')['reactiveComputed']>
|
|
||||||
readonly reactiveOmit: UnwrapRef<typeof import('@vueuse/core')['reactiveOmit']>
|
|
||||||
readonly reactivePick: UnwrapRef<typeof import('@vueuse/core')['reactivePick']>
|
|
||||||
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
|
|
||||||
readonly ref: UnwrapRef<typeof import('vue')['ref']>
|
|
||||||
readonly refAutoReset: UnwrapRef<typeof import('@vueuse/core')['refAutoReset']>
|
|
||||||
readonly refDebounced: UnwrapRef<typeof import('@vueuse/core')['refDebounced']>
|
|
||||||
readonly refDefault: UnwrapRef<typeof import('@vueuse/core')['refDefault']>
|
|
||||||
readonly refThrottled: UnwrapRef<typeof import('@vueuse/core')['refThrottled']>
|
|
||||||
readonly refWithControl: UnwrapRef<typeof import('@vueuse/core')['refWithControl']>
|
|
||||||
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
|
|
||||||
readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']>
|
|
||||||
readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']>
|
|
||||||
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
|
|
||||||
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
|
|
||||||
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
|
|
||||||
readonly syncRef: UnwrapRef<typeof import('@vueuse/core')['syncRef']>
|
|
||||||
readonly syncRefs: UnwrapRef<typeof import('@vueuse/core')['syncRefs']>
|
|
||||||
readonly templateRef: UnwrapRef<typeof import('@vueuse/core')['templateRef']>
|
|
||||||
readonly throttledRef: UnwrapRef<typeof import('@vueuse/core')['throttledRef']>
|
|
||||||
readonly throttledWatch: UnwrapRef<typeof import('@vueuse/core')['throttledWatch']>
|
|
||||||
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
|
|
||||||
readonly toReactive: UnwrapRef<typeof import('@vueuse/core')['toReactive']>
|
|
||||||
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
|
|
||||||
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
|
|
||||||
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
|
|
||||||
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
|
|
||||||
readonly tryOnBeforeMount: UnwrapRef<typeof import('@vueuse/core')['tryOnBeforeMount']>
|
|
||||||
readonly tryOnBeforeUnmount: UnwrapRef<typeof import('@vueuse/core')['tryOnBeforeUnmount']>
|
|
||||||
readonly tryOnMounted: UnwrapRef<typeof import('@vueuse/core')['tryOnMounted']>
|
|
||||||
readonly tryOnScopeDispose: UnwrapRef<typeof import('@vueuse/core')['tryOnScopeDispose']>
|
|
||||||
readonly tryOnUnmounted: UnwrapRef<typeof import('@vueuse/core')['tryOnUnmounted']>
|
|
||||||
readonly unref: UnwrapRef<typeof import('vue')['unref']>
|
|
||||||
readonly unrefElement: UnwrapRef<typeof import('@vueuse/core')['unrefElement']>
|
|
||||||
readonly until: UnwrapRef<typeof import('@vueuse/core')['until']>
|
|
||||||
readonly useAbs: UnwrapRef<typeof import('@vueuse/math')['useAbs']>
|
|
||||||
readonly useActiveElement: UnwrapRef<typeof import('@vueuse/core')['useActiveElement']>
|
|
||||||
readonly useAnimate: UnwrapRef<typeof import('@vueuse/core')['useAnimate']>
|
|
||||||
readonly useArrayDifference: UnwrapRef<typeof import('@vueuse/core')['useArrayDifference']>
|
|
||||||
readonly useArrayEvery: UnwrapRef<typeof import('@vueuse/core')['useArrayEvery']>
|
|
||||||
readonly useArrayFilter: UnwrapRef<typeof import('@vueuse/core')['useArrayFilter']>
|
|
||||||
readonly useArrayFind: UnwrapRef<typeof import('@vueuse/core')['useArrayFind']>
|
|
||||||
readonly useArrayFindIndex: UnwrapRef<typeof import('@vueuse/core')['useArrayFindIndex']>
|
|
||||||
readonly useArrayFindLast: UnwrapRef<typeof import('@vueuse/core')['useArrayFindLast']>
|
|
||||||
readonly useArrayIncludes: UnwrapRef<typeof import('@vueuse/core')['useArrayIncludes']>
|
|
||||||
readonly useArrayJoin: UnwrapRef<typeof import('@vueuse/core')['useArrayJoin']>
|
|
||||||
readonly useArrayMap: UnwrapRef<typeof import('@vueuse/core')['useArrayMap']>
|
|
||||||
readonly useArrayReduce: UnwrapRef<typeof import('@vueuse/core')['useArrayReduce']>
|
|
||||||
readonly useArraySome: UnwrapRef<typeof import('@vueuse/core')['useArraySome']>
|
|
||||||
readonly useArrayUnique: UnwrapRef<typeof import('@vueuse/core')['useArrayUnique']>
|
|
||||||
readonly useAsyncQueue: UnwrapRef<typeof import('@vueuse/core')['useAsyncQueue']>
|
|
||||||
readonly useAsyncState: UnwrapRef<typeof import('@vueuse/core')['useAsyncState']>
|
|
||||||
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
|
|
||||||
readonly useAverage: UnwrapRef<typeof import('@vueuse/math')['useAverage']>
|
|
||||||
readonly useBase64: UnwrapRef<typeof import('@vueuse/core')['useBase64']>
|
|
||||||
readonly useBattery: UnwrapRef<typeof import('@vueuse/core')['useBattery']>
|
|
||||||
readonly useBluetooth: UnwrapRef<typeof import('@vueuse/core')['useBluetooth']>
|
|
||||||
readonly useBreakpoints: UnwrapRef<typeof import('@vueuse/core')['useBreakpoints']>
|
|
||||||
readonly useBroadcastChannel: UnwrapRef<typeof import('@vueuse/core')['useBroadcastChannel']>
|
|
||||||
readonly useBrowserLocation: UnwrapRef<typeof import('@vueuse/core')['useBrowserLocation']>
|
|
||||||
readonly useCached: UnwrapRef<typeof import('@vueuse/core')['useCached']>
|
|
||||||
readonly useCeil: UnwrapRef<typeof import('@vueuse/math')['useCeil']>
|
|
||||||
readonly useClamp: UnwrapRef<typeof import('@vueuse/math')['useClamp']>
|
|
||||||
readonly useClipboard: UnwrapRef<typeof import('@vueuse/core')['useClipboard']>
|
|
||||||
readonly useClipboardItems: UnwrapRef<typeof import('@vueuse/core')['useClipboardItems']>
|
|
||||||
readonly useCloned: UnwrapRef<typeof import('@vueuse/core')['useCloned']>
|
|
||||||
readonly useColorMode: UnwrapRef<typeof import('@vueuse/core')['useColorMode']>
|
|
||||||
readonly useConfirmDialog: UnwrapRef<typeof import('@vueuse/core')['useConfirmDialog']>
|
|
||||||
readonly useCounter: UnwrapRef<typeof import('@vueuse/core')['useCounter']>
|
|
||||||
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
|
|
||||||
readonly useCssVar: UnwrapRef<typeof import('@vueuse/core')['useCssVar']>
|
|
||||||
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
|
|
||||||
readonly useCurrentElement: UnwrapRef<typeof import('@vueuse/core')['useCurrentElement']>
|
|
||||||
readonly useCycleList: UnwrapRef<typeof import('@vueuse/core')['useCycleList']>
|
|
||||||
readonly useDark: UnwrapRef<typeof import('@vueuse/core')['useDark']>
|
|
||||||
readonly useDateFormat: UnwrapRef<typeof import('@vueuse/core')['useDateFormat']>
|
|
||||||
readonly useDebounce: UnwrapRef<typeof import('@vueuse/core')['useDebounce']>
|
|
||||||
readonly useDebounceFn: UnwrapRef<typeof import('@vueuse/core')['useDebounceFn']>
|
|
||||||
readonly useDebouncedRefHistory: UnwrapRef<typeof import('@vueuse/core')['useDebouncedRefHistory']>
|
|
||||||
readonly useDeviceMotion: UnwrapRef<typeof import('@vueuse/core')['useDeviceMotion']>
|
|
||||||
readonly useDeviceOrientation: UnwrapRef<typeof import('@vueuse/core')['useDeviceOrientation']>
|
|
||||||
readonly useDevicePixelRatio: UnwrapRef<typeof import('@vueuse/core')['useDevicePixelRatio']>
|
|
||||||
readonly useDevicesList: UnwrapRef<typeof import('@vueuse/core')['useDevicesList']>
|
|
||||||
readonly useDisplayMedia: UnwrapRef<typeof import('@vueuse/core')['useDisplayMedia']>
|
|
||||||
readonly useDocumentVisibility: UnwrapRef<typeof import('@vueuse/core')['useDocumentVisibility']>
|
|
||||||
readonly useDraggable: UnwrapRef<typeof import('@vueuse/core')['useDraggable']>
|
|
||||||
readonly useDropZone: UnwrapRef<typeof import('@vueuse/core')['useDropZone']>
|
|
||||||
readonly useElementBounding: UnwrapRef<typeof import('@vueuse/core')['useElementBounding']>
|
|
||||||
readonly useElementByPoint: UnwrapRef<typeof import('@vueuse/core')['useElementByPoint']>
|
|
||||||
readonly useElementHover: UnwrapRef<typeof import('@vueuse/core')['useElementHover']>
|
|
||||||
readonly useElementSize: UnwrapRef<typeof import('@vueuse/core')['useElementSize']>
|
|
||||||
readonly useElementVisibility: UnwrapRef<typeof import('@vueuse/core')['useElementVisibility']>
|
|
||||||
readonly useEventBus: UnwrapRef<typeof import('@vueuse/core')['useEventBus']>
|
|
||||||
readonly useEventListener: UnwrapRef<typeof import('@vueuse/core')['useEventListener']>
|
|
||||||
readonly useEventSource: UnwrapRef<typeof import('@vueuse/core')['useEventSource']>
|
|
||||||
readonly useEyeDropper: UnwrapRef<typeof import('@vueuse/core')['useEyeDropper']>
|
|
||||||
readonly useFavicon: UnwrapRef<typeof import('@vueuse/core')['useFavicon']>
|
|
||||||
readonly useFetch: UnwrapRef<typeof import('@vueuse/core')['useFetch']>
|
|
||||||
readonly useFileDialog: UnwrapRef<typeof import('@vueuse/core')['useFileDialog']>
|
|
||||||
readonly useFileSystemAccess: UnwrapRef<typeof import('@vueuse/core')['useFileSystemAccess']>
|
|
||||||
readonly useFloor: UnwrapRef<typeof import('@vueuse/math')['useFloor']>
|
|
||||||
readonly useFocus: UnwrapRef<typeof import('@vueuse/core')['useFocus']>
|
|
||||||
readonly useFocusWithin: UnwrapRef<typeof import('@vueuse/core')['useFocusWithin']>
|
|
||||||
readonly useFps: UnwrapRef<typeof import('@vueuse/core')['useFps']>
|
|
||||||
readonly useFullscreen: UnwrapRef<typeof import('@vueuse/core')['useFullscreen']>
|
|
||||||
readonly useGamepad: UnwrapRef<typeof import('@vueuse/core')['useGamepad']>
|
|
||||||
readonly useGeolocation: UnwrapRef<typeof import('@vueuse/core')['useGeolocation']>
|
|
||||||
readonly useIdle: UnwrapRef<typeof import('@vueuse/core')['useIdle']>
|
|
||||||
readonly useImage: UnwrapRef<typeof import('@vueuse/core')['useImage']>
|
|
||||||
readonly useInfiniteScroll: UnwrapRef<typeof import('@vueuse/core')['useInfiniteScroll']>
|
|
||||||
readonly useIntersectionObserver: UnwrapRef<typeof import('@vueuse/core')['useIntersectionObserver']>
|
|
||||||
readonly useInterval: UnwrapRef<typeof import('@vueuse/core')['useInterval']>
|
|
||||||
readonly useIntervalFn: UnwrapRef<typeof import('@vueuse/core')['useIntervalFn']>
|
|
||||||
readonly useKeyModifier: UnwrapRef<typeof import('@vueuse/core')['useKeyModifier']>
|
|
||||||
readonly useLastChanged: UnwrapRef<typeof import('@vueuse/core')['useLastChanged']>
|
|
||||||
readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
|
|
||||||
readonly useLocalStorage: UnwrapRef<typeof import('@vueuse/core')['useLocalStorage']>
|
|
||||||
readonly useMagicKeys: UnwrapRef<typeof import('@vueuse/core')['useMagicKeys']>
|
|
||||||
readonly useManualRefHistory: UnwrapRef<typeof import('@vueuse/core')['useManualRefHistory']>
|
|
||||||
readonly useMath: UnwrapRef<typeof import('@vueuse/math')['useMath']>
|
|
||||||
readonly useMax: UnwrapRef<typeof import('@vueuse/math')['useMax']>
|
|
||||||
readonly useMediaControls: UnwrapRef<typeof import('@vueuse/core')['useMediaControls']>
|
|
||||||
readonly useMediaQuery: UnwrapRef<typeof import('@vueuse/core')['useMediaQuery']>
|
|
||||||
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
|
|
||||||
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
|
|
||||||
readonly useMin: UnwrapRef<typeof import('@vueuse/math')['useMin']>
|
|
||||||
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
|
|
||||||
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
|
|
||||||
readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
|
|
||||||
readonly useMousePressed: UnwrapRef<typeof import('@vueuse/core')['useMousePressed']>
|
|
||||||
readonly useMutationObserver: UnwrapRef<typeof import('@vueuse/core')['useMutationObserver']>
|
|
||||||
readonly useNavigatorLanguage: UnwrapRef<typeof import('@vueuse/core')['useNavigatorLanguage']>
|
|
||||||
readonly useNetwork: UnwrapRef<typeof import('@vueuse/core')['useNetwork']>
|
|
||||||
readonly useNow: UnwrapRef<typeof import('@vueuse/core')['useNow']>
|
|
||||||
readonly useObjectUrl: UnwrapRef<typeof import('@vueuse/core')['useObjectUrl']>
|
|
||||||
readonly useOffsetPagination: UnwrapRef<typeof import('@vueuse/core')['useOffsetPagination']>
|
|
||||||
readonly useOnline: UnwrapRef<typeof import('@vueuse/core')['useOnline']>
|
|
||||||
readonly usePageLeave: UnwrapRef<typeof import('@vueuse/core')['usePageLeave']>
|
|
||||||
readonly useParallax: UnwrapRef<typeof import('@vueuse/core')['useParallax']>
|
|
||||||
readonly useParentElement: UnwrapRef<typeof import('@vueuse/core')['useParentElement']>
|
|
||||||
readonly usePerformanceObserver: UnwrapRef<typeof import('@vueuse/core')['usePerformanceObserver']>
|
|
||||||
readonly usePermission: UnwrapRef<typeof import('@vueuse/core')['usePermission']>
|
|
||||||
readonly usePointer: UnwrapRef<typeof import('@vueuse/core')['usePointer']>
|
|
||||||
readonly usePointerLock: UnwrapRef<typeof import('@vueuse/core')['usePointerLock']>
|
|
||||||
readonly usePointerSwipe: UnwrapRef<typeof import('@vueuse/core')['usePointerSwipe']>
|
|
||||||
readonly usePrecision: UnwrapRef<typeof import('@vueuse/math')['usePrecision']>
|
|
||||||
readonly usePreferredColorScheme: UnwrapRef<typeof import('@vueuse/core')['usePreferredColorScheme']>
|
|
||||||
readonly usePreferredContrast: UnwrapRef<typeof import('@vueuse/core')['usePreferredContrast']>
|
|
||||||
readonly usePreferredDark: UnwrapRef<typeof import('@vueuse/core')['usePreferredDark']>
|
|
||||||
readonly usePreferredLanguages: UnwrapRef<typeof import('@vueuse/core')['usePreferredLanguages']>
|
|
||||||
readonly usePreferredReducedMotion: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedMotion']>
|
|
||||||
readonly usePrevious: UnwrapRef<typeof import('@vueuse/core')['usePrevious']>
|
|
||||||
readonly useProjection: UnwrapRef<typeof import('@vueuse/math')['useProjection']>
|
|
||||||
readonly useRafFn: UnwrapRef<typeof import('@vueuse/core')['useRafFn']>
|
|
||||||
readonly useRefHistory: UnwrapRef<typeof import('@vueuse/core')['useRefHistory']>
|
|
||||||
readonly useResizeObserver: UnwrapRef<typeof import('@vueuse/core')['useResizeObserver']>
|
|
||||||
readonly useRound: UnwrapRef<typeof import('@vueuse/math')['useRound']>
|
|
||||||
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
|
|
||||||
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
|
|
||||||
readonly useScreenOrientation: UnwrapRef<typeof import('@vueuse/core')['useScreenOrientation']>
|
|
||||||
readonly useScreenSafeArea: UnwrapRef<typeof import('@vueuse/core')['useScreenSafeArea']>
|
|
||||||
readonly useScriptTag: UnwrapRef<typeof import('@vueuse/core')['useScriptTag']>
|
|
||||||
readonly useScroll: UnwrapRef<typeof import('@vueuse/core')['useScroll']>
|
|
||||||
readonly useScrollLock: UnwrapRef<typeof import('@vueuse/core')['useScrollLock']>
|
|
||||||
readonly useSessionStorage: UnwrapRef<typeof import('@vueuse/core')['useSessionStorage']>
|
|
||||||
readonly useShare: UnwrapRef<typeof import('@vueuse/core')['useShare']>
|
|
||||||
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
|
|
||||||
readonly useSorted: UnwrapRef<typeof import('@vueuse/core')['useSorted']>
|
|
||||||
readonly useSpeechRecognition: UnwrapRef<typeof import('@vueuse/core')['useSpeechRecognition']>
|
|
||||||
readonly useSpeechSynthesis: UnwrapRef<typeof import('@vueuse/core')['useSpeechSynthesis']>
|
|
||||||
readonly useStepper: UnwrapRef<typeof import('@vueuse/core')['useStepper']>
|
|
||||||
readonly useStorage: UnwrapRef<typeof import('@vueuse/core')['useStorage']>
|
|
||||||
readonly useStorageAsync: UnwrapRef<typeof import('@vueuse/core')['useStorageAsync']>
|
|
||||||
readonly useStore: UnwrapRef<typeof import('vuex')['useStore']>
|
|
||||||
readonly useStyleTag: UnwrapRef<typeof import('@vueuse/core')['useStyleTag']>
|
|
||||||
readonly useSum: UnwrapRef<typeof import('@vueuse/math')['useSum']>
|
|
||||||
readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
|
|
||||||
readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
|
|
||||||
readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
|
readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
|
||||||
readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
|
readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
|
||||||
readonly useTextSelection: UnwrapRef<typeof import('@vueuse/core')['useTextSelection']>
|
readonly useTextSelection: UnwrapRef<typeof import('@vueuse/core')['useTextSelection']>
|
||||||
|
|||||||
2
components.d.ts
vendored
2
components.d.ts
vendored
@@ -1,10 +1,10 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/* prettier-ignore */
|
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
// Generated by unplugin-vue-components
|
// Generated by unplugin-vue-components
|
||||||
// Read more: https://github.com/vuejs/core/pull/3399
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
export {}
|
export {}
|
||||||
|
|
||||||
|
/* prettier-ignore */
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
DialogCloseBtn: typeof import('./src/@core/components/DialogCloseBtn.vue')['default']
|
DialogCloseBtn: typeof import('./src/@core/components/DialogCloseBtn.vue')['default']
|
||||||
|
|||||||
@@ -145,17 +145,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
|
||||||
<script>
|
<script>
|
||||||
const loaderColor = localStorage.getItem('materio-initial-loader-bg') || '#FFFFFF'
|
const loaderColor = localStorage.getItem('materio-initial-loader-bg') || '#FFFFFF'
|
||||||
const primaryColor = localStorage.getItem('materio-initial-loader-color') || '#9155FD'
|
const primaryColor = localStorage.getItem('materio-initial-loader-color') || '#9155FD'
|
||||||
|
|
||||||
if (loaderColor)
|
if (loaderColor)
|
||||||
document.documentElement.style.setProperty('--initial-loader-bg', loaderColor)
|
document.documentElement.style.setProperty('--initial-loader-bg', loaderColor)
|
||||||
|
|
||||||
if (primaryColor)
|
if (primaryColor)
|
||||||
document.documentElement.style.setProperty('--initial-loader-color', primaryColor)
|
document.documentElement.style.setProperty('--initial-loader-color', primaryColor)
|
||||||
</script>
|
</script>
|
||||||
|
<script type="module" src="/src/main.ts"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
104
package.json
104
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "moviepilot",
|
"name": "moviepilot",
|
||||||
"version": "2.0.2",
|
"version": "2.2.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"bin": "dist/service.js",
|
"bin": "dist/service.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -19,86 +19,86 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fullcalendar/core": "^6.1.8",
|
"@fullcalendar/core": "^6.1.15",
|
||||||
"@fullcalendar/daygrid": "^6.1.8",
|
"@fullcalendar/daygrid": "^6.1.15",
|
||||||
"@fullcalendar/interaction": "^6.1.7",
|
"@fullcalendar/interaction": "^6.1.15",
|
||||||
"@fullcalendar/list": "^6.1.7",
|
"@fullcalendar/list": "^6.1.15",
|
||||||
"@fullcalendar/timegrid": "^6.1.7",
|
"@fullcalendar/timegrid": "^6.1.15",
|
||||||
"@fullcalendar/vue3": "^6.1.8",
|
"@fullcalendar/vue3": "^6.1.15",
|
||||||
"@iconify/utils": "^2.1.22",
|
"@iconify/utils": "^2.2.1",
|
||||||
"@vueuse/core": "^10.1.2",
|
"@vue-js-cron/vuetify": "^5.0.9",
|
||||||
"@vueuse/math": "^10.1.2",
|
"@vueuse/core": "^12.4.0",
|
||||||
"ace-builds": "^1.32.6",
|
"@vueuse/math": "^12.4.0",
|
||||||
"apexcharts-clevision": "^3.28.5",
|
"ace-builds": "^1.37.4",
|
||||||
"axios": "1.6.8",
|
"apexcharts": "^4.0.0",
|
||||||
"colorthief": "^2.4.0",
|
"axios": "^1.7.9",
|
||||||
"dayjs": "^1.11.10",
|
"colorthief": "^2.6.0",
|
||||||
"express": "^4.18.2",
|
"copy-to-clipboard": "^3.3.3",
|
||||||
"express-http-proxy": "^2.0.0",
|
"dayjs": "^1.11.13",
|
||||||
|
"express": "^4.21.2",
|
||||||
|
"express-http-proxy": "^2.1.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mousetrap": "^1.6.5",
|
"mousetrap": "^1.6.5",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"qrcode.vue": "^3.4.1",
|
"qrcode.vue": "^3.6.0",
|
||||||
"sass": "^1.59.3",
|
"sass": "^1.83.4",
|
||||||
"tailwindcss": "^3.3.2",
|
"tailwindcss": "^ 3.4.17",
|
||||||
"unplugin-vue-define-options": "^1.3.5",
|
"vue": "^3.5.13",
|
||||||
"vue": "^3.3.2",
|
"vue-router": "^4.5.0",
|
||||||
"vue-router": "^4.2.0",
|
"vue-toast-notification": "^3.1.3",
|
||||||
"vue-toast-notification": "^3",
|
|
||||||
"vue3-ace-editor": "^2.2.4",
|
"vue3-ace-editor": "^2.2.4",
|
||||||
"vue3-apexcharts": "^1.4.1",
|
"vue3-apexcharts": "^1.8.0",
|
||||||
"vue3-perfect-scrollbar": "^2.0.0",
|
"vue3-perfect-scrollbar": "^2.0.0",
|
||||||
"vuedraggable": "^4.1.0",
|
"vuedraggable": "^4.1.0",
|
||||||
"vuetify": "3.6.8",
|
"vuetify": "3.7.3",
|
||||||
"vuetify-use-dialog": "^0.6.11",
|
"vuetify-use-dialog": "^0.6.11",
|
||||||
"vuex": "^4.1.0",
|
"vuex": "^4.1.0",
|
||||||
"vuex-persistedstate": "^4.1.0",
|
"vuex-persistedstate": "^4.1.0",
|
||||||
"webfontloader": "^1.6.28"
|
"webfontloader": "^1.6.28"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config-vue": "^0.43.1",
|
|
||||||
"@iconify-json/mdi": "^1.1.52",
|
"@iconify-json/mdi": "^1.1.52",
|
||||||
"@iconify/tools": "^4.0.4",
|
"@iconify/tools": "^4.0.4",
|
||||||
"@iconify/vue": "4.1.1",
|
"@iconify/vue": "^4.3.0",
|
||||||
"@intlify/unplugin-vue-i18n": "^4.0.0",
|
"@intlify/unplugin-vue-i18n": "^6.0.3",
|
||||||
"@tailwindcss/aspect-ratio": "^0.4.2",
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
||||||
"@types/lodash": "^4.14.197",
|
"@types/lodash": "^4.14.197",
|
||||||
"@types/node": "^20.1.4",
|
"@types/node": "^20.1.4",
|
||||||
"@types/webfontloader": "^1.6.34",
|
"@types/webfontloader": "^1.6.34",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
||||||
"@typescript-eslint/parser": "^7.5.0",
|
"@typescript-eslint/parser": "^8.20.0",
|
||||||
"@vitejs/plugin-vue": "^5.0.4",
|
"@vitejs/plugin-vue": "^5.0.4",
|
||||||
"@vitejs/plugin-vue-jsx": "^3.0.0",
|
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
"eslint": "^9.0.0",
|
"eslint": "^9.18.0",
|
||||||
"eslint-config-airbnb-base": "^15.0.0",
|
|
||||||
"eslint-import-resolver-typescript": "^3.5.1",
|
"eslint-import-resolver-typescript": "^3.5.1",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-promise": "^6.0.1",
|
"eslint-plugin-promise": "^7.2.1",
|
||||||
"eslint-plugin-regex": "^1.10.0",
|
"eslint-plugin-regex": "^1.10.0",
|
||||||
"eslint-plugin-sonarjs": "^0.25.1",
|
"eslint-plugin-sonarjs": "^3.0.1",
|
||||||
"eslint-plugin-unicorn": "^52.0.0",
|
"eslint-plugin-unicorn": "^56.0.1",
|
||||||
"eslint-plugin-vue": "^9.12.0",
|
"eslint-plugin-vue": "^9.12.0",
|
||||||
"postcss": "8",
|
"postcss": "^8.5.1",
|
||||||
"postcss-html": "^1.5.0",
|
"postcss-html": "^1.5.0",
|
||||||
"stylelint": "16.3.1",
|
"stylelint": "^16.13.2",
|
||||||
"stylelint-config-idiomatic-order": "10.0.0",
|
"stylelint-config-idiomatic-order": "^10.0.0",
|
||||||
"stylelint-config-standard-scss": "13.1.0",
|
"stylelint-config-standard-scss": "^14.0.0",
|
||||||
"stylelint-use-logical-spec": "5.0.1",
|
"stylelint-use-logical-spec": "5.0.1",
|
||||||
|
"terser": "^5.36.0",
|
||||||
"type-fest": "^4.15.0",
|
"type-fest": "^4.15.0",
|
||||||
"typescript": "^5.0.4",
|
"typescript": "^5.0.4",
|
||||||
"unplugin-auto-import": "^0.17.5",
|
"unplugin-auto-import": "^19.0.0",
|
||||||
"unplugin-vue-components": "^0.26.0",
|
"unplugin-vue-components": "^28.0.0",
|
||||||
"vite": "^5.2.8",
|
"unplugin-vue-define-options": "^1.5.3",
|
||||||
|
"vite": "^5.4.11",
|
||||||
"vite-plugin-pages": "^0.32.1",
|
"vite-plugin-pages": "^0.32.1",
|
||||||
"vite-plugin-pwa": "^0.20.0",
|
"vite-plugin-pwa": "^0.21.1",
|
||||||
"vite-plugin-vue-layouts": "^0.11.0",
|
"vite-plugin-vue-layouts": "^0.11.0",
|
||||||
"vite-plugin-vuetify": "2.0.3",
|
"vite-plugin-vuetify": "2.0.4",
|
||||||
"vue-shepherd": "^3.0.0",
|
"vue-shepherd": "^4.1.0",
|
||||||
"vue-tsc": "^2.0.10"
|
"vue-tsc": "^2.0.10",
|
||||||
|
"workbox-build": "^7.3.0",
|
||||||
|
"workbox-window": "^7.3.0"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@1.22.18",
|
"packageManager": "yarn@1.22.18"
|
||||||
"resolutions": {
|
|
||||||
"postcss": "8"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -5,12 +5,12 @@ body {
|
|||||||
html {
|
html {
|
||||||
overflow: hidden auto;
|
overflow: hidden auto;
|
||||||
background: var(--initial-loader-bg, #fff);
|
background: var(--initial-loader-bg, #fff);
|
||||||
min-block-size: calc(100% + env(safe-area-inset-top));
|
min-block-size: calc(100% + env(safe-area-inset-top) + env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
#loading-bg {
|
#loading-bg {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 999;
|
z-index: 9999;
|
||||||
display: block;
|
display: block;
|
||||||
background: var(--initial-loader-bg, #fff);
|
background: var(--initial-loader-bg, #fff);
|
||||||
block-size: 100vh;
|
block-size: 100vh;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import type { ThemeSwitcherTheme } from '@layouts/types'
|
|||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { checkPrefersColorSchemeIsDark } from '@/@core/utils'
|
import { checkPrefersColorSchemeIsDark } from '@/@core/utils'
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import { VAceEditor } from 'vue3-ace-editor'
|
|
||||||
|
|
||||||
// 显示器宽度
|
// 显示器宽度
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
@@ -115,7 +114,7 @@ function changeTheme(theme: string) {
|
|||||||
// 保存主题到服务端
|
// 保存主题到服务端
|
||||||
try {
|
try {
|
||||||
api.post('/user/config/Layout', {
|
api.post('/user/config/Layout', {
|
||||||
theme: nextTheme
|
theme: nextTheme,
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('保存主题到服务端失败')
|
console.error('保存主题到服务端失败')
|
||||||
@@ -176,7 +175,7 @@ async function saveCustomCSS() {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if (result.success) $toast.success('自定义CSS保存成功!')
|
if (result.success) $toast.success('自定义CSS保存成功,请刷新页面生效!')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('保存自定义 CSS 到服务端失败')
|
console.error('保存自定义 CSS 到服务端失败')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
.auth-wrapper {
|
.auth-wrapper {
|
||||||
min-block-size: calc(var(--vh, 1vh) * 100 + env(safe-area-inset-top));
|
min-block-size: calc(var(--vh, 1vh) * 100 + env(safe-area-inset-top) + env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth-footer-mask {
|
.auth-footer-mask {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "vuetify/lib/styles/settings" as vuetify_settings;
|
@use "vuetify/lib/styles/settings" as vuetify_settings;
|
||||||
|
|
||||||
@mixin avatar-font-sizes($map: $avatar-sizes) {
|
@mixin avatar-font-sizes($map: $avatar-sizes) {
|
||||||
@each $sizeName, $multiplier in vuetify_settings.$size-scales {
|
@each $sizeName, $multiplier in vuetify_settings.$size-scales {
|
||||||
/* stylelint-disable-next-line scss/no-global-function-names */
|
/* stylelint-disable-next-line scss/no-global-function-names */
|
||||||
$size: map-get($map, $sizeName);
|
$size: map.get($map, $sizeName);
|
||||||
|
|
||||||
&.v-avatar--size-#{$sizeName} {
|
&.v-avatar--size-#{$sizeName} {
|
||||||
font-size: #{$size}px;
|
font-size: #{$size}px;
|
||||||
|
|||||||
@@ -92,8 +92,7 @@
|
|||||||
.fc-header-toolbar {
|
.fc-header-toolbar {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin: 1.25rem;
|
margin: 1.25rem;
|
||||||
column-gap: 0.5rem;
|
gap: 1rem 0.5rem;
|
||||||
row-gap: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.fc-toolbar-chunk {
|
.fc-toolbar-chunk {
|
||||||
@@ -238,7 +237,7 @@
|
|||||||
inline-size: 1.5625rem;
|
inline-size: 1.5625rem;
|
||||||
margin-inline-end: 0.25rem;
|
margin-inline-end: 0.25rem;
|
||||||
|
|
||||||
@media (max-width: 1264px) {
|
@media (width <= 1264px) {
|
||||||
display: block !important;
|
display: block !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ export function useDefer(maxFrameCount = 1) {
|
|||||||
const refreshFrameCount = () => {
|
const refreshFrameCount = () => {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
frameCount.value++
|
frameCount.value++
|
||||||
if (frameCount.value < maxFrameCount)
|
if (frameCount.value < maxFrameCount) refreshFrameCount()
|
||||||
refreshFrameCount()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
refreshFrameCount()
|
refreshFrameCount()
|
||||||
@@ -19,3 +18,9 @@ export function useDefer(maxFrameCount = 1) {
|
|||||||
return frameCount.value >= showInFrameCount
|
return frameCount.value >= showInFrameCount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function ensureRenderComplete(callback: () => void) {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
requestAnimationFrame(callback)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import copy from 'copy-to-clipboard'
|
||||||
|
|
||||||
// 请求和获取剪贴板内容
|
// 请求和获取剪贴板内容
|
||||||
export async function getClipboardContent() {
|
export async function getClipboardContent() {
|
||||||
if (navigator.clipboard && window.isSecureContext) {
|
if (navigator.clipboard && window.isSecureContext) {
|
||||||
@@ -13,20 +15,10 @@ export async function getClipboardContent() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将内容复制到剪贴板,兼容非安全域场景
|
// 将内容复制到剪贴板
|
||||||
export async function copyToClipboard(content: string) {
|
export async function copyToClipboard(content: string) {
|
||||||
if (navigator.clipboard && window.isSecureContext) {
|
const success = copy(content)
|
||||||
await navigator.clipboard.writeText(content)
|
return success
|
||||||
} else {
|
|
||||||
const input = document.createElement('textarea')
|
|
||||||
input.value = content
|
|
||||||
document.body.appendChild(input)
|
|
||||||
// 阻止事件冒泡到其他元素,确保 focusin 事件只在 textarea 元素上处理,不会影响其他元素
|
|
||||||
input.addEventListener('focusin', e => e.stopPropagation())
|
|
||||||
input.select()
|
|
||||||
document.execCommand('copy')
|
|
||||||
document.body.removeChild(input)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// VAPID公钥转Uint8Array
|
// VAPID公钥转Uint8Array
|
||||||
|
|||||||
1
src/@iconify/tsconfig.tsbuildinfo
Normal file
1
src/@iconify/tsconfig.tsbuildinfo
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"root":["./build-icons.ts"],"version":"5.7.3"}
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
@use "@configured-variables" as variables;
|
@use "@configured-variables" as variables;
|
||||||
|
|
||||||
html {
|
html {
|
||||||
min-height: calc(100% + env(safe-area-inset-top));
|
min-height: calc(100% + env(safe-area-inset-top) + env(safe-area-inset-bottom));
|
||||||
background: rgb(var(--v-theme-background));
|
background: rgb(var(--v-theme-background));
|
||||||
overflow-y: overlay;
|
overflow-y: overlay;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,5 +7,5 @@
|
|||||||
|
|
||||||
html {
|
html {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
min-height: calc(100% + env(safe-area-inset-top))
|
min-height: calc(100% + env(safe-area-inset-top) + env(safe-area-inset-bottom))
|
||||||
}
|
}
|
||||||
|
|||||||
11
src/App.vue
11
src/App.vue
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useTheme } from 'vuetify'
|
import { useTheme } from 'vuetify'
|
||||||
import { checkPrefersColorSchemeIsDark } from '@/@core/utils'
|
import { checkPrefersColorSchemeIsDark } from '@/@core/utils'
|
||||||
|
import { ensureRenderComplete, removeEl } from './@core/utils/dom'
|
||||||
|
|
||||||
const { global: globalTheme } = useTheme()
|
const { global: globalTheme } = useTheme()
|
||||||
|
|
||||||
@@ -41,9 +42,15 @@ if (window.Apex) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 页面加载时,加载当前用户数据
|
onMounted(() => {
|
||||||
onBeforeMount(async () => {
|
|
||||||
setTheme()
|
setTheme()
|
||||||
|
ensureRenderComplete(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
removeEl('#loading-bg')
|
||||||
|
}, 1500)
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -2,18 +2,27 @@ export const storageOptions = [
|
|||||||
{
|
{
|
||||||
title: '本地',
|
title: '本地',
|
||||||
value: 'local',
|
value: 'local',
|
||||||
|
icon: 'mdi-folder-multiple-outline',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '阿里云盘',
|
title: '阿里云盘',
|
||||||
value: 'alipan',
|
value: 'alipan',
|
||||||
|
icon: 'mdi-cloud-outline',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '115网盘',
|
title: '115网盘',
|
||||||
value: 'u115',
|
value: 'u115',
|
||||||
|
icon: 'mdi-cloud-outline',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Rclone网盘',
|
title: 'RClone',
|
||||||
value: 'rclone',
|
value: 'rclone',
|
||||||
|
icon: 'mdi-cloud-outline',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'AList',
|
||||||
|
value: 'alist',
|
||||||
|
icon: 'mdi-cloud-outline',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -62,3 +71,10 @@ export const storageDict = storageOptions.reduce((dict, item) => {
|
|||||||
dict[item.value] = item.title
|
dict[item.value] = item.title
|
||||||
return dict
|
return dict
|
||||||
}, {} as Record<string, string>)
|
}, {} as Record<string, string>)
|
||||||
|
|
||||||
|
export const transferTypeOptions = [
|
||||||
|
{ title: '复制', value: 'copy' },
|
||||||
|
{ title: '移动', value: 'move' },
|
||||||
|
{ title: '硬链接', value: 'link' },
|
||||||
|
{ title: '软链接', value: 'softlink' },
|
||||||
|
]
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export interface Subscribe {
|
|||||||
lack_episode?: number
|
lack_episode?: number
|
||||||
// 附加信息
|
// 附加信息
|
||||||
note?: string
|
note?: string
|
||||||
// 状态:N-新建, R-订阅中
|
// 状态:N-新建 R-订阅中 P-待定 S-暂停
|
||||||
state: string
|
state: string
|
||||||
// 最后更新时间
|
// 最后更新时间
|
||||||
last_update: string
|
last_update: string
|
||||||
@@ -72,6 +72,8 @@ export interface Subscribe {
|
|||||||
media_category?: string
|
media_category?: string
|
||||||
// 过滤规则组
|
// 过滤规则组
|
||||||
filter_groups?: string[]
|
filter_groups?: string[]
|
||||||
|
// 下载器
|
||||||
|
downloader: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// 订阅分享
|
// 订阅分享
|
||||||
@@ -86,6 +88,8 @@ export interface SubscribeShare {
|
|||||||
share_comment?: string
|
share_comment?: string
|
||||||
// 分享人
|
// 分享人
|
||||||
share_user?: string
|
share_user?: string
|
||||||
|
// 分享人唯一ID
|
||||||
|
share_uid?: string
|
||||||
// 订阅名称
|
// 订阅名称
|
||||||
name?: string
|
name?: string
|
||||||
// 订阅年份
|
// 订阅年份
|
||||||
@@ -182,7 +186,7 @@ export interface TransferHistory {
|
|||||||
export interface MediaInfo {
|
export interface MediaInfo {
|
||||||
// 来源:themoviedb、douban、bangumi
|
// 来源:themoviedb、douban、bangumi
|
||||||
source?: string
|
source?: string
|
||||||
// 类型 电影、电视剧
|
// 类型 电影、电视剧、合集
|
||||||
type?: string
|
type?: string
|
||||||
// 媒体标题
|
// 媒体标题
|
||||||
title?: string
|
title?: string
|
||||||
@@ -202,6 +206,8 @@ export interface MediaInfo {
|
|||||||
douban_id?: string
|
douban_id?: string
|
||||||
// Bangumi ID
|
// Bangumi ID
|
||||||
bangumi_id?: string
|
bangumi_id?: string
|
||||||
|
// 合集ID
|
||||||
|
collection_id?: number
|
||||||
// 媒体原语种
|
// 媒体原语种
|
||||||
original_language?: string
|
original_language?: string
|
||||||
// 媒体原发行标题
|
// 媒体原发行标题
|
||||||
@@ -387,6 +393,8 @@ export interface Site {
|
|||||||
pri?: number
|
pri?: number
|
||||||
// RSS地址
|
// RSS地址
|
||||||
rss?: string
|
rss?: string
|
||||||
|
// 下载器
|
||||||
|
downloader: string
|
||||||
// Cookie
|
// Cookie
|
||||||
cookie?: string
|
cookie?: string
|
||||||
// ApiKey
|
// ApiKey
|
||||||
@@ -605,6 +613,8 @@ export interface TorrentInfo {
|
|||||||
site_proxy: boolean
|
site_proxy: boolean
|
||||||
// 站点优先级
|
// 站点优先级
|
||||||
site_order: number
|
site_order: number
|
||||||
|
// 站点下载器
|
||||||
|
site_downloader?: string
|
||||||
// 种子名称
|
// 种子名称
|
||||||
title?: string
|
title?: string
|
||||||
// 种子副标题
|
// 种子副标题
|
||||||
@@ -1045,7 +1055,7 @@ export interface TransferDirectoryConf {
|
|||||||
// 监控模式 fast/compatibility
|
// 监控模式 fast/compatibility
|
||||||
monitor_mode?: string
|
monitor_mode?: string
|
||||||
// 整理方式 move/copy/link/softlink
|
// 整理方式 move/copy/link/softlink
|
||||||
transfer_type?: string
|
transfer_type: string
|
||||||
// 文件覆盖模式 always/size/never/latest
|
// 文件覆盖模式 always/size/never/latest
|
||||||
overwrite_mode?: string
|
overwrite_mode?: string
|
||||||
// 整理到媒体库目录
|
// 整理到媒体库目录
|
||||||
@@ -1094,6 +1104,7 @@ export interface FilterRuleGroup {
|
|||||||
category?: string
|
category?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 订阅下载文件详情
|
||||||
export interface SubscribeDownloadFileInfo {
|
export interface SubscribeDownloadFileInfo {
|
||||||
// 种子名称
|
// 种子名称
|
||||||
torrent_title?: string
|
torrent_title?: string
|
||||||
@@ -1107,6 +1118,7 @@ export interface SubscribeDownloadFileInfo {
|
|||||||
file_path?: string
|
file_path?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 订阅媒体库文件详情
|
||||||
export interface SubscribeLibraryFileInfo {
|
export interface SubscribeLibraryFileInfo {
|
||||||
// 存储
|
// 存储
|
||||||
storage?: string
|
storage?: string
|
||||||
@@ -1114,6 +1126,7 @@ export interface SubscribeLibraryFileInfo {
|
|||||||
file_path?: string
|
file_path?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 订阅集详情
|
||||||
export interface SubscribeEpisodeInfo {
|
export interface SubscribeEpisodeInfo {
|
||||||
// 标题
|
// 标题
|
||||||
title?: string
|
title?: string
|
||||||
@@ -1127,9 +1140,67 @@ export interface SubscribeEpisodeInfo {
|
|||||||
library?: SubscribeLibraryFileInfo[]
|
library?: SubscribeLibraryFileInfo[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 订阅详情
|
||||||
export interface SubscrbieInfo {
|
export interface SubscrbieInfo {
|
||||||
// 订阅信息
|
// 订阅信息
|
||||||
subscribe: Subscribe
|
subscribe: Subscribe
|
||||||
// 集信息 {集号: {download: 文件路径,library: 文件路径, backdrop: url, title: 标题, description: 描述}}
|
// 集信息 {集号: {download: 文件路径,library: 文件路径, backdrop: url, title: 标题, description: 描述}}
|
||||||
episodes: Record<number, SubscribeEpisodeInfo>
|
episodes: Record<number, SubscribeEpisodeInfo>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 整理表单
|
||||||
|
export interface TransferForm {
|
||||||
|
// 文件项
|
||||||
|
fileitem: FileItem
|
||||||
|
// 历史ID
|
||||||
|
logid: number
|
||||||
|
// 目标存储
|
||||||
|
target_storage: string
|
||||||
|
// 目标路径
|
||||||
|
target_path: string
|
||||||
|
// TMDB ID
|
||||||
|
tmdbid?: number
|
||||||
|
// 豆瓣 ID
|
||||||
|
doubanid?: string
|
||||||
|
// 季号
|
||||||
|
season?: number
|
||||||
|
// 类型
|
||||||
|
type_name?: string
|
||||||
|
// 整理方式
|
||||||
|
transfer_type: string
|
||||||
|
// 自定义格式
|
||||||
|
episode_format?: string
|
||||||
|
// 指定集数
|
||||||
|
episode_detail?: string
|
||||||
|
// 指定PART
|
||||||
|
episode_part?: string
|
||||||
|
// 集数偏移
|
||||||
|
episode_offset?: string
|
||||||
|
// 最小文件大小
|
||||||
|
min_filesize: number
|
||||||
|
// 刮削
|
||||||
|
scrape: boolean
|
||||||
|
// 复用历史识别信息
|
||||||
|
from_history: boolean
|
||||||
|
// 媒体库类型子目录
|
||||||
|
library_type_folder?: boolean
|
||||||
|
// 媒体库类别子目录
|
||||||
|
library_category_folder?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
// 整理队列
|
||||||
|
export interface TransferQueue {
|
||||||
|
// 媒体信息
|
||||||
|
media: MediaInfo
|
||||||
|
// 季
|
||||||
|
season?: number
|
||||||
|
// 任务列表
|
||||||
|
tasks: {
|
||||||
|
// 文件项
|
||||||
|
fileitem: FileItem
|
||||||
|
// 元数据
|
||||||
|
meta: MetaInfo
|
||||||
|
// 状态
|
||||||
|
state: string
|
||||||
|
}[]
|
||||||
|
}
|
||||||
|
|||||||
10
src/assets/images/misc/alist.svg
Normal file
10
src/assets/images/misc/alist.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<svg width="1252" height="1252" xmlns="http://www.w3.org/2000/svg" version="1.1">
|
||||||
|
<g>
|
||||||
|
<g id="#70c6beff">
|
||||||
|
<path id="svg_2" d="m634.37,138.38c11.88,-1.36 24.25,1.3 34.18,8.09c14.96,9.66 25.55,24.41 34.49,39.51c40.59,68.03 81.45,135.91 122.02,203.96c54.02,90.99 108.06,181.97 161.94,273.06c37.28,63 74.65,125.96 112.18,188.82c24.72,41.99 50.21,83.54 73.84,126.16c10.18,17.84 15.77,38.44 14.93,59.03c-0.59,15.92 -3.48,32.28 -11.84,46.08c-11.73,19.46 -31.39,33.2 -52.71,40.36c-11.37,4.09 -23.3,6.87 -35.43,6.89c-132.32,-0.05 -264.64,0.04 -396.95,0.03c-11.38,-0.29 -22.95,-1.6 -33.63,-5.72c-7.81,-3.33 -15.5,-7.43 -21.61,-13.42c-10.43,-10.32 -17.19,-24.96 -15.38,-39.83c0.94,-10.39 3.48,-20.64 7.76,-30.16c4.15,-9.77 9.99,-18.67 15.06,-27.97c22.13,-39.47 45.31,-78.35 69.42,-116.65c7.72,-12.05 14.44,-25.07 25.12,-34.87c11.35,-10.39 25.6,-18.54 41.21,-19.6c12.55,-0.52 24.89,3.82 35.35,10.55c11.8,6.92 21.09,18.44 24.2,31.88c4.49,17.01 -0.34,34.88 -7.55,50.42c-8.09,17.65 -19.62,33.67 -25.81,52.18c-1.13,4.21 -2.66,9.52 0.48,13.23c3.19,3 7.62,4.18 11.77,5.22c12,2.67 24.38,1.98 36.59,2.06c45,-0.01 90,0 135,0c8.91,-0.15 17.83,0.3 26.74,-0.22c6.43,-0.74 13.44,-1.79 18.44,-6.28c3.3,-2.92 3.71,-7.85 2.46,-11.85c-2.74,-8.86 -7.46,-16.93 -12.12,-24.89c-119.99,-204.91 -239.31,-410.22 -360.56,-614.4c-3.96,-6.56 -7.36,-13.68 -13.03,-18.98c-2.8,-2.69 -6.95,-4.22 -10.77,-3.11c-3.25,1.17 -5.45,4.03 -7.61,6.57c-5.34,6.81 -10.12,14.06 -14.51,21.52c-20.89,33.95 -40.88,68.44 -61.35,102.64c-117.9,198.43 -235.82,396.85 -353.71,595.29c-7.31,13.46 -15.09,26.67 -23.57,39.43c-7.45,10.96 -16.49,21.23 -28.14,27.83c-13.73,7.94 -30.69,11.09 -46.08,6.54c-11.23,-3.47 -22.09,-9.12 -30.13,-17.84c-10.18,-10.08 -14.69,-24.83 -14.17,-38.94c0.52,-14.86 5.49,-29.34 12.98,-42.1c71.58,-121.59 143.62,-242.92 215.93,-364.09c37.2,-62.8 74.23,-125.69 111.64,-188.36c37.84,-63.5 75.77,-126.94 113.44,-190.54c21.02,-35.82 42.19,-71.56 64.28,-106.74c6.79,-11.15 15.58,-21.15 26.16,-28.85c8.68,-5.92 18.42,-11 29.05,-11.94z" fill="#70c6be"/>
|
||||||
|
</g>
|
||||||
|
<g id="#1ba0d8ff">
|
||||||
|
<path id="svg_3" d="m628.35,608.38c17.83,-2.87 36.72,1.39 51.5,11.78c11.22,8.66 19.01,21.64 21.26,35.65c1.53,10.68 0.49,21.75 -3.44,31.84c-3.02,8.73 -7.35,16.94 -12.17,24.81c-68.76,115.58 -137.5,231.17 -206.27,346.75c-8.8,14.47 -16.82,29.47 -26.96,43.07c-7.37,9.11 -16.58,16.85 -27.21,21.89c-22.47,11.97 -51.79,4.67 -68.88,-13.33c-8.66,-8.69 -13.74,-20.63 -14.4,-32.84c-0.98,-12.64 1.81,-25.42 7.53,-36.69c5.03,-10.96 10.98,-21.45 17.19,-31.77c30.22,-50.84 60.17,-101.84 90.3,-152.73c41.24,-69.98 83.16,-139.55 124.66,-209.37c4.41,-7.94 9.91,-15.26 16.09,-21.9c8.33,-8.46 18.9,-15.3 30.8,-17.16z" fill="#1ba0d8"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.6 KiB |
@@ -3,6 +3,7 @@ import type { Axios } from 'axios'
|
|||||||
import FileList from './filebrowser/FileList.vue'
|
import FileList from './filebrowser/FileList.vue'
|
||||||
import FileToolbar from './filebrowser/FileToolbar.vue'
|
import FileToolbar from './filebrowser/FileToolbar.vue'
|
||||||
import type { EndPoints, FileItem, StorageConf } from '@/api/types'
|
import type { EndPoints, FileItem, StorageConf } from '@/api/types'
|
||||||
|
import { storageOptions } from '@/api/constants'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -27,29 +28,6 @@ const props = defineProps({
|
|||||||
// 对外事件
|
// 对外事件
|
||||||
const emit = defineEmits(['pathchanged'])
|
const emit = defineEmits(['pathchanged'])
|
||||||
|
|
||||||
const availableStorages = [
|
|
||||||
{
|
|
||||||
name: '本地',
|
|
||||||
code: 'local',
|
|
||||||
icon: 'mdi-folder-multiple-outline',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '阿里云盘',
|
|
||||||
code: 'alipan',
|
|
||||||
icon: 'mdi-cloud-outline',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '115网盘',
|
|
||||||
code: 'u115',
|
|
||||||
icon: 'mdi-cloud-outline',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Rclone网盘',
|
|
||||||
code: 'rclone',
|
|
||||||
icon: 'mdi-cloud-outline',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const fileIcons = {
|
const fileIcons = {
|
||||||
// 压缩包
|
// 压缩包
|
||||||
zip: 'mdi-folder-zip-outline',
|
zip: 'mdi-folder-zip-outline',
|
||||||
@@ -151,7 +129,7 @@ const sort = ref('name')
|
|||||||
// 计算属性
|
// 计算属性
|
||||||
const storagesArray = computed(() => {
|
const storagesArray = computed(() => {
|
||||||
const storageCodes = props.storages?.map(item => item.type)
|
const storageCodes = props.storages?.map(item => item.type)
|
||||||
return availableStorages.filter(item => storageCodes?.includes(item.code))
|
return storageOptions.filter(item => storageCodes?.includes(item.value))
|
||||||
})
|
})
|
||||||
|
|
||||||
// 方法
|
// 方法
|
||||||
|
|||||||
@@ -98,8 +98,8 @@ function onClose() {
|
|||||||
<DialogCloseBtn @click="onClose" />
|
<DialogCloseBtn @click="onClose" />
|
||||||
<VCardText class="flex justify-space-between align-center gap-3">
|
<VCardText class="flex justify-space-between align-center gap-3">
|
||||||
<div class="align-self-start">
|
<div class="align-self-start">
|
||||||
<h5 class="text-h6 mb-1">{{ props.rule.id }}</h5>
|
<h5 class="text-h6 mb-1">{{ props.rule.name }}</h5>
|
||||||
<div class="text-body-1 mb-3">{{ props.rule.name }}</div>
|
<div class="text-body-1 mb-3">{{ props.rule.id }}</div>
|
||||||
</div>
|
</div>
|
||||||
<VImg :src="filter_svg" cover class="mt-7" max-width="3rem" />
|
<VImg :src="filter_svg" cover class="mt-7" max-width="3rem" />
|
||||||
</VCardText>
|
</VCardText>
|
||||||
@@ -156,7 +156,7 @@ function onClose() {
|
|||||||
v-model="ruleInfo.size_range"
|
v-model="ruleInfo.size_range"
|
||||||
placeholder="0/1-10"
|
placeholder="0/1-10"
|
||||||
label="资源体积(MB)"
|
label="资源体积(MB)"
|
||||||
hint="最小资源文件体积或文件体积范围"
|
hint="最小资源文件体积或体积范围(剧集计算单集平均大小)"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
active
|
active
|
||||||
/>
|
/>
|
||||||
@@ -174,9 +174,9 @@ function onClose() {
|
|||||||
<VCol cols="6">
|
<VCol cols="6">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="ruleInfo.publish_time"
|
v-model="ruleInfo.publish_time"
|
||||||
placeholder="0"
|
placeholder="0/1-10"
|
||||||
label="发布时间(分钟)"
|
label="发布时间(分钟)"
|
||||||
hint="距离资源发布的最小时间间隔"
|
hint="距离资源发布的最小时间间隔或时间区间"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
active
|
active
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { TransferDirectoryConf } from '@/api/types'
|
import type { TransferDirectoryConf } from '@/api/types'
|
||||||
import { VDivider, VSpacer, VTextField } from 'vuetify/lib/components/index.mjs'
|
|
||||||
import { useToast } from 'vue-toast-notification'
|
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
import { storageOptions } from '@/api/constants'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -20,12 +19,6 @@ const props = defineProps({
|
|||||||
height: String,
|
height: String,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 下载路径
|
|
||||||
const downloadPath = ref<string>('')
|
|
||||||
|
|
||||||
// 媒体库路径
|
|
||||||
const libraryPath = ref<string>('')
|
|
||||||
|
|
||||||
// 卡版是否折叠状态
|
// 卡版是否折叠状态
|
||||||
const isCollapsed = ref(true)
|
const isCollapsed = ref(true)
|
||||||
|
|
||||||
@@ -36,19 +29,12 @@ const typeItems = [
|
|||||||
{ title: '电视剧', value: '电视剧' },
|
{ title: '电视剧', value: '电视剧' },
|
||||||
]
|
]
|
||||||
|
|
||||||
// 存储下拉字典
|
|
||||||
const storageItems = [
|
|
||||||
{ title: '本地', value: 'local' },
|
|
||||||
{ title: '阿里云盘', value: 'alipan' },
|
|
||||||
{ title: '115网盘', value: 'u115' },
|
|
||||||
{ title: 'Rclone网盘', value: 'rclone' },
|
|
||||||
]
|
|
||||||
|
|
||||||
// 自动整理方式下拉字典
|
// 自动整理方式下拉字典
|
||||||
const transferSourceItems = [
|
const transferSourceItems = [
|
||||||
{ title: '不自动整理', value: '' },
|
{ title: '不整理', value: '' },
|
||||||
{ title: '下载器监控', value: 'downloader' },
|
{ title: '下载器监控', value: 'downloader' },
|
||||||
{ title: '目录监控', value: 'monitor' },
|
{ title: '目录监控', value: 'monitor' },
|
||||||
|
{ title: '手动整理', value: 'manual' },
|
||||||
]
|
]
|
||||||
|
|
||||||
// 监控模式下拉字典
|
// 监控模式下拉字典
|
||||||
@@ -112,13 +98,13 @@ async function loadTransferTypeItems() {
|
|||||||
// 整理方式无数据提示
|
// 整理方式无数据提示
|
||||||
const computedNoDataText = computed(() => {
|
const computedNoDataText = computed(() => {
|
||||||
if (!props.directory.library_storage && !props.directory.storage) {
|
if (!props.directory.library_storage && !props.directory.storage) {
|
||||||
return '无可用整理方式!请先选择下载器储存与媒体库储存!'
|
return '请选择储存'
|
||||||
} else if (!props.directory.library_storage) {
|
} else if (!props.directory.library_storage) {
|
||||||
return '无可用整理方式!请先选择媒体库储存!'
|
return '请选择媒体库储存'
|
||||||
} else if (!props.directory.storage) {
|
} else if (!props.directory.storage) {
|
||||||
return '无可用整理方式!请先选择下载器储存!'
|
return '请选择下载器储存'
|
||||||
} else {
|
} else {
|
||||||
return '选择的存储没有支持的整理方法!'
|
return '选择的存储类型没有支持的整理方式'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -138,24 +124,6 @@ function onClose() {
|
|||||||
emit('close')
|
emit('close')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 下载路径更新
|
|
||||||
function updateDownloadPath(value: string) {
|
|
||||||
downloadPath.value = value
|
|
||||||
emit('update:modelValue', {
|
|
||||||
download: downloadPath.value,
|
|
||||||
library: libraryPath.value,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 媒体库路径更新
|
|
||||||
function updateLibraryPath(value: string) {
|
|
||||||
libraryPath.value = value
|
|
||||||
emit('update:modelValue', {
|
|
||||||
download: downloadPath.value,
|
|
||||||
library: libraryPath.value,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据选中的媒体类型,获取对应的媒体类别
|
// 根据选中的媒体类型,获取对应的媒体类别
|
||||||
const getCategories = computed(() => {
|
const getCategories = computed(() => {
|
||||||
const default_value = [{ title: '全部', value: '' }]
|
const default_value = [{ title: '全部', value: '' }]
|
||||||
@@ -227,19 +195,20 @@ watch(
|
|||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="4">
|
<VCol cols="4">
|
||||||
<VSelect v-model="props.directory.storage" variant="underlined" :items="storageItems" label="下载存储" />
|
<VSelect
|
||||||
|
v-model="props.directory.storage"
|
||||||
|
variant="underlined"
|
||||||
|
:items="storageOptions"
|
||||||
|
label="下载存储/源存储"
|
||||||
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="8">
|
<VCol cols="8">
|
||||||
<VPathField @update:modelValue="updateDownloadPath" :storage="props.directory.storage">
|
<VPathField
|
||||||
<template #activator="{ menuprops }">
|
v-model="props.directory.download_path"
|
||||||
<VTextField
|
:storage="props.directory.storage"
|
||||||
v-model="props.directory.download_path"
|
variant="underlined"
|
||||||
v-bind="menuprops"
|
label="下载目录/源目录"
|
||||||
variant="underlined"
|
/>
|
||||||
label="下载目录"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</VPathField>
|
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="6" v-if="!props.directory.media_type || props.directory.media_type === ''">
|
<VCol cols="6" v-if="!props.directory.media_type || props.directory.media_type === ''">
|
||||||
<VSwitch v-model="props.directory.download_type_folder" label="按类型分类"></VSwitch>
|
<VSwitch v-model="props.directory.download_type_folder" label="按类型分类"></VSwitch>
|
||||||
@@ -272,21 +241,17 @@ watch(
|
|||||||
<VSelect
|
<VSelect
|
||||||
v-model="props.directory.library_storage"
|
v-model="props.directory.library_storage"
|
||||||
variant="underlined"
|
variant="underlined"
|
||||||
:items="storageItems"
|
:items="storageOptions"
|
||||||
label="媒体库存储"
|
label="媒体库存储"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="8">
|
<VCol cols="8">
|
||||||
<VPathField @update:modelValue="updateLibraryPath" :storage="props.directory.library_storage">
|
<VPathField
|
||||||
<template #activator="{ menuprops }">
|
v-model="props.directory.library_path"
|
||||||
<VTextField
|
:storage="props.directory.library_storage"
|
||||||
v-model="props.directory.library_path"
|
variant="underlined"
|
||||||
v-bind="menuprops"
|
label="媒体库目录"
|
||||||
variant="underlined"
|
/>
|
||||||
label="媒体库目录"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</VPathField>
|
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="4">
|
<VCol cols="4">
|
||||||
<VSelect
|
<VSelect
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useToast } from 'vue-toast-notification'
|
|||||||
import type { DownloaderInfo } from '@/api/types'
|
import type { DownloaderInfo } from '@/api/types'
|
||||||
import qbittorrent_image from '@images/logos/qbittorrent.png'
|
import qbittorrent_image from '@images/logos/qbittorrent.png'
|
||||||
import transmission_image from '@images/logos/transmission.png'
|
import transmission_image from '@images/logos/transmission.png'
|
||||||
import {cloneDeep} from "lodash";
|
import { cloneDeep } from 'lodash'
|
||||||
|
|
||||||
// 定义输入
|
// 定义输入
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -211,7 +211,6 @@ onUnmounted(() => {
|
|||||||
<VTextField
|
<VTextField
|
||||||
v-model="downloaderInfo.config.username"
|
v-model="downloaderInfo.config.username"
|
||||||
label="用户名"
|
label="用户名"
|
||||||
placeholder="admin"
|
|
||||||
hint="登录使用的用户名"
|
hint="登录使用的用户名"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
active
|
active
|
||||||
@@ -289,7 +288,6 @@ onUnmounted(() => {
|
|||||||
<VTextField
|
<VTextField
|
||||||
v-model="downloaderInfo.config.username"
|
v-model="downloaderInfo.config.username"
|
||||||
label="用户名"
|
label="用户名"
|
||||||
placeholder="admin"
|
|
||||||
hint="登录使用的用户名"
|
hint="登录使用的用户名"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
active
|
active
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ const groupInfoDialog = ref(false)
|
|||||||
|
|
||||||
// 规则详情
|
// 规则详情
|
||||||
const groupInfo = ref<FilterRuleGroup>({
|
const groupInfo = ref<FilterRuleGroup>({
|
||||||
name: props.group?.name,
|
name: props.group?.name ?? '',
|
||||||
rule_string: props.group?.rule_string,
|
rule_string: props.group?.rule_string ?? '',
|
||||||
media_type: props.group?.media_type,
|
media_type: props.group?.media_type ?? '',
|
||||||
category: props.group?.category,
|
category: props.group?.category ?? '',
|
||||||
})
|
})
|
||||||
|
|
||||||
// 媒体类型字典
|
// 媒体类型字典
|
||||||
@@ -64,24 +64,30 @@ const mediaTypeItems = [
|
|||||||
// 根据选中的媒体类型,获取对应的媒体类别
|
// 根据选中的媒体类型,获取对应的媒体类别
|
||||||
const getCategories = computed(() => {
|
const getCategories = computed(() => {
|
||||||
const default_value = [{ title: '全部', value: '' }]
|
const default_value = [{ title: '全部', value: '' }]
|
||||||
if (!props.categories || !groupInfo.value.media_type || !props.categories[groupInfo.value.media_type ?? ''])
|
if (!props.categories || !groupInfo.value.media_type || !props.categories[groupInfo.value.media_type]) {
|
||||||
return default_value
|
return default_value
|
||||||
return default_value.concat(props.categories[groupInfo.value.media_type ?? ''])
|
}
|
||||||
|
return default_value.concat(props.categories[groupInfo.value.media_type] || [])
|
||||||
})
|
})
|
||||||
|
|
||||||
// 规则组规则卡片列表
|
// 规则组规则卡片列表
|
||||||
const filterRuleCards = ref<FilterCard[]>([])
|
const filterRuleCards = ref<FilterCard[]>([])
|
||||||
|
// 规则组类型,仅用于导入判断
|
||||||
|
const filterRuleCardsType = ref<FilterCard>({
|
||||||
|
pri: '',
|
||||||
|
rules: [],
|
||||||
|
})
|
||||||
|
|
||||||
// 导入代码弹窗
|
// 导入代码弹窗
|
||||||
const importCodeDialog = ref(false)
|
const importCodeDialog = ref(false)
|
||||||
|
|
||||||
// 导入的代码
|
// 导入代码类型
|
||||||
const importCodeString = ref('')
|
const importCodeType = ref('')
|
||||||
|
|
||||||
// 更新规则卡片的值
|
// 更新规则卡片的值
|
||||||
function updateFilterCardValue(pri: string, rules: string[]) {
|
function updateFilterCardValue(pri: string, rules: string[]) {
|
||||||
const card = filterRuleCards.value.find(card => card.pri === pri)
|
const card = filterRuleCards.value.find(card => card.pri === pri)
|
||||||
if (card) card.rules = rules
|
if (card && Array.isArray(rules)) card.rules = rules
|
||||||
}
|
}
|
||||||
|
|
||||||
// 移除卡片
|
// 移除卡片
|
||||||
@@ -95,99 +101,93 @@ function filterCardClose(pri: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 分享规则
|
// 分享规则
|
||||||
function shareRules() {
|
async function shareRules() {
|
||||||
// 有值才处理
|
|
||||||
if (filterRuleCards.value.length === 0) return
|
if (filterRuleCards.value.length === 0) return
|
||||||
|
|
||||||
// 将卡片规则接装为字符串
|
|
||||||
const value = filterRuleCards.value
|
const value = filterRuleCards.value
|
||||||
.filter(card => card.rules.length > 0)
|
.filter(card => Array.isArray(card.rules) && card.rules.length > 0)
|
||||||
.map(card => card.rules.join('&'))
|
.map(card => card.rules.join('&'))
|
||||||
.join('>')
|
.join('>')
|
||||||
|
|
||||||
// 复制到剪贴板
|
|
||||||
try {
|
try {
|
||||||
copyToClipboard(value)
|
let success
|
||||||
$toast.success('优先级规则已复制到剪贴板')
|
success = copyToClipboard(value)
|
||||||
|
if (await success) $toast.success('优先级规则已复制到剪贴板!')
|
||||||
|
else $toast.error('优先级规则复制失败:可能是浏览器不支持或被用户阻止!')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
$toast.error('优先级规则复制失败!')
|
$toast.error('优先级规则复制失败!')
|
||||||
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导入规则
|
// 导入规则
|
||||||
async function importRules() {
|
async function importRules(ruleType: string) {
|
||||||
importCodeString.value = ''
|
importCodeType.value = ruleType
|
||||||
importCodeDialog.value = true
|
importCodeDialog.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 监听导入代码变化
|
// 保存导入的代码,直接覆盖原有值
|
||||||
watchEffect(() => {
|
function saveCodeString(type: string, code: any) {
|
||||||
if (!importCodeString.value) return
|
try {
|
||||||
// 导入代码需要以空格开头和结束,没有则拼接
|
code = code.value
|
||||||
if (!importCodeString.value.startsWith(' ')) importCodeString.value = ` ${importCodeString.value}`
|
if (type === 'priority') {
|
||||||
if (!importCodeString.value.endsWith(' ')) importCodeString.value = `${importCodeString.value} `
|
// 解析值
|
||||||
// 将导入的代码转换为规则卡片
|
if (!code) return
|
||||||
const groups = importCodeString.value.split('>')
|
// 首尾增加空格
|
||||||
filterRuleCards.value = groups.map((group: string, index: number) => {
|
if (!code.startsWith(' ')) code = ` ${code}`
|
||||||
return {
|
if (!code.endsWith(' ')) code = `${code} `
|
||||||
pri: (index + 1).toString(),
|
const groups = code.split('>')
|
||||||
rules: group.split('&'),
|
filterRuleCards.value = groups.map((group: string, index: number) => ({
|
||||||
|
pri: (index + 1).toString(),
|
||||||
|
rules: group.split('&').filter(rule => rule),
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
})
|
} catch (error) {
|
||||||
})
|
$toast.error('导入失败!')
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 增加卡片
|
// 增加卡片
|
||||||
function addFilterCard() {
|
function addFilterCard() {
|
||||||
// 优先级
|
|
||||||
const pri = (filterRuleCards.value.length + 1).toString()
|
const pri = (filterRuleCards.value.length + 1).toString()
|
||||||
|
|
||||||
// 新卡片
|
|
||||||
const newCard: FilterCard = { pri, rules: [] }
|
const newCard: FilterCard = { pri, rules: [] }
|
||||||
|
|
||||||
// 添加到列表
|
|
||||||
filterRuleCards.value.push(newCard)
|
filterRuleCards.value.push(newCard)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据列表的拖动顺序更新优先级
|
// 根据列表的拖动顺序更新优先级
|
||||||
function dragOrderEnd() {
|
function dragOrderEnd() {
|
||||||
filterRuleCards.value.map((card, index) => {
|
filterRuleCards.value.forEach((card, index) => {
|
||||||
card.pri = (index + 1).toString()
|
card.pri = (index + 1).toString()
|
||||||
return card
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开详情弹窗
|
// 打开详情弹窗
|
||||||
function opengroupInfoDialog() {
|
function opengroupInfoDialog() {
|
||||||
// 深复制
|
|
||||||
groupInfo.value = cloneDeep(props.group)
|
groupInfo.value = cloneDeep(props.group)
|
||||||
if (props.group.rule_string) {
|
if (props.group.rule_string) {
|
||||||
filterRuleCards.value = props.group.rule_string.split('>').map((group: string, index: number) => {
|
filterRuleCards.value = props.group.rule_string.split('>').map((group: string, index: number) => ({
|
||||||
return {
|
pri: (index + 1).toString(),
|
||||||
pri: (index + 1).toString(),
|
rules: group.split('&').filter(rule => rule),
|
||||||
rules: group.split('&'),
|
}))
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
groupInfoDialog.value = true
|
groupInfoDialog.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存详情数据
|
// 保存详情数据
|
||||||
function saveGroupInfo() {
|
function saveGroupInfo() {
|
||||||
// 为空
|
if (!groupInfo.value.name.trim()) {
|
||||||
if (!groupInfo.value.name) {
|
|
||||||
$toast.error('规则组名称不能为空')
|
$toast.error('规则组名称不能为空')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 重名判断
|
|
||||||
if (props.groups.some(item => item.name === groupInfo.value.name && item !== props.group)) {
|
if (props.groups.some(item => item.name === groupInfo.value.name && item !== props.group)) {
|
||||||
$toast.error(`规则组名称【${groupInfo.value.name}】已存在,请替换`)
|
$toast.error(`规则组名称【${groupInfo.value.name}】已存在,请替换`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 保存
|
|
||||||
groupInfoDialog.value = false
|
groupInfoDialog.value = false
|
||||||
// 更新到 groupInfo的rule_string
|
|
||||||
groupInfo.value.rule_string = filterRuleCards.value
|
groupInfo.value.rule_string = filterRuleCards.value
|
||||||
.filter(card => card.rules.length > 0)
|
.filter(card => Array.isArray(card.rules) && card.rules.length > 0)
|
||||||
.map(card => card.rules.join('&'))
|
.map(card => card.rules.join('&'))
|
||||||
.join('>')
|
.join('>')
|
||||||
emit('change', groupInfo.value, props.group.name)
|
emit('change', groupInfo.value, props.group.name)
|
||||||
@@ -224,8 +224,8 @@ function onClose() {
|
|||||||
<VCard :title="`${props.group.name} - 配置`" class="rounded-t">
|
<VCard :title="`${props.group.name} - 配置`" class="rounded-t">
|
||||||
<DialogCloseBtn v-model="groupInfoDialog" />
|
<DialogCloseBtn v-model="groupInfoDialog" />
|
||||||
<VDivider />
|
<VDivider />
|
||||||
<VCardText>
|
<VCardItem class="pt-1">
|
||||||
<VRow>
|
<VRow class="mt-1">
|
||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="groupInfo.name"
|
v-model="groupInfo.name"
|
||||||
@@ -257,7 +257,7 @@ function onClose() {
|
|||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
</VCardText>
|
</VCardItem>
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<draggable
|
<draggable
|
||||||
v-model="filterRuleCards"
|
v-model="filterRuleCards"
|
||||||
@@ -284,7 +284,7 @@ function onClose() {
|
|||||||
<VBtn color="primary" variant="tonal" @click="addFilterCard">
|
<VBtn color="primary" variant="tonal" @click="addFilterCard">
|
||||||
<VIcon icon="mdi-plus" />
|
<VIcon icon="mdi-plus" />
|
||||||
</VBtn>
|
</VBtn>
|
||||||
<VBtn color="success" variant="tonal" @click="importRules">
|
<VBtn color="success" variant="tonal" @click="importRules('priority')">
|
||||||
<VIcon icon="mdi-import" />
|
<VIcon icon="mdi-import" />
|
||||||
</VBtn>
|
</VBtn>
|
||||||
<VBtn color="info" variant="tonal" @click="shareRules">
|
<VBtn color="info" variant="tonal" @click="shareRules">
|
||||||
@@ -295,8 +295,13 @@ function onClose() {
|
|||||||
</VCardActions>
|
</VCardActions>
|
||||||
</VCard>
|
</VCard>
|
||||||
</VDialog>
|
</VDialog>
|
||||||
<VDialog v-model="importCodeDialog" width="60rem" scrollable>
|
<ImportCodeDialog
|
||||||
<ImportCodeDialog v-model="importCodeString" title="导入优先级规则" @close="importCodeDialog = false" />
|
v-if="importCodeDialog"
|
||||||
</VDialog>
|
v-model="importCodeDialog"
|
||||||
|
title="导入规则优先级"
|
||||||
|
:dataType="importCodeType"
|
||||||
|
@close="importCodeDialog = false"
|
||||||
|
@save="saveCodeString"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -91,7 +91,17 @@ async function drawImages(imageList: string[]) {
|
|||||||
const img = new Image()
|
const img = new Image()
|
||||||
img.setAttribute('crossorigin', 'anonymous')
|
img.setAttribute('crossorigin', 'anonymous')
|
||||||
img.src = imgSrc
|
img.src = imgSrc
|
||||||
await new Promise(resolve => (img.onload = resolve))
|
try {
|
||||||
|
await new Promise<void>((resolve, reject) => {
|
||||||
|
img.onload = () => resolve()
|
||||||
|
img.onerror = () => reject(new Error(`Failed to load image: ${imgSrc}`))
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
ctx.fillStyle = '#e5e7eb'
|
||||||
|
ctx.fillRect(MARGIN_WIDTH * index + POSTER_WIDTH * (index - 1), MARGIN_HEIGHT, POSTER_WIDTH, POSTER_HEIGHT)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const x = MARGIN_WIDTH * index + POSTER_WIDTH * (index - 1)
|
const x = MARGIN_WIDTH * index + POSTER_WIDTH * (index - 1)
|
||||||
const y = MARGIN_HEIGHT
|
const y = MARGIN_HEIGHT
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { formatSeason } from '@/@core/utils/formatters'
|
|||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
||||||
import type { MediaInfo, NotExistMediaInfo, Subscribe, TmdbSeason } from '@/api/types'
|
import type { MediaInfo, NotExistMediaInfo, Subscribe, TmdbSeason } from '@/api/types'
|
||||||
import router from '@/router'
|
import router, { registerAbortController } from '@/router'
|
||||||
import noImage from '@images/no-image.jpeg'
|
import noImage from '@images/no-image.jpeg'
|
||||||
import tmdbImage from '@images/logos/tmdb.png'
|
import tmdbImage from '@images/logos/tmdb.png'
|
||||||
import doubanImage from '@images/logos/douban-black.png'
|
import doubanImage from '@images/logos/douban-black.png'
|
||||||
@@ -67,6 +67,12 @@ const sourceIconDict: { [key: string]: any } = {
|
|||||||
bangumi: bangumiImage,
|
bangumi: bangumiImage,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 绑定MediaCard元素
|
||||||
|
const mediaCardRef = ref<HTMLElement | null>(null)
|
||||||
|
|
||||||
|
// 创建Intersection Observer实例
|
||||||
|
const observer = ref<IntersectionObserver | null>(null)
|
||||||
|
|
||||||
// 获得mediaid
|
// 获得mediaid
|
||||||
function getMediaId() {
|
function getMediaId() {
|
||||||
if (props.media?.tmdb_id) return `tmdb:${props.media?.tmdb_id}`
|
if (props.media?.tmdb_id) return `tmdb:${props.media?.tmdb_id}`
|
||||||
@@ -90,7 +96,6 @@ function getChipColor(type: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 添加订阅处理
|
// 添加订阅处理
|
||||||
|
|
||||||
async function handleAddSubscribe() {
|
async function handleAddSubscribe() {
|
||||||
if (props.media?.type === '电视剧' && props.media?.tmdb_id) {
|
if (props.media?.type === '电视剧' && props.media?.tmdb_id) {
|
||||||
// TMDB电视剧
|
// TMDB电视剧
|
||||||
@@ -219,6 +224,9 @@ async function handleCheckSubscribe() {
|
|||||||
// 查询当前媒体是否已入库
|
// 查询当前媒体是否已入库
|
||||||
async function handleCheckExists() {
|
async function handleCheckExists() {
|
||||||
try {
|
try {
|
||||||
|
const abortController = new AbortController()
|
||||||
|
registerAbortController(abortController)
|
||||||
|
const { signal } = abortController
|
||||||
const result: { [key: string]: any } = await api.get('mediaserver/exists', {
|
const result: { [key: string]: any } = await api.get('mediaserver/exists', {
|
||||||
params: {
|
params: {
|
||||||
tmdbid: props.media?.tmdb_id,
|
tmdbid: props.media?.tmdb_id,
|
||||||
@@ -227,6 +235,7 @@ async function handleCheckExists() {
|
|||||||
season: props.media?.season,
|
season: props.media?.season,
|
||||||
mtype: props.media?.type,
|
mtype: props.media?.type,
|
||||||
},
|
},
|
||||||
|
signal,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (result.success) isExists.value = true
|
if (result.success) isExists.value = true
|
||||||
@@ -238,13 +247,16 @@ async function handleCheckExists() {
|
|||||||
// 调用API检查是否已订阅,电视剧需要指定季
|
// 调用API检查是否已订阅,电视剧需要指定季
|
||||||
async function checkSubscribe(season = 0) {
|
async function checkSubscribe(season = 0) {
|
||||||
try {
|
try {
|
||||||
|
const abortController = new AbortController()
|
||||||
|
registerAbortController(abortController)
|
||||||
|
const { signal } = abortController
|
||||||
const mediaid = getMediaId()
|
const mediaid = getMediaId()
|
||||||
|
|
||||||
const result: Subscribe = await api.get(`subscribe/media/${mediaid}`, {
|
const result: Subscribe = await api.get(`subscribe/media/${mediaid}`, {
|
||||||
params: {
|
params: {
|
||||||
season,
|
season,
|
||||||
title: props.media?.title,
|
title: props.media?.title,
|
||||||
},
|
},
|
||||||
|
signal,
|
||||||
})
|
})
|
||||||
|
|
||||||
return result.id || null
|
return result.id || null
|
||||||
@@ -267,7 +279,6 @@ async function checkSeasonsNotExists() {
|
|||||||
let state = 0
|
let state = 0
|
||||||
if (item.episodes.length === 0) state = 2
|
if (item.episodes.length === 0) state = 2
|
||||||
else if (item.episodes.length < item.total_episode) state = 1
|
else if (item.episodes.length < item.total_episode) state = 1
|
||||||
|
|
||||||
seasonsNotExisted.value[item.season] = state
|
seasonsNotExisted.value[item.season] = state
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -336,13 +347,24 @@ function getExistText(season: number) {
|
|||||||
// 打开详情页
|
// 打开详情页
|
||||||
function goMediaDetail(isHovering = false) {
|
function goMediaDetail(isHovering = false) {
|
||||||
if (isHovering) {
|
if (isHovering) {
|
||||||
router.push({
|
if (props.media?.collection_id) {
|
||||||
path: '/media',
|
// 跳转到合集列表
|
||||||
query: {
|
router.push({
|
||||||
mediaid: getMediaId(),
|
path: `/browse/tmdb/collection/${props.media?.collection_id}`,
|
||||||
type: props.media?.type,
|
query: {
|
||||||
},
|
title: props.media?.title,
|
||||||
})
|
},
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 跳转到媒体详情页
|
||||||
|
router.push({
|
||||||
|
path: '/media',
|
||||||
|
query: {
|
||||||
|
mediaid: getMediaId(),
|
||||||
|
type: props.media?.type,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,10 +381,43 @@ function handleSearch() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 装载时检查是否已订阅
|
// 懒加载检查
|
||||||
onBeforeMount(() => {
|
function handleCheckLazy() {
|
||||||
|
if (props.media?.collection_id) {
|
||||||
|
return
|
||||||
|
}
|
||||||
handleCheckSubscribe()
|
handleCheckSubscribe()
|
||||||
handleCheckExists()
|
handleCheckExists()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 在元素进入视窗时触发懒加载函数
|
||||||
|
function setupIntersectionObserver() {
|
||||||
|
if (mediaCardRef.value) {
|
||||||
|
observer.value = new IntersectionObserver(
|
||||||
|
entries => {
|
||||||
|
entries.forEach(entry => {
|
||||||
|
if (entry.isIntersecting) {
|
||||||
|
// 只要MediaCard进入视窗,就调用懒加载的操作
|
||||||
|
handleCheckLazy()
|
||||||
|
// 加载后销毁观察者实例
|
||||||
|
observer.value?.disconnect()
|
||||||
|
observer.value = null
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
{ threshold: 0.1 },
|
||||||
|
)
|
||||||
|
observer.value.observe(mediaCardRef.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
setupIntersectionObserver()
|
||||||
|
})
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
observer.value?.disconnect()
|
||||||
|
observer.value = null
|
||||||
})
|
})
|
||||||
|
|
||||||
// 计算图片地址
|
// 计算图片地址
|
||||||
@@ -407,81 +462,85 @@ function onRemoveSubscribe() {
|
|||||||
<template>
|
<template>
|
||||||
<VHover>
|
<VHover>
|
||||||
<template #default="hover">
|
<template #default="hover">
|
||||||
<VCard
|
<div ref="mediaCardRef">
|
||||||
v-bind="hover.props"
|
<VCard
|
||||||
:height="props.height"
|
v-bind="hover.props"
|
||||||
:width="props.width"
|
:height="props.height"
|
||||||
class="outline-none shadow ring-gray-500 rounded-lg"
|
:width="props.width"
|
||||||
:class="{
|
class="outline-none shadow ring-gray-500 rounded-lg"
|
||||||
'transition transform-cpu duration-300 scale-105 shadow-lg': hover.isHovering,
|
:class="{
|
||||||
'ring-1': isImageLoaded,
|
'transition transform-cpu duration-300 scale-105 shadow-lg': hover.isHovering,
|
||||||
}"
|
'ring-1': isImageLoaded,
|
||||||
@click.stop="goMediaDetail(hover.isHovering ?? false)"
|
}"
|
||||||
>
|
@click.stop="goMediaDetail(hover.isHovering ?? false)"
|
||||||
<VImg
|
|
||||||
aspect-ratio="2/3"
|
|
||||||
:src="getImgUrl"
|
|
||||||
class="object-cover aspect-w-2 aspect-h-3"
|
|
||||||
:class="hover.isHovering ? 'on-hover' : ''"
|
|
||||||
cover
|
|
||||||
@load="isImageLoaded = true"
|
|
||||||
@error="imageLoadError = true"
|
|
||||||
>
|
>
|
||||||
<template #placeholder>
|
<VImg
|
||||||
<div class="w-full h-full">
|
aspect-ratio="2/3"
|
||||||
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
|
:src="getImgUrl"
|
||||||
|
class="object-cover aspect-w-2 aspect-h-3"
|
||||||
|
cover
|
||||||
|
@load="isImageLoaded = true"
|
||||||
|
@error="imageLoadError = true"
|
||||||
|
>
|
||||||
|
<template #placeholder>
|
||||||
|
<div class="w-full h-full">
|
||||||
|
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VImg>
|
||||||
|
<!-- 详情 -->
|
||||||
|
<VCardText
|
||||||
|
v-show="hover.isHovering || imageLoadError"
|
||||||
|
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 ...">
|
||||||
|
{{ props.media?.title }}
|
||||||
|
</h1>
|
||||||
|
<p class="leading-4 line-clamp-4 overflow-hidden text-ellipsis ...">
|
||||||
|
{{ props.media?.overview }}
|
||||||
|
</p>
|
||||||
|
<div v-if="props.media?.collection_id" class="mb-3" @click.stop=""></div>
|
||||||
|
<div v-else class="flex align-center justify-between">
|
||||||
|
<IconBtn icon="mdi-magnify" color="white" @click.stop="handleSearch" />
|
||||||
|
<IconBtn icon="mdi-heart" :color="isSubscribed ? 'error' : 'white'" @click.stop="handleSubscribe" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</VCardText>
|
||||||
</VImg>
|
<!-- 类型角标 -->
|
||||||
<!-- 类型角标 -->
|
<VChip
|
||||||
<VChip
|
v-show="isImageLoaded"
|
||||||
v-show="isImageLoaded"
|
variant="elevated"
|
||||||
variant="elevated"
|
size="small"
|
||||||
size="small"
|
:class="getChipColor(props.media?.type || '')"
|
||||||
:class="getChipColor(props.media?.type || '')"
|
class="absolute left-2 top-2 bg-opacity-80 shadow-md text-white font-bold"
|
||||||
class="absolute left-2 top-2 bg-opacity-80 shadow-md text-white font-bold"
|
>
|
||||||
>
|
{{ props.media?.type }}
|
||||||
{{ props.media?.type }}
|
</VChip>
|
||||||
</VChip>
|
<!-- 本地存在标识 -->
|
||||||
<!-- 本地存在标识 -->
|
<ExistIcon v-if="isExists && !hover.isHovering" />
|
||||||
<ExistIcon v-if="isExists && !hover.isHovering" />
|
<!-- 评分角标 -->
|
||||||
<!-- 评分角标 -->
|
<VChip
|
||||||
<VChip
|
v-if="isImageLoaded && props.media?.vote_average && !(isExists && !hover.isHovering)"
|
||||||
v-if="isImageLoaded && props.media?.vote_average && !(isExists && !hover.isHovering)"
|
variant="elevated"
|
||||||
variant="elevated"
|
size="small"
|
||||||
size="small"
|
:class="getChipColor('rating')"
|
||||||
:class="getChipColor('rating')"
|
class="absolute right-2 top-2 bg-opacity-80 shadow-md text-white font-bold"
|
||||||
class="absolute right-2 top-2 bg-opacity-80 shadow-md text-white font-bold"
|
>
|
||||||
>
|
{{ props.media?.vote_average }}
|
||||||
{{ props.media?.vote_average }}
|
</VChip>
|
||||||
</VChip>
|
<!--来源图标-->
|
||||||
<!-- 详情 -->
|
<VAvatar
|
||||||
<VCardText
|
size="24"
|
||||||
v-show="hover.isHovering || imageLoadError"
|
density="compact"
|
||||||
class="w-full flex flex-col flex-wrap justify-end align-left text-white absolute bottom-0 cursor-pointer pa-2"
|
class="absolute bottom-1 right-1"
|
||||||
>
|
tile
|
||||||
<span class="font-bold">{{ props.media?.year }}</span>
|
v-if="!hover.isHovering && isImageLoaded && props.media?.source"
|
||||||
<h1 class="mb-1 text-white font-extrabold text-xl line-clamp-2 overflow-hidden text-ellipsis ...">
|
>
|
||||||
{{ props.media?.title }}
|
<VImg cover :src="sourceIconDict[props.media?.source]" class="shadow-lg" />
|
||||||
</h1>
|
</VAvatar>
|
||||||
<p class="leading-4 line-clamp-4 overflow-hidden text-ellipsis ...">
|
</VCard>
|
||||||
{{ props.media?.overview }}
|
</div>
|
||||||
</p>
|
|
||||||
<div class="flex align-center justify-between">
|
|
||||||
<IconBtn icon="mdi-magnify" color="white" @click.stop="handleSearch" />
|
|
||||||
<IconBtn icon="mdi-heart" :color="isSubscribed ? 'error' : 'white'" @click.stop="handleSubscribe" />
|
|
||||||
</div>
|
|
||||||
</VCardText>
|
|
||||||
<VAvatar
|
|
||||||
size="24"
|
|
||||||
density="compact"
|
|
||||||
class="absolute bottom-1 right-1"
|
|
||||||
tile
|
|
||||||
v-if="!hover.isHovering && isImageLoaded && props.media?.source"
|
|
||||||
>
|
|
||||||
<VImg cover :src="sourceIconDict[props.media?.source]" class="shadow-lg" />
|
|
||||||
</VAvatar>
|
|
||||||
</VCard>
|
|
||||||
</template>
|
</template>
|
||||||
</VHover>
|
</VHover>
|
||||||
<!-- 订阅季弹窗 -->
|
<!-- 订阅季弹窗 -->
|
||||||
@@ -551,9 +610,3 @@ function onRemoveSubscribe() {
|
|||||||
@remove="onRemoveSubscribe"
|
@remove="onRemoveSubscribe"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.on-hover img {
|
|
||||||
@apply brightness-50;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { Context } from '@/api/types'
|
|||||||
import { isNullOrEmptyObject } from '@/@core/utils'
|
import { isNullOrEmptyObject } from '@/@core/utils'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
defineProps({
|
||||||
context: Object as PropType<Context>,
|
context: Object as PropType<Context>,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -45,8 +45,7 @@ function openTmdbPage(type: string, tmdbId: number) {
|
|||||||
</template>
|
</template>
|
||||||
</VImg>
|
</VImg>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex-grow">
|
||||||
<div>
|
|
||||||
<VCardItem class="pb-1">
|
<VCardItem class="pb-1">
|
||||||
<VCardTitle class="text-center text-md-left">
|
<VCardTitle class="text-center text-md-left">
|
||||||
{{ context?.media_info?.title || context?.meta_info?.name }}
|
{{ context?.media_info?.title || context?.meta_info?.name }}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { isNullOrEmptyObject } from '@/@core/utils'
|
||||||
import type { Message } from '@/api/types'
|
import type { Message } from '@/api/types'
|
||||||
import { formatDateDifference } from '@core/utils/formatters'
|
import { formatDateDifference } from '@core/utils/formatters'
|
||||||
|
|
||||||
@@ -45,24 +46,31 @@ function replaceNewLine(value: string) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VCard variant="tonal" :width="props.width" :height="props.height" @click="openLink">
|
<VCard variant="tonal" :width="props.width" :height="props.height" @click="openLink" max-width="23rem">
|
||||||
<div v-if="props.message?.image" class="relative text-center card-cover-blurred">
|
<div v-if="props.message?.image" class="relative text-center card-cover-blurred">
|
||||||
<VImg
|
<VImg
|
||||||
:src="props.message?.image"
|
:src="props.message?.image"
|
||||||
aspect-ratio="4/3"
|
aspect-ratio="3/2"
|
||||||
cover
|
cover
|
||||||
|
position="top"
|
||||||
:class="{ shadow: isImageLoaded }"
|
:class="{ shadow: isImageLoaded }"
|
||||||
@load="imageLoaded"
|
@load="imageLoaded"
|
||||||
@error="imageLoadError = true"
|
@error="imageLoadError = true"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="props.message?.title && !props.message?.image && !props.message?.note"
|
v-if="
|
||||||
|
props.message?.title &&
|
||||||
|
!props.message?.text &&
|
||||||
|
!props.message?.image &&
|
||||||
|
isNullOrEmptyObject(props.message?.note) &&
|
||||||
|
props.message?.action === 0
|
||||||
|
"
|
||||||
class="rounded-md text-body-1 py-2 px-4 elevation-2 bg-primary text-white chat-right mb-1"
|
class="rounded-md text-body-1 py-2 px-4 elevation-2 bg-primary text-white chat-right mb-1"
|
||||||
>
|
>
|
||||||
<p class="mb-0">{{ props.message?.title }}</p>
|
<p class="mb-0">{{ props.message?.title }}</p>
|
||||||
</div>
|
</div>
|
||||||
<VCardTitle v-else-if="props.message?.title">
|
<VCardTitle v-else-if="props.message?.title" class="break-words whitespace-break-spaces">
|
||||||
{{ props.message?.title }}
|
{{ props.message?.title }}
|
||||||
</VCardTitle>
|
</VCardTitle>
|
||||||
<div
|
<div
|
||||||
@@ -72,13 +80,13 @@ function replaceNewLine(value: string) {
|
|||||||
<p class="mb-0">{{ props.message?.text }}</p>
|
<p class="mb-0">{{ props.message?.text }}</p>
|
||||||
</div>
|
</div>
|
||||||
<VCardText v-if="props.message?.text && props.message?.action === 1" v-html="replaceNewLine(props.message?.text)" />
|
<VCardText v-if="props.message?.text && props.message?.action === 1" v-html="replaceNewLine(props.message?.text)" />
|
||||||
<VCardText v-if="props.message?.note">
|
<VCardText v-if="!isNullOrEmptyObject(props.message?.note)">
|
||||||
<VList>
|
<VList>
|
||||||
<VListItem v-for="(value, key) in noteToJson()" :key="key" two-line>
|
<VListItem v-for="(value, key) in noteToJson()" :key="key" two-line>
|
||||||
<VListItemTitle v-if="value.title_year" class="font-bold">
|
<VListItemTitle v-if="value.title_year" class="font-bold break-words whitespace-break-spaces">
|
||||||
{{ key + 1 }}. {{ value.title_year }}
|
{{ key + 1 }}. {{ value.title_year }}
|
||||||
</VListItemTitle>
|
</VListItemTitle>
|
||||||
<VListItemTitle v-if="value.enclosure" class="font-bold whitespace-break-spaces">
|
<VListItemTitle v-if="value.enclosure" class="font-bold break-words whitespace-break-spaces">
|
||||||
{{ key + 1 }}. {{ value.title }} {{ value.volume_factor }} ↑{{ value.seeders }}
|
{{ key + 1 }}. {{ value.title }} {{ value.volume_factor }} ↑{{ value.seeders }}
|
||||||
</VListItemTitle>
|
</VListItemTitle>
|
||||||
<VListItemSubtitle v-if="value.type">
|
<VListItemSubtitle v-if="value.type">
|
||||||
|
|||||||
@@ -43,11 +43,8 @@ const imageLoadError = ref(false)
|
|||||||
// 更新日志弹窗
|
// 更新日志弹窗
|
||||||
const releaseDialog = ref(false)
|
const releaseDialog = ref(false)
|
||||||
|
|
||||||
// 计算插件标签
|
// 插件详情弹窗
|
||||||
const pluginLabels = computed(() => {
|
const detailDialog = ref(false)
|
||||||
if (!props.plugin?.plugin_label) return []
|
|
||||||
return props.plugin.plugin_label.split(',')
|
|
||||||
})
|
|
||||||
|
|
||||||
// 图片加载完成
|
// 图片加载完成
|
||||||
async function imageLoaded() {
|
async function imageLoaded() {
|
||||||
@@ -76,7 +73,7 @@ async function installPlugin() {
|
|||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
$toast.success(`插件 ${props.plugin?.plugin_name} 安装成功!`)
|
$toast.success(`插件 ${props.plugin?.plugin_name} 安装成功!`)
|
||||||
|
detailDialog.value = false
|
||||||
// 通知父组件刷新
|
// 通知父组件刷新
|
||||||
emit('install')
|
emit('install')
|
||||||
} else {
|
} else {
|
||||||
@@ -149,80 +146,141 @@ const dropdownItems = ref([
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VCard :width="props.width" :height="props.height" @click="installPlugin" class="flex flex-col">
|
<div>
|
||||||
<div class="me-n3 absolute bottom-0 right-3">
|
<VCard :width="props.width" :height="props.height" @click="detailDialog = true" class="flex flex-col h-full">
|
||||||
<IconBtn>
|
|
||||||
<VIcon icon="mdi-dots-vertical" />
|
|
||||||
<VMenu activator="parent" close-on-content-click>
|
|
||||||
<VList>
|
|
||||||
<VListItem
|
|
||||||
v-for="(item, i) in dropdownItems"
|
|
||||||
v-show="item.show"
|
|
||||||
:key="i"
|
|
||||||
variant="plain"
|
|
||||||
@click="item.props.click"
|
|
||||||
>
|
|
||||||
<template #prepend>
|
|
||||||
<VIcon :icon="item.props.prependIcon" />
|
|
||||||
</template>
|
|
||||||
<VListItemTitle v-text="item.title" />
|
|
||||||
</VListItem>
|
|
||||||
</VList>
|
|
||||||
</VMenu>
|
|
||||||
</IconBtn>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="relative flex flex-row items-start pa-3 justify-between grow"
|
|
||||||
:style="{ background: `${backgroundColor}` }"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
class="absolute inset-0 bg-cover bg-center"
|
class="relative flex flex-row items-start pa-3 justify-between grow"
|
||||||
:style="{ background: `${backgroundColor}`, filter: 'brightness(0.5)' }"
|
:style="{ background: `${backgroundColor}` }"
|
||||||
></div>
|
>
|
||||||
<div class="relative flex-1 min-w-0">
|
<div
|
||||||
<VCardTitle class="text-white px-2 text-shadow whitespace-nowrap overflow-hidden text-ellipsis">
|
class="absolute inset-0 bg-cover bg-center"
|
||||||
{{ props.plugin?.plugin_name }}
|
:style="{ background: `${backgroundColor}`, filter: 'brightness(0.5)' }"
|
||||||
<span class="text-sm text-gray-200">v{{ props.plugin?.plugin_version }}</span>
|
></div>
|
||||||
</VCardTitle>
|
<div class="relative flex-1 min-w-0">
|
||||||
<VCardText class="text-white px-2 py-1 text-shadow line-clamp-3">
|
<VCardTitle class="text-white text-lg px-2 text-shadow whitespace-nowrap overflow-hidden text-ellipsis ...">
|
||||||
{{ props.plugin?.plugin_desc }}
|
{{ props.plugin?.plugin_name }}
|
||||||
</VCardText>
|
<span class="text-sm text-gray-200">v{{ props.plugin?.plugin_version }}</span>
|
||||||
|
</VCardTitle>
|
||||||
|
<VCardText class="text-white text-sm px-2 py-0 text-shadow overflow-hidden line-clamp-3 ...">
|
||||||
|
{{ props.plugin?.plugin_desc }}
|
||||||
|
</VCardText>
|
||||||
|
</div>
|
||||||
|
<div class="relative flex-shrink-0 self-center">
|
||||||
|
<VAvatar size="64">
|
||||||
|
<VImg
|
||||||
|
ref="imageRef"
|
||||||
|
:src="iconPath"
|
||||||
|
aspect-ratio="4/3"
|
||||||
|
cover
|
||||||
|
:class="{ shadow: isImageLoaded }"
|
||||||
|
@load="imageLoaded"
|
||||||
|
@error="imageLoadError = true"
|
||||||
|
/>
|
||||||
|
</VAvatar>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative flex-shrink-0 self-center">
|
<VCardText class="flex flex-none align-self-baseline py-3 w-full align-end">
|
||||||
<VAvatar size="64">
|
<span>
|
||||||
<VImg
|
<VIcon icon="mdi-github" class="me-1" />
|
||||||
ref="imageRef"
|
<a :href="props.plugin?.author_url" target="_blank" @click.stop>
|
||||||
:src="iconPath"
|
{{ props.plugin?.plugin_author }}
|
||||||
aspect-ratio="4/3"
|
</a>
|
||||||
cover
|
</span>
|
||||||
:class="{ shadow: isImageLoaded }"
|
<span v-if="props.count" class="ms-3">
|
||||||
@load="imageLoaded"
|
<VIcon icon="mdi-download" />
|
||||||
@error="imageLoadError = true"
|
<span class="text-sm ms-1 mt-1">{{ props.count?.toLocaleString() }}</span>
|
||||||
/>
|
</span>
|
||||||
</VAvatar>
|
<div class="me-n3 absolute bottom-1 right-3">
|
||||||
</div>
|
<IconBtn>
|
||||||
</div>
|
<VIcon icon="mdi-dots-vertical" />
|
||||||
<VCardText class="flex flex-none align-self-baseline py-3 w-full align-end">
|
<VMenu activator="parent" close-on-content-click>
|
||||||
<span>
|
<VList>
|
||||||
<VIcon icon="mdi-github" class="me-1" />
|
<VListItem
|
||||||
<a :href="props.plugin?.author_url" target="_blank" @click.stop>
|
v-for="(item, i) in dropdownItems"
|
||||||
{{ props.plugin?.plugin_author }}
|
v-show="item.show"
|
||||||
</a>
|
:key="i"
|
||||||
</span>
|
variant="plain"
|
||||||
<span v-if="props.count" class="ms-3">
|
@click="item.props.click"
|
||||||
<VIcon icon="mdi-download" />
|
>
|
||||||
<span class="text-sm ms-1 mt-1">{{ props.count?.toLocaleString() }}</span>
|
<template #prepend>
|
||||||
</span>
|
<VIcon :icon="item.props.prependIcon" />
|
||||||
</VCardText>
|
</template>
|
||||||
</VCard>
|
<VListItemTitle v-text="item.title" />
|
||||||
<!-- 安装插件进度框 -->
|
</VListItem>
|
||||||
<ProgressDialog v-if="progressDialog" v-model="progressDialog" :text="progressText" />
|
</VList>
|
||||||
<!-- 更新日志 -->
|
</VMenu>
|
||||||
<VDialog v-if="releaseDialog" v-model="releaseDialog" width="600" scrollable>
|
</IconBtn>
|
||||||
<VCard :title="`${props.plugin?.plugin_name} 更新说明`">
|
</div>
|
||||||
<DialogCloseBtn @click="releaseDialog = false" />
|
</VCardText>
|
||||||
<VDivider />
|
|
||||||
<VersionHistory :history="props.plugin?.history" />
|
|
||||||
</VCard>
|
</VCard>
|
||||||
</VDialog>
|
<!-- 安装插件进度框 -->
|
||||||
|
<ProgressDialog v-if="progressDialog" v-model="progressDialog" :text="progressText" />
|
||||||
|
<!-- 更新日志 -->
|
||||||
|
<VDialog v-if="releaseDialog" v-model="releaseDialog" width="600" scrollable>
|
||||||
|
<VCard :title="`${props.plugin?.plugin_name} 更新说明`">
|
||||||
|
<DialogCloseBtn @click="releaseDialog = false" />
|
||||||
|
<VDivider />
|
||||||
|
<VersionHistory :history="props.plugin?.history" />
|
||||||
|
</VCard>
|
||||||
|
</VDialog>
|
||||||
|
<!-- 插件详情-->
|
||||||
|
<VDialog v-if="detailDialog" v-model="detailDialog" max-width="30rem">
|
||||||
|
<VCard>
|
||||||
|
<DialogCloseBtn @click="detailDialog = false" />
|
||||||
|
<VCardText>
|
||||||
|
<VCol>
|
||||||
|
<div class="d-flex justify-space-between flex-wrap flex-md-nowrap flex-column flex-md-row">
|
||||||
|
<div class="mx-auto mt-5">
|
||||||
|
<VAvatar size="64">
|
||||||
|
<VImg
|
||||||
|
ref="imageRef"
|
||||||
|
:src="iconPath"
|
||||||
|
aspect-ratio="4/3"
|
||||||
|
cover
|
||||||
|
:class="{ shadow: isImageLoaded }"
|
||||||
|
@load="imageLoaded"
|
||||||
|
@error="imageLoadError = true"
|
||||||
|
/>
|
||||||
|
</VAvatar>
|
||||||
|
</div>
|
||||||
|
<div class="flex-grow">
|
||||||
|
<VCardItem>
|
||||||
|
<VCardTitle class="text-center text-md-left">
|
||||||
|
{{ props.plugin?.plugin_name }}
|
||||||
|
</VCardTitle>
|
||||||
|
<VCardSubtitle
|
||||||
|
class="text-center text-md-left break-words whitespace-break-spaces line-clamp-4 overflow-hidden text-ellipsis ..."
|
||||||
|
>
|
||||||
|
{{ props.plugin?.plugin_desc }}
|
||||||
|
</VCardSubtitle>
|
||||||
|
<VList lines="one">
|
||||||
|
<VListItem class="ps-0">
|
||||||
|
<VListItemTitle class="text-center text-md-left">
|
||||||
|
<span class="font-weight-medium">版本:</span>
|
||||||
|
<span class="text-body-1"> v{{ props.plugin?.plugin_version }}</span>
|
||||||
|
</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
<VListItem class="ps-0">
|
||||||
|
<VListItemTitle class="text-center text-md-left">
|
||||||
|
<span class="font-weight-medium">作者:</span>
|
||||||
|
<span class="text-body-1 cursor-pointer" @click="visitPluginPage">
|
||||||
|
{{ props.plugin?.plugin_author }}
|
||||||
|
</span>
|
||||||
|
</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
</VList>
|
||||||
|
<div class="text-center text-md-left">
|
||||||
|
<VBtn color="primary" @click="installPlugin" prepend-icon="mdi-download"> 安装到本地 </VBtn>
|
||||||
|
<div class="text-xs mt-2" v-if="props.count">
|
||||||
|
<VIcon icon="mdi-fire" />共 {{ props.count?.toLocaleString() }} 次下载
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</VCardItem>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</VCol>
|
||||||
|
</VCardText>
|
||||||
|
</VCard>
|
||||||
|
</VDialog>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import { useConfirm } from 'vuetify-use-dialog'
|
import { useConfirm } from 'vuetify-use-dialog'
|
||||||
import { VIcon } from 'vuetify/lib/components/index.mjs'
|
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Plugin } from '@/api/types'
|
import type { Plugin } from '@/api/types'
|
||||||
import FormRender from '@/components/render/FormRender.vue'
|
import FormRender from '@/components/render/FormRender.vue'
|
||||||
@@ -15,6 +14,8 @@ import ProgressDialog from '../dialog/ProgressDialog.vue'
|
|||||||
|
|
||||||
// 显示器宽度
|
// 显示器宽度
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
|
// APP
|
||||||
|
const appMode = inject('pwaMode') && display.mdAndDown.value
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -49,6 +50,9 @@ const pluginConfigDialog = ref(false)
|
|||||||
// 插件配置表单数据
|
// 插件配置表单数据
|
||||||
const pluginConfigForm = ref({})
|
const pluginConfigForm = ref({})
|
||||||
|
|
||||||
|
// 菜单显示状态
|
||||||
|
const menuVisible = ref(false)
|
||||||
|
|
||||||
// 进度框
|
// 进度框
|
||||||
const progressDialog = ref(false)
|
const progressDialog = ref(false)
|
||||||
|
|
||||||
@@ -390,130 +394,155 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- 插件卡片 -->
|
<div>
|
||||||
<VCard v-if="isVisible" :width="props.width" :height="props.height" @click="openPluginDetail" class="flex flex-col">
|
<!-- 插件卡片 -->
|
||||||
<div class="me-n3 absolute bottom-0 right-3">
|
<VHover>
|
||||||
<IconBtn>
|
<template #default="hover">
|
||||||
<VIcon icon="mdi-dots-vertical" />
|
<VCard
|
||||||
<VMenu activator="parent" close-on-content-click>
|
v-if="isVisible"
|
||||||
<VList>
|
v-bind="hover.props"
|
||||||
<VListItem
|
:width="props.width"
|
||||||
v-for="(item, i) in dropdownItems"
|
:height="props.height"
|
||||||
v-show="item.show"
|
@click="openPluginDetail"
|
||||||
:key="i"
|
class="flex flex-col h-full"
|
||||||
variant="plain"
|
>
|
||||||
:base-color="item.props.color"
|
<div
|
||||||
@click="item.props.click"
|
class="relative flex flex-row items-start pa-3 justify-between grow"
|
||||||
>
|
:style="{ background: `${backgroundColor}` }"
|
||||||
<template #prepend>
|
>
|
||||||
<VIcon :icon="item.props.prependIcon" />
|
<div
|
||||||
</template>
|
class="absolute inset-0 bg-cover bg-center"
|
||||||
<VListItemTitle v-text="item.title" />
|
:style="{ background: `${backgroundColor}`, filter: 'brightness(0.5)' }"
|
||||||
</VListItem>
|
/>
|
||||||
</VList>
|
<div class="relative flex-1 min-w-0">
|
||||||
</VMenu>
|
<VCardTitle class="text-white text-lg px-2 text-shadow whitespace-nowrap overflow-hidden text-ellipsis">
|
||||||
</IconBtn>
|
<VBadge v-if="props.plugin?.state" dot inline color="success" />
|
||||||
</div>
|
{{ props.plugin?.plugin_name }}
|
||||||
<div
|
<span class="text-sm mt-1 text-gray-200"> v{{ props.plugin?.plugin_version }} </span>
|
||||||
class="relative flex flex-row items-start pa-3 justify-between grow"
|
</VCardTitle>
|
||||||
:style="{ background: `${backgroundColor}` }"
|
<VCardText class="px-2 py-0 text-white text-sm text-shadow overflow-hidden line-clamp-3 ...">
|
||||||
>
|
{{ props.plugin?.plugin_desc }}
|
||||||
<div
|
</VCardText>
|
||||||
class="absolute inset-0 bg-cover bg-center"
|
</div>
|
||||||
:style="{ background: `${backgroundColor}`, filter: 'brightness(0.5)' }"
|
<div class="relative flex-shrink-0 self-center">
|
||||||
/>
|
<VAvatar size="64">
|
||||||
<div class="relative flex-1 min-w-0">
|
<VImg
|
||||||
<VCardTitle class="text-white px-2 text-shadow whitespace-nowrap overflow-hidden text-ellipsis">
|
ref="imageRef"
|
||||||
<VBadge v-if="props.plugin?.state" dot inline color="success" />
|
:src="iconPath"
|
||||||
{{ props.plugin?.plugin_name }}
|
aspect-ratio="4/3"
|
||||||
<span class="text-sm mt-1 text-gray-200">v{{ props.plugin?.plugin_version }}</span>
|
cover
|
||||||
</VCardTitle>
|
:class="{ shadow: isImageLoaded }"
|
||||||
<VCardText class="px-2 py-1 text-white text-shadow line-clamp-3">
|
@load="imageLoaded"
|
||||||
{{ props.plugin?.plugin_desc }}
|
@error="imageLoadError = true"
|
||||||
|
/>
|
||||||
|
</VAvatar>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<VCardText class="flex flex-none align-self-baseline py-3 w-full align-end">
|
||||||
|
<span class="author-info">
|
||||||
|
<VImg :src="authorPath" class="author-avatar" @load="isAvatarLoaded = true">
|
||||||
|
<VIcon v-if="!isAvatarLoaded" icon="mdi-github" class="me-1" />
|
||||||
|
</VImg>
|
||||||
|
<a :href="props.plugin?.author_url" target="_blank" @click.stop>
|
||||||
|
{{ props.plugin?.plugin_author }}
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<span v-if="props.count" class="ms-3">
|
||||||
|
<VIcon icon="mdi-download" />
|
||||||
|
<span class="text-sm ms-1 mt-1">{{ props.count?.toLocaleString() }}</span>
|
||||||
|
</span>
|
||||||
|
<div class="me-n3 absolute bottom-1 right-3">
|
||||||
|
<IconBtn>
|
||||||
|
<VIcon icon="mdi-dots-vertical" />
|
||||||
|
<VMenu v-model="menuVisible" activator="parent" close-on-content-click>
|
||||||
|
<VList>
|
||||||
|
<VListItem
|
||||||
|
v-for="(item, i) in dropdownItems"
|
||||||
|
v-show="item.show"
|
||||||
|
:key="i"
|
||||||
|
variant="plain"
|
||||||
|
:base-color="item.props.color"
|
||||||
|
@click="item.props.click"
|
||||||
|
>
|
||||||
|
<template #prepend>
|
||||||
|
<VIcon :icon="item.props.prependIcon" />
|
||||||
|
</template>
|
||||||
|
<VListItemTitle v-text="item.title" />
|
||||||
|
</VListItem>
|
||||||
|
</VList>
|
||||||
|
</VMenu>
|
||||||
|
</IconBtn>
|
||||||
|
</div>
|
||||||
|
</VCardText>
|
||||||
|
<div v-if="hover.isHovering" class="me-n3 absolute top-0 right-5">
|
||||||
|
<VIcon class="cursor-move text-white">mdi-drag</VIcon>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="props.plugin?.has_update" class="me-n3 absolute top-0 right-5">
|
||||||
|
<VIcon icon="mdi-new-box" class="text-white" />
|
||||||
|
</div>
|
||||||
|
</VCard>
|
||||||
|
</template>
|
||||||
|
</VHover>
|
||||||
|
|
||||||
|
<!-- 插件配置页面 -->
|
||||||
|
<VDialog v-model="pluginConfigDialog" scrollable max-width="60rem" :fullscreen="!display.mdAndUp.value">
|
||||||
|
<VCard :title="`${props.plugin?.plugin_name} - 配置`" class="rounded-t">
|
||||||
|
<DialogCloseBtn v-model="pluginConfigDialog" />
|
||||||
|
<VDivider />
|
||||||
|
<VCardText>
|
||||||
|
<FormRender v-for="(item, index) in pluginFormItems" :key="index" :config="item" :model="pluginConfigForm" />
|
||||||
</VCardText>
|
</VCardText>
|
||||||
</div>
|
<VCardActions class="pt-3">
|
||||||
<div class="relative flex-shrink-0 self-center">
|
<VBtn v-if="pluginPageItems.length > 0" @click="showPluginInfo" variant="outlined" color="info">
|
||||||
<VAvatar size="64">
|
查看数据
|
||||||
<VImg
|
</VBtn>
|
||||||
ref="imageRef"
|
<VSpacer />
|
||||||
:src="iconPath"
|
<VBtn @click="savePluginConf" variant="elevated" prepend-icon="mdi-content-save" class="px-5"> 保存 </VBtn>
|
||||||
aspect-ratio="4/3"
|
</VCardActions>
|
||||||
cover
|
</VCard>
|
||||||
:class="{ shadow: isImageLoaded }"
|
</VDialog>
|
||||||
@load="imageLoaded"
|
|
||||||
@error="imageLoadError = true"
|
|
||||||
/>
|
|
||||||
</VAvatar>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<VCardText class="flex flex-none align-self-baseline py-3 w-full align-end">
|
|
||||||
<span class="author-info">
|
|
||||||
<VImg :src="authorPath" class="author-avatar" @load="isAvatarLoaded = true">
|
|
||||||
<VIcon v-if="!isAvatarLoaded" icon="mdi-github" class="me-1" />
|
|
||||||
</VImg>
|
|
||||||
<a :href="props.plugin?.author_url" target="_blank" @click.stop>
|
|
||||||
{{ props.plugin?.plugin_author }}
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
<span v-if="props.count" class="ms-3">
|
|
||||||
<VIcon icon="mdi-download" />
|
|
||||||
<span class="text-sm ms-1 mt-1">{{ props.count?.toLocaleString() }}</span>
|
|
||||||
</span>
|
|
||||||
</VCardText>
|
|
||||||
<div v-if="props.plugin?.has_update" class="me-n3 absolute top-0 right-5">
|
|
||||||
<VIcon icon="mdi-new-box" class="text-white" />
|
|
||||||
</div>
|
|
||||||
</VCard>
|
|
||||||
|
|
||||||
<!-- 插件配置页面 -->
|
<!-- 插件数据页面 -->
|
||||||
<VDialog v-model="pluginConfigDialog" scrollable max-width="60rem" :fullscreen="!display.mdAndUp.value">
|
<VDialog v-model="pluginInfoDialog" scrollable max-width="80rem" :fullscreen="!display.mdAndUp.value">
|
||||||
<VCard :title="`${props.plugin?.plugin_name} - 配置`" class="rounded-t">
|
<VCard :title="`${props.plugin?.plugin_name}`" class="rounded-t">
|
||||||
<DialogCloseBtn v-model="pluginConfigDialog" />
|
<DialogCloseBtn v-model="pluginInfoDialog" />
|
||||||
<VDivider />
|
<VCardText class="min-h-40">
|
||||||
<VCardText>
|
<PageRender @action="loadPluginPage" v-for="(item, index) in pluginPageItems" :key="index" :config="item" />
|
||||||
<FormRender v-for="(item, index) in pluginFormItems" :key="index" :config="item" :form="pluginConfigForm" />
|
</VCardText>
|
||||||
</VCardText>
|
<VFab
|
||||||
<VCardActions class="pt-3">
|
icon="mdi-cog"
|
||||||
<VBtn v-if="pluginPageItems.length > 0" @click="showPluginInfo" variant="outlined" color="info">
|
location="bottom"
|
||||||
查看数据
|
size="x-large"
|
||||||
</VBtn>
|
fixed
|
||||||
<VSpacer />
|
app
|
||||||
<VBtn @click="savePluginConf" variant="elevated" prepend-icon="mdi-content-save" class="px-5"> 保存 </VBtn>
|
appear
|
||||||
</VCardActions>
|
@click="showPluginConfig"
|
||||||
</VCard>
|
:class="{ 'mb-10': appMode }"
|
||||||
</VDialog>
|
/>
|
||||||
|
</VCard>
|
||||||
|
</VDialog>
|
||||||
|
|
||||||
<!-- 插件数据页面 -->
|
<!-- 进度框 -->
|
||||||
<VDialog v-model="pluginInfoDialog" scrollable max-width="80rem" :fullscreen="!display.mdAndUp.value">
|
<ProgressDialog v-if="progressDialog" v-model="progressDialog" :text="progressText" />
|
||||||
<VCard :title="`${props.plugin?.plugin_name}`" class="rounded-t">
|
|
||||||
<DialogCloseBtn v-model="pluginInfoDialog" />
|
|
||||||
<VCardText class="min-h-40">
|
|
||||||
<PageRender @action="loadPluginPage" v-for="(item, index) in pluginPageItems" :key="index" :config="item" />
|
|
||||||
</VCardText>
|
|
||||||
<VFab icon="mdi-cog" location="bottom" size="x-large" fixed app appear @click="showPluginConfig" />
|
|
||||||
</VCard>
|
|
||||||
</VDialog>
|
|
||||||
|
|
||||||
<!-- 进度框 -->
|
<!-- 更新日志 -->
|
||||||
<ProgressDialog v-if="progressDialog" v-model="progressDialog" :text="progressText" />
|
<VDialog v-if="releaseDialog" v-model="releaseDialog" width="600" scrollable>
|
||||||
|
<VCard :title="`${props.plugin?.plugin_name} 更新说明`">
|
||||||
<!-- 更新日志 -->
|
<DialogCloseBtn @click="releaseDialog = false" />
|
||||||
<VDialog v-if="releaseDialog" v-model="releaseDialog" width="600" scrollable>
|
<VDivider />
|
||||||
<VCard :title="`${props.plugin?.plugin_name} 更新说明`">
|
<VersionHistory :history="props.plugin?.history" />
|
||||||
<DialogCloseBtn @click="releaseDialog = false" />
|
<VDivider />
|
||||||
<VDivider />
|
<VCardItem>
|
||||||
<VersionHistory :history="props.plugin?.history" />
|
<VBtn @click="updatePlugin" block>
|
||||||
<VDivider />
|
<template #prepend>
|
||||||
<VCardText>
|
<VIcon icon="mdi-arrow-up-circle-outline" />
|
||||||
<VBtn @click="updatePlugin" block>
|
</template>
|
||||||
<template #prepend>
|
更新到最新版本
|
||||||
<VIcon icon="mdi-arrow-up-circle-outline" />
|
</VBtn>
|
||||||
</template>
|
</VCardItem>
|
||||||
更新到最新版本
|
</VCard>
|
||||||
</VBtn>
|
</VDialog>
|
||||||
</VCardText>
|
</div>
|
||||||
</VCard>
|
|
||||||
</VDialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const getImgUrl = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 跳转播放
|
// 跳转播放
|
||||||
function goPlay(isHovering = false) {
|
function goPlay(isHovering: boolean | null = false) {
|
||||||
if (props.media?.link && isHovering) window.open(props.media?.link, '_blank')
|
if (props.media?.link && isHovering) window.open(props.media?.link, '_blank')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -54,7 +54,6 @@ function goPlay(isHovering = false) {
|
|||||||
aspect-ratio="2/3"
|
aspect-ratio="2/3"
|
||||||
:src="getImgUrl"
|
:src="getImgUrl"
|
||||||
class="object-cover aspect-w-2 aspect-h-3"
|
class="object-cover aspect-w-2 aspect-h-3"
|
||||||
:class="hover.isHovering ? 'on-hover' : ''"
|
|
||||||
cover
|
cover
|
||||||
@load="isImageLoaded = true"
|
@load="isImageLoaded = true"
|
||||||
@error="imageLoadError = true"
|
@error="imageLoadError = true"
|
||||||
@@ -78,7 +77,9 @@ function goPlay(isHovering = false) {
|
|||||||
<!-- 详情 -->
|
<!-- 详情 -->
|
||||||
<VCardText
|
<VCardText
|
||||||
v-show="hover.isHovering || imageLoadError"
|
v-show="hover.isHovering || imageLoadError"
|
||||||
class="w-full flex flex-col flex-wrap justify-end align-left text-white absolute bottom-0 cursor-pointer pa-2"
|
class="w-full h-full flex flex-col flex-wrap justify-end align-left text-white absolute bottom-0 cursor-pointer pa-2 pb-5"
|
||||||
|
style="background: linear-gradient(rgba(45, 55, 72, 40%) 0%, rgba(45, 55, 72, 90%) 100%)"
|
||||||
|
@click.stop=""
|
||||||
>
|
>
|
||||||
<span class="font-bold">{{ props.media?.subtitle }}</span>
|
<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 ...">
|
<h1 class="mb-1 text-white font-extrabold text-xl line-clamp-2 overflow-hidden text-ellipsis ...">
|
||||||
@@ -89,9 +90,3 @@ function goPlay(isHovering = false) {
|
|||||||
</template>
|
</template>
|
||||||
</VHover>
|
</VHover>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.on-hover img {
|
|
||||||
@apply brightness-50;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import SiteCookieUpdateDialog from '../dialog/SiteCookieUpdateDialog.vue'
|
|||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Site, SiteStatistic, SiteUserData } from '@/api/types'
|
import type { Site, SiteStatistic, SiteUserData } from '@/api/types'
|
||||||
import { isNullOrEmptyObject } from '@/@core/utils'
|
import { isNullOrEmptyObject } from '@/@core/utils'
|
||||||
import { VCardActions, VExpandTransition, VProgressLinear, VSpacer } from 'vuetify/lib/components/index.mjs'
|
|
||||||
import { formatFileSize } from '@/@core/utils/formatters'
|
import { formatFileSize } from '@/@core/utils/formatters'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
@@ -27,7 +26,7 @@ const siteIcon = ref<string>('')
|
|||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
|
|
||||||
// 测试按钮文字
|
// 测试按钮文字
|
||||||
const testButtonText = ref('测试')
|
const testButtonText = ref('连通性测试')
|
||||||
|
|
||||||
// 测试按钮可用性
|
// 测试按钮可用性
|
||||||
const testButtonDisable = ref(false)
|
const testButtonDisable = ref(false)
|
||||||
@@ -44,9 +43,6 @@ const resourceDialog = ref(false)
|
|||||||
// 用户数据弹窗
|
// 用户数据弹窗
|
||||||
const siteUserDataDialog = ref(false)
|
const siteUserDataDialog = ref(false)
|
||||||
|
|
||||||
// 站点操作显示
|
|
||||||
const siteActionShow = ref(false)
|
|
||||||
|
|
||||||
// 站点使用统计
|
// 站点使用统计
|
||||||
const siteStats = ref<SiteStatistic>({})
|
const siteStats = ref<SiteStatistic>({})
|
||||||
|
|
||||||
@@ -69,7 +65,7 @@ async function testSite() {
|
|||||||
if (result.success) $toast.success(`${cardProps.site?.name} 连通性测试成功,可正常使用!`)
|
if (result.success) $toast.success(`${cardProps.site?.name} 连通性测试成功,可正常使用!`)
|
||||||
else $toast.error(`${cardProps.site?.name} 连通性测试失败:${result.message}`)
|
else $toast.error(`${cardProps.site?.name} 连通性测试失败:${result.message}`)
|
||||||
|
|
||||||
testButtonText.value = '测试'
|
testButtonText.value = '连通性测试'
|
||||||
testButtonDisable.value = false
|
testButtonDisable.value = false
|
||||||
|
|
||||||
getSiteStats()
|
getSiteStats()
|
||||||
@@ -156,7 +152,7 @@ onMounted(() => {
|
|||||||
<div>
|
<div>
|
||||||
<VCard
|
<VCard
|
||||||
:variant="cardProps.site?.is_active ? 'elevated' : 'outlined'"
|
:variant="cardProps.site?.is_active ? 'elevated' : 'outlined'"
|
||||||
class="overflow-hidden"
|
class="overflow-hidden h-full flex flex-col"
|
||||||
@click="siteEditDialog = true"
|
@click="siteEditDialog = true"
|
||||||
>
|
>
|
||||||
<template #image>
|
<template #image>
|
||||||
@@ -195,44 +191,42 @@ onMounted(() => {
|
|||||||
</VTooltip>
|
</VTooltip>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardActions>
|
<VCardActions>
|
||||||
<VBtn
|
<IconBtn>
|
||||||
:icon="siteActionShow ? 'mdi-chevron-up' : 'mdi-chevron-down'"
|
<VIcon icon="mdi-chevron-down" color="primary" />
|
||||||
@click.stop="siteActionShow = !siteActionShow"
|
<VMenu activator="parent" close-on-content-click>
|
||||||
/>
|
<VList>
|
||||||
|
<VListItem variant="plain" v-if="!cardProps.site?.public" @click="handleSiteUpdate">
|
||||||
|
<template #prepend>
|
||||||
|
<VIcon icon="mdi-refresh" />
|
||||||
|
</template>
|
||||||
|
<VListItemTitle>更新 Cookie & UA</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
<VListItem variant="plain" :disabled="testButtonDisable" @click.stop="testSite">
|
||||||
|
<template #prepend>
|
||||||
|
<VIcon icon="mdi-link" />
|
||||||
|
</template>
|
||||||
|
<VListItemTitle>{{ testButtonText }}</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
<VListItem variant="plain" @click="handleResourceBrowse">
|
||||||
|
<template #prepend>
|
||||||
|
<VIcon icon="mdi-web" />
|
||||||
|
</template>
|
||||||
|
<VListItemTitle>资源预览</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
<VListItem variant="plain" @click="handleSiteUserData">
|
||||||
|
<template #prepend>
|
||||||
|
<VIcon icon="mdi-chart-bell-curve" />
|
||||||
|
</template>
|
||||||
|
<VListItemTitle>站点数据</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
</VList>
|
||||||
|
</VMenu>
|
||||||
|
</IconBtn>
|
||||||
<span class="text-sm">
|
<span class="text-sm">
|
||||||
↑ {{ formatFileSize(cardProps.data?.upload || 0) }} / ↓ {{ formatFileSize(cardProps.data?.download || 0) }}
|
↑ {{ formatFileSize(cardProps.data?.upload || 0) }} / ↓ {{ formatFileSize(cardProps.data?.download || 0) }}
|
||||||
</span>
|
</span>
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
</VCardActions>
|
</VCardActions>
|
||||||
<VDivider class="mb-1" v-if="siteActionShow" />
|
|
||||||
<VExpandTransition>
|
|
||||||
<div v-show="siteActionShow" class="py-1 pe-12">
|
|
||||||
<VBtn v-if="!cardProps.site?.public" @click.stop="handleSiteUpdate" variant="text">
|
|
||||||
<template #prepend>
|
|
||||||
<VIcon icon="mdi-refresh" />
|
|
||||||
</template>
|
|
||||||
更新
|
|
||||||
</VBtn>
|
|
||||||
<VBtn :disabled="testButtonDisable" @click.stop="testSite" variant="text">
|
|
||||||
<template #prepend>
|
|
||||||
<VIcon icon="mdi-link" />
|
|
||||||
</template>
|
|
||||||
{{ testButtonText }}
|
|
||||||
</VBtn>
|
|
||||||
<VBtn @click.stop="handleResourceBrowse" variant="text">
|
|
||||||
<template #prepend>
|
|
||||||
<VIcon icon="mdi-web" />
|
|
||||||
</template>
|
|
||||||
浏览
|
|
||||||
</VBtn>
|
|
||||||
<VBtn @click.stop="handleSiteUserData" variant="text">
|
|
||||||
<template #prepend>
|
|
||||||
<VIcon icon="mdi-chart-bell-curve" />
|
|
||||||
</template>
|
|
||||||
数据
|
|
||||||
</VBtn>
|
|
||||||
</div>
|
|
||||||
</VExpandTransition>
|
|
||||||
<StatIcon v-if="cardProps.site?.is_active" :color="statColor" />
|
<StatIcon v-if="cardProps.site?.is_active" :color="statColor" />
|
||||||
<span class="absolute top-1 right-8">
|
<span class="absolute top-1 right-8">
|
||||||
<VIcon class="cursor-move">mdi-drag</VIcon>
|
<VIcon class="cursor-move">mdi-drag</VIcon>
|
||||||
|
|||||||
@@ -5,11 +5,14 @@ import storage_png from '@images/misc/storage.png'
|
|||||||
import alipan_png from '@images/misc/alipan.webp'
|
import alipan_png from '@images/misc/alipan.webp'
|
||||||
import u115_png from '@images/misc/u115.png'
|
import u115_png from '@images/misc/u115.png'
|
||||||
import rclone_png from '@images/misc/rclone.png'
|
import rclone_png from '@images/misc/rclone.png'
|
||||||
|
import alist_png from '@images/misc/alist.svg'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import AliyunAuthDialog from '../dialog/AliyunAuthDialog.vue'
|
import AliyunAuthDialog from '../dialog/AliyunAuthDialog.vue'
|
||||||
import U115AuthDialog from '../dialog/U115AuthDialog.vue'
|
import U115AuthDialog from '../dialog/U115AuthDialog.vue'
|
||||||
import RcloneConfigDialog from '../dialog/RcloneConfigDialog.vue'
|
import RcloneConfigDialog from '../dialog/RcloneConfigDialog.vue'
|
||||||
|
import AlistConfigDialog from '../dialog/AlistConfigDialog.vue'
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
|
import { isNullOrEmptyObject } from '@/@core/utils'
|
||||||
|
|
||||||
// 定义输入
|
// 定义输入
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -42,6 +45,8 @@ const aliyunAuthDialog = ref(false)
|
|||||||
const u115AuthDialog = ref(false)
|
const u115AuthDialog = ref(false)
|
||||||
// Rclone配置对话框
|
// Rclone配置对话框
|
||||||
const rcloneConfigDialog = ref(false)
|
const rcloneConfigDialog = ref(false)
|
||||||
|
// AList配置对话框
|
||||||
|
const aListConfigDialog = ref(false)
|
||||||
|
|
||||||
// 打开存储对话框
|
// 打开存储对话框
|
||||||
function openStorageDialog() {
|
function openStorageDialog() {
|
||||||
@@ -55,6 +60,9 @@ function openStorageDialog() {
|
|||||||
case 'rclone':
|
case 'rclone':
|
||||||
rcloneConfigDialog.value = true
|
rcloneConfigDialog.value = true
|
||||||
break
|
break
|
||||||
|
case 'alist':
|
||||||
|
aListConfigDialog.value = true
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
$toast.info('此存储类型无需配置参数,请直接配置目录!')
|
$toast.info('此存储类型无需配置参数,请直接配置目录!')
|
||||||
break
|
break
|
||||||
@@ -72,6 +80,8 @@ const getIcon = computed(() => {
|
|||||||
return u115_png
|
return u115_png
|
||||||
case 'rclone':
|
case 'rclone':
|
||||||
return rclone_png
|
return rclone_png
|
||||||
|
case 'alist':
|
||||||
|
return alist_png
|
||||||
default:
|
default:
|
||||||
return storage_png
|
return storage_png
|
||||||
}
|
}
|
||||||
@@ -109,6 +119,7 @@ function handleDone() {
|
|||||||
aliyunAuthDialog.value = false
|
aliyunAuthDialog.value = false
|
||||||
u115AuthDialog.value = false
|
u115AuthDialog.value = false
|
||||||
rcloneConfigDialog.value = false
|
rcloneConfigDialog.value = false
|
||||||
|
aListConfigDialog.value = false
|
||||||
emit('done')
|
emit('done')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +133,7 @@ onMounted(() => {
|
|||||||
<div class="align-self-start flex-1">
|
<div class="align-self-start flex-1">
|
||||||
<h5 class="text-h6 mb-1">{{ storage.name }}</h5>
|
<h5 class="text-h6 mb-1">{{ storage.name }}</h5>
|
||||||
<div class="mb-3 text-sm" v-if="total">{{ formatBytes(used, 1) }} / {{ formatBytes(total, 1) }}</div>
|
<div class="mb-3 text-sm" v-if="total">{{ formatBytes(used, 1) }} / {{ formatBytes(total, 1) }}</div>
|
||||||
<div v-else>未配置</div>
|
<div v-else-if="isNullOrEmptyObject(storage.config)">未配置</div>
|
||||||
</div>
|
</div>
|
||||||
<VImg :src="getIcon" cover class="mt-5" max-width="3rem" min-width="3rem" />
|
<VImg :src="getIcon" cover class="mt-5" max-width="3rem" min-width="3rem" />
|
||||||
</VCardText>
|
</VCardText>
|
||||||
@@ -133,10 +144,17 @@ onMounted(() => {
|
|||||||
<AliyunAuthDialog
|
<AliyunAuthDialog
|
||||||
v-if="aliyunAuthDialog"
|
v-if="aliyunAuthDialog"
|
||||||
v-model="aliyunAuthDialog"
|
v-model="aliyunAuthDialog"
|
||||||
|
:conf="props.storage.config || {}"
|
||||||
@close="aliyunAuthDialog = false"
|
@close="aliyunAuthDialog = false"
|
||||||
@done="handleDone"
|
@done="handleDone"
|
||||||
/>
|
/>
|
||||||
<U115AuthDialog v-if="u115AuthDialog" v-model="u115AuthDialog" @close="u115AuthDialog = false" @done="handleDone" />
|
<U115AuthDialog
|
||||||
|
v-if="u115AuthDialog"
|
||||||
|
v-model="u115AuthDialog"
|
||||||
|
:conf="props.storage.config || {}"
|
||||||
|
@close="u115AuthDialog = false"
|
||||||
|
@done="handleDone"
|
||||||
|
/>
|
||||||
<RcloneConfigDialog
|
<RcloneConfigDialog
|
||||||
v-if="rcloneConfigDialog"
|
v-if="rcloneConfigDialog"
|
||||||
v-model="rcloneConfigDialog"
|
v-model="rcloneConfigDialog"
|
||||||
@@ -144,4 +162,11 @@ onMounted(() => {
|
|||||||
@close="rcloneConfigDialog = false"
|
@close="rcloneConfigDialog = false"
|
||||||
@done="handleDone"
|
@done="handleDone"
|
||||||
/>
|
/>
|
||||||
|
<AlistConfigDialog
|
||||||
|
v-if="aListConfigDialog"
|
||||||
|
v-model="aListConfigDialog"
|
||||||
|
:conf="props.storage.config || {}"
|
||||||
|
@close="aListConfigDialog = false"
|
||||||
|
@done="handleDone"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -38,8 +38,11 @@ const subscribeFilesDialog = ref(false)
|
|||||||
// 分享订阅弹窗
|
// 分享订阅弹窗
|
||||||
const subscribeShareDialog = ref(false)
|
const subscribeShareDialog = ref(false)
|
||||||
|
|
||||||
|
// 当前的订阅状态
|
||||||
|
const subscribeState = ref<string>(props.media?.state ?? 'P')
|
||||||
|
|
||||||
// 上一次更新时间
|
// 上一次更新时间
|
||||||
const lastUpdateText = ref(props.media && props.media.last_update ? formatDateDifference(props.media.last_update) : '')
|
const lastUpdateText = computed(() => (props.media?.last_update ? formatDateDifference(props.media.last_update) : ''))
|
||||||
|
|
||||||
// 图片加载完成响应
|
// 图片加载完成响应
|
||||||
function imageLoadHandler() {
|
function imageLoadHandler() {
|
||||||
@@ -81,13 +84,39 @@ async function searchSubscribe() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 切换订阅状态
|
||||||
|
async function toggleSubscribeStatus(state: 'R' | 'S') {
|
||||||
|
try {
|
||||||
|
// 根据传入的 state 判断对应的操作文字
|
||||||
|
const action = state === 'S' ? '暂停' : '启用'
|
||||||
|
// 弹出确认框
|
||||||
|
const isConfirmed = await createConfirm({
|
||||||
|
title: `确认${action}`,
|
||||||
|
content: `是否${action}订阅 ${props.media?.name}?`,
|
||||||
|
})
|
||||||
|
if (!isConfirmed) return
|
||||||
|
// 调用 API 更新订阅状态
|
||||||
|
const result: { [key: string]: any } = await api.put(`subscribe/status/${props.media?.id}?state=${state}`)
|
||||||
|
// 提示
|
||||||
|
if (result.success) {
|
||||||
|
$toast.success(`${props.media?.name} 已${action}!`)
|
||||||
|
subscribeState.value = state
|
||||||
|
emit('save')
|
||||||
|
} else {
|
||||||
|
$toast.error(`${action}失败:${result.message}`)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 重置订阅
|
// 重置订阅
|
||||||
async function resetSubscribe() {
|
async function resetSubscribe() {
|
||||||
// 确认
|
// 确认
|
||||||
try {
|
try {
|
||||||
const isConfirmed = await createConfirm({
|
const isConfirmed = await createConfirm({
|
||||||
title: '确认',
|
title: '确认',
|
||||||
content: `重置后 ${props.media?.name} 已下载记录将被清除,未入库的剧集将会重新下载,是否确认?`,
|
content: `重置后 ${props.media?.name} 将恢复初始状态,已下载记录将被清除,未入库的内容将会重新下载,是否确认?`,
|
||||||
})
|
})
|
||||||
if (!isConfirmed) return
|
if (!isConfirmed) return
|
||||||
// 重置
|
// 重置
|
||||||
@@ -95,6 +124,7 @@ async function resetSubscribe() {
|
|||||||
// 提示
|
// 提示
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
$toast.success(`${props.media?.name} 重置成功!`)
|
$toast.success(`${props.media?.name} 重置成功!`)
|
||||||
|
subscribeState.value = 'R'
|
||||||
emit('save')
|
emit('save')
|
||||||
} else $toast.error(`${props.media?.name} 重置失败:${result.message}`)
|
} else $toast.error(`${props.media?.name} 重置失败:${result.message}`)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -129,7 +159,7 @@ async function viewSubscribeFiles() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 弹出菜单
|
// 弹出菜单
|
||||||
const dropdownItems = ref([
|
const dropdownItems = computed(() => [
|
||||||
{
|
{
|
||||||
title: '编辑',
|
title: '编辑',
|
||||||
value: 1,
|
value: 1,
|
||||||
@@ -163,18 +193,26 @@ const dropdownItems = ref([
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '重置',
|
title: subscribeState.value === 'S' ? '启用' : '暂停',
|
||||||
value: 5,
|
value: 5,
|
||||||
|
props: {
|
||||||
|
prependIcon: subscribeState.value === 'S' ? 'mdi-play' : 'mdi-pause',
|
||||||
|
click: () => toggleSubscribeStatus(subscribeState.value === 'S' ? 'R' : 'S'),
|
||||||
|
color: subscribeState.value === 'S' ? 'success' : 'info',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '重置',
|
||||||
|
value: 6,
|
||||||
props: {
|
props: {
|
||||||
prependIcon: 'mdi-restore-alert',
|
prependIcon: 'mdi-restore-alert',
|
||||||
click: resetSubscribe,
|
click: resetSubscribe,
|
||||||
color: 'warning',
|
color: 'warning',
|
||||||
},
|
},
|
||||||
show: props.media?.type === '电视剧',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '分享',
|
title: '分享',
|
||||||
value: 6,
|
value: 7,
|
||||||
props: {
|
props: {
|
||||||
prependIcon: 'mdi-share',
|
prependIcon: 'mdi-share',
|
||||||
click: shareSubscribe,
|
click: shareSubscribe,
|
||||||
@@ -184,7 +222,7 @@ const dropdownItems = ref([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '取消订阅',
|
title: '取消订阅',
|
||||||
value: 7,
|
value: 8,
|
||||||
props: {
|
props: {
|
||||||
prependIcon: 'mdi-trash-can-outline',
|
prependIcon: 'mdi-trash-can-outline',
|
||||||
color: 'error',
|
color: 'error',
|
||||||
@@ -201,6 +239,14 @@ watch(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 监听订阅状态
|
||||||
|
watch(
|
||||||
|
() => props.media?.state,
|
||||||
|
newState => {
|
||||||
|
subscribeState.value = newState ?? 'P'
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
// 计算backdrop图片地址
|
// 计算backdrop图片地址
|
||||||
const backdropUrl = computed(() => {
|
const backdropUrl = computed(() => {
|
||||||
const url = props.media?.backdrop || props.media?.poster
|
const url = props.media?.backdrop || props.media?.poster
|
||||||
@@ -233,129 +279,136 @@ function onSubscribeEditRemove() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VHover>
|
<div>
|
||||||
<template #default="hover">
|
<VHover>
|
||||||
<VCard
|
<template #default="hover">
|
||||||
v-bind="hover.props"
|
<VCard
|
||||||
:key="props.media?.id"
|
v-bind="hover.props"
|
||||||
class="flex flex-col rounded-lg"
|
:key="props.media?.id"
|
||||||
:class="{
|
class="flex flex-col rounded-lg h-full"
|
||||||
'outline-dashed outline-1': props.media?.best_version && imageLoaded,
|
:class="{
|
||||||
'transition transform-cpu duration-300 scale-105 shadow-lg': hover.isHovering,
|
'outline-dashed outline-1': props.media?.best_version && imageLoaded,
|
||||||
}"
|
'transition transform-cpu duration-300 scale-105 shadow-lg': hover.isHovering,
|
||||||
min-height="170"
|
'opacity-70': subscribeState === 'S',
|
||||||
@click="editSubscribeDialog"
|
}"
|
||||||
>
|
min-height="170"
|
||||||
<div class="me-n3 absolute top-1 right-2">
|
@click="editSubscribeDialog"
|
||||||
<IconBtn>
|
>
|
||||||
<VIcon icon="mdi-dots-vertical" color="white" />
|
<div class="me-n3 absolute top-1 right-2">
|
||||||
<VMenu activator="parent" close-on-content-click>
|
<IconBtn>
|
||||||
<VList>
|
<VIcon icon="mdi-dots-vertical" color="white" />
|
||||||
<template v-for="(item, i) in dropdownItems" :key="i">
|
<VMenu activator="parent" close-on-content-click>
|
||||||
<VListItem
|
<VList>
|
||||||
v-if="item.show !== false"
|
<template v-for="(item, i) in dropdownItems" :key="i">
|
||||||
variant="plain"
|
<VListItem
|
||||||
:base-color="item.props.color"
|
v-if="item.show !== false"
|
||||||
@click="item.props.click"
|
variant="plain"
|
||||||
>
|
:base-color="item.props.color"
|
||||||
<template #prepend>
|
@click="item.props.click"
|
||||||
<VIcon :icon="item.props.prependIcon" />
|
>
|
||||||
</template>
|
<template #prepend>
|
||||||
<VListItemTitle v-text="item.title" />
|
<VIcon :icon="item.props.prependIcon" />
|
||||||
</VListItem>
|
</template>
|
||||||
</template>
|
<VListItemTitle v-text="item.title" />
|
||||||
</VList>
|
</VListItem>
|
||||||
</VMenu>
|
</template>
|
||||||
</IconBtn>
|
</VList>
|
||||||
</div>
|
</VMenu>
|
||||||
<template #image>
|
</IconBtn>
|
||||||
<VImg :src="backdropUrl || posterUrl" aspect-ratio="3/2" cover @load="imageLoadHandler" position="top">
|
|
||||||
<template #placeholder>
|
|
||||||
<div class="w-full h-full">
|
|
||||||
<VSkeletonLoader class="object-cover aspect-w-3 aspect-h-2" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div class="absolute inset-0 subscribe-card-background"></div>
|
|
||||||
</VImg>
|
|
||||||
</template>
|
|
||||||
<div>
|
|
||||||
<VCardText class="flex items-center">
|
|
||||||
<div class="h-auto w-12 flex-shrink-0 overflow-hidden rounded-md shadow-lg" v-if="imageLoaded">
|
|
||||||
<VImg :src="posterUrl" aspect-ratio="2/3" cover @click.stop="viewMediaDetail">
|
|
||||||
<template #placeholder>
|
|
||||||
<div class="w-full h-full">
|
|
||||||
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</VImg>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col justify-center overflow-hidden pl-2 xl:pl-4">
|
|
||||||
<div class="text-sm font-medium text-white sm:pt-1">{{ props.media?.year }}</div>
|
|
||||||
<div class="mr-2 min-w-0 text-lg font-bold text-white">
|
|
||||||
{{ props.media?.name }}
|
|
||||||
{{ formatSeason(props.media?.season ? props.media?.season.toString() : '') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</VCardText>
|
|
||||||
<VCardText class="flex justify-space-between align-center flex-wrap">
|
|
||||||
<div class="flex align-center">
|
|
||||||
<IconBtn
|
|
||||||
v-if="props.media?.total_episode"
|
|
||||||
v-bind="props"
|
|
||||||
icon="mdi-progress-download"
|
|
||||||
color="white"
|
|
||||||
class="me-1"
|
|
||||||
/>
|
|
||||||
<div v-if="props.media?.season" class="text-subtitle-2 me-4 text-white">
|
|
||||||
{{ (props.media?.total_episode || 0) - (props.media?.lack_episode || 0) }} /
|
|
||||||
{{ props.media?.total_episode }}
|
|
||||||
</div>
|
|
||||||
<IconBtn v-if="props.media?.username" icon="mdi-account" color="white" class="me-1" />
|
|
||||||
<span v-if="props.media?.username" class="text-subtitle-2 me-4 text-white">
|
|
||||||
{{ props.media?.username }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</VCardText>
|
|
||||||
<VCardText v-if="lastUpdateText" class="absolute right-0 bottom-0 d-flex align-center p-2 text-gray-300">
|
|
||||||
<VIcon icon="mdi-download" class="me-1" />
|
|
||||||
{{ lastUpdateText }}
|
|
||||||
</VCardText>
|
|
||||||
<div class="w-full absolute bottom-0">
|
|
||||||
<VProgressLinear
|
|
||||||
v-if="getPercentage() > 0"
|
|
||||||
:model-value="getPercentage()"
|
|
||||||
bg-color="success"
|
|
||||||
color="success"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<template #image>
|
||||||
</VCard>
|
<VImg :src="backdropUrl || posterUrl" aspect-ratio="3/2" cover @load="imageLoadHandler" position="top">
|
||||||
</template>
|
<template #placeholder>
|
||||||
</VHover>
|
<div class="w-full h-full">
|
||||||
<!-- 订阅编辑弹窗 -->
|
<VSkeletonLoader class="object-cover aspect-w-3 aspect-h-2" />
|
||||||
<SubscribeEditDialog
|
</div>
|
||||||
v-if="subscribeEditDialog"
|
</template>
|
||||||
v-model="subscribeEditDialog"
|
<div class="absolute inset-0 subscribe-card-background"></div>
|
||||||
:subid="props.media?.id"
|
</VImg>
|
||||||
@remove="onSubscribeEditRemove"
|
<div v-if="subscribeState === 'P'" class="absolute inset-0 bg-yellow-900 opacity-80 pointer-events-none" />
|
||||||
@save="onSubscribeEditSave"
|
</template>
|
||||||
@close="subscribeEditDialog = false"
|
<div>
|
||||||
/>
|
<VCardText class="flex items-center">
|
||||||
|
<div class="h-auto w-12 flex-shrink-0 overflow-hidden rounded-md shadow-lg" v-if="imageLoaded">
|
||||||
|
<VImg :src="posterUrl" aspect-ratio="2/3" cover @click.stop="viewMediaDetail">
|
||||||
|
<template #placeholder>
|
||||||
|
<div class="w-full h-full">
|
||||||
|
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VImg>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col justify-center overflow-hidden pl-2 xl:pl-4">
|
||||||
|
<div class="text-sm font-medium text-white sm:pt-1">{{ props.media?.year }}</div>
|
||||||
|
<div class="mr-2 min-w-0 text-lg font-bold text-white">
|
||||||
|
{{ props.media?.name }}
|
||||||
|
{{ formatSeason(props.media?.season ? props.media?.season.toString() : '') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</VCardText>
|
||||||
|
<VCardText class="flex justify-space-between align-center flex-wrap">
|
||||||
|
<div class="flex align-center">
|
||||||
|
<IconBtn
|
||||||
|
v-if="props.media?.total_episode"
|
||||||
|
v-bind="props"
|
||||||
|
icon="mdi-progress-download"
|
||||||
|
color="white"
|
||||||
|
class="me-1"
|
||||||
|
/>
|
||||||
|
<div v-if="props.media?.season" class="text-subtitle-2 me-4 text-white">
|
||||||
|
{{ (props.media?.total_episode || 0) - (props.media?.lack_episode || 0) }} /
|
||||||
|
{{ props.media?.total_episode }}
|
||||||
|
</div>
|
||||||
|
<IconBtn v-if="props.media?.username" icon="mdi-account" color="white" class="me-1" />
|
||||||
|
<span v-if="props.media?.username" class="text-subtitle-2 me-4 text-white">
|
||||||
|
{{ props.media?.username }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</VCardText>
|
||||||
|
<VCardText v-if="lastUpdateText" class="absolute right-0 bottom-0 d-flex align-center p-2 text-gray-300">
|
||||||
|
<VIcon icon="mdi-download" class="me-1" />
|
||||||
|
{{ lastUpdateText }}
|
||||||
|
</VCardText>
|
||||||
|
<div class="w-full absolute bottom-0">
|
||||||
|
<VProgressLinear
|
||||||
|
v-if="getPercentage() > 0"
|
||||||
|
:model-value="getPercentage()"
|
||||||
|
bg-color="success"
|
||||||
|
color="success"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div v-if="hover.isHovering" class="me-n3 absolute top-1 right-10">
|
||||||
|
<IconBtn><VIcon class="cursor-move text-white">mdi-drag</VIcon></IconBtn>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</VCard>
|
||||||
|
</template>
|
||||||
|
</VHover>
|
||||||
|
<!-- 订阅编辑弹窗 -->
|
||||||
|
<SubscribeEditDialog
|
||||||
|
v-if="subscribeEditDialog"
|
||||||
|
v-model="subscribeEditDialog"
|
||||||
|
:subid="props.media?.id"
|
||||||
|
@remove="onSubscribeEditRemove"
|
||||||
|
@save="onSubscribeEditSave"
|
||||||
|
@close="subscribeEditDialog = false"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 订阅文件信息弹窗 -->
|
<!-- 订阅文件信息弹窗 -->
|
||||||
<SubscribeFilesDialog
|
<SubscribeFilesDialog
|
||||||
v-if="subscribeFilesDialog"
|
v-if="subscribeFilesDialog"
|
||||||
v-model="subscribeFilesDialog"
|
v-model="subscribeFilesDialog"
|
||||||
:subid="props.media?.id"
|
:subid="props.media?.id"
|
||||||
@close="subscribeFilesDialog = false"
|
@close="subscribeFilesDialog = false"
|
||||||
/>
|
/>
|
||||||
<!-- 分享订阅弹窗 -->
|
<!-- 分享订阅弹窗 -->
|
||||||
<SubscribeShareDialog
|
<SubscribeShareDialog
|
||||||
v-if="subscribeShareDialog"
|
v-if="subscribeShareDialog"
|
||||||
v-model="subscribeShareDialog"
|
v-model="subscribeShareDialog"
|
||||||
:sub="props.media"
|
:sub="props.media"
|
||||||
@close="subscribeShareDialog = false"
|
@close="subscribeShareDialog = false"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.subscribe-card-background {
|
.subscribe-card-background {
|
||||||
|
|||||||
@@ -1,23 +1,17 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { formatDateDifference } from '@/@core/utils/formatters'
|
import { formatDateDifference } from '@/@core/utils/formatters'
|
||||||
import api from '@/api'
|
|
||||||
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
|
||||||
import type { SubscribeShare } from '@/api/types'
|
import type { SubscribeShare } from '@/api/types'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import { useToast } from 'vue-toast-notification'
|
|
||||||
import { useConfirm } from 'vuetify-use-dialog'
|
|
||||||
import SubscribeEditDialog from '../dialog/SubscribeEditDialog.vue'
|
import SubscribeEditDialog from '../dialog/SubscribeEditDialog.vue'
|
||||||
|
import ForkSubscribeDialog from '../dialog/ForkSubscribeDialog.vue'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
media: Object as PropType<SubscribeShare>,
|
media: Object as PropType<SubscribeShare>,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 提示框
|
// 定义删除事件
|
||||||
const $toast = useToast()
|
const emit = defineEmits(['delete'])
|
||||||
|
|
||||||
// 确认框
|
|
||||||
const createConfirm = useConfirm()
|
|
||||||
|
|
||||||
// 从 provide 中获取全局设置
|
// 从 provide 中获取全局设置
|
||||||
const globalSettings: any = inject('globalSettings')
|
const globalSettings: any = inject('globalSettings')
|
||||||
@@ -28,6 +22,9 @@ const imageLoaded = ref(false)
|
|||||||
// 订阅编辑弹窗
|
// 订阅编辑弹窗
|
||||||
const subscribeEditDialog = ref(false)
|
const subscribeEditDialog = ref(false)
|
||||||
|
|
||||||
|
// 复用订阅弹窗
|
||||||
|
const forkSubscribeDialog = ref(false)
|
||||||
|
|
||||||
// 订阅ID
|
// 订阅ID
|
||||||
const subscribeId = ref<number>()
|
const subscribeId = ref<number>()
|
||||||
|
|
||||||
@@ -69,109 +66,110 @@ async function viewMediaDetail() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 复用订阅
|
// 复用订阅
|
||||||
async function forkSubscribe() {
|
function showForkSubscribe() {
|
||||||
// 开始处理
|
forkSubscribeDialog.value = true
|
||||||
startNProgress()
|
|
||||||
try {
|
|
||||||
// 确认
|
|
||||||
const isConfirmed = await createConfirm({
|
|
||||||
title: '确认',
|
|
||||||
content: `是否确认添加来自 ${props.media?.share_user} 分享的订阅:${props.media?.share_title}?`,
|
|
||||||
})
|
|
||||||
if (!isConfirmed) return
|
|
||||||
|
|
||||||
// 请求API
|
|
||||||
const result: { [key: string]: any } = await api.post('subscribe/fork', props.media)
|
|
||||||
|
|
||||||
// 订阅状态
|
|
||||||
if (result.success) {
|
|
||||||
$toast.success(`${props.media?.share_title} 添加订阅成功!`)
|
|
||||||
// 弹出订阅编辑弹窗
|
|
||||||
subscribeId.value = result.data.id
|
|
||||||
subscribeEditDialog.value = true
|
|
||||||
} else {
|
|
||||||
$toast.error(`${props.media?.share_title} 添加订阅失败:${result.message}!`)
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error)
|
|
||||||
} finally {
|
|
||||||
doneNProgress()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 完成复用订阅
|
||||||
|
function finishForkSubscribe(subid: number) {
|
||||||
|
subscribeId.value = subid
|
||||||
|
forkSubscribeDialog.value=false
|
||||||
|
subscribeEditDialog.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除订阅分享时处理
|
||||||
|
function doDelete() {
|
||||||
|
forkSubscribeDialog.value=false
|
||||||
|
// 通知父组件刷新
|
||||||
|
emit('delete')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VHover>
|
<div>
|
||||||
<template #default="hover">
|
<VHover>
|
||||||
<VCard
|
<template #default="hover">
|
||||||
v-bind="hover.props"
|
<VCard
|
||||||
:key="props.media?.id"
|
v-bind="hover.props"
|
||||||
class="flex flex-col rounded-lg"
|
:key="props.media?.id"
|
||||||
:class="{
|
class="flex flex-col rounded-lg"
|
||||||
'transition transform-cpu duration-300 scale-105 shadow-lg': hover.isHovering,
|
:class="{
|
||||||
}"
|
'transition transform-cpu duration-300 scale-105 shadow-lg': hover.isHovering,
|
||||||
min-height="170"
|
}"
|
||||||
@click="forkSubscribe"
|
min-height="170"
|
||||||
>
|
@click="showForkSubscribe"
|
||||||
<template #image>
|
>
|
||||||
<VImg :src="backdropUrl || posterUrl" aspect-ratio="3/2" cover @load="imageLoadHandler" position="top">
|
<template #image>
|
||||||
<template #placeholder>
|
<VImg :src="backdropUrl || posterUrl" aspect-ratio="3/2" cover @load="imageLoadHandler" position="top">
|
||||||
<div class="w-full h-full">
|
<template #placeholder>
|
||||||
<VSkeletonLoader class="object-cover aspect-w-3 aspect-h-2" />
|
<div class="w-full h-full">
|
||||||
|
<VSkeletonLoader class="object-cover aspect-w-3 aspect-h-2" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div class="absolute inset-0 subscribe-card-background"></div>
|
||||||
|
</VImg>
|
||||||
|
</template>
|
||||||
|
<div>
|
||||||
|
<VCardText class="flex items-center pb-1">
|
||||||
|
<div class="h-auto w-12 flex-shrink-0 overflow-hidden rounded-md shadow-lg" v-if="imageLoaded">
|
||||||
|
<VImg :src="posterUrl" aspect-ratio="2/3" cover @click.stop="viewMediaDetail">
|
||||||
|
<template #placeholder>
|
||||||
|
<div class="w-full h-full">
|
||||||
|
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VImg>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<div class="flex flex-col justify-center pl-2 xl:pl-4">
|
||||||
<div class="absolute inset-0 subscribe-card-background"></div>
|
<div class="mr-2 min-w-0 text-lg font-bold text-white line-clamp-2 overflow-hidden text-ellipsis ...">
|
||||||
</VImg>
|
{{ props.media?.share_title }}
|
||||||
</template>
|
</div>
|
||||||
<div>
|
<div class="text-sm font-medium text-gray-200 sm:pt-1 line-clamp-3 overflow-hidden text-ellipsis ...">
|
||||||
<VCardText class="flex items-center pb-1">
|
{{ props.media?.share_comment }}
|
||||||
<div class="h-auto w-12 flex-shrink-0 overflow-hidden rounded-md shadow-lg" v-if="imageLoaded">
|
</div>
|
||||||
<VImg :src="posterUrl" aspect-ratio="2/3" cover @click.stop="viewMediaDetail">
|
|
||||||
<template #placeholder>
|
|
||||||
<div class="w-full h-full">
|
|
||||||
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</VImg>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col justify-center pl-2 xl:pl-4">
|
|
||||||
<div class="mr-2 min-w-0 text-lg font-bold text-white line-clamp-2 overflow-hidden text-ellipsis ...">
|
|
||||||
{{ props.media?.share_title }}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm font-medium text-gray-200 sm:pt-1 line-clamp-3 overflow-hidden text-ellipsis ...">
|
</VCardText>
|
||||||
{{ props.media?.share_comment }}
|
<VCardText class="flex justify-space-between align-center flex-wrap">
|
||||||
|
<div class="flex align-center">
|
||||||
|
<IconBtn v-bind="props" icon="mdi-account" color="white" class="me-1" />
|
||||||
|
<div class="text-subtitle-2 me-4 text-white">
|
||||||
|
{{ props.media?.share_user }}
|
||||||
|
</div>
|
||||||
|
<IconBtn v-if="props.media?.count" icon="mdi-fire" color="white" class="me-1" />
|
||||||
|
<span v-if="props.media?.count" class="text-subtitle-2 me-4 text-white">
|
||||||
|
{{ props.media?.count.toLocaleString() }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</VCardText>
|
||||||
</VCardText>
|
<VCardText class="absolute right-0 bottom-0 d-flex align-center p-2 text-gray-300">
|
||||||
<VCardText class="flex justify-space-between align-center flex-wrap">
|
<VIcon icon="mdi-calcdar" class="me-1" />
|
||||||
<div class="flex align-center">
|
{{ dateText }}
|
||||||
<IconBtn v-bind="props" icon="mdi-account" color="white" class="me-1" />
|
</VCardText>
|
||||||
<div class="text-subtitle-2 me-4 text-white">
|
</div>
|
||||||
{{ props.media?.share_user }}
|
</VCard>
|
||||||
</div>
|
</template>
|
||||||
<IconBtn v-if="props.media?.count" icon="mdi-fire" color="error" class="me-1" />
|
</VHover>
|
||||||
<span v-if="props.media?.count" class="text-subtitle-2 me-4 text-white">
|
<!-- 订阅编辑弹窗 -->
|
||||||
{{ props.media?.count.toLocaleString() }}
|
<SubscribeEditDialog
|
||||||
</span>
|
v-if="subscribeEditDialog"
|
||||||
</div>
|
v-model="subscribeEditDialog"
|
||||||
</VCardText>
|
:subid="subscribeId"
|
||||||
<VCardText class="absolute right-0 bottom-0 d-flex align-center p-2 text-gray-300">
|
@close="subscribeEditDialog = false"
|
||||||
<VIcon icon="mdi-calcdar" class="me-1" />
|
@save="subscribeEditDialog = false"
|
||||||
{{ dateText }}
|
@remove="subscribeEditDialog = false"
|
||||||
</VCardText>
|
/>
|
||||||
</div>
|
<!-- 复用订阅弹窗 -->
|
||||||
</VCard>
|
<ForkSubscribeDialog
|
||||||
</template>
|
v-if="forkSubscribeDialog"
|
||||||
</VHover>
|
v-model="forkSubscribeDialog"
|
||||||
<!-- 订阅编辑弹窗 -->
|
:media="props.media"
|
||||||
<SubscribeEditDialog
|
@close="forkSubscribeDialog = false"
|
||||||
v-if="subscribeEditDialog"
|
@fork="finishForkSubscribe"
|
||||||
v-model="subscribeEditDialog"
|
@delete="doDelete"
|
||||||
:subid="subscribeId"
|
/>
|
||||||
@close="subscribeEditDialog = false"
|
</div>
|
||||||
@save="subscribeEditDialog = false"
|
|
||||||
@remove="subscribeEditDialog = false"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.subscribe-card-background {
|
.subscribe-card-background {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import api from '@/api'
|
|||||||
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
||||||
import type { DownloaderConf, MediaInfo, TorrentInfo, TransferDirectoryConf } from '@/api/types'
|
import type { DownloaderConf, MediaInfo, TorrentInfo, TransferDirectoryConf } from '@/api/types'
|
||||||
import { formatFileSize } from '@/@core/utils/formatters'
|
import { formatFileSize } from '@/@core/utils/formatters'
|
||||||
import { VCardTitle } from 'vuetify/lib/components/index.mjs'
|
import { VCardTitle, VChip } from 'vuetify/lib/components/index.mjs'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -13,6 +13,9 @@ const props = defineProps({
|
|||||||
torrent: Object as PropType<TorrentInfo>,
|
torrent: Object as PropType<TorrentInfo>,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 定义成功和失败事件
|
||||||
|
const emit = defineEmits(['done', 'error', 'close'])
|
||||||
|
|
||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
|
|
||||||
@@ -22,8 +25,8 @@ const selectedDownloader = ref<string | null>(null)
|
|||||||
// 选择的保存目录
|
// 选择的保存目录
|
||||||
const selectedDirectory = ref<string | null>(null)
|
const selectedDirectory = ref<string | null>(null)
|
||||||
|
|
||||||
// 定义成功和失败事件
|
// 下载器
|
||||||
const emit = defineEmits(['done', 'error', 'close'])
|
const downloaders = ref<DownloaderConf[]>([])
|
||||||
|
|
||||||
// 所有目录设置
|
// 所有目录设置
|
||||||
const directories = ref<TransferDirectoryConf[]>([])
|
const directories = ref<TransferDirectoryConf[]>([])
|
||||||
@@ -53,14 +56,10 @@ const targetDirectories = computed(() => {
|
|||||||
return [...new Set(downloadDirectories)]
|
return [...new Set(downloadDirectories)]
|
||||||
})
|
})
|
||||||
|
|
||||||
// 下载器
|
|
||||||
const downloaders = ref<DownloaderConf[]>([])
|
|
||||||
|
|
||||||
// 调用API查询下载器设置
|
// 调用API查询下载器设置
|
||||||
async function loadDownloaderSetting() {
|
async function loadDownloaderSetting() {
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.get('system/setting/Downloaders')
|
downloaders.value = await api.get('download/clients')
|
||||||
downloaders.value = result.data?.value ?? []
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
@@ -119,37 +118,63 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VDialog max-width="40rem" scrollable>
|
<VDialog max-width="45rem" scrollable>
|
||||||
<VCard>
|
<VCard>
|
||||||
<VCardItem>
|
<VCardItem>
|
||||||
<VCardTitle v-if="title">下载 - {{ title }}</VCardTitle>
|
<VCardTitle v-if="title">{{ torrent?.site_name }} - {{ title }}</VCardTitle>
|
||||||
<VCardTitle v-else>确认下载</VCardTitle>
|
<VCardTitle v-else>确认下载</VCardTitle>
|
||||||
<DialogCloseBtn @click="emit('close')" />
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
<VDivider />
|
<VDivider />
|
||||||
<VCardText>
|
<VCardText>
|
||||||
|
<VList lines="one">
|
||||||
|
<VListItem>
|
||||||
|
<template #prepend>
|
||||||
|
<VIcon icon="mdi-web"></VIcon>
|
||||||
|
</template>
|
||||||
|
<VListItemTitle>
|
||||||
|
<span class="whitespace-break-spaces me-2">{{ torrent?.title }}</span>
|
||||||
|
<span class="text-green-700 ms-2 text-sm">↑{{ torrent?.seeders }}</span>
|
||||||
|
<span class="text-orange-700 ms-2 text-sm">↓{{ torrent?.peers }}</span>
|
||||||
|
</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
<VListItem>
|
||||||
|
<template #prepend>
|
||||||
|
<VIcon icon="mdi-subtitles-outline"></VIcon>
|
||||||
|
</template>
|
||||||
|
<VListItemTitle>
|
||||||
|
<span class="text-body-1 whitespace-break-spaces">{{ torrent?.description }}</span>
|
||||||
|
</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
<VListItem>
|
||||||
|
<template #prepend>
|
||||||
|
<VIcon icon="mdi-database"></VIcon>
|
||||||
|
</template>
|
||||||
|
<VListItemTitle>
|
||||||
|
<span class="text-body-1">
|
||||||
|
<VChip variant="tonal" label>
|
||||||
|
{{ formatFileSize(torrent?.size || 0) }}
|
||||||
|
</VChip>
|
||||||
|
</span>
|
||||||
|
</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
</VList>
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol cols="12" class="text-lg text-high-emphasis pb-0">
|
|
||||||
<div><strong>站点:</strong>{{ props.torrent?.site_name }}</div>
|
|
||||||
<div><strong>标题:</strong>{{ props.torrent?.title }}</div>
|
|
||||||
<div><strong>描述:</strong>{{ props.torrent?.description }}</div>
|
|
||||||
<div><strong>大小:</strong>{{ formatFileSize(props.torrent?.size || 0) }}</div>
|
|
||||||
</VCol>
|
|
||||||
<VCol cols="12" md="4">
|
<VCol cols="12" md="4">
|
||||||
<VSelect
|
<VSelect
|
||||||
v-model="selectedDownloader"
|
v-model="selectedDownloader"
|
||||||
:items="downloaderOptions"
|
:items="downloaderOptions"
|
||||||
label="下载器"
|
label="指定下载器"
|
||||||
variant="underlined"
|
variant="underlined"
|
||||||
placeholder="默认"
|
placeholder="留空默认"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="8">
|
<VCol cols="12" md="8">
|
||||||
<VCombobox
|
<VCombobox
|
||||||
v-model="selectedDirectory"
|
v-model="selectedDirectory"
|
||||||
:items="targetDirectories"
|
:items="targetDirectories"
|
||||||
label="保存目录"
|
label="指定保存目录"
|
||||||
placeholder="自动"
|
placeholder="留空自动匹配"
|
||||||
variant="underlined"
|
variant="underlined"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
|||||||
60
src/components/dialog/AlistConfigDialog.vue
Normal file
60
src/components/dialog/AlistConfigDialog.vue
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import api from '@/api'
|
||||||
|
|
||||||
|
// 定义输入
|
||||||
|
const props = defineProps({
|
||||||
|
conf: {
|
||||||
|
type: Object as PropType<{ [key: string]: any }>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
// 定义事件
|
||||||
|
const emit = defineEmits(['done', 'close'])
|
||||||
|
|
||||||
|
// 完成
|
||||||
|
async function handleDone() {
|
||||||
|
await savaAlistConfig()
|
||||||
|
emit('done')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存rclone设置
|
||||||
|
async function savaAlistConfig() {
|
||||||
|
try {
|
||||||
|
await api.post(`storage/save/alist`, props.conf)
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VDialog width="50rem" scrollable max-height="85vh">
|
||||||
|
<VCard title="AList配置" class="rounded-t">
|
||||||
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
|
<VCardText>
|
||||||
|
<VRow>
|
||||||
|
<VCol cols="12">
|
||||||
|
<VTextField v-model="props.conf.url" hint="AList服务地址" label="地址" persistent-hint />
|
||||||
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VTextField v-model="props.conf.username" hint="AList登录用户名" label="用户名" persistent-hint />
|
||||||
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VTextField
|
||||||
|
type="password"
|
||||||
|
v-model="props.conf.password"
|
||||||
|
hint="AList登录密码"
|
||||||
|
label="密码"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
</VCardText>
|
||||||
|
<VCardActions>
|
||||||
|
<VSpacer />
|
||||||
|
<VBtn variant="elevated" @click="handleDone" prepend-icon="mdi-check" class="px-5 me-3"> 完成 </VBtn>
|
||||||
|
</VCardActions>
|
||||||
|
</VCard>
|
||||||
|
</VDialog>
|
||||||
|
</template>
|
||||||
@@ -2,6 +2,14 @@
|
|||||||
import QrcodeVue from 'qrcode.vue'
|
import QrcodeVue from 'qrcode.vue'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
|
|
||||||
|
// 定义输入
|
||||||
|
const props = defineProps({
|
||||||
|
conf: {
|
||||||
|
type: Object as PropType<{ [key: string]: any }>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
// 定义事件
|
// 定义事件
|
||||||
const emit = defineEmits(['done', 'close'])
|
const emit = defineEmits(['done', 'close'])
|
||||||
|
|
||||||
@@ -25,6 +33,10 @@ let timeoutTimer: NodeJS.Timeout | undefined = undefined
|
|||||||
|
|
||||||
// 完成
|
// 完成
|
||||||
async function handleDone() {
|
async function handleDone() {
|
||||||
|
clearTimeout(timeoutTimer)
|
||||||
|
if (props.conf?.refreshToken) {
|
||||||
|
await savaAliPanConfig()
|
||||||
|
}
|
||||||
emit('done')
|
emit('done')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,6 +87,15 @@ async function checkQrcode() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存cookie设置
|
||||||
|
async function savaAliPanConfig() {
|
||||||
|
try {
|
||||||
|
await api.post(`storage/save/alipan`, props.conf)
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getQrcode()
|
await getQrcode()
|
||||||
timeoutTimer = setTimeout(checkQrcode, 3000)
|
timeoutTimer = setTimeout(checkQrcode, 3000)
|
||||||
@@ -97,6 +118,13 @@ onUnmounted(() => {
|
|||||||
<template #prepend />
|
<template #prepend />
|
||||||
</VAlert>
|
</VAlert>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
|
<VCardText>
|
||||||
|
<VRow>
|
||||||
|
<VCol class="mt-2">
|
||||||
|
<VTextField label="自定义refreshToken" v-model="props.conf.refreshToken" outlined dense />
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
</VCardText>
|
||||||
<VCardActions>
|
<VCardActions>
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn variant="elevated" @click="handleDone" prepend-icon="mdi-check" class="px-5 me-3"> 完成 </VBtn>
|
<VBtn variant="elevated" @click="handleDone" prepend-icon="mdi-check" class="px-5 me-3"> 完成 </VBtn>
|
||||||
|
|||||||
267
src/components/dialog/ForkSubscribeDialog.vue
Normal file
267
src/components/dialog/ForkSubscribeDialog.vue
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import api from '@/api'
|
||||||
|
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
||||||
|
import { SubscribeShare } from '@/api/types'
|
||||||
|
import router from '@/router'
|
||||||
|
import { useToast } from 'vue-toast-notification'
|
||||||
|
import { VBtn } from 'vuetify/lib/components/index.mjs'
|
||||||
|
|
||||||
|
// 输入参数
|
||||||
|
const props = defineProps({
|
||||||
|
media: Object as PropType<SubscribeShare>,
|
||||||
|
})
|
||||||
|
|
||||||
|
// 定义事件
|
||||||
|
const emit = defineEmits(['fork', 'delete', 'close'])
|
||||||
|
|
||||||
|
// 从 provide 中获取全局设置
|
||||||
|
const globalSettings: any = inject('globalSettings')
|
||||||
|
|
||||||
|
// 提示框
|
||||||
|
const $toast = useToast()
|
||||||
|
|
||||||
|
// 处理中
|
||||||
|
const processing = ref(false)
|
||||||
|
|
||||||
|
// 删除中
|
||||||
|
const deleting = ref(false)
|
||||||
|
|
||||||
|
// 是否折叠
|
||||||
|
const isExpanded = ref(false)
|
||||||
|
|
||||||
|
// follow用户列表
|
||||||
|
const followUsers = ref<string[]>([])
|
||||||
|
|
||||||
|
// 当前用户是否已follow
|
||||||
|
const isFollowed = computed(() => followUsers.value.includes(props.media?.share_uid || ''))
|
||||||
|
|
||||||
|
// 折叠展开
|
||||||
|
function toggleExpand() {
|
||||||
|
isExpanded.value = !isExpanded.value
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载follow用户列表
|
||||||
|
async function queryFollowUsers() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.get('system/setting/FollowSubscribers')
|
||||||
|
followUsers.value = result.data?.value ?? []
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// follow用户
|
||||||
|
async function followUser() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.post(`subscribe/follow?share_uid=${props.media?.share_uid}`)
|
||||||
|
if (result.success) {
|
||||||
|
queryFollowUsers()
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// unfollow用户
|
||||||
|
async function unfollowUser() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.delete('subscribe/follow', {
|
||||||
|
params: {
|
||||||
|
share_uid: props.media?.share_uid,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if (result.success) {
|
||||||
|
queryFollowUsers()
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算海报图片地址
|
||||||
|
const posterUrl = computed(() => {
|
||||||
|
const url = props.media?.poster
|
||||||
|
// 使用图片缓存
|
||||||
|
if (globalSettings.GLOBAL_IMAGE_CACHE && url)
|
||||||
|
return `${import.meta.env.VITE_API_BASE_URL}system/cache/image?url=${encodeURIComponent(url)}`
|
||||||
|
return url
|
||||||
|
})
|
||||||
|
|
||||||
|
// 查看媒体详情
|
||||||
|
async function viewMediaDetail() {
|
||||||
|
router.push({
|
||||||
|
path: '/media',
|
||||||
|
query: {
|
||||||
|
mediaid: `${props.media?.tmdbid ? `tmdb:${props.media?.tmdbid}` : `douban:${props.media?.doubanid}`}`,
|
||||||
|
type: props.media?.type,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 复用订阅
|
||||||
|
async function doFork() {
|
||||||
|
// 开始处理
|
||||||
|
startNProgress()
|
||||||
|
try {
|
||||||
|
processing.value = true
|
||||||
|
// 请求API
|
||||||
|
const result: { [key: string]: any } = await api.post('subscribe/fork', props.media)
|
||||||
|
// 订阅状态
|
||||||
|
if (result.success) {
|
||||||
|
$toast.success(`${props.media?.share_title} 添加订阅成功!`)
|
||||||
|
// 完成
|
||||||
|
emit('fork', result.data.id)
|
||||||
|
} else {
|
||||||
|
$toast.error(`${props.media?.share_title} 添加订阅失败:${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(`subscribe/share/${props.media?.id}`, {
|
||||||
|
params: {
|
||||||
|
share_uid: globalSettings.USER_UNIQUE_ID,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// 订阅状态
|
||||||
|
if (result.success) {
|
||||||
|
$toast.success(`${props.media?.share_title} 取消分享成功!`)
|
||||||
|
// 完成
|
||||||
|
emit('delete', result.data.id)
|
||||||
|
} else {
|
||||||
|
$toast.error(`${props.media?.share_title} 取消分享失败:${result.message}!`)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
} finally {
|
||||||
|
deleting.value = false
|
||||||
|
doneNProgress()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
queryFollowUsers()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VDialog max-width="40rem" scrollable>
|
||||||
|
<VCard>
|
||||||
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
|
<VCardText>
|
||||||
|
<VCol>
|
||||||
|
<div class="d-flex justify-space-between flex-wrap flex-md-nowrap flex-column flex-md-row">
|
||||||
|
<div class="ma-auto">
|
||||||
|
<VImg
|
||||||
|
width="10rem"
|
||||||
|
aspect-ratio="2/3"
|
||||||
|
class="object-cover aspect-w-2 aspect-h-3 rounded-lg ring-1 ring-gray-500"
|
||||||
|
:src="posterUrl"
|
||||||
|
@click="viewMediaDetail"
|
||||||
|
cover
|
||||||
|
>
|
||||||
|
<template #placeholder>
|
||||||
|
<div class="w-full h-full">
|
||||||
|
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VImg>
|
||||||
|
</div>
|
||||||
|
<div class="flex-grow">
|
||||||
|
<VCardItem>
|
||||||
|
<VCardTitle class="text-center text-md-left">
|
||||||
|
{{ props.media?.share_title }}
|
||||||
|
</VCardTitle>
|
||||||
|
<VCardSubtitle
|
||||||
|
class="text-center text-md-left break-words whitespace-break-spaces line-clamp-4 overflow-hidden text-ellipsis"
|
||||||
|
>
|
||||||
|
{{ props.media?.share_comment }}
|
||||||
|
</VCardSubtitle>
|
||||||
|
<VList lines="one">
|
||||||
|
<VListItem class="ps-0">
|
||||||
|
<VListItemTitle class="text-center text-md-left">
|
||||||
|
<span class="font-weight-medium">分享人:</span>
|
||||||
|
<span class="text-body-1"> {{ media?.share_user }}</span>
|
||||||
|
</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
<VListItem class="ps-0" v-if="media?.keyword">
|
||||||
|
<VListItemTitle class="text-center text-md-left">
|
||||||
|
<span class="font-weight-medium">搜索词:</span>
|
||||||
|
<span class="text-body-1"> {{ media?.keyword }}</span>
|
||||||
|
</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
<VListItem class="ps-0" v-if="media?.custom_words" @click.stop="toggleExpand">
|
||||||
|
<VListItemTitle
|
||||||
|
class="text-center text-md-left break-words whitespace-break-spaces"
|
||||||
|
:class="{
|
||||||
|
'line-clamp-4 overflow-hidden text-ellipsis': !isExpanded,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<span class="font-weight-medium">识别词:</span>
|
||||||
|
<span class="text-body-1"> {{ media?.custom_words }}</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"
|
||||||
|
>
|
||||||
|
订阅
|
||||||
|
</VBtn>
|
||||||
|
<VBtn
|
||||||
|
v-if="props.media?.share_uid && props.media?.share_uid === globalSettings.USER_UNIQUE_ID"
|
||||||
|
color="error"
|
||||||
|
:disabled="deleting"
|
||||||
|
@click="doDelete"
|
||||||
|
prepend-icon="mdi-delete"
|
||||||
|
:loading="deleting"
|
||||||
|
class="ms-2"
|
||||||
|
>
|
||||||
|
取消分享
|
||||||
|
</VBtn>
|
||||||
|
<VBtn
|
||||||
|
v-else-if="isFollowed && props.media?.share_uid"
|
||||||
|
color="warning"
|
||||||
|
@click="unfollowUser"
|
||||||
|
prepend-icon="mdi-account-remove"
|
||||||
|
class="ms-2"
|
||||||
|
>
|
||||||
|
取消关注
|
||||||
|
</VBtn>
|
||||||
|
<VBtn
|
||||||
|
v-else-if="props.media?.share_uid"
|
||||||
|
@click="followUser"
|
||||||
|
color="info"
|
||||||
|
prepend-icon="mdi-account-plus"
|
||||||
|
class="ms-2"
|
||||||
|
>
|
||||||
|
关注
|
||||||
|
</VBtn>
|
||||||
|
</div>
|
||||||
|
<div class="text-xs mt-2" v-if="props.media?.count">
|
||||||
|
<VIcon icon="mdi-fire" />共 {{ props.media?.count?.toLocaleString() }} 次复用
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</VCardItem>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</VCol>
|
||||||
|
</VCardText>
|
||||||
|
</VCard>
|
||||||
|
</VDialog>
|
||||||
|
</template>
|
||||||
@@ -2,23 +2,24 @@
|
|||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
title: String,
|
title: String,
|
||||||
|
dataType: String,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 定义事件
|
|
||||||
const emit = defineEmits(['update:modelValue', 'close'])
|
|
||||||
|
|
||||||
// 代码
|
// 代码
|
||||||
const codeString = ref('')
|
const codeString = ref('')
|
||||||
|
|
||||||
|
// 定义事件
|
||||||
|
const emit = defineEmits(['close', 'save'])
|
||||||
|
|
||||||
// 导入
|
// 导入
|
||||||
function handleImport() {
|
function handleImport() {
|
||||||
emit('update:modelValue', codeString.value)
|
emit('save', props.dataType, codeString)
|
||||||
emit('close')
|
emit('close')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VDialog width="40rem" scrollable max-height="85vh">
|
<VDialog width="40rem" scrollable max-height="85vh" persistent>
|
||||||
<VCard :title="props.title" class="rounded-t">
|
<VCard :title="props.title" class="rounded-t">
|
||||||
<DialogCloseBtn @click="emit('close')" />
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
<VCardText class="pt-2">
|
<VCardText class="pt-2">
|
||||||
|
|||||||
22
src/components/dialog/MediaInfoDialog.vue
Normal file
22
src/components/dialog/MediaInfoDialog.vue
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { Context } from '@/api/types'
|
||||||
|
import MediaInfoCard from '../cards/MediaInfoCard.vue'
|
||||||
|
|
||||||
|
// 输入参数
|
||||||
|
defineProps({
|
||||||
|
context: Object as PropType<Context>,
|
||||||
|
})
|
||||||
|
|
||||||
|
// 定义事件
|
||||||
|
const emit = defineEmits(['close'])
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VDialog max-width="50rem">
|
||||||
|
<VCard>
|
||||||
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
|
<VCardItem>
|
||||||
|
<MediaInfoCard :context="context" />
|
||||||
|
</VCardItem>
|
||||||
|
</VCard>
|
||||||
|
</VDialog>
|
||||||
|
</template>
|
||||||
@@ -34,7 +34,7 @@ async function saveHandle() {
|
|||||||
if (result.success) {
|
if (result.success) {
|
||||||
$toast.success('插件仓库保存成功')
|
$toast.success('插件仓库保存成功')
|
||||||
emit('save')
|
emit('save')
|
||||||
} else $toast.error('插件仓库保存失败!')
|
} else $toast.error(`插件仓库保存失败:${result?.message}!`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ async function savaRcloneConfig() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VDialog width="50rem" scrollable max-height="85vh">
|
<VDialog width="50rem" scrollable max-height="85vh">
|
||||||
<VCard title="Rclone网盘配置" class="rounded-t">
|
<VCard title="RClone配置" class="rounded-t">
|
||||||
<DialogCloseBtn @click="emit('close')" />
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<VRow>
|
<VRow>
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import MediaIdSelector from '../misc/MediaIdSelector.vue'
|
import MediaIdSelector from '../misc/MediaIdSelector.vue'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { storageOptions } from '@/api/constants'
|
import { storageOptions, transferTypeOptions } from '@/api/constants'
|
||||||
import { numberValidator } from '@/@validators'
|
import { numberValidator } from '@/@validators'
|
||||||
import { useDisplay } from 'vuetify'
|
import { useDisplay } from 'vuetify'
|
||||||
import ProgressDialog from './ProgressDialog.vue'
|
import ProgressDialog from './ProgressDialog.vue'
|
||||||
import { FileItem, TransferDirectoryConf } from '@/api/types'
|
import { FileItem, TransferDirectoryConf, TransferForm } from '@/api/types'
|
||||||
|
|
||||||
// 显示器宽度
|
// 显示器宽度
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
@@ -49,7 +49,7 @@ const progressEventSource = ref<EventSource>()
|
|||||||
const progressDialog = ref(false)
|
const progressDialog = ref(false)
|
||||||
|
|
||||||
// 整理进度文本
|
// 整理进度文本
|
||||||
const progressText = ref('请稍候 ...')
|
const progressText = ref('正在处理 ...')
|
||||||
|
|
||||||
// 整理进度
|
// 整理进度
|
||||||
const progressValue = ref(0)
|
const progressValue = ref(0)
|
||||||
@@ -65,21 +65,21 @@ const dialogTitle = computed(() => {
|
|||||||
return '手动整理'
|
return '手动整理'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 禁用指定集数
|
||||||
|
const disableEpisodeDetail = computed(() => {
|
||||||
|
if (props.items) {
|
||||||
|
if (transferForm.episode_format) return false
|
||||||
|
return !(props.items.length === 1 && props.items[0].type !== 'dir')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// 表单
|
// 表单
|
||||||
const transferForm = reactive({
|
const transferForm = reactive<TransferForm>({
|
||||||
fileitem: {},
|
fileitem: {} as FileItem,
|
||||||
logid: 0,
|
logid: 0,
|
||||||
target_storage: props.target_storage ?? 'local',
|
target_storage: props.target_storage ?? 'local',
|
||||||
target_path: props.target_path ?? null,
|
|
||||||
tmdbid: null,
|
|
||||||
doubanid: null,
|
|
||||||
season: null,
|
|
||||||
type_name: '',
|
|
||||||
transfer_type: '',
|
transfer_type: '',
|
||||||
episode_format: '',
|
target_path: '',
|
||||||
episode_detail: '',
|
|
||||||
episode_part: '',
|
|
||||||
episode_offset: null,
|
|
||||||
min_filesize: 0,
|
min_filesize: 0,
|
||||||
scrape: false,
|
scrape: false,
|
||||||
from_history: false,
|
from_history: false,
|
||||||
@@ -87,7 +87,6 @@ const transferForm = reactive({
|
|||||||
|
|
||||||
// 所有媒体库目录
|
// 所有媒体库目录
|
||||||
const directories = ref<TransferDirectoryConf[]>([])
|
const directories = ref<TransferDirectoryConf[]>([])
|
||||||
|
|
||||||
// 查询目录
|
// 查询目录
|
||||||
async function loadDirectories() {
|
async function loadDirectories() {
|
||||||
try {
|
try {
|
||||||
@@ -104,16 +103,58 @@ const targetDirectories = computed(() => {
|
|||||||
return [...new Set(libraryDirectories)]
|
return [...new Set(libraryDirectories)]
|
||||||
})
|
})
|
||||||
|
|
||||||
// 监听目的路径变化,自动查询目录削配置
|
// 监听目的路径变化,配置默认值
|
||||||
watch(transferForm, async () => {
|
watch(
|
||||||
if (transferForm.target_path) {
|
() => transferForm.target_path,
|
||||||
const directory = directories.value.find(item => item.library_path === transferForm.target_path)
|
async newPath => {
|
||||||
if (directory) {
|
if (newPath) {
|
||||||
transferForm.scrape = directory.scraping ?? false
|
const directory = directories.value.find(item => item.library_path === newPath)
|
||||||
transferForm.transfer_type = directory.transfer_type ?? ''
|
if (directory) {
|
||||||
|
transferForm.target_storage = directory.library_storage ?? 'local'
|
||||||
|
transferForm.transfer_type = transferForm.transfer_type || directory.transfer_type
|
||||||
|
transferForm.scrape = directory.scraping ?? false
|
||||||
|
transferForm.library_category_folder = directory.library_category_folder ?? false
|
||||||
|
transferForm.library_type_folder = directory.library_type_folder ?? false
|
||||||
|
} else {
|
||||||
|
transferForm.transfer_type = transferForm.transfer_type || 'copy'
|
||||||
|
transferForm.scrape = false
|
||||||
|
transferForm.library_category_folder = false
|
||||||
|
transferForm.library_type_folder = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 路径为空时, 恢复到`自动`条件
|
||||||
|
transferForm.transfer_type = ''
|
||||||
|
transferForm.library_type_folder = undefined
|
||||||
|
transferForm.library_category_folder = undefined
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
// 整理文件
|
||||||
|
async function handleTransfer(item: FileItem, background: boolean = false) {
|
||||||
|
transferForm.fileitem = item
|
||||||
|
transferForm.logid = 0
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.post(`transfer/manual?background=${background}`, transferForm)
|
||||||
|
if (!result.success) $toast.error(result.message)
|
||||||
|
else if (background) $toast.success(`文件 ${item.name} 已加入整理队列!`)
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
|
// 整理日志
|
||||||
|
async function handleTransferLog(logid: number, background: boolean = false) {
|
||||||
|
transferForm.logid = logid
|
||||||
|
transferForm.fileitem = {} as FileItem
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.post(`transfer/manual?background=${background}`, transferForm)
|
||||||
|
if (!result.success) $toast.error(result.message)
|
||||||
|
else if (background) $toast.success(`历史记录 ${logid} 已加入整理队列!`)
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 使用SSE监听加载进度
|
// 使用SSE监听加载进度
|
||||||
function startLoadingProgress() {
|
function startLoadingProgress() {
|
||||||
@@ -134,63 +175,49 @@ function stopLoadingProgress() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 整理文件
|
// 整理文件
|
||||||
async function transfer() {
|
async function transfer(background: boolean = false) {
|
||||||
if (!props.logids && !props.items) return
|
if (!props.logids && !props.items) return
|
||||||
|
|
||||||
// 显示进度条
|
// 显示进度条
|
||||||
progressDialog.value = true
|
progressDialog.value = true
|
||||||
// 开始监听进度
|
|
||||||
startLoadingProgress()
|
if (!background) {
|
||||||
|
// 开始监听进度
|
||||||
|
startLoadingProgress()
|
||||||
|
}
|
||||||
|
|
||||||
// 文件整理
|
// 文件整理
|
||||||
if (props.items) {
|
if (props.items) {
|
||||||
for (const item of props.items) {
|
for (const item of props.items) {
|
||||||
await handleTransfer(item)
|
await handleTransfer(item, background)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 日志整理
|
// 日志整理
|
||||||
if (props.logids) {
|
if (props.logids) {
|
||||||
for (const logid of props.logids) {
|
for (const logid of props.logids) {
|
||||||
await handleTransferLog(logid)
|
await handleTransferLog(logid, background)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 停止监听进度
|
if (!background) {
|
||||||
stopLoadingProgress()
|
// 停止监听进度
|
||||||
|
stopLoadingProgress()
|
||||||
|
}
|
||||||
|
|
||||||
// 关闭进度条
|
// 关闭进度条
|
||||||
progressDialog.value = false
|
progressDialog.value = false
|
||||||
// 重新加载
|
// 重新加载
|
||||||
emit('done')
|
emit('done')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 整理文件
|
|
||||||
async function handleTransfer(item: FileItem) {
|
|
||||||
transferForm.fileitem = item
|
|
||||||
transferForm.logid = 0
|
|
||||||
try {
|
|
||||||
const result: { [key: string]: any } = await api.post('transfer/manual', transferForm)
|
|
||||||
if (!result.success) $toast.error(`文件 ${item.path} 整理失败:${result.message}!`)
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 整理日志
|
|
||||||
async function handleTransferLog(logid: number) {
|
|
||||||
transferForm.logid = logid
|
|
||||||
transferForm.fileitem = {}
|
|
||||||
try {
|
|
||||||
const result: { [key: string]: any } = await api.post('transfer/manual', transferForm)
|
|
||||||
if (!result.success) $toast.error(`历史记录 ${logid} 重新整理失败:${result.message}!`)
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadDirectories()
|
loadDirectories()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
stopLoadingProgress()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -215,18 +242,16 @@ onMounted(() => {
|
|||||||
<VSelect
|
<VSelect
|
||||||
v-model="transferForm.transfer_type"
|
v-model="transferForm.transfer_type"
|
||||||
label="整理方式"
|
label="整理方式"
|
||||||
:items="[
|
:items="transferTypeOptions"
|
||||||
{ title: '默认', value: '' },
|
|
||||||
{ title: '移动', value: 'move' },
|
|
||||||
{ title: '复制', value: 'copy' },
|
|
||||||
{ title: '硬链接', value: 'link' },
|
|
||||||
{ title: '软链接', value: 'softlink' },
|
|
||||||
]"
|
|
||||||
hint="文件操作整理方式"
|
hint="文件操作整理方式"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
/>
|
>
|
||||||
|
<template v-slot:selection="{ item }">
|
||||||
|
{{ transferForm.transfer_type === '' ? '自动' : item.title }}
|
||||||
|
</template>
|
||||||
|
</VSelect>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="12">
|
<VCol cols="12">
|
||||||
<VCombobox
|
<VCombobox
|
||||||
v-model="transferForm.target_path"
|
v-model="transferForm.target_path"
|
||||||
:items="targetDirectories"
|
:items="targetDirectories"
|
||||||
@@ -301,6 +326,7 @@ onMounted(() => {
|
|||||||
<VCol cols="12" md="4">
|
<VCol cols="12" md="4">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="transferForm.episode_detail"
|
v-model="transferForm.episode_detail"
|
||||||
|
:disabled="disableEpisodeDetail"
|
||||||
label="指定集数"
|
label="指定集数"
|
||||||
placeholder="起始集,终止集,如1或1,2"
|
placeholder="起始集,终止集,如1或1,2"
|
||||||
hint="指定集数或范围,如1或1,2"
|
hint="指定集数或范围,如1或1,2"
|
||||||
@@ -318,7 +344,7 @@ onMounted(() => {
|
|||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="4">
|
<VCol cols="12" md="4">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model.number="transferForm.episode_offset"
|
v-model="transferForm.episode_offset"
|
||||||
label="集数偏移"
|
label="集数偏移"
|
||||||
placeholder="如-10"
|
placeholder="如-10"
|
||||||
hint="集数偏移运算,如-10或EP*2"
|
hint="集数偏移运算,如-10或EP*2"
|
||||||
@@ -337,6 +363,22 @@ onMounted(() => {
|
|||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
<VRow>
|
<VRow>
|
||||||
|
<VCol cols="12" md="6" v-if="transferForm.target_path">
|
||||||
|
<VSwitch
|
||||||
|
v-model="transferForm.library_type_folder"
|
||||||
|
label="按类型分类"
|
||||||
|
hint="整理时目的路径下按媒体类型添加子目录"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
<VCol cols="12" md="6" v-if="transferForm.target_path">
|
||||||
|
<VSwitch
|
||||||
|
v-model="transferForm.library_category_folder"
|
||||||
|
label="按类别分类"
|
||||||
|
hint="整理时在目的路径下按媒体类别添加子目录"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
<VSwitch
|
<VSwitch
|
||||||
v-model="transferForm.scrape"
|
v-model="transferForm.scrape"
|
||||||
@@ -349,7 +391,7 @@ onMounted(() => {
|
|||||||
<VSwitch
|
<VSwitch
|
||||||
v-model="transferForm.from_history"
|
v-model="transferForm.from_history"
|
||||||
label="复用历史识别信息"
|
label="复用历史识别信息"
|
||||||
hint="使用历史记录中已识别的媒体信息"
|
hint="使用历史整理记录中已识别的媒体信息"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
@@ -358,7 +400,12 @@ onMounted(() => {
|
|||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardActions class="pt-3">
|
<VCardActions class="pt-3">
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn variant="elevated" @click="transfer" prepend-icon="mdi-arrow-right-bold" class="px-5"> 开始整理 </VBtn>
|
<VBtn variant="elevated" color="success" @click="transfer(true)" prepend-icon="mdi-plus" class="px-5">
|
||||||
|
加入整理队列
|
||||||
|
</VBtn>
|
||||||
|
<VBtn variant="elevated" @click="transfer(false)" prepend-icon="mdi-arrow-right-bold" class="px-5">
|
||||||
|
立即整理
|
||||||
|
</VBtn>
|
||||||
</VCardActions>
|
</VCardActions>
|
||||||
</VCard>
|
</VCard>
|
||||||
<!-- 手动整理进度框 -->
|
<!-- 手动整理进度框 -->
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import type { Site } from '@/api/types'
|
import type { DownloaderConf, Site } from '@/api/types'
|
||||||
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
||||||
import { numberValidator, requiredValidator } from '@/@validators'
|
import { numberValidator, requiredValidator } from '@/@validators'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
@@ -35,6 +35,7 @@ const siteForm = ref<Site>({
|
|||||||
limit_seconds: 0,
|
limit_seconds: 0,
|
||||||
name: '',
|
name: '',
|
||||||
domain: '',
|
domain: '',
|
||||||
|
downloader: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
// 提示框
|
// 提示框
|
||||||
@@ -60,6 +61,24 @@ const priorityItems = ref(
|
|||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 下载器选项
|
||||||
|
const downloaderOptions = ref<{ title: string; value: string }[]>([])
|
||||||
|
|
||||||
|
async function loadDownloaderSetting() {
|
||||||
|
try {
|
||||||
|
const downloaders: DownloaderConf[] = await api.get('download/clients')
|
||||||
|
downloaderOptions.value = [
|
||||||
|
{ title: '默认', value: '' },
|
||||||
|
...downloaders.map((item: { name: any }) => ({
|
||||||
|
title: item.name,
|
||||||
|
value: item.name,
|
||||||
|
})),
|
||||||
|
]
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载下载器设置失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 查询站点信息
|
// 查询站点信息
|
||||||
async function fetchSiteInfo() {
|
async function fetchSiteInfo() {
|
||||||
try {
|
try {
|
||||||
@@ -142,6 +161,7 @@ onMounted(async () => {
|
|||||||
isLimit.value = true
|
isLimit.value = true
|
||||||
if (siteForm.value.apikey) siteType.value = 'api'
|
if (siteForm.value.apikey) siteType.value = 'api'
|
||||||
}
|
}
|
||||||
|
await loadDownloaderSetting()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -186,7 +206,7 @@ onMounted(async () => {
|
|||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol cols="12" md="9">
|
<VCol cols="12" md="6">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="siteForm.rss"
|
v-model="siteForm.rss"
|
||||||
label="RSS地址"
|
label="RSS地址"
|
||||||
@@ -195,7 +215,21 @@ onMounted(async () => {
|
|||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="3">
|
<VCol cols="12" md="3">
|
||||||
<VTextField v-model="siteForm.timeout" label="超时时间(秒)" hint="站点请求超时时间" persistent-hint />
|
<VTextField
|
||||||
|
v-model="siteForm.timeout"
|
||||||
|
label="超时时间(秒)"
|
||||||
|
hint="站点请求超时时间,为0时不限制"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
<VCol cols="6" md="3">
|
||||||
|
<VSelect
|
||||||
|
v-model="siteForm.downloader"
|
||||||
|
label="下载器"
|
||||||
|
:items="downloaderOptions"
|
||||||
|
hint="此站点使用的下载器"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
<VTabs v-model="siteType" show-arrows class="v-tabs-pill mt-3">
|
<VTabs v-model="siteType" show-arrows class="v-tabs-pill mt-3">
|
||||||
|
|||||||
@@ -67,17 +67,18 @@ async function updateSiteCookie() {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VDialog max-width="50rem">
|
<VDialog max-width="30rem">
|
||||||
<!-- Dialog Content -->
|
<!-- Dialog Content -->
|
||||||
<VCard title="更新站点Cookie & UA">
|
<VCard title="更新站点Cookie & UA">
|
||||||
<DialogCloseBtn @click="emit('close')" />
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
|
<VDivider />
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<VForm @submit.prevent="() => {}">
|
<VForm @submit.prevent="() => {}">
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol cols="12" md="4">
|
<VCol cols="12">
|
||||||
<VTextField v-model="userPwForm.username" label="用户名" :rules="[requiredValidator]" />
|
<VTextField v-model="userPwForm.username" label="用户名" :rules="[requiredValidator]" />
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="4">
|
<VCol cols="12">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="userPwForm.password"
|
v-model="userPwForm.password"
|
||||||
label="密码"
|
label="密码"
|
||||||
@@ -88,19 +89,19 @@ async function updateSiteCookie() {
|
|||||||
@keydown.enter="updateSiteCookie"
|
@keydown.enter="updateSiteCookie"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="4">
|
<VCol cols="12">
|
||||||
<VTextField v-model="userPwForm.code" label="两步验证" />
|
<VTextField v-model="userPwForm.code" label="两步验证" />
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
</VForm>
|
</VForm>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
|
<VCardActions class="mx-auto">
|
||||||
<VCardActions>
|
|
||||||
<VSpacer />
|
|
||||||
<VBtn
|
<VBtn
|
||||||
|
size="large"
|
||||||
variant="elevated"
|
variant="elevated"
|
||||||
@click="updateSiteCookie"
|
@click="updateSiteCookie"
|
||||||
:disabled="updateButtonDisable"
|
:disabled="updateButtonDisable"
|
||||||
|
:loading="updateButtonDisable"
|
||||||
prepend-icon="mdi-refresh"
|
prepend-icon="mdi-refresh"
|
||||||
class="px-5"
|
class="px-5"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
import type { Site, SiteUserData } from '@/api/types'
|
import type { Site, SiteUserData } from '@/api/types'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { useDisplay, useTheme } from 'vuetify'
|
import { useDisplay, useTheme } from 'vuetify'
|
||||||
import { VAvatar, VCardText, VIcon } from 'vuetify/lib/components/index.mjs'
|
|
||||||
import { formatFileSize } from '@/@core/utils/formatters'
|
import { formatFileSize } from '@/@core/utils/formatters'
|
||||||
import VueApexCharts from 'vue3-apexcharts'
|
import ProgressDialog from '@/components/dialog/ProgressDialog.vue'
|
||||||
|
|
||||||
// 显示器宽度
|
// 显示器宽度
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
@@ -17,6 +16,9 @@ const props = defineProps({
|
|||||||
// 注册事件
|
// 注册事件
|
||||||
const emit = defineEmits(['close'])
|
const emit = defineEmits(['close'])
|
||||||
|
|
||||||
|
// 进度框
|
||||||
|
const progressDialog = ref(false)
|
||||||
|
|
||||||
const vuetifyTheme = useTheme()
|
const vuetifyTheme = useTheme()
|
||||||
|
|
||||||
const currentTheme = controlledComputed(
|
const currentTheme = controlledComputed(
|
||||||
@@ -27,8 +29,8 @@ const currentTheme = controlledComputed(
|
|||||||
// 站点数据列表
|
// 站点数据列表
|
||||||
const siteDatas = ref<SiteUserData[]>([])
|
const siteDatas = ref<SiteUserData[]>([])
|
||||||
|
|
||||||
// 最新一天的数据,按时间倒序排序后取第一条记录
|
// 最新一天的数据
|
||||||
const siteData = computed(() => siteDatas.value[0])
|
const siteData = computed(() => siteDatas.value[siteDatas.value.length - 1])
|
||||||
|
|
||||||
// 站点数据列表中的上传量、下载量数据生成图形使用的数据
|
// 站点数据列表中的上传量、下载量数据生成图形使用的数据
|
||||||
const historySeries = computed(() => {
|
const historySeries = computed(() => {
|
||||||
@@ -238,6 +240,20 @@ async function fetchSiteUserData() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 刷新站点数据
|
||||||
|
async function refreshSiteData() {
|
||||||
|
progressDialog.value = true
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.post(`site/userdata/${props.site?.id}`)
|
||||||
|
if (result.success) {
|
||||||
|
await fetchSiteUserData()
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
progressDialog.value = false
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
await fetchSiteUserData()
|
await fetchSiteUserData()
|
||||||
})
|
})
|
||||||
@@ -245,9 +261,16 @@ onBeforeMount(async () => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VDialog scrollable eager max-width="80rem" :fullscreen="!display.mdAndUp.value">
|
<VDialog scrollable eager max-width="80rem" :fullscreen="!display.mdAndUp.value">
|
||||||
<VCard :title="`数据 - ${props.site?.name}`" class="rounded-t">
|
<VCard class="rounded-t">
|
||||||
<DialogCloseBtn @click="emit('close')" />
|
<VCardItem>
|
||||||
<VCardText>
|
<VCardTitle
|
||||||
|
>{{ `数据 - ${props.site?.name}` }}
|
||||||
|
<IconBtn @click.stop="refreshSiteData" color="info"><VIcon icon="mdi-refresh" /></IconBtn>
|
||||||
|
</VCardTitle>
|
||||||
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
|
</VCardItem>
|
||||||
|
<VDivider />
|
||||||
|
<VCardText class="pt-5">
|
||||||
<VRow class="match-height">
|
<VRow class="match-height">
|
||||||
<!-- 用户信息 -->
|
<!-- 用户信息 -->
|
||||||
<VCol cols="12" md="3">
|
<VCol cols="12" md="3">
|
||||||
@@ -416,7 +439,7 @@ onBeforeMount(async () => {
|
|||||||
<VCol>
|
<VCol>
|
||||||
<VCard title="历史流量">
|
<VCard title="历史流量">
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<VueApexCharts type="line" :options="historyChartOptions" :series="historySeries" :height="300" />
|
<VApexChart type="line" :options="historyChartOptions" :series="historySeries" :height="300" />
|
||||||
</VCardText>
|
</VCardText>
|
||||||
</VCard>
|
</VCard>
|
||||||
</VCol>
|
</VCol>
|
||||||
@@ -425,12 +448,14 @@ onBeforeMount(async () => {
|
|||||||
<VCol>
|
<VCol>
|
||||||
<VCard title="做种分布">
|
<VCard title="做种分布">
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<VueApexCharts type="scatter" :options="seedingChartOptions" :series="seedingSeries" :height="300" />
|
<VApexChart type="scatter" :options="seedingChartOptions" :series="seedingSeries" :height="300" />
|
||||||
</VCardText>
|
</VCardText>
|
||||||
</VCard>
|
</VCard>
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
</VCard>
|
</VCard>
|
||||||
|
<!-- 进度框 -->
|
||||||
|
<ProgressDialog v-if="progressDialog" v-model="progressDialog" text="正在刷新站点数据..." />
|
||||||
</VDialog>
|
</VDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import { numberValidator } from '@/@validators'
|
import { numberValidator } from '@/@validators'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { FilterRuleGroup, Site, Subscribe, TransferDirectoryConf } from '@/api/types'
|
import type { DownloaderConf, FilterRuleGroup, Site, Subscribe, TransferDirectoryConf } from '@/api/types'
|
||||||
import { useDisplay } from 'vuetify'
|
import { useDisplay } from 'vuetify'
|
||||||
import { useConfirm } from 'vuetify-use-dialog'
|
import { useConfirm } from 'vuetify-use-dialog'
|
||||||
import { VTextarea, VTextField } from 'vuetify/lib/components/index.mjs'
|
import { VTextarea, VTextField } from 'vuetify/lib/components/index.mjs'
|
||||||
@@ -50,6 +50,7 @@ const subscribeForm = ref<Subscribe>({
|
|||||||
sites: [],
|
sites: [],
|
||||||
best_version: undefined,
|
best_version: undefined,
|
||||||
current_priority: 0,
|
current_priority: 0,
|
||||||
|
downloader: '',
|
||||||
date: '',
|
date: '',
|
||||||
show_edit_dialog: false,
|
show_edit_dialog: false,
|
||||||
})
|
})
|
||||||
@@ -57,6 +58,24 @@ const subscribeForm = ref<Subscribe>({
|
|||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
|
|
||||||
|
// 下载器选项
|
||||||
|
const downloaderOptions = ref<{ title: string; value: string }[]>([])
|
||||||
|
|
||||||
|
async function loadDownloaderSetting() {
|
||||||
|
try {
|
||||||
|
const downloaders: DownloaderConf[] = await api.get('download/clients')
|
||||||
|
downloaderOptions.value = [
|
||||||
|
{ title: '默认', value: '' },
|
||||||
|
...downloaders.map((item: { name: any }) => ({
|
||||||
|
title: item.name,
|
||||||
|
value: item.name,
|
||||||
|
})),
|
||||||
|
]
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载下载器设置失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 加载规则组
|
// 加载规则组
|
||||||
async function queryFilterRuleGroups() {
|
async function queryFilterRuleGroups() {
|
||||||
try {
|
try {
|
||||||
@@ -188,7 +207,7 @@ async function removeSubscribe() {
|
|||||||
// 查询下载目录
|
// 查询下载目录
|
||||||
async function loadDownloadDirectories() {
|
async function loadDownloadDirectories() {
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.get('system/setting/DownloadDirectories')
|
const result: { [key: string]: any } = await api.get('system/setting/Directories')
|
||||||
if (result.success && result.data?.value) {
|
if (result.success && result.data?.value) {
|
||||||
downloadDirectories.value = result.data.value
|
downloadDirectories.value = result.data.value
|
||||||
}
|
}
|
||||||
@@ -200,8 +219,7 @@ async function loadDownloadDirectories() {
|
|||||||
// 保存目录下拉框
|
// 保存目录下拉框
|
||||||
const targetDirectories = computed(() => {
|
const targetDirectories = computed(() => {
|
||||||
// 去重后的下载目录
|
// 去重后的下载目录
|
||||||
const directories = downloadDirectories.value.map(item => item.download_path)
|
return downloadDirectories.value.map(item => item.download_path)
|
||||||
return [...new Set(directories)]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 质量选择框数据
|
// 质量选择框数据
|
||||||
@@ -292,6 +310,7 @@ onMounted(() => {
|
|||||||
queryFilterRuleGroups()
|
queryFilterRuleGroups()
|
||||||
loadDownloadDirectories()
|
loadDownloadDirectories()
|
||||||
getSiteList()
|
getSiteList()
|
||||||
|
loadDownloaderSetting()
|
||||||
if (props.subid) getSubscribeInfo()
|
if (props.subid) getSubscribeInfo()
|
||||||
if (props.default) queryDefaultSubscribeConfig()
|
if (props.default) queryDefaultSubscribeConfig()
|
||||||
})
|
})
|
||||||
@@ -392,6 +411,26 @@ onMounted(() => {
|
|||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
|
<VRow>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VSelect
|
||||||
|
v-model="subscribeForm.downloader"
|
||||||
|
:items="downloaderOptions"
|
||||||
|
label="下载器"
|
||||||
|
hint="指定该订阅使用的下载器"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VCombobox
|
||||||
|
v-model="subscribeForm.save_path"
|
||||||
|
:items="targetDirectories"
|
||||||
|
label="保存路径"
|
||||||
|
hint="指定该订阅的下载保存路径,留空自动使用设定的下载目录"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol cols="12" md="4">
|
<VCol cols="12" md="4">
|
||||||
<VSwitch
|
<VSwitch
|
||||||
@@ -461,15 +500,6 @@ onMounted(() => {
|
|||||||
persistent-hint
|
persistent-hint
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="6">
|
|
||||||
<VCombobox
|
|
||||||
v-model="subscribeForm.save_path"
|
|
||||||
:items="targetDirectories"
|
|
||||||
label="自定义保存路径"
|
|
||||||
hint="指定该订阅的下载保存路径,留空自动使用设定的下载目录"
|
|
||||||
persistent-hint
|
|
||||||
/>
|
|
||||||
</VCol>
|
|
||||||
</VRow>
|
</VRow>
|
||||||
<VRow v-if="!props.default">
|
<VRow v-if="!props.default">
|
||||||
<VCol cols="12">
|
<VCol cols="12">
|
||||||
|
|||||||
@@ -132,59 +132,63 @@ onBeforeMount(() => {
|
|||||||
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
|
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
|
||||||
<VWindowItem value="download">
|
<VWindowItem value="download">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<VDataTable
|
<div>
|
||||||
items-per-page="50"
|
<VDataTable
|
||||||
:headers="downloadHeaders"
|
items-per-page="50"
|
||||||
:items="downloadInfos"
|
:headers="downloadHeaders"
|
||||||
:items-length="totalCount"
|
:items="downloadInfos"
|
||||||
density="compact"
|
:items-length="totalCount"
|
||||||
item-value="title"
|
density="compact"
|
||||||
return-object
|
item-value="title"
|
||||||
fixed-header
|
return-object
|
||||||
hover
|
fixed-header
|
||||||
items-per-page-text="每页条数"
|
hover
|
||||||
page-text="{0}-{1} 共 {2} 条"
|
items-per-page-text="每页条数"
|
||||||
loading-text="加载中..."
|
page-text="{0}-{1} 共 {2} 条"
|
||||||
>
|
loading-text="加载中..."
|
||||||
<template #item.episode_number="{ item }">
|
>
|
||||||
<div class="text-high-emphasis pt-1">{{ item.episode_number }}. {{ item.title }}</div>
|
<template #item.episode_number="{ item }">
|
||||||
</template>
|
<div class="text-high-emphasis pt-1">{{ item.episode_number }}. {{ item.title }}</div>
|
||||||
<template #item.torrent_title="{ item }">
|
</template>
|
||||||
<div class="text-xs" v-for="file in item.download">
|
<template #item.torrent_title="{ item }">
|
||||||
【{{ file.site_name }}】{{ file.torrent_title }}
|
<div class="text-xs" v-for="file in item.download">
|
||||||
</div>
|
【{{ file.site_name }}】{{ file.torrent_title }}
|
||||||
</template>
|
</div>
|
||||||
<template #item.file_path="{ item }">
|
</template>
|
||||||
<div class="text-xs" v-for="file in item.download">{{ file.file_path }}</div>
|
<template #item.file_path="{ item }">
|
||||||
</template>
|
<div class="text-xs" v-for="file in item.download">{{ file.file_path }}</div>
|
||||||
<template #no-data> 没有数据 </template>
|
</template>
|
||||||
</VDataTable>
|
<template #no-data> 没有数据 </template>
|
||||||
|
</VDataTable>
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
<VWindowItem value="library">
|
<VWindowItem value="library">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<VDataTable
|
<div>
|
||||||
items-per-page="50"
|
<VDataTable
|
||||||
:headers="libraryHeaders"
|
items-per-page="50"
|
||||||
:items="libraryInfos"
|
:headers="libraryHeaders"
|
||||||
:items-length="totalCount"
|
:items="libraryInfos"
|
||||||
density="compact"
|
:items-length="totalCount"
|
||||||
item-value="title"
|
density="compact"
|
||||||
return-object
|
item-value="title"
|
||||||
fixed-header
|
return-object
|
||||||
hover
|
fixed-header
|
||||||
items-per-page-text="每页条数"
|
hover
|
||||||
page-text="{0}-{1} 共 {2} 条"
|
items-per-page-text="每页条数"
|
||||||
loading-text="加载中..."
|
page-text="{0}-{1} 共 {2} 条"
|
||||||
>
|
loading-text="加载中..."
|
||||||
<template #item.episode_number="{ item }">
|
>
|
||||||
<div class="text-high-emphasis pt-1">{{ item.episode_number }}. {{ item.title }}</div>
|
<template #item.episode_number="{ item }">
|
||||||
</template>
|
<div class="text-high-emphasis pt-1">{{ item.episode_number }}. {{ item.title }}</div>
|
||||||
<template #item.file_path="{ item }">
|
</template>
|
||||||
<div class="text-xs" v-for="file in item.library">{{ file.file_path }}</div>
|
<template #item.file_path="{ item }">
|
||||||
</template>
|
<div class="text-xs" v-for="file in item.library">{{ file.file_path }}</div>
|
||||||
<template #no-data> 没有数据 </template>
|
</template>
|
||||||
</VDataTable>
|
<template #no-data> 没有数据 </template>
|
||||||
|
</VDataTable>
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
</VWindow>
|
</VWindow>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ async function reSubscribe(item: Subscribe) {
|
|||||||
else progressText.value = `正在重新订阅 ${item.name} 第 ${item.season} 季 ...`
|
else progressText.value = `正在重新订阅 ${item.name} 第 ${item.season} 季 ...`
|
||||||
progressDialog.value = true
|
progressDialog.value = true
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.post('subscribe', item)
|
const result: { [key: string]: any } = await api.post('subscribe/', item)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
emit('save')
|
emit('save')
|
||||||
}
|
}
|
||||||
@@ -138,14 +138,7 @@ const dropdownItems = ref([
|
|||||||
<VCardTitle>{{ props.type + '订阅历史' }}</VCardTitle>
|
<VCardTitle>{{ props.type + '订阅历史' }}</VCardTitle>
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
<VDivider />
|
<VDivider />
|
||||||
<DialogCloseBtn
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
@click="
|
|
||||||
() => {
|
|
||||||
emit('close')
|
|
||||||
}
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
<!-- <VList lines="two" v-if="historyList.length > 0"> -->
|
|
||||||
<VList lines="two">
|
<VList lines="two">
|
||||||
<VInfiniteScroll mode="intersect" side="end" :items="historyList" class="overflow-hidden" @load="loadHistory">
|
<VInfiniteScroll mode="intersect" side="end" :items="historyList" class="overflow-hidden" @load="loadHistory">
|
||||||
<template #loading>
|
<template #loading>
|
||||||
@@ -207,7 +200,7 @@ const dropdownItems = ref([
|
|||||||
</template>
|
</template>
|
||||||
</VInfiniteScroll>
|
</VInfiniteScroll>
|
||||||
</VList>
|
</VList>
|
||||||
<VCardText v-if="historyList.length === 0" class="text-center"> 没有已完成的订阅 </VCardText>
|
<VCardText v-if="historyList.length === 0 && isRefreshed" class="text-center"> 没有已完成的订阅 </VCardText>
|
||||||
</VCard>
|
</VCard>
|
||||||
<!-- 进度框 -->
|
<!-- 进度框 -->
|
||||||
<ProgressDialog v-if="progressDialog" v-model="progressDialog" :text="progressText" />
|
<ProgressDialog v-if="progressDialog" v-model="progressDialog" :text="progressText" />
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { requiredValidator } from '@/@validators'
|
|||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Subscribe, SubscribeShare } from '@/api/types'
|
import type { Subscribe, SubscribeShare } from '@/api/types'
|
||||||
import { useDisplay } from 'vuetify'
|
import { useDisplay } from 'vuetify'
|
||||||
|
import { formatSeason } from '@/@core/utils/formatters'
|
||||||
|
|
||||||
// 显示器宽度
|
// 显示器宽度
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
@@ -16,16 +17,22 @@ const props = defineProps({
|
|||||||
// 定义触发的自定义事件
|
// 定义触发的自定义事件
|
||||||
const emit = defineEmits(['close'])
|
const emit = defineEmits(['close'])
|
||||||
|
|
||||||
|
// 分享处理状态
|
||||||
|
const shareDoing = ref(false)
|
||||||
|
|
||||||
// 订阅编辑表单
|
// 订阅编辑表单
|
||||||
const shareForm = ref<SubscribeShare>({
|
const shareForm = ref<SubscribeShare>({
|
||||||
subscribe_id: props.sub?.id ?? 0,
|
subscribe_id: props.sub?.id ?? 0,
|
||||||
|
share_title: `${props.sub?.name} ${formatSeason(props.sub?.season ? props.sub?.season.toString() : '')}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 分享订阅
|
// 分享订阅
|
||||||
async function doShare() {
|
async function doShare() {
|
||||||
if (!shareForm.value.share_title || !shareForm.value.share_comment || !shareForm.value.share_user) return
|
if (!shareForm.value.share_title || !shareForm.value.share_comment || !shareForm.value.share_user) return
|
||||||
try {
|
try {
|
||||||
|
shareDoing.value = true
|
||||||
const result: { [key: string]: any } = await api.post('subscribe/share', shareForm.value)
|
const result: { [key: string]: any } = await api.post('subscribe/share', shareForm.value)
|
||||||
|
shareDoing.value = false
|
||||||
// 提示
|
// 提示
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
$toast.success(`${props.sub?.name} 分享成功!`)
|
$toast.success(`${props.sub?.name} 分享成功!`)
|
||||||
@@ -56,8 +63,8 @@ const $toast = useToast()
|
|||||||
<VCol cols="12">
|
<VCol cols="12">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="shareForm.share_title"
|
v-model="shareForm.share_title"
|
||||||
|
readonly
|
||||||
label="标题"
|
label="标题"
|
||||||
hint="给分享取一个便于识别的名称"
|
|
||||||
:rules="[requiredValidator]"
|
:rules="[requiredValidator]"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
/>
|
/>
|
||||||
@@ -67,7 +74,7 @@ const $toast = useToast()
|
|||||||
v-model="shareForm.share_comment"
|
v-model="shareForm.share_comment"
|
||||||
label="说明"
|
label="说明"
|
||||||
:rules="[requiredValidator]"
|
:rules="[requiredValidator]"
|
||||||
hint="关于该订阅的说明"
|
hint="填写关于该订阅的说明,订阅中的搜索词、识别词等将会默认包含在分享中"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
@@ -85,7 +92,16 @@ const $toast = useToast()
|
|||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardActions class="pt-3">
|
<VCardActions class="pt-3">
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn variant="elevated" @click="doShare" prepend-icon="mdi-share" class="px-5"> 确认分享 </VBtn>
|
<VBtn
|
||||||
|
variant="elevated"
|
||||||
|
:disabled="shareDoing"
|
||||||
|
@click="doShare"
|
||||||
|
prepend-icon="mdi-share"
|
||||||
|
class="px-5"
|
||||||
|
:loading="shareDoing"
|
||||||
|
>
|
||||||
|
确认分享
|
||||||
|
</VBtn>
|
||||||
</VCardActions>
|
</VCardActions>
|
||||||
</VCard>
|
</VCard>
|
||||||
</VDialog>
|
</VDialog>
|
||||||
|
|||||||
187
src/components/dialog/TransferQueueDialog.vue
Normal file
187
src/components/dialog/TransferQueueDialog.vue
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { formatFileSize } from '@/@core/utils/formatters'
|
||||||
|
import api from '@/api'
|
||||||
|
import { FileItem, TransferQueue } from '@/api/types'
|
||||||
|
import { useDisplay } from 'vuetify'
|
||||||
|
|
||||||
|
// 显示器宽度
|
||||||
|
const display = useDisplay()
|
||||||
|
// 定义触发的自定义事件
|
||||||
|
const emit = defineEmits(['close'])
|
||||||
|
|
||||||
|
// 数据列表
|
||||||
|
const dataList = ref<TransferQueue[]>([])
|
||||||
|
|
||||||
|
// 加载进度SSE
|
||||||
|
const progressEventSource = ref<EventSource>()
|
||||||
|
|
||||||
|
// 整理进度文本
|
||||||
|
const progressText = ref('请稍候 ...')
|
||||||
|
|
||||||
|
// 整理进度
|
||||||
|
const progressValue = ref(0)
|
||||||
|
|
||||||
|
// 数据可刷新标志
|
||||||
|
const refreshFlag = ref(false)
|
||||||
|
|
||||||
|
// 活动标签
|
||||||
|
const activeTab = ref('')
|
||||||
|
|
||||||
|
// 状态标签
|
||||||
|
const stateDict: { [key: string]: string } = {
|
||||||
|
'waiting': '等待中',
|
||||||
|
'running': '正在整理',
|
||||||
|
'completed': '完成',
|
||||||
|
'failed': '失败',
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取状态颜色
|
||||||
|
function getStateColor(state: string) {
|
||||||
|
if (state === 'waiting') return 'gray'
|
||||||
|
else if (state === 'running') return 'primary'
|
||||||
|
else if (state === 'completed') return 'success'
|
||||||
|
else return 'error'
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从dataList中提取所有的媒体信息
|
||||||
|
const mediaList = computed(() => {
|
||||||
|
return dataList.value.map(item => item.media)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 按media计算总数和完成数,返回 x/x
|
||||||
|
function getMediaCount(title_year: string) {
|
||||||
|
// 按title_year查询出所有media列表
|
||||||
|
const medias = dataList.value.filter(item => item.media.title_year === title_year)
|
||||||
|
// 计算media下任务的总数
|
||||||
|
const total = medias.reduce((acc, cur) => acc + cur.tasks.length, 0)
|
||||||
|
// 计算media下任务的完成数
|
||||||
|
const completed = medias.reduce((acc, cur) => acc + cur.tasks.filter(task => task.state === 'completed').length, 0)
|
||||||
|
return `${completed} / ${total}`
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据媒体信息获取对应的整理任务
|
||||||
|
const activeTasks = computed(() => {
|
||||||
|
return dataList.value.find(item => item.media.title_year === activeTab.value)?.tasks
|
||||||
|
})
|
||||||
|
|
||||||
|
// 调用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 || ''
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 移除队列任务
|
||||||
|
async function remove_queue_task(fileitem: FileItem) {
|
||||||
|
try {
|
||||||
|
await api.delete(`transfer/queue`, { data: fileitem })
|
||||||
|
get_transfer_queue()
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用SSE监听加载进度
|
||||||
|
function startLoadingProgress() {
|
||||||
|
progressText.value = '请稍候 ...'
|
||||||
|
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 = '请稍候 ...'
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 停止监听加载进度
|
||||||
|
function stopLoadingProgress() {
|
||||||
|
progressEventSource.value?.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
get_transfer_queue()
|
||||||
|
startLoadingProgress()
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
stopLoadingProgress()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VDialog scrollable max-width="50rem" :fullscreen="!display.mdAndUp.value">
|
||||||
|
<VCard class="mx-auto" width="100%">
|
||||||
|
<VCardItem>
|
||||||
|
<VCardTitle>整理队列</VCardTitle>
|
||||||
|
</VCardItem>
|
||||||
|
<DialogCloseBtn @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"> 没有正在整理的任务 </VCardText>
|
||||||
|
<VCardText>
|
||||||
|
<VTabs v-model="activeTab" show-arrows class="v-tabs-pill" stacked>
|
||||||
|
<VTab
|
||||||
|
v-for="media in mediaList"
|
||||||
|
:value="media.title_year"
|
||||||
|
selected-class="v-slide-group-item--active v-tab--selected"
|
||||||
|
>
|
||||||
|
<div class="font-bold text-lg">{{ media.title }}</div>
|
||||||
|
<div>({{ getMediaCount(media.title_year || '') }})</div>
|
||||||
|
</VTab>
|
||||||
|
</VTabs>
|
||||||
|
<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">
|
||||||
|
<VListItemTitle>{{ task.fileitem.name }}</VListItemTitle>
|
||||||
|
<VListItemSubtitle>
|
||||||
|
大小:{{ formatFileSize(task.fileitem.size || 0) }}
|
||||||
|
<VChip size="small" :color="getStateColor(task.state)" class="ms-2">
|
||||||
|
{{ stateDict[task.state] }}
|
||||||
|
</VChip>
|
||||||
|
</VListItemSubtitle>
|
||||||
|
<template #append>
|
||||||
|
<IconBtn size="small" icon="mdi-cancel" @click="remove_queue_task(task.fileitem)" />
|
||||||
|
</template>
|
||||||
|
</VListItem>
|
||||||
|
</VList>
|
||||||
|
</VWindowItem>
|
||||||
|
</VWindow>
|
||||||
|
</VCardText>
|
||||||
|
</VCard>
|
||||||
|
</VDialog>
|
||||||
|
</template>
|
||||||
@@ -1,6 +1,15 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import QrcodeVue from 'qrcode.vue'
|
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
|
import QrcodeVue from 'qrcode.vue'
|
||||||
|
import { VCardItem, VTextField } from 'vuetify/lib/components/index.mjs'
|
||||||
|
|
||||||
|
// 定义输入
|
||||||
|
const props = defineProps({
|
||||||
|
conf: {
|
||||||
|
type: Object as PropType<{ [key: string]: any }>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
// 定义事件
|
// 定义事件
|
||||||
const emit = defineEmits(['done', 'close'])
|
const emit = defineEmits(['done', 'close'])
|
||||||
@@ -9,7 +18,7 @@ const emit = defineEmits(['done', 'close'])
|
|||||||
const qrCodeContent = ref('')
|
const qrCodeContent = ref('')
|
||||||
|
|
||||||
// 下方的提示信息
|
// 下方的提示信息
|
||||||
const text = ref('请使用微信或115客户端扫码')
|
const text = ref('请使用微信或115客户端扫码,或在下方输入Cookie')
|
||||||
|
|
||||||
// 提醒类型
|
// 提醒类型
|
||||||
const alertType = ref<'success' | 'info' | 'error' | 'warning' | undefined>('info')
|
const alertType = ref<'success' | 'info' | 'error' | 'warning' | undefined>('info')
|
||||||
@@ -19,6 +28,10 @@ let timeoutTimer: NodeJS.Timeout | undefined = undefined
|
|||||||
|
|
||||||
// 完成
|
// 完成
|
||||||
async function handleDone() {
|
async function handleDone() {
|
||||||
|
clearTimeout(timeoutTimer)
|
||||||
|
if (props.conf?.cookie) {
|
||||||
|
await savaU115Config()
|
||||||
|
}
|
||||||
emit('done')
|
emit('done')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,15 +56,21 @@ async function checkQrcode() {
|
|||||||
if (result.success && result.data) {
|
if (result.success && result.data) {
|
||||||
const status = result.data.status
|
const status = result.data.status
|
||||||
text.value = result.data.tip
|
text.value = result.data.tip
|
||||||
if (status == 1) {
|
if (status == 0) {
|
||||||
// 已确认完成
|
|
||||||
alertType.value = 'success'
|
|
||||||
handleDone()
|
|
||||||
} else if (status == 0) {
|
|
||||||
alertType.value = 'info'
|
alertType.value = 'info'
|
||||||
// 新建、待扫码
|
// 新建、待扫码
|
||||||
clearTimeout(timeoutTimer)
|
clearTimeout(timeoutTimer)
|
||||||
timeoutTimer = setTimeout(checkQrcode, 3000)
|
timeoutTimer = setTimeout(checkQrcode, 3000)
|
||||||
|
} else if (status == 1) {
|
||||||
|
// 已扫码
|
||||||
|
alertType.value = 'info'
|
||||||
|
text.value = '已扫码,请确认登录'
|
||||||
|
clearTimeout(timeoutTimer)
|
||||||
|
timeoutTimer = setTimeout(checkQrcode, 3000)
|
||||||
|
} else if (status == 2) {
|
||||||
|
// 已确认完成
|
||||||
|
alertType.value = 'success'
|
||||||
|
handleDone()
|
||||||
} else {
|
} else {
|
||||||
// 过期或者已取消
|
// 过期或者已取消
|
||||||
alertType.value = 'error'
|
alertType.value = 'error'
|
||||||
@@ -65,6 +84,15 @@ async function checkQrcode() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存cookie设置
|
||||||
|
async function savaU115Config() {
|
||||||
|
try {
|
||||||
|
await api.post(`storage/save/u115`, props.conf)
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getQrcode()
|
await getQrcode()
|
||||||
timeoutTimer = setTimeout(checkQrcode, 3000)
|
timeoutTimer = setTimeout(checkQrcode, 3000)
|
||||||
@@ -80,15 +108,20 @@ onUnmounted(() => {
|
|||||||
<VCard title="115网盘登录" class="rounded-t">
|
<VCard title="115网盘登录" class="rounded-t">
|
||||||
<DialogCloseBtn @click="emit('close')" />
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
<VCardText class="pt-2 flex flex-col items-center">
|
<VCardText class="pt-2 flex flex-col items-center">
|
||||||
<div class="my-6 shadow-lg rounded border">
|
<div class="my-6 shadow-lg rounded text-center p-3 border">
|
||||||
<VImg class="mx-auto" :src="qrCodeContent" style="block-size: 200px; inline-size: 200px">
|
<QrcodeVue class="mx-auto" :value="qrCodeContent" :size="200" />
|
||||||
<VSkeletonLoader v-if="!qrCodeContent" class="w-full h-full" />
|
|
||||||
</VImg>
|
|
||||||
</div>
|
</div>
|
||||||
<VAlert variant="tonal" :type="alertType" class="my-4 text-center" :text="text">
|
<VAlert variant="tonal" :type="alertType" class="my-4 text-center" :text="text">
|
||||||
<template #prepend />
|
<template #prepend />
|
||||||
</VAlert>
|
</VAlert>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
|
<VCardText>
|
||||||
|
<VRow>
|
||||||
|
<VCol class="mt-2">
|
||||||
|
<VTextField label="自定义Cookie" v-model="props.conf.cookie" outlined dense />
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
</VCardText>
|
||||||
<VCardActions>
|
<VCardActions>
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn variant="elevated" @click="handleDone" prepend-icon="mdi-check" class="px-5 me-3"> 完成 </VBtn>
|
<VBtn variant="elevated" @click="handleDone" prepend-icon="mdi-check" class="px-5 me-3"> 完成 </VBtn>
|
||||||
|
|||||||
@@ -269,41 +269,48 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<DialogCloseBtn @click="emit('close')" />
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
<VDivider />
|
<VDivider />
|
||||||
<VCardText class="d-flex">
|
<VCardItem>
|
||||||
<!-- 👉 Avatar -->
|
<!-- 👉 Avatar -->
|
||||||
<VAvatar rounded="lg" size="100" class="me-6" :image="currentAvatar" />
|
<div class="flex flex-row">
|
||||||
|
<VAvatar rounded="lg" size="100" class="me-5" :image="currentAvatar" />
|
||||||
|
<!-- 👉 Upload Photo -->
|
||||||
|
<div class="flex flex-col justify-center gap-5">
|
||||||
|
<div class="flex flex-wrap gap-2">
|
||||||
|
<VBtn color="primary" @click="refInputEl?.click()">
|
||||||
|
<VIcon icon="mdi-cloud-upload-outline" />
|
||||||
|
<span v-if="display.mdAndUp.value" class="ms-2">上传新头像</span>
|
||||||
|
</VBtn>
|
||||||
|
|
||||||
<!-- 👉 Upload Photo -->
|
<input
|
||||||
<form class="d-flex flex-column justify-center gap-5">
|
ref="refInputEl"
|
||||||
<div class="d-flex flex-wrap gap-2">
|
type="file"
|
||||||
<VBtn color="primary" @click="refInputEl?.click()">
|
name="file"
|
||||||
<VIcon icon="mdi-cloud-upload-outline" />
|
accept=".jpeg,.png,.jpg,GIF"
|
||||||
<span v-if="display.mdAndUp.value" class="ms-2">上传新头像</span>
|
hidden
|
||||||
</VBtn>
|
@input="changeAvatar"
|
||||||
|
/>
|
||||||
|
|
||||||
<input ref="refInputEl" type="file" name="file" accept=".jpeg,.png,.jpg,GIF" hidden @input="changeAvatar" />
|
<VBtn type="reset" color="info" variant="tonal" @click="restoreCurrentAvatar" v-if="props.oper !== 'add'">
|
||||||
|
<VIcon icon="mdi-refresh" />
|
||||||
|
<span v-if="display.mdAndUp.value" class="ms-2">重置</span>
|
||||||
|
</VBtn>
|
||||||
|
|
||||||
<VBtn type="reset" color="info" variant="tonal" @click="restoreCurrentAvatar" v-if="props.oper !== 'add'">
|
<VBtn
|
||||||
<VIcon icon="mdi-refresh" />
|
type="reset"
|
||||||
<span v-if="display.mdAndUp.value" class="ms-2">重置</span>
|
:color="props.oper === 'add' ? 'info' : 'error'"
|
||||||
</VBtn>
|
variant="tonal"
|
||||||
|
@click="resetDefaultAvatar"
|
||||||
<VBtn
|
>
|
||||||
type="reset"
|
<VIcon icon="mdi-image-sync-outline" />
|
||||||
:color="props.oper === 'add' ? 'info' : 'error'"
|
<span v-if="display.mdAndUp.value" class="ms-2">默认</span>
|
||||||
variant="tonal"
|
</VBtn>
|
||||||
@click="resetDefaultAvatar"
|
</div>
|
||||||
>
|
<p class="text-body-1 mb-0">允许 JPG、PNG、GIF、WEBP 格式, 最大尺寸 800KB。</p>
|
||||||
<VIcon icon="mdi-image-sync-outline" />
|
|
||||||
<span v-if="display.mdAndUp.value" class="ms-2">默认</span>
|
|
||||||
</VBtn>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<p class="text-body-1 mb-0">允许 JPG、PNG、GIF、WEBP 格式, 最大尺寸 800KB。</p>
|
</VCardItem>
|
||||||
</form>
|
|
||||||
</VCardText>
|
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<VForm @submit.prevent="() => {}" class="mt-3">
|
<VForm @submit.prevent="() => {}">
|
||||||
<VDivider class="my-10">
|
<VDivider class="my-10">
|
||||||
<span>用户基础设置</span>
|
<span>用户基础设置</span>
|
||||||
</VDivider>
|
</VDivider>
|
||||||
@@ -355,7 +362,7 @@ onMounted(() => {
|
|||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
<VDivider class="my-10">
|
<VDivider class="my-10">
|
||||||
<span>消息账号绑定</span>
|
<span>账号绑定</span>
|
||||||
</VDivider>
|
</VDivider>
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
@@ -388,6 +395,9 @@ onMounted(() => {
|
|||||||
label="SynologyChat用户"
|
label="SynologyChat用户"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VTextField v-model="userForm.settings.douban_userid" density="comfortable" clearable label="豆瓣用户" />
|
||||||
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
</VForm>
|
</VForm>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
|
|||||||
177
src/components/dialog/UserAuthDialog.vue
Normal file
177
src/components/dialog/UserAuthDialog.vue
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { isNullOrEmptyObject } from '@/@core/utils'
|
||||||
|
import api from '@/api'
|
||||||
|
import { useToast } from 'vue-toast-notification'
|
||||||
|
|
||||||
|
// 定义事件
|
||||||
|
const emit = defineEmits(['done', 'close'])
|
||||||
|
|
||||||
|
// 提示框
|
||||||
|
const $toast = useToast()
|
||||||
|
|
||||||
|
// 是否加载中
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
|
// 用户认证表单
|
||||||
|
const authForm = ref<any>({
|
||||||
|
site: null,
|
||||||
|
params: {},
|
||||||
|
})
|
||||||
|
|
||||||
|
// 所有认证站点
|
||||||
|
const authSites = ref<{
|
||||||
|
[key: string]: {
|
||||||
|
name: string
|
||||||
|
icon: string
|
||||||
|
params: { [key: string]: any }
|
||||||
|
}
|
||||||
|
}>({})
|
||||||
|
|
||||||
|
// 生成站点拉选项
|
||||||
|
const dropdownItems = computed(() => {
|
||||||
|
return Object.keys(authSites.value).map(key => {
|
||||||
|
return {
|
||||||
|
key,
|
||||||
|
name: authSites.value[key].name,
|
||||||
|
prependAvatar: authSites.value[key].icon,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// 读取authSites.params,生成表单配置列表
|
||||||
|
const formFields = computed(() => {
|
||||||
|
const site = authSites.value[authForm.value.site]
|
||||||
|
return Object.keys(site?.params || {})
|
||||||
|
.filter(item => {
|
||||||
|
return site.params[item].name && site.params[item].type
|
||||||
|
})
|
||||||
|
.map(key => {
|
||||||
|
return {
|
||||||
|
key,
|
||||||
|
site: authForm.value.site,
|
||||||
|
name: site.params[key].name,
|
||||||
|
type: site.params[key].type,
|
||||||
|
placeholder: site.params[key].placeholder,
|
||||||
|
tooltip: site.params[key].tooltip,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// 查询之前使用的认证参数
|
||||||
|
async function loadLastAuthParams() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.get(`system/setting/UserSiteAuthParams`)
|
||||||
|
if (result.success) {
|
||||||
|
const ret = result.data?.value
|
||||||
|
if (ret && !isNullOrEmptyObject(ret.params)) {
|
||||||
|
authForm.value = ret
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载认证站点配置
|
||||||
|
async function loadAuthSites() {
|
||||||
|
try {
|
||||||
|
authSites.value = (await api.get(`site/auth`)) || {}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 完成
|
||||||
|
async function handleDone() {
|
||||||
|
await checkUser()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 认证处理
|
||||||
|
async function checkUser() {
|
||||||
|
if (!authForm.value.site) {
|
||||||
|
$toast.error('请选择认证站点!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!authSites.value[authForm.value.site]) {
|
||||||
|
$toast.error('站点配置不存在!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (formFields.value.length > 0) {
|
||||||
|
for (const field of formFields.value) {
|
||||||
|
if (!authForm.value.params[field.site.toUpperCase() + '_' + field.key.toUpperCase()]) {
|
||||||
|
$toast.error(`请输入${field.name}!`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.post(`site/auth`, authForm.value)
|
||||||
|
if (result.success) {
|
||||||
|
$toast.success('用户认证成功,请重新登录!')
|
||||||
|
// 1秒后刷新页面
|
||||||
|
setTimeout(() => {
|
||||||
|
emit('done')
|
||||||
|
}, 1000)
|
||||||
|
} else {
|
||||||
|
$toast.error(`认证失败:${result.message}`)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await loadAuthSites()
|
||||||
|
loadLastAuthParams()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VDialog width="40rem" max-height="85vh">
|
||||||
|
<VCard title="用户认证" class="rounded-t">
|
||||||
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
|
<VCardText>
|
||||||
|
<VRow>
|
||||||
|
<VCol cols="12">
|
||||||
|
<VSelect
|
||||||
|
v-model="authForm.site"
|
||||||
|
:items="dropdownItems"
|
||||||
|
item-value="key"
|
||||||
|
item-title="name"
|
||||||
|
label="选择认证站点"
|
||||||
|
item-props
|
||||||
|
>
|
||||||
|
</VSelect>
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
<VRow>
|
||||||
|
<VCol v-for="param in formFields" :key="param.key">
|
||||||
|
<VTextField
|
||||||
|
v-model="authForm.params[param.site.toUpperCase() + '_' + param.key.toUpperCase()]"
|
||||||
|
:type="param.type"
|
||||||
|
:label="param.name"
|
||||||
|
:placeholder="param.placeholder"
|
||||||
|
:hint="param.tooltip"
|
||||||
|
clearable
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
</VCardText>
|
||||||
|
<VCardText class="text-center">
|
||||||
|
<VBtn
|
||||||
|
variant="elevated"
|
||||||
|
@click="handleDone"
|
||||||
|
prepend-icon="mdi-check"
|
||||||
|
class="px-5"
|
||||||
|
size="large"
|
||||||
|
:disabled="loading"
|
||||||
|
>
|
||||||
|
开始认证
|
||||||
|
</VBtn>
|
||||||
|
</VCardText>
|
||||||
|
</VCard>
|
||||||
|
</VDialog>
|
||||||
|
</template>
|
||||||
46
src/components/field/CronField.vue
Normal file
46
src/components/field/CronField.vue
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import CronInput from '@/components/input/CronInput.vue'
|
||||||
|
|
||||||
|
const attrs = useAttrs()
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: {
|
||||||
|
type: String,
|
||||||
|
default: '* * * * *',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
|
const innerValue = ref(props.modelValue)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
value => {
|
||||||
|
innerValue.value = value
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
const propsWithoutModelValue = computed(() => {
|
||||||
|
const { modelValue, ...rest } = props
|
||||||
|
return { ...rest, ...attrs }
|
||||||
|
})
|
||||||
|
|
||||||
|
function updateModelValue(value: string) {
|
||||||
|
innerValue.value = value
|
||||||
|
emit('update:modelValue', value)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<CronInput v-model="innerValue" @update:modelValue="updateModelValue">
|
||||||
|
<template #activator="{ menuprops }">
|
||||||
|
<VTextField
|
||||||
|
:modelValue="innerValue"
|
||||||
|
@update:modelValue="updateModelValue"
|
||||||
|
v-bind="{ ...menuprops, ...propsWithoutModelValue }"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</CronInput>
|
||||||
|
</template>
|
||||||
49
src/components/field/PathField.vue
Normal file
49
src/components/field/PathField.vue
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import PathInput from '@/components/input/PathInput.vue'
|
||||||
|
|
||||||
|
const attrs = useAttrs()
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: {
|
||||||
|
type: String,
|
||||||
|
default: '* * * * *',
|
||||||
|
},
|
||||||
|
storage: {
|
||||||
|
type: String,
|
||||||
|
default: 'local',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
|
const innerValue = ref(props.modelValue)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
value => {
|
||||||
|
innerValue.value = value
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
const propsWithoutModelValue = computed(() => {
|
||||||
|
const { modelValue, ...rest } = props
|
||||||
|
return { ...rest, ...attrs }
|
||||||
|
})
|
||||||
|
|
||||||
|
function updateModelValue(value: string) {
|
||||||
|
innerValue.value = value
|
||||||
|
emit('update:modelValue', value)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<PathInput v-model="innerValue" :storage="props.storage" @update:modelValue="updateModelValue">
|
||||||
|
<template #activator="{ menuprops }">
|
||||||
|
<VTextField
|
||||||
|
:modelValue="innerValue"
|
||||||
|
@update:modelValue="updateModelValue"
|
||||||
|
v-bind="{ ...menuprops, ...propsWithoutModelValue }"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</PathInput>
|
||||||
|
</template>
|
||||||
@@ -7,9 +7,9 @@ import ReorganizeDialog from '../dialog/ReorganizeDialog.vue'
|
|||||||
import { formatBytes } from '@core/utils/formatters'
|
import { formatBytes } from '@core/utils/formatters'
|
||||||
import type { Context, EndPoints, FileItem } from '@/api/types'
|
import type { Context, EndPoints, FileItem } from '@/api/types'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import MediaInfoCard from '@/components/cards/MediaInfoCard.vue'
|
|
||||||
import ProgressDialog from '../dialog/ProgressDialog.vue'
|
import ProgressDialog from '../dialog/ProgressDialog.vue'
|
||||||
import { useDisplay } from 'vuetify'
|
import { useDisplay } from 'vuetify'
|
||||||
|
import MediaInfoDialog from '../dialog/MediaInfoDialog.vue'
|
||||||
|
|
||||||
// 显示器宽度
|
// 显示器宽度
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
@@ -106,9 +106,6 @@ const files = computed(() => items.value.filter(item => item.type === 'file' &&
|
|||||||
// 是否文件
|
// 是否文件
|
||||||
const isFile = computed(() => inProps.item.type == 'file')
|
const isFile = computed(() => inProps.item.type == 'file')
|
||||||
|
|
||||||
// 是否目录
|
|
||||||
const isDir = computed(() => !isFile.value)
|
|
||||||
|
|
||||||
// 需要整理的文件项
|
// 需要整理的文件项
|
||||||
const transferItems = ref<FileItem[]>([])
|
const transferItems = ref<FileItem[]>([])
|
||||||
|
|
||||||
@@ -622,7 +619,8 @@ onMounted(() => {
|
|||||||
v-if="inProps.icons && item.extension"
|
v-if="inProps.icons && item.extension"
|
||||||
:icon="inProps.icons[item.extension.toLowerCase()] || inProps.icons?.other"
|
:icon="inProps.icons[item.extension.toLowerCase()] || inProps.icons?.other"
|
||||||
/>
|
/>
|
||||||
<VIcon v-else icon="mdi-folder-outline" />
|
<VIcon v-else-if="item.type == 'dir'" icon="mdi-folder-outline" />
|
||||||
|
<VIcon v-else icon="mdi-file-outline" />
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<VListItemTitle v-text="item.name" />
|
<VListItemTitle v-text="item.name" />
|
||||||
@@ -737,14 +735,12 @@ onMounted(() => {
|
|||||||
<!-- 进度框 -->
|
<!-- 进度框 -->
|
||||||
<ProgressDialog v-if="progressDialog" v-model="progressDialog" :text="progressText" :value="progressValue" />
|
<ProgressDialog v-if="progressDialog" v-model="progressDialog" :text="progressText" :value="progressValue" />
|
||||||
<!-- 识别结果对话框 -->
|
<!-- 识别结果对话框 -->
|
||||||
<VDialog v-if="nameTestDialog" v-model="nameTestDialog" width="50rem">
|
<MediaInfoDialog
|
||||||
<VCard>
|
v-if="nameTestDialog"
|
||||||
<DialogCloseBtn @click="nameTestDialog = false" />
|
v-model="nameTestDialog"
|
||||||
<VCardItem>
|
:context="nameTestResult"
|
||||||
<MediaInfoCard :context="nameTestResult" />
|
@close="nameTestDialog = false"
|
||||||
</VCardItem>
|
/>
|
||||||
</VCard>
|
|
||||||
</VDialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const pathSegments = computed(() => {
|
|||||||
|
|
||||||
// 当前存储
|
// 当前存储
|
||||||
const storageObject = computed(() => {
|
const storageObject = computed(() => {
|
||||||
return inProps.storages?.find(item => item.code === inProps.storage)
|
return inProps.storages?.find(item => item.value === inProps.storage)
|
||||||
})
|
})
|
||||||
|
|
||||||
// 切换存储
|
// 切换存储
|
||||||
@@ -127,19 +127,19 @@ const sortIcon = computed(() => {
|
|||||||
<VListItem
|
<VListItem
|
||||||
v-for="(item, index) in storages"
|
v-for="(item, index) in storages"
|
||||||
:key="index"
|
:key="index"
|
||||||
:disabled="item.code === storageObject?.code"
|
:disabled="item.value === storageObject?.value"
|
||||||
@click="changeStorage(item.code)"
|
@click="changeStorage(item.value)"
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<Icon :icon="item.icon" />
|
<Icon :icon="item.icon" />
|
||||||
</template>
|
</template>
|
||||||
<VListItemTitle>{{ item.name }}</VListItemTitle>
|
<VListItemTitle>{{ item.title }}</VListItemTitle>
|
||||||
</VListItem>
|
</VListItem>
|
||||||
</VList>
|
</VList>
|
||||||
</VMenu>
|
</VMenu>
|
||||||
<VBtn variant="text" :input-value="item.path === '/'" class="px-1" @click="changePath(inProps.itemstack[0])">
|
<VBtn variant="text" :input-value="item.path === '/'" class="px-1" @click="changePath(inProps.itemstack[0])">
|
||||||
<VIcon :icon="storageObject?.icon" class="mr-2" />
|
<VIcon :icon="storageObject?.icon" class="mr-2" />
|
||||||
{{ storageObject?.name }}
|
{{ storageObject?.title }}
|
||||||
</VBtn>
|
</VBtn>
|
||||||
<template v-for="(segment, index) in pathSegments" :key="index">
|
<template v-for="(segment, index) in pathSegments" :key="index">
|
||||||
<VBtn
|
<VBtn
|
||||||
|
|||||||
38
src/components/input/CronInput.vue
Normal file
38
src/components/input/CronInput.vue
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: {
|
||||||
|
type: String,
|
||||||
|
default: '* * * * *',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
|
const currentCron = ref(props.modelValue)
|
||||||
|
|
||||||
|
watch(currentCron, newVal => {
|
||||||
|
emit('update:modelValue', newVal)
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
value => {
|
||||||
|
currentCron.value = value
|
||||||
|
},
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<VMenu :close-on-content-click="false" content-class="cursor-default" persistent>
|
||||||
|
<template v-slot:activator="{ props }">
|
||||||
|
<slot name="activator" :menuprops="props" />
|
||||||
|
</template>
|
||||||
|
<VList>
|
||||||
|
<VListItem>
|
||||||
|
<VCronVuetify v-model="currentCron" locale="zh-CN" :chip-props="{ color: 'success' }" class="mt-1" />
|
||||||
|
</VListItem>
|
||||||
|
</VList>
|
||||||
|
</VMenu>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import api from '@/api'
|
|
||||||
import { FileItem } from '@/api/types'
|
|
||||||
import { VTreeview } from 'vuetify/labs/VTreeview'
|
|
||||||
|
|
||||||
// 输入变量为默认路径
|
|
||||||
const props = defineProps({
|
|
||||||
root: {
|
|
||||||
type: String,
|
|
||||||
default: '/',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
storage: {
|
|
||||||
type: String,
|
|
||||||
default: 'local',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
// update:modelValue 事件
|
|
||||||
const emit = defineEmits(['update:modelValue'])
|
|
||||||
|
|
||||||
// 激活的目录
|
|
||||||
const activedDirs = ref<string[]>([])
|
|
||||||
|
|
||||||
// 打开的目录
|
|
||||||
const openedDirs = ref<string[]>([])
|
|
||||||
|
|
||||||
// 目录列表
|
|
||||||
const treeItems = ref<FileItem[]>([
|
|
||||||
{
|
|
||||||
name: '/',
|
|
||||||
path: props.root,
|
|
||||||
children: [],
|
|
||||||
type: 'dir',
|
|
||||||
basename: props.root,
|
|
||||||
storage: props.storage,
|
|
||||||
},
|
|
||||||
])
|
|
||||||
|
|
||||||
// 拉取子目录
|
|
||||||
async function fetchDirs(item: any) {
|
|
||||||
return api
|
|
||||||
.post('/storage/list', item)
|
|
||||||
.then((data: any) => {
|
|
||||||
// 只添加目录到子目录
|
|
||||||
data = data.filter((i: any) => i.type === 'dir')
|
|
||||||
item.children.push(...data)
|
|
||||||
})
|
|
||||||
.catch(err => console.warn(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取选择的目录路径
|
|
||||||
const selectedPath = computed(() => {
|
|
||||||
if (activedDirs.value.length > 0) {
|
|
||||||
return activedDirs.value[0]
|
|
||||||
}
|
|
||||||
return ''
|
|
||||||
})
|
|
||||||
|
|
||||||
// 监听目录变化
|
|
||||||
watch(activedDirs, newVal => {
|
|
||||||
if (!newVal.length) return
|
|
||||||
emit('update:modelValue', selectedPath)
|
|
||||||
})
|
|
||||||
|
|
||||||
// 监听存储变化
|
|
||||||
watch(
|
|
||||||
() => props.storage,
|
|
||||||
async newVal => {
|
|
||||||
treeItems.value = [
|
|
||||||
{
|
|
||||||
name: '/',
|
|
||||||
path: props.root,
|
|
||||||
children: [],
|
|
||||||
type: 'dir',
|
|
||||||
basename: props.root,
|
|
||||||
storage: newVal,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
openedDirs.value = []
|
|
||||||
activedDirs.value = []
|
|
||||||
},
|
|
||||||
)
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<VMenu :close-on-content-click="false" content-class="cursor-default">
|
|
||||||
<template v-slot:activator="{ props }">
|
|
||||||
<slot name="activator" :menuprops="props" />
|
|
||||||
</template>
|
|
||||||
<VTreeview
|
|
||||||
v-model:activated="activedDirs"
|
|
||||||
v-model:opened="openedDirs"
|
|
||||||
:items="treeItems"
|
|
||||||
:load-children="fetchDirs"
|
|
||||||
item-key="path"
|
|
||||||
item-title="name"
|
|
||||||
item-value="path"
|
|
||||||
item-type="unknown"
|
|
||||||
activatable
|
|
||||||
return-object
|
|
||||||
max-height="20rem"
|
|
||||||
expand-icon="mdi-folder"
|
|
||||||
collapse-icon="mdi-folder-open"
|
|
||||||
>
|
|
||||||
</VTreeview>
|
|
||||||
</VMenu>
|
|
||||||
</template>
|
|
||||||
174
src/components/input/PathInput.vue
Normal file
174
src/components/input/PathInput.vue
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import api from '@/api'
|
||||||
|
import { FileItem } from '@/api/types'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: {
|
||||||
|
type: String,
|
||||||
|
default: '/',
|
||||||
|
},
|
||||||
|
root: {
|
||||||
|
type: String,
|
||||||
|
default: '/',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
storage: {
|
||||||
|
type: String,
|
||||||
|
default: 'local',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
|
const menuVisible = ref(false)
|
||||||
|
|
||||||
|
const treeItems = ref<FileItem[]>([
|
||||||
|
{
|
||||||
|
name: '/',
|
||||||
|
path: props.root,
|
||||||
|
children: [],
|
||||||
|
type: 'dir',
|
||||||
|
basename: props.root,
|
||||||
|
storage: props.storage,
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
|
const activedDirs = ref<FileItem[]>([])
|
||||||
|
|
||||||
|
const openedDirs = ref<FileItem[]>([])
|
||||||
|
|
||||||
|
// 调用API查询子目录
|
||||||
|
async function fetchDirs(item: any) {
|
||||||
|
return api
|
||||||
|
.post('/storage/list', item)
|
||||||
|
.then((data: any) => {
|
||||||
|
data = data.filter((i: any) => i.type === 'dir')
|
||||||
|
item.children?.push(...data)
|
||||||
|
})
|
||||||
|
.catch(err => console.warn(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 递归查询路径
|
||||||
|
function findPath(item: FileItem, path: string): FileItem | null {
|
||||||
|
if (item.path === path) {
|
||||||
|
return item
|
||||||
|
}
|
||||||
|
if (item.children) {
|
||||||
|
for (const child of item.children) {
|
||||||
|
const res: FileItem | null = findPath(child, path)
|
||||||
|
if (res) {
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据路径展开所有子目录
|
||||||
|
async function expandDirs(path: string) {
|
||||||
|
// 分割路径
|
||||||
|
const paths = path.split('/').filter(i => i)
|
||||||
|
// 展开根目录
|
||||||
|
const root_item = treeItems.value[0]
|
||||||
|
await fetchDirs(root_item)
|
||||||
|
openedDirs.value.push(root_item)
|
||||||
|
// 逐级展开
|
||||||
|
let currentPath = '/'
|
||||||
|
for (const p of paths) {
|
||||||
|
currentPath += `${p}/`
|
||||||
|
// 查询当前目录
|
||||||
|
const item = findPath(root_item, currentPath)
|
||||||
|
if (!item) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
// 加载子目录
|
||||||
|
if (item.children?.length === 0) {
|
||||||
|
await fetchDirs(item)
|
||||||
|
}
|
||||||
|
// 打开当前目录
|
||||||
|
if (!openedDirs.value.includes(item) && path != currentPath) {
|
||||||
|
openedDirs.value.push(item)
|
||||||
|
}
|
||||||
|
// 选中当前目录
|
||||||
|
if (path == currentPath) {
|
||||||
|
activedDirs.value = [item]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前选中项
|
||||||
|
const selectedPath = computed(() => {
|
||||||
|
if (activedDirs.value.length > 0) {
|
||||||
|
return activedDirs.value[0].path
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(activedDirs, newVal => {
|
||||||
|
if (!newVal.length) return
|
||||||
|
emit('update:modelValue', selectedPath.value)
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => menuVisible.value,
|
||||||
|
async visible => {
|
||||||
|
if (visible) {
|
||||||
|
treeItems.value = [
|
||||||
|
{
|
||||||
|
name: '/',
|
||||||
|
path: props.root,
|
||||||
|
children: [],
|
||||||
|
type: 'dir',
|
||||||
|
basename: props.root,
|
||||||
|
storage: props.storage,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
openedDirs.value = []
|
||||||
|
activedDirs.value = []
|
||||||
|
await expandDirs(props.modelValue)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.storage,
|
||||||
|
async newVal => {
|
||||||
|
treeItems.value = [
|
||||||
|
{
|
||||||
|
name: '/',
|
||||||
|
path: props.root,
|
||||||
|
children: [],
|
||||||
|
type: 'dir',
|
||||||
|
basename: props.root,
|
||||||
|
storage: newVal,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
activedDirs.value = []
|
||||||
|
openedDirs.value = []
|
||||||
|
},
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<VMenu v-model="menuVisible" :close-on-content-click="false" content-class="cursor-default">
|
||||||
|
<template v-slot:activator="{ props }">
|
||||||
|
<slot name="activator" :menuprops="props" />
|
||||||
|
</template>
|
||||||
|
<VTreeview
|
||||||
|
v-model:activated="activedDirs"
|
||||||
|
v-model:opened="openedDirs"
|
||||||
|
:items="treeItems"
|
||||||
|
:load-children="fetchDirs"
|
||||||
|
item-key="path"
|
||||||
|
item-title="name"
|
||||||
|
item-value="path"
|
||||||
|
activatable
|
||||||
|
return-object
|
||||||
|
max-height="20rem"
|
||||||
|
expand-icon="mdi-folder"
|
||||||
|
collapse-icon="mdi-folder-open"
|
||||||
|
/>
|
||||||
|
</VMenu>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -6,10 +6,21 @@ import { type PropType } from 'vue'
|
|||||||
const elementProps = defineProps({
|
const elementProps = defineProps({
|
||||||
config: Object as PropType<RenderProps>,
|
config: Object as PropType<RenderProps>,
|
||||||
})
|
})
|
||||||
|
// key
|
||||||
|
const componentKey = ref(0)
|
||||||
|
|
||||||
|
onActivated(() => {
|
||||||
|
componentKey.value++
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Component :is="elementProps.config?.component" v-if="!elementProps.config?.html" v-bind="elementProps.config?.props">
|
<Component
|
||||||
|
:key="componentKey"
|
||||||
|
:is="elementProps.config?.component"
|
||||||
|
v-if="!elementProps.config?.html"
|
||||||
|
v-bind="elementProps.config?.props"
|
||||||
|
>
|
||||||
{{ elementProps.config?.text }}
|
{{ elementProps.config?.text }}
|
||||||
<template v-for="(content, name) in elementProps.config?.slots || []" :key="name" v-slot:[name]="{ _props }">
|
<template v-for="(content, name) in elementProps.config?.slots || []" :key="name" v-slot:[name]="{ _props }">
|
||||||
<slot :name="name" v-bind="_props">
|
<slot :name="name" v-bind="_props">
|
||||||
@@ -23,6 +34,7 @@ const elementProps = defineProps({
|
|||||||
/>
|
/>
|
||||||
</Component>
|
</Component>
|
||||||
<Component
|
<Component
|
||||||
|
:key="componentKey"
|
||||||
:is="elementProps.config?.component"
|
:is="elementProps.config?.component"
|
||||||
v-if="elementProps.config?.html"
|
v-if="elementProps.config?.html"
|
||||||
v-bind="elementProps.config?.props"
|
v-bind="elementProps.config?.props"
|
||||||
|
|||||||
@@ -1,57 +1,116 @@
|
|||||||
<script lang="ts" setup>
|
<script setup lang="ts">
|
||||||
import { RenderProps } from '@/api/types'
|
import { RenderProps } from '@/api/types'
|
||||||
import { type PropType, ref } from 'vue'
|
|
||||||
|
|
||||||
// 输入参数
|
// 定义 props
|
||||||
const elementProps = defineProps({
|
defineProps<{
|
||||||
config: Object as PropType<RenderProps>,
|
config: RenderProps // JSON 配置
|
||||||
form: Object as PropType<any>,
|
model: Record<string, any> // 数据模型
|
||||||
})
|
}>()
|
||||||
|
|
||||||
// 配置元素
|
/**
|
||||||
const formItem = ref<RenderProps>(
|
* 解析属性,支持 v-model 和动态绑定
|
||||||
elementProps.config ?? {
|
* @param rawProps 原始属性
|
||||||
component: 'div',
|
* @param model 数据模型
|
||||||
text: '',
|
* @returns 解析后的属性
|
||||||
html: '',
|
*/
|
||||||
props: {},
|
const parseProps = (rawProps: Record<string, any>, model: Record<string, any>) => {
|
||||||
content: [],
|
const parsedProps: Record<string, any> = {}
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
// 配置数据
|
for (const [key, value] of Object.entries(rawProps)) {
|
||||||
const formData = ref<any>(elementProps.form || {})
|
if (key === 'modelvalue') {
|
||||||
|
// 将 modelvalue 转换为 v-model:value 的形式
|
||||||
|
parsedProps['value'] = model[value]
|
||||||
|
parsedProps['onUpdate:value'] = (newValue: any) => {
|
||||||
|
model[value] = newValue
|
||||||
|
}
|
||||||
|
} else if (key === 'model') {
|
||||||
|
// 处理 v-model
|
||||||
|
parsedProps['modelValue'] = model[value]
|
||||||
|
parsedProps['onUpdate:modelValue'] = (newValue: any) => {
|
||||||
|
model[value] = newValue
|
||||||
|
}
|
||||||
|
} else if (key.startsWith('model:')) {
|
||||||
|
// 处理 v-model:<prop>
|
||||||
|
const propName = key.replace('model:', '')
|
||||||
|
parsedProps[propName] = model[value]
|
||||||
|
parsedProps[`onUpdate:${propName}`] = (newValue: any) => {
|
||||||
|
model[value] = newValue
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 普通属性直接赋值
|
||||||
|
parsedProps[key] = typeof value === 'string' && value in model ? model[value] : value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return parsedProps
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 渲染插槽内容
|
||||||
|
* @param slotContent 插槽配置
|
||||||
|
* @param model 数据模型
|
||||||
|
* @param slotScope 插槽作用域
|
||||||
|
*/
|
||||||
|
const renderSlotContent = (slotContent: any, model: any, slotScope: any) => {
|
||||||
|
if (Array.isArray(slotContent)) {
|
||||||
|
// 如果插槽内容是数组,递归渲染
|
||||||
|
return slotContent.map(childConfig => renderComponent(childConfig, model, slotScope))
|
||||||
|
}
|
||||||
|
// 如果插槽内容是单个配置,递归渲染
|
||||||
|
return renderComponent(slotContent, model, slotScope)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 渲染组件函数(递归支持嵌套)
|
||||||
|
* @param config JSON 配置
|
||||||
|
* @param model 数据模型
|
||||||
|
* @param slotScope 插槽作用域
|
||||||
|
* @returns 渲染的组件 VNode
|
||||||
|
*/
|
||||||
|
const renderComponent = (config: any, model: any, slotScope: any = {}) => {
|
||||||
|
const { component, props: componentProps = {}, content = [], slots = {}, html, text } = config
|
||||||
|
|
||||||
|
// 动态解析组件
|
||||||
|
const Component = resolveComponent(component)
|
||||||
|
|
||||||
|
// 解析属性
|
||||||
|
const parsedProps = parseProps(componentProps, model)
|
||||||
|
|
||||||
|
// 动态插槽解析
|
||||||
|
const slotNodes: Record<string, any> = {}
|
||||||
|
for (const [slotName, slotContent] of Object.entries(slots)) {
|
||||||
|
slotNodes[slotName] = (slotScopeData: any) =>
|
||||||
|
renderSlotContent(slotContent, model, { ...slotScope, ...slotScopeData })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 渲染组件内容
|
||||||
|
const renderContent = () => {
|
||||||
|
// 如果配置了 `html`,直接渲染为 HTML 内容
|
||||||
|
if (html) {
|
||||||
|
return h(Component, { innerHTML: typeof html === 'string' ? html : model[html] })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果配置了 `text`,直接渲染为文本内容
|
||||||
|
if (text) {
|
||||||
|
return typeof text === 'string' ? text : model[text]
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果配置了 `content`,递归渲染子组件
|
||||||
|
if (Array.isArray(content)) {
|
||||||
|
return content.map((childConfig: any) => renderComponent(childConfig, model, slotScope))
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 渲染组件
|
||||||
|
return h(Component, parsedProps, {
|
||||||
|
...slotNodes,
|
||||||
|
default: renderContent,
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Component
|
<Component :is="renderComponent(config, model)" />
|
||||||
:is="formItem.component"
|
|
||||||
v-if="!formItem.html && !!formItem.props?.modelvalue"
|
|
||||||
v-bind="formItem.props"
|
|
||||||
v-model:value="formData[formItem.props?.modelvalue]"
|
|
||||||
>
|
|
||||||
{{ formItem.text }}
|
|
||||||
<template v-for="(innerItem, innerIndex) in formItem.content || []" :key="innerIndex">
|
|
||||||
<FormRender
|
|
||||||
v-if="!!innerItem.props?.modelvalue"
|
|
||||||
v-model:value="formData[innerItem.props?.modelvalue]"
|
|
||||||
:config="innerItem"
|
|
||||||
:form="formData"
|
|
||||||
/>
|
|
||||||
<FormRender v-else v-model="formData[innerItem.props?.model]" :config="innerItem" :form="formData" />
|
|
||||||
</template>
|
|
||||||
</Component>
|
|
||||||
<Component :is="formItem.component" v-else-if="formItem.html" v-bind="formItem.props" v-html="formItem.html" />
|
|
||||||
<Component :is="formItem.component" v-else v-bind="formItem.props" v-model="formData[formItem.props?.model]">
|
|
||||||
{{ formItem.text }}
|
|
||||||
<template v-for="(innerItem, innerIndex) in formItem.content || []" :key="innerIndex">
|
|
||||||
<FormRender
|
|
||||||
v-if="!!innerItem.props?.modelvalue"
|
|
||||||
v-model:value="formData[innerItem.props?.modelvalue]"
|
|
||||||
:config="innerItem"
|
|
||||||
:form="formData"
|
|
||||||
/>
|
|
||||||
<FormRender v-else v-model="formData[innerItem.props?.model]" :config="innerItem" :form="formData" />
|
|
||||||
</template>
|
|
||||||
</Component>
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { RenderProps } from '@/api/types'
|
|||||||
const emit = defineEmits(['action'])
|
const emit = defineEmits(['action'])
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const elementProps = defineProps({
|
const props = defineProps({
|
||||||
config: Object as PropType<RenderProps>,
|
config: Object as PropType<RenderProps>,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -41,9 +41,9 @@ async function commonAction(api_path: string, method: string, params = {}) {
|
|||||||
// 组装事件
|
// 组装事件
|
||||||
let componentEvents = reactive<{ [key: string]: any }>({})
|
let componentEvents = reactive<{ [key: string]: any }>({})
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
if (!isNullOrEmptyObject(elementProps.config?.events)) {
|
if (!isNullOrEmptyObject(props.config?.events)) {
|
||||||
for (const key in elementProps.config?.events) {
|
for (const key in props.config?.events) {
|
||||||
const attr = elementProps.config?.events[key]
|
const attr = props.config?.events[key]
|
||||||
const func = async () => {
|
const func = async () => {
|
||||||
await commonAction(attr['api'], attr['method'], attr['params'])
|
await commonAction(attr['api'], attr['method'], attr['params'])
|
||||||
}
|
}
|
||||||
@@ -54,35 +54,20 @@ watchEffect(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Component
|
<Component :is="config?.component" v-if="!config?.html" v-bind="config?.props" v-on="componentEvents">
|
||||||
:is="elementProps.config?.component"
|
{{ config?.text }}
|
||||||
v-if="!elementProps.config?.html"
|
|
||||||
v-bind="elementProps.config?.props"
|
|
||||||
v-on="componentEvents"
|
|
||||||
>
|
|
||||||
{{ elementProps.config?.text }}
|
|
||||||
<template v-for="(content, name) in elementProps.config?.slots || []" :key="name" v-slot:[name]="{ _props }">
|
|
||||||
<slot :name="name" v-bind="_props">
|
|
||||||
<PageRender
|
|
||||||
v-for="(slotItem, slotIndex) in content || []"
|
|
||||||
:key="slotIndex"
|
|
||||||
:config="slotItem"
|
|
||||||
@action="emit('action')"
|
|
||||||
/>
|
|
||||||
</slot>
|
|
||||||
</template>
|
|
||||||
<PageRender
|
<PageRender
|
||||||
v-for="(innerItem, innerIndex) in elementProps.config?.content || []"
|
v-for="(innerItem, innerIndex) in config?.content || []"
|
||||||
:key="innerIndex"
|
:key="innerIndex"
|
||||||
:config="innerItem"
|
:config="innerItem"
|
||||||
@action="emit('action')"
|
@action="emit('action')"
|
||||||
/>
|
/>
|
||||||
</Component>
|
</Component>
|
||||||
<Component
|
<Component
|
||||||
:is="elementProps.config?.component"
|
:is="config?.component"
|
||||||
v-if="elementProps.config?.html"
|
v-if="config?.html"
|
||||||
v-bind="elementProps.config?.props"
|
v-bind="config?.props"
|
||||||
v-html="elementProps.config?.html"
|
v-html="config?.html"
|
||||||
v-on="componentEvents"
|
v-on="componentEvents"
|
||||||
/>
|
/>
|
||||||
<!-- 进度框 -->
|
<!-- 进度框 -->
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ onMounted(() => {
|
|||||||
<VIcon icon="mdi-menu" />
|
<VIcon icon="mdi-menu" />
|
||||||
</IconBtn>
|
</IconBtn>
|
||||||
<!-- 👉 Back Button -->
|
<!-- 👉 Back Button -->
|
||||||
<IconBtn v-if="appMode && display.lgAndUp" class="ms-n2" @click="goBack">
|
<IconBtn v-if="appMode && display.mdAndDown.value" class="ms-n2" @click="goBack">
|
||||||
<VIcon icon="mdi-arrow-left" size="32" />
|
<VIcon icon="mdi-arrow-left" size="32" />
|
||||||
</IconBtn>
|
</IconBtn>
|
||||||
<!-- 👉 Search Bar -->
|
<!-- 👉 Search Bar -->
|
||||||
|
|||||||
@@ -64,4 +64,3 @@ const activeState = computed(() => {
|
|||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import router from '@/router'
|
|||||||
import avatar1 from '@images/avatars/avatar-1.png'
|
import avatar1 from '@images/avatars/avatar-1.png'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import ProgressDialog from '@/components/dialog/ProgressDialog.vue'
|
import ProgressDialog from '@/components/dialog/ProgressDialog.vue'
|
||||||
|
import UserAuthDialog from '@/components/dialog/UserAuthDialog.vue'
|
||||||
|
|
||||||
// Vuex Store
|
// Vuex Store
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
@@ -19,6 +20,12 @@ const $toast = useToast()
|
|||||||
// 进度框
|
// 进度框
|
||||||
const progressDialog = ref(false)
|
const progressDialog = ref(false)
|
||||||
|
|
||||||
|
// 站点认证对话框
|
||||||
|
const siteAuthDialog = ref(false)
|
||||||
|
|
||||||
|
// 重启确认对话框
|
||||||
|
const restartDialog = ref(false)
|
||||||
|
|
||||||
// 执行注销操作
|
// 执行注销操作
|
||||||
function logout() {
|
function logout() {
|
||||||
// 清除登录状态信息
|
// 清除登录状态信息
|
||||||
@@ -29,13 +36,8 @@ function logout() {
|
|||||||
|
|
||||||
// 执行重启操作
|
// 执行重启操作
|
||||||
async function restart() {
|
async function restart() {
|
||||||
// 弹出提示
|
{
|
||||||
const confirmed = await createConfirm({
|
restartDialog.value = false
|
||||||
title: '确认',
|
|
||||||
content: '确认重启系统吗?',
|
|
||||||
})
|
|
||||||
|
|
||||||
if (confirmed) {
|
|
||||||
// 调用API重启
|
// 调用API重启
|
||||||
try {
|
try {
|
||||||
// 显示等待框
|
// 显示等待框
|
||||||
@@ -56,10 +58,27 @@ async function restart() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 显示重启确认对话框
|
||||||
|
async function showRestartDialog() {
|
||||||
|
restartDialog.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示站点认证对话框
|
||||||
|
function showSiteAuthDialog() {
|
||||||
|
siteAuthDialog.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户站点认证成功
|
||||||
|
function siteAuthDone() {
|
||||||
|
siteAuthDialog.value = false
|
||||||
|
logout()
|
||||||
|
}
|
||||||
|
|
||||||
// 从Vuex Store中获取信息
|
// 从Vuex Store中获取信息
|
||||||
const superUser = computed(() => store.state.auth.superUser)
|
const superUser = computed(() => store.state.auth.superUser)
|
||||||
const userName = computed(() => store.state.auth.userName)
|
const userName = computed(() => store.state.auth.userName)
|
||||||
const avatar = computed(() => store.state.auth.avatar || avatar1)
|
const avatar = computed(() => store.state.auth.avatar || avatar1)
|
||||||
|
const userLevel = computed(() => store.state.auth.level)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -94,6 +113,14 @@ const avatar = computed(() => store.state.auth.avatar || avatar1)
|
|||||||
<VListItemTitle>个人信息</VListItemTitle>
|
<VListItemTitle>个人信息</VListItemTitle>
|
||||||
</VListItem>
|
</VListItem>
|
||||||
|
|
||||||
|
<!-- 👉 Site Auth -->
|
||||||
|
<VListItem v-if="userLevel < 2 && superUser" link @click="showSiteAuthDialog">
|
||||||
|
<template #prepend>
|
||||||
|
<VIcon class="me-2" icon="mdi-lock-check-outline" size="22" />
|
||||||
|
</template>
|
||||||
|
<VListItemTitle>用户认证</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
|
||||||
<!-- 👉 FAQ -->
|
<!-- 👉 FAQ -->
|
||||||
<VListItem href="https://wiki.movie-pilot.org" target="_blank">
|
<VListItem href="https://wiki.movie-pilot.org" target="_blank">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
@@ -106,7 +133,7 @@ const avatar = computed(() => store.state.auth.avatar || avatar1)
|
|||||||
<VDivider v-if="superUser" class="my-2" />
|
<VDivider v-if="superUser" class="my-2" />
|
||||||
|
|
||||||
<!-- 👉 restart -->
|
<!-- 👉 restart -->
|
||||||
<VListItem v-if="superUser" @click="restart">
|
<VListItem v-if="superUser" @click="showRestartDialog">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<VIcon class="me-2" icon="mdi-restart" size="22" />
|
<VIcon class="me-2" icon="mdi-restart" size="22" />
|
||||||
</template>
|
</template>
|
||||||
@@ -126,4 +153,27 @@ const avatar = computed(() => store.state.auth.avatar || avatar1)
|
|||||||
</VAvatar>
|
</VAvatar>
|
||||||
<!-- 重启进度框 -->
|
<!-- 重启进度框 -->
|
||||||
<ProgressDialog v-if="progressDialog" v-model="progressDialog" text="正在重启 ..." />
|
<ProgressDialog v-if="progressDialog" v-model="progressDialog" text="正在重启 ..." />
|
||||||
|
<!-- 用户认证对话框 -->
|
||||||
|
<UserAuthDialog v-if="siteAuthDialog" v-model="siteAuthDialog" @done="siteAuthDone" @close="siteAuthDialog = false" />
|
||||||
|
<!-- 重启确认对话框 -->
|
||||||
|
<VDialog v-model="restartDialog" max-width="25rem">
|
||||||
|
<VCard>
|
||||||
|
<VCardItem>
|
||||||
|
<div class="flex items-center justify-center mt-3">
|
||||||
|
<VAvatar color="warning" variant="text" size="x-large">
|
||||||
|
<VIcon size="x-large" icon="mdi-alert" />
|
||||||
|
</VAvatar>
|
||||||
|
<div class="ms-3">
|
||||||
|
<p class="font-bold text-xl text-high-emphasis">确认重启系统吗?</p>
|
||||||
|
<p>重启后,您将被注销并需要重新登录。</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</VCardItem>
|
||||||
|
<VCardActions class="mx-auto">
|
||||||
|
<VBtn variant="elevated" color="error" @click="restart" prepend-icon="mdi-restart" class="px-5"> 确定 </VBtn>
|
||||||
|
<VBtn variant="tonal" color="secondary" class="px-5" @click="restartDialog = false">取消</VBtn>
|
||||||
|
</VCardActions>
|
||||||
|
<DialogCloseBtn @click="restartDialog = false" />
|
||||||
|
</VCard>
|
||||||
|
</VDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
46
src/main.ts
46
src/main.ts
@@ -1,21 +1,31 @@
|
|||||||
|
// 1. 配置与兼容性
|
||||||
|
import './ace-config'
|
||||||
import '@/@core/utils/compatibility'
|
import '@/@core/utils/compatibility'
|
||||||
import '@/@iconify/icons-bundle'
|
import '@/@iconify/icons-bundle'
|
||||||
import '@/plugins/webfontloader'
|
import '@/plugins/webfontloader'
|
||||||
import App from '@/App.vue'
|
|
||||||
|
// 2. 核心插件和 UI 框架
|
||||||
|
import { createApp } from 'vue'
|
||||||
import vuetify from '@/plugins/vuetify'
|
import vuetify from '@/plugins/vuetify'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { createApp } from 'vue'
|
|
||||||
import { removeEl } from './@core/utils/dom'
|
// 3. 全局组件
|
||||||
import { fetchGlobalSettings } from './api'
|
import App from '@/App.vue'
|
||||||
import { isPWA } from './@core/utils/navigator'
|
|
||||||
import './ace-config'
|
|
||||||
import { VAceEditor } from 'vue3-ace-editor'
|
import { VAceEditor } from 'vue3-ace-editor'
|
||||||
import { PerfectScrollbarPlugin } from 'vue3-perfect-scrollbar'
|
import { PerfectScrollbarPlugin } from 'vue3-perfect-scrollbar'
|
||||||
import { VTreeview } from 'vuetify/labs/VTreeview'
|
import { CronVuetify } from '@vue-js-cron/vuetify'
|
||||||
|
|
||||||
|
// 4. 工具函数和其他辅助模块
|
||||||
|
import { fetchGlobalSettings } from './api'
|
||||||
|
import { isPWA } from './@core/utils/navigator'
|
||||||
|
|
||||||
|
// 5. 其他插件和功能模块
|
||||||
import ToastPlugin from 'vue-toast-notification'
|
import ToastPlugin from 'vue-toast-notification'
|
||||||
import VuetifyUseDialog from 'vuetify-use-dialog'
|
import VuetifyUseDialog from 'vuetify-use-dialog'
|
||||||
import VueApexCharts from 'vue3-apexcharts'
|
import VueApexCharts from 'vue3-apexcharts'
|
||||||
|
|
||||||
|
// 6. 注册自定义组件
|
||||||
import DialogCloseBtn from '@/@core/components/DialogCloseBtn.vue'
|
import DialogCloseBtn from '@/@core/components/DialogCloseBtn.vue'
|
||||||
import MediaCard from './components/cards/MediaCard.vue'
|
import MediaCard from './components/cards/MediaCard.vue'
|
||||||
import PosterCard from './components/cards/PosterCard.vue'
|
import PosterCard from './components/cards/PosterCard.vue'
|
||||||
@@ -24,12 +34,18 @@ import PersonCard from './components/cards/PersonCard.vue'
|
|||||||
import MediaInfoCard from './components/cards/MediaInfoCard.vue'
|
import MediaInfoCard from './components/cards/MediaInfoCard.vue'
|
||||||
import TorrentCard from './components/cards/TorrentCard.vue'
|
import TorrentCard from './components/cards/TorrentCard.vue'
|
||||||
import MediaIdSelector from './components/misc/MediaIdSelector.vue'
|
import MediaIdSelector from './components/misc/MediaIdSelector.vue'
|
||||||
import PathField from './components/input/PathField.vue'
|
import CronField from './components/field/CronField.vue'
|
||||||
|
import PathField from './components/field/PathField.vue'
|
||||||
|
|
||||||
|
// 7. 样式文件
|
||||||
|
import '@core/scss/template/libs/vuetify/index.scss'
|
||||||
|
import 'vuetify/styles'
|
||||||
import '@core/scss/template/index.scss'
|
import '@core/scss/template/index.scss'
|
||||||
import '@layouts/styles/index.scss'
|
import '@layouts/styles/index.scss'
|
||||||
import '@styles/styles.scss'
|
|
||||||
import 'vue-toast-notification/dist/theme-bootstrap.css'
|
import 'vue-toast-notification/dist/theme-bootstrap.css'
|
||||||
import 'vue3-perfect-scrollbar/style.css'
|
import 'vue3-perfect-scrollbar/style.css'
|
||||||
|
import '@vue-js-cron/vuetify/dist/vuetify.css'
|
||||||
|
import '@styles/styles.scss'
|
||||||
|
|
||||||
// 创建Vue实例
|
// 创建Vue实例
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
@@ -49,9 +65,14 @@ async function initializeApp() {
|
|||||||
|
|
||||||
// 注册全局组件
|
// 注册全局组件
|
||||||
initializeApp().then(() => {
|
initializeApp().then(() => {
|
||||||
|
// 优先注册框架
|
||||||
|
app.use(vuetify)
|
||||||
|
|
||||||
|
// 注册全局组件
|
||||||
app
|
app
|
||||||
.component('VAceEditor', VAceEditor)
|
.component('VAceEditor', VAceEditor)
|
||||||
.component('VApexChart', VueApexCharts)
|
.component('VApexChart', VueApexCharts)
|
||||||
|
.component('VCronVuetify', CronVuetify)
|
||||||
.component('VDialogCloseBtn', DialogCloseBtn)
|
.component('VDialogCloseBtn', DialogCloseBtn)
|
||||||
.component('VMediaCard', MediaCard)
|
.component('VMediaCard', MediaCard)
|
||||||
.component('VPosterCard', PosterCard)
|
.component('VPosterCard', PosterCard)
|
||||||
@@ -60,14 +81,14 @@ initializeApp().then(() => {
|
|||||||
.component('VMediaInfoCard', MediaInfoCard)
|
.component('VMediaInfoCard', MediaInfoCard)
|
||||||
.component('VTorrentCard', TorrentCard)
|
.component('VTorrentCard', TorrentCard)
|
||||||
.component('VMediaIdSelector', MediaIdSelector)
|
.component('VMediaIdSelector', MediaIdSelector)
|
||||||
.component('VTreeview', VTreeview)
|
.component('VCronField', CronField)
|
||||||
.component('VPathField', PathField)
|
.component('VPathField', PathField)
|
||||||
|
|
||||||
// 注册插件
|
// 注册插件
|
||||||
app
|
app
|
||||||
.use(vuetify)
|
|
||||||
.use(router)
|
.use(router)
|
||||||
.use(store)
|
.use(store)
|
||||||
|
.use(PerfectScrollbarPlugin)
|
||||||
.use(ToastPlugin, {
|
.use(ToastPlugin, {
|
||||||
position: 'bottom-right',
|
position: 'bottom-right',
|
||||||
})
|
})
|
||||||
@@ -91,8 +112,5 @@ initializeApp().then(() => {
|
|||||||
cancellationText: '取消',
|
cancellationText: '取消',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.use(PerfectScrollbarPlugin)
|
|
||||||
.use(VueApexCharts)
|
|
||||||
.mount('#app')
|
.mount('#app')
|
||||||
.$nextTick(() => removeEl('#loading-bg'))
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,17 +11,12 @@ const activeTab = ref(route.query.tab)
|
|||||||
// 下载器
|
// 下载器
|
||||||
const downloaders = ref<DownloaderConf[]>([])
|
const downloaders = ref<DownloaderConf[]>([])
|
||||||
|
|
||||||
// 获取启用的下载器
|
|
||||||
const enabledDownloaders = computed(() => downloaders.value.filter(item => item.enabled))
|
|
||||||
|
|
||||||
// 调用API查询下载器设置
|
// 调用API查询下载器设置
|
||||||
async function loadDownloaderSetting() {
|
async function loadDownloaderSetting() {
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.get('system/setting/Downloaders')
|
downloaders.value = await api.get('download/clients')
|
||||||
if (result.data?.value && result.data.value.length > 0) {
|
if (downloaders.value && downloaders.value.length > 0 && !activeTab.value)
|
||||||
downloaders.value = result.data?.value ?? []
|
activeTab.value = downloaders.value[0].name
|
||||||
if (!activeTab.value) activeTab.value = downloaders.value[0].name
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
@@ -31,23 +26,25 @@ function jumpTab(tab: string) {
|
|||||||
router.push('/subscribe/movie?tab=' + tab)
|
router.push('/subscribe/movie?tab=' + tab)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
loadDownloaderSetting()
|
await loadDownloaderSetting()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="enabledDownloaders.length > 0">
|
<div v-if="downloaders.length > 0">
|
||||||
<VTabs v-model="activeTab">
|
<VTabs v-model="activeTab">
|
||||||
<VTab v-for="item in enabledDownloaders" :value="item.name" @to="jumpTab(item.name)">
|
<VTab v-for="item in downloaders" :value="item.name" @to="jumpTab(item.name)">
|
||||||
<span class="mx-5">{{ item.name }}</span>
|
<span class="mx-5">{{ item.name }}</span>
|
||||||
</VTab>
|
</VTab>
|
||||||
</VTabs>
|
</VTabs>
|
||||||
|
|
||||||
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
|
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
|
||||||
<VWindowItem v-for="item in enabledDownloaders" :value="item.name">
|
<VWindowItem v-for="item in downloaders" :value="item.name">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<DownloadingListView :name="item.name" />
|
<div>
|
||||||
|
<DownloadingListView :name="item.name" />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
</VWindow>
|
</VWindow>
|
||||||
|
|||||||
@@ -130,7 +130,6 @@ function login() {
|
|||||||
|
|
||||||
// 进行表单校验
|
// 进行表单校验
|
||||||
if (!form.value.username || !form.value.password || (isOTP.value && !form.value.otp_password)) {
|
if (!form.value.username || !form.value.password || (isOTP.value && !form.value.otp_password)) {
|
||||||
errorMessage.value = '请输入完整信息'
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 用户名密码
|
// 用户名密码
|
||||||
@@ -175,11 +174,11 @@ function login() {
|
|||||||
})
|
})
|
||||||
.catch((error: any) => {
|
.catch((error: any) => {
|
||||||
// 登录失败,显示错误提示
|
// 登录失败,显示错误提示
|
||||||
if (!error.response) errorMessage.value = '登录失败,请检查网络连接'
|
if (!error.response) errorMessage.value = '登录失败,请检查网络连接!'
|
||||||
else if (error.response.status === 401) errorMessage.value = '登录失败,请检查用户名、密码或双重验证是否正确'
|
else if (error.response.status === 401) errorMessage.value = '登录失败,请检查用户名、密码或双重验证是否正确!'
|
||||||
else if (error.response.status === 403) errorMessage.value = '登录失败,您没有权限访问'
|
else if (error.response.status === 403) errorMessage.value = '登录失败,您没有权限访问!'
|
||||||
else if (error.response.status === 500) errorMessage.value = '登录失败,服务器错误'
|
else if (error.response.status === 500) errorMessage.value = '登录失败,服务器错误!'
|
||||||
else errorMessage.value = `登录失败 ${error.response.status},请检查用户名、密码或双重验证码是否正确`
|
else errorMessage.value = `登录失败 ${error.response.status},请检查用户名、密码或双重验证码是否正确!`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,7 +240,7 @@ onUnmounted(() => {
|
|||||||
<VCardTitle class="font-weight-bold text-2xl text-uppercase"> MoviePilot </VCardTitle>
|
<VCardTitle class="font-weight-bold text-2xl text-uppercase"> MoviePilot </VCardTitle>
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<VForm ref="refForm" @submit.prevent="() => {}">
|
<VForm ref="refForm" autocomplete="on" @submit.prevent="() => {}">
|
||||||
<VRow>
|
<VRow>
|
||||||
<!-- username -->
|
<!-- username -->
|
||||||
<VCol cols="12">
|
<VCol cols="12">
|
||||||
@@ -250,6 +249,8 @@ onUnmounted(() => {
|
|||||||
v-model="form.username"
|
v-model="form.username"
|
||||||
label="用户名"
|
label="用户名"
|
||||||
type="text"
|
type="text"
|
||||||
|
name="username"
|
||||||
|
autocomplete="username"
|
||||||
:rules="[requiredValidator]"
|
:rules="[requiredValidator]"
|
||||||
@input="fetchOTP"
|
@input="fetchOTP"
|
||||||
/>
|
/>
|
||||||
@@ -260,6 +261,8 @@ onUnmounted(() => {
|
|||||||
v-model="form.password"
|
v-model="form.password"
|
||||||
label="密码"
|
label="密码"
|
||||||
:type="isPasswordVisible ? 'text' : 'password'"
|
:type="isPasswordVisible ? 'text' : 'password'"
|
||||||
|
name="current-password"
|
||||||
|
autocomplete="current-password"
|
||||||
:append-inner-icon="isPasswordVisible ? 'mdi-eye-off-outline' : 'mdi-eye-outline'"
|
:append-inner-icon="isPasswordVisible ? 'mdi-eye-off-outline' : 'mdi-eye-outline'"
|
||||||
:rules="[requiredValidator]"
|
:rules="[requiredValidator]"
|
||||||
@click:append-inner="isPasswordVisible = !isPasswordVisible"
|
@click:append-inner="isPasswordVisible = !isPasswordVisible"
|
||||||
@@ -275,9 +278,9 @@ onUnmounted(() => {
|
|||||||
<VCol cols="12">
|
<VCol cols="12">
|
||||||
<!-- login button -->
|
<!-- login button -->
|
||||||
<VBtn block type="submit" @click="login"> 登录 </VBtn>
|
<VBtn block type="submit" @click="login"> 登录 </VBtn>
|
||||||
<div v-if="errorMessage" class="text-error mt-2 text-shadow">
|
<VAlert v-if="errorMessage" type="error" variant="tonal" class="mt-3">
|
||||||
{{ errorMessage }}
|
{{ errorMessage }}
|
||||||
</div>
|
</VAlert>
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
</VForm>
|
</VForm>
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ const viewList = reactive<{ apipath: string; linkurl: string; title: string }[]>
|
|||||||
title: '豆瓣全球剧集榜',
|
title: '豆瓣全球剧集榜',
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -139,27 +139,29 @@ onUnmounted(() => {
|
|||||||
<TorrentCardListView v-else :items="dataList" />
|
<TorrentCardListView v-else :items="dataList" />
|
||||||
</div>
|
</div>
|
||||||
<!-- 视图切换 -->
|
<!-- 视图切换 -->
|
||||||
<VFab
|
<div v-if="isRefreshed">
|
||||||
v-if="viewType === 'list'"
|
<VFab
|
||||||
class="mb-12"
|
v-if="viewType === 'list'"
|
||||||
icon="mdi-view-grid"
|
class="mb-12"
|
||||||
location="bottom"
|
icon="mdi-view-grid"
|
||||||
size="x-large"
|
location="bottom"
|
||||||
absolute
|
size="x-large"
|
||||||
app
|
absolute
|
||||||
appear
|
app
|
||||||
@click="setViewType('card')"
|
appear
|
||||||
:class="{ 'mb-12': appMode }"
|
@click="setViewType('card')"
|
||||||
/>
|
:class="{ 'mb-12': appMode }"
|
||||||
<VFab
|
/>
|
||||||
v-else
|
<VFab
|
||||||
icon="mdi-view-list"
|
v-else
|
||||||
location="bottom"
|
icon="mdi-view-list"
|
||||||
size="x-large"
|
location="bottom"
|
||||||
fixed
|
size="x-large"
|
||||||
app
|
fixed
|
||||||
appear
|
app
|
||||||
@click="setViewType('list')"
|
appear
|
||||||
:class="{ 'mb-12': appMode }"
|
@click="setViewType('list')"
|
||||||
/>
|
:class="{ 'mb-12': appMode }"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -70,7 +70,9 @@ function jumpTab(tab: string) {
|
|||||||
<!-- 规则 -->
|
<!-- 规则 -->
|
||||||
<VWindowItem value="rule">
|
<VWindowItem value="rule">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<AccountSettingRule />
|
<div>
|
||||||
|
<AccountSettingRule />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import SubscribeListView from '@/views/subscribe/SubscribeListView.vue'
|
import SubscribeListView from '@/views/subscribe/SubscribeListView.vue'
|
||||||
import SubscribePopularView from '@/views/subscribe/SubscribePopularView.vue'
|
import SubscribePopularView from '@/views/subscribe/SubscribePopularView.vue'
|
||||||
import SubscribeShareView from '@/views/subscribe/SubscribeShareView.vue'
|
import SubscribeShareView from '@/views/subscribe/SubscribeShareView.vue'
|
||||||
import { SubscribeMovieTabs } from '@/router/menu'
|
import { SubscribeMovieTabs, SubscribeTvTabs } from '@/router/menu'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -19,28 +19,34 @@ function jumpTab(tab: string) {
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<VTabs v-model="activeTab">
|
<VTabs v-model="activeTab">
|
||||||
<VTab v-for="item in SubscribeMovieTabs" :value="item.tab" @to="jumpTab(item.tab)">
|
<VTab v-if="subType == '电影'" v-for="item in SubscribeMovieTabs" :value="item.tab" @to="jumpTab(item.tab)">
|
||||||
<span class="mx-5">{{ item.title }}</span>
|
<span class="mx-5">{{ item.title }}</span>
|
||||||
</VTab>
|
</VTab>
|
||||||
<VTab v-if="subType == '电视剧'" value="share" @to="jumpTab('share')">
|
<VTab v-if="subType == '电视剧'" v-for="item in SubscribeTvTabs" :value="item.tab" @to="jumpTab(item.tab)">
|
||||||
<span class="mx-5">订阅分享</span>
|
<span class="mx-5">{{ item.title }}</span>
|
||||||
</VTab>
|
</VTab>
|
||||||
</VTabs>
|
</VTabs>
|
||||||
|
|
||||||
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
|
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
|
||||||
<VWindowItem value="mysub">
|
<VWindowItem value="mysub">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<SubscribeListView :type="subType" :subid="subId" />
|
<div>
|
||||||
|
<SubscribeListView :type="subType" :subid="subId" />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
<VWindowItem value="popular">
|
<VWindowItem value="popular">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<SubscribePopularView :type="subType" />
|
<div>
|
||||||
|
<SubscribePopularView :type="subType" />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
<VWindowItem value="share">
|
<VWindowItem value="share">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<SubscribeShareView />
|
<div>
|
||||||
|
<SubscribeShareView />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
</VWindow>
|
</VWindow>
|
||||||
|
|||||||
@@ -6,10 +6,6 @@ import defaults from './defaults'
|
|||||||
import { icons } from './icons'
|
import { icons } from './icons'
|
||||||
import theme from './theme'
|
import theme from './theme'
|
||||||
|
|
||||||
// Styles
|
|
||||||
import '@core/scss/template/libs/vuetify/index.scss'
|
|
||||||
import 'vuetify/styles'
|
|
||||||
|
|
||||||
export default createVuetify({
|
export default createVuetify({
|
||||||
aliases: {
|
aliases: {
|
||||||
IconBtn: VBtn,
|
IconBtn: VBtn,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ configureNProgress()
|
|||||||
// Router
|
// Router
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHashHistory(import.meta.env.BASE_URL),
|
history: createWebHashHistory(import.meta.env.BASE_URL),
|
||||||
scrollBehavior(to, from, savedPosition) {
|
scrollBehavior(to: any, from: any, savedPosition: any) {
|
||||||
// 如果页面有缓存那么恢复其位置, 否则始终滚动到顶部
|
// 如果页面有缓存那么恢复其位置, 否则始终滚动到顶部
|
||||||
if (to.meta.keepAlive && savedPosition) return savedPosition
|
if (to.meta.keepAlive && savedPosition) return savedPosition
|
||||||
return { top: 0 }
|
return { top: 0 }
|
||||||
@@ -190,16 +190,35 @@ const router = createRouter({
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const abortControllers = new Set<AbortController>()
|
||||||
|
|
||||||
|
// 注册中止控制器
|
||||||
|
function registerAbortController(controller: AbortController) {
|
||||||
|
abortControllers.add(controller)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 中止所有组件的任务
|
||||||
|
function abortAllControllers() {
|
||||||
|
for (const controller of abortControllers) {
|
||||||
|
controller.abort()
|
||||||
|
}
|
||||||
|
abortControllers.clear()
|
||||||
|
}
|
||||||
|
|
||||||
// 路由导航守卫
|
// 路由导航守卫
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to: any, from: any, next: any) => {
|
||||||
// 总是记录非login路由
|
// 总是记录非login路由
|
||||||
if (to.fullPath != '/login') store.state.auth.originalPath = to.fullPath
|
if (to.fullPath != '/login') store.state.auth.originalPath = to.fullPath
|
||||||
const isAuthenticated = store.state.auth.token !== null
|
const isAuthenticated = store.state.auth.token !== null
|
||||||
if (to.meta.requiresAuth && !isAuthenticated) {
|
if (to.meta.requiresAuth && !isAuthenticated) {
|
||||||
next('/login')
|
next('/login')
|
||||||
} else {
|
} else {
|
||||||
|
abortAllControllers()
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 导出默认对象
|
||||||
export default router
|
export default router
|
||||||
|
// 另行导出其他功能
|
||||||
|
export { registerAbortController }
|
||||||
|
|||||||
@@ -50,15 +50,15 @@ export const SystemNavMenus = [
|
|||||||
admin: false,
|
admin: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '正在下载',
|
title: '下载管理',
|
||||||
icon: 'mdi-download-outline',
|
icon: 'mdi-download-outline',
|
||||||
to: '/downloading',
|
to: '/downloading',
|
||||||
header: '整理',
|
header: '整理',
|
||||||
admin: false,
|
admin: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '历史记录',
|
title: '媒体整理',
|
||||||
icon: 'mdi-history',
|
icon: 'mdi-folder-play-outline',
|
||||||
to: '/history',
|
to: '/history',
|
||||||
header: '整理',
|
header: '整理',
|
||||||
admin: true,
|
admin: true,
|
||||||
@@ -100,35 +100,6 @@ export const SystemNavMenus = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
// 常用菜单功能
|
|
||||||
export const UserfulMenus = [
|
|
||||||
{
|
|
||||||
title: '搜索设置',
|
|
||||||
icon: 'mdi-magnify',
|
|
||||||
to: 'setting?tab=search',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '订阅设置',
|
|
||||||
icon: 'mdi-rss',
|
|
||||||
to: 'setting?tab=subscribe',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '服务',
|
|
||||||
icon: 'mdi-list-box',
|
|
||||||
to: 'setting?tab=service',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '词表',
|
|
||||||
icon: 'mdi-file-word-box',
|
|
||||||
to: 'setting?tab=words',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '历史记录',
|
|
||||||
icon: 'mdi-history',
|
|
||||||
to: 'history',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
// 设定标签页
|
// 设定标签页
|
||||||
export const SettingTabs = [
|
export const SettingTabs = [
|
||||||
{
|
{
|
||||||
@@ -219,6 +190,11 @@ export const SubscribeTvTabs = [
|
|||||||
tab: 'popular',
|
tab: 'popular',
|
||||||
icon: 'mdi-television',
|
icon: 'mdi-television',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '订阅分享',
|
||||||
|
tab: 'share',
|
||||||
|
icon: 'mdi-television',
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
// 插件标签页
|
// 插件标签页
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { createHandlerBoundToURL, cleanupOutdatedCaches, precacheAndRoute } from 'workbox-precaching'
|
import { createHandlerBoundToURL, cleanupOutdatedCaches, precacheAndRoute } from 'workbox-precaching'
|
||||||
import { NavigationRoute, registerRoute } from 'workbox-routing'
|
import { NavigationRoute, registerRoute } from 'workbox-routing'
|
||||||
import { clientsClaim } from 'workbox-core'
|
|
||||||
|
|
||||||
declare let self: ServiceWorkerGlobalScope
|
declare let self: ServiceWorkerGlobalScope
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
|
html.v-overlay-scroll-blocked {
|
||||||
|
position: relative;
|
||||||
|
--v-body-scroll-y: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
#nprogress .bar {
|
#nprogress .bar {
|
||||||
background: rgb(var(--v-theme-primary)) !important;
|
background: rgb(var(--v-theme-primary)) !important;
|
||||||
inset-block-start: env(safe-area-inset-top) !important;
|
inset-block-start: env(safe-area-inset-top) !important;
|
||||||
@@ -24,15 +29,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.v-dialog > .v-overlay__content {
|
.v-dialog > .v-overlay__content {
|
||||||
inline-size: calc(100% - 1rem);
|
margin-block: env(safe-area-inset-top) env(safe-area-inset-bottom);
|
||||||
margin-block-start: calc(env(safe-area-inset-top) + 1rem);
|
|
||||||
max-block-size: calc(100% - env(safe-area-inset-top) - 1rem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.v-dialog--fullscreen > .v-overlay__content{
|
.v-dialog--fullscreen > .v-overlay__content > .v-card {
|
||||||
inline-size: 100%;
|
padding-block-end: calc(env(safe-area-inset-top) + env(safe-area-inset-bottom));
|
||||||
margin-block-start: env(safe-area-inset-top);
|
|
||||||
max-block-size: calc(100% - env(safe-area-inset-top));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* router view transition fade-slide */
|
/* router view transition fade-slide */
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import VueApexCharts from 'vue3-apexcharts'
|
|
||||||
import { useTheme } from 'vuetify'
|
import { useTheme } from 'vuetify'
|
||||||
import { hexToRgb } from '@layouts/utils'
|
import { hexToRgb } from '@layouts/utils'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
@@ -24,6 +23,8 @@ const variableTheme = controlledComputed(
|
|||||||
() => vuetifyTheme.current.value.variables,
|
() => vuetifyTheme.current.value.variables,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const chartKey = ref(0)
|
||||||
|
|
||||||
// 定时器
|
// 定时器
|
||||||
let refreshTimer: NodeJS.Timeout | null = null
|
let refreshTimer: NodeJS.Timeout | null = null
|
||||||
|
|
||||||
@@ -130,6 +131,10 @@ onUnmounted(() => {
|
|||||||
refreshTimer = null
|
refreshTimer = null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onActivated(() => {
|
||||||
|
chartKey.value += 1
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -143,8 +148,7 @@ onUnmounted(() => {
|
|||||||
<VCardTitle>CPU</VCardTitle>
|
<VCardTitle>CPU</VCardTitle>
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<VueApexCharts type="line" :options="chartOptions" :series="series" :height="150" />
|
<VApexChart :key="chartKey" type="line" :options="chartOptions" :series="series" :height="150" />
|
||||||
|
|
||||||
<p class="text-center font-weight-medium mb-0">当前:{{ current }}%</p>
|
<p class="text-center font-weight-medium mb-0">当前:{{ current }}%</p>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
</VCard>
|
</VCard>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import VueApexCharts from 'vue3-apexcharts'
|
|
||||||
import { useTheme } from 'vuetify'
|
import { useTheme } from 'vuetify'
|
||||||
import { hexToRgb } from '@layouts/utils'
|
import { hexToRgb } from '@layouts/utils'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
@@ -25,6 +24,8 @@ const variableTheme = controlledComputed(
|
|||||||
() => vuetifyTheme.current.value.variables,
|
() => vuetifyTheme.current.value.variables,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const chartKey = ref(0)
|
||||||
|
|
||||||
// 定时器
|
// 定时器
|
||||||
let refreshTimer: NodeJS.Timeout | null = null
|
let refreshTimer: NodeJS.Timeout | null = null
|
||||||
|
|
||||||
@@ -136,6 +137,10 @@ onUnmounted(() => {
|
|||||||
refreshTimer = null
|
refreshTimer = null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onActivated(() => {
|
||||||
|
chartKey.value += 1
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -149,8 +154,7 @@ onUnmounted(() => {
|
|||||||
<VCardTitle>内存</VCardTitle>
|
<VCardTitle>内存</VCardTitle>
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<VueApexCharts type="area" :options="chartOptions" :series="series" :height="150" />
|
<VApexChart :key="chartKey" type="area" :options="chartOptions" :series="series" :height="150" />
|
||||||
|
|
||||||
<p class="text-center font-weight-medium mb-0">当前:{{ formatBytes(usedMemory) }}</p>
|
<p class="text-center font-weight-medium mb-0">当前:{{ formatBytes(usedMemory) }}</p>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
</VCard>
|
</VCard>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import VueApexCharts from 'vue3-apexcharts'
|
|
||||||
import { useTheme } from 'vuetify'
|
import { useTheme } from 'vuetify'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { hexToRgb } from '@layouts/utils'
|
import { hexToRgb } from '@layouts/utils'
|
||||||
@@ -127,8 +126,7 @@ onMounted(() => {
|
|||||||
</VCardItem>
|
</VCardItem>
|
||||||
|
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<VueApexCharts type="bar" :options="options" :series="series" :height="160" />
|
<VApexChart type="bar" :options="options" :series="series" :height="160" />
|
||||||
|
|
||||||
<div class="d-flex align-center mb-3">
|
<div class="d-flex align-center mb-3">
|
||||||
<h5 class="text-h5 me-4">
|
<h5 class="text-h5 me-4">
|
||||||
{{ totalCount }}
|
{{ totalCount }}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ const isRefreshed = ref(false)
|
|||||||
// 数据列表
|
// 数据列表
|
||||||
const dataList = ref<MediaInfo[]>([])
|
const dataList = ref<MediaInfo[]>([])
|
||||||
const currData = ref<MediaInfo[]>([])
|
const currData = ref<MediaInfo[]>([])
|
||||||
|
|
||||||
// 拼装参数
|
// 拼装参数
|
||||||
function getParams() {
|
function getParams() {
|
||||||
let params = {
|
let params = {
|
||||||
@@ -78,6 +77,7 @@ async function fetchData({ done }: { done: any }) {
|
|||||||
} else {
|
} else {
|
||||||
// 加载一次
|
// 加载一次
|
||||||
// 设置加载中
|
// 设置加载中
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
// 请求API
|
// 请求API
|
||||||
currData.value = await api.get(props.apipath, {
|
currData.value = await api.get(props.apipath, {
|
||||||
@@ -115,15 +115,7 @@ async function fetchData({ done }: { done: any }) {
|
|||||||
<div v-if="dataList.length > 0" class="grid gap-4 grid-media-card mx-3" tabindex="0">
|
<div v-if="dataList.length > 0" class="grid gap-4 grid-media-card mx-3" tabindex="0">
|
||||||
<MediaCard v-for="data in dataList" :key="data.tmdb_id || data.douban_id" :media="data" />
|
<MediaCard v-for="data in dataList" :key="data.tmdb_id || data.douban_id" :media="data" />
|
||||||
</div>
|
</div>
|
||||||
<NoDataFound
|
<NoDataFound v-if="dataList.length === 0 && isRefreshed" error-code="404" error-title="没有数据"
|
||||||
v-if="dataList.length === 0 && isRefreshed"
|
error-description="无法获取到媒体信息。" />
|
||||||
error-code="404"
|
|
||||||
error-title="没有数据"
|
|
||||||
error-description="无法获取到媒体信息。"
|
|
||||||
/>
|
|
||||||
</VInfiniteScroll>
|
</VInfiniteScroll>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import api from '@/api'
|
|||||||
import type { MediaInfo } from '@/api/types'
|
import type { MediaInfo } from '@/api/types'
|
||||||
import MediaCard from '@/components/cards/MediaCard.vue'
|
import MediaCard from '@/components/cards/MediaCard.vue'
|
||||||
import SlideView from '@/components/slide/SlideView.vue'
|
import SlideView from '@/components/slide/SlideView.vue'
|
||||||
|
import { registerAbortController } from '@/router'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -11,7 +12,8 @@ const props = defineProps({
|
|||||||
title: String,
|
title: String,
|
||||||
})
|
})
|
||||||
|
|
||||||
provide('rankingPropsKey', reactive({...props}))
|
// 提供给子组件的属性
|
||||||
|
provide('rankingPropsKey', reactive({ ...props }))
|
||||||
|
|
||||||
// 组件加载完成
|
// 组件加载完成
|
||||||
const componentLoaded = ref(false)
|
const componentLoaded = ref(false)
|
||||||
@@ -22,36 +24,33 @@ const dataList = ref<MediaInfo[]>([])
|
|||||||
// 获取订阅列表数据
|
// 获取订阅列表数据
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
try {
|
try {
|
||||||
if (!props.apipath)
|
if (!props.apipath) return
|
||||||
return
|
const abortController = new AbortController()
|
||||||
|
registerAbortController(abortController)
|
||||||
dataList.value = await api.get(props.apipath)
|
const { signal } = abortController
|
||||||
if (dataList.value.length > 0)
|
dataList.value = await api.get(props.apipath, { signal })
|
||||||
componentLoaded.value = true
|
if (dataList.value.length > 0) componentLoaded.value = true
|
||||||
}
|
} catch (error) {
|
||||||
catch (error) {
|
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载时获取数据
|
// 加载时获取数据
|
||||||
onMounted(fetchData)
|
onMounted(() => {
|
||||||
|
fetchData()
|
||||||
|
})
|
||||||
|
onActivated(() => {
|
||||||
|
if (dataList.value.length == 0) {
|
||||||
|
fetchData()
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<SlideView
|
<SlideView v-if="componentLoaded">
|
||||||
v-if="componentLoaded"
|
|
||||||
>
|
|
||||||
<template #content>
|
<template #content>
|
||||||
<template
|
<template v-for="data in dataList" :key="data.tmdb_id || data.douban_id || data.bangumi_id">
|
||||||
v-for="data in dataList"
|
<MediaCard :media="data" height="15rem" width="10rem" />
|
||||||
:key="data.tmdb_id || data.douban_id || data.bangumi_id"
|
|
||||||
>
|
|
||||||
<MediaCard
|
|
||||||
:media="data"
|
|
||||||
height="15rem"
|
|
||||||
width="10rem"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</SlideView>
|
</SlideView>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import draggable from 'vuedraggable'
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Plugin } from '@/api/types'
|
import type { Plugin } from '@/api/types'
|
||||||
@@ -28,6 +29,9 @@ const pluginId = ref(route.query.id)
|
|||||||
// 当前排序字段
|
// 当前排序字段
|
||||||
const activeSort = ref(null)
|
const activeSort = ref(null)
|
||||||
|
|
||||||
|
// 插件顺序配置
|
||||||
|
const orderConfig = ref<{ id: string }[]>([])
|
||||||
|
|
||||||
// 排序选项
|
// 排序选项
|
||||||
const sortOptions = [
|
const sortOptions = [
|
||||||
{ title: '热门', value: 'count' },
|
{ title: '热门', value: 'count' },
|
||||||
@@ -104,6 +108,52 @@ const labelFilterOptions = ref<string[]>([])
|
|||||||
// 插件库过滤项
|
// 插件库过滤项
|
||||||
const repoFilterOptions = ref<string[]>([])
|
const repoFilterOptions = ref<string[]>([])
|
||||||
|
|
||||||
|
// 加载插件顺序
|
||||||
|
async function loadPluginOrderConfig() {
|
||||||
|
// 顺序配置
|
||||||
|
const local_order = localStorage.getItem('MP_PLUGIN_ORDER')
|
||||||
|
if (local_order) {
|
||||||
|
orderConfig.value = JSON.parse(local_order)
|
||||||
|
} else {
|
||||||
|
const response2 = await api.get('/user/config/PluginOrder')
|
||||||
|
if (response2 && response2.data && response2.data.value) {
|
||||||
|
orderConfig.value = response2.data.value
|
||||||
|
localStorage.setItem('MP_PLUGIN_ORDER', JSON.stringify(orderConfig.value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按order的顺序对插件进行排序
|
||||||
|
function sortPluginOrder() {
|
||||||
|
if (!orderConfig.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (dataList.value.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dataList.value.sort((a, b) => {
|
||||||
|
const aIndex = orderConfig.value.findIndex((item: { id: string }) => item.id === a.id)
|
||||||
|
const bIndex = orderConfig.value.findIndex((item: { id: string }) => item.id === b.id)
|
||||||
|
return (aIndex === -1 ? 999 : aIndex) - (bIndex === -1 ? 999 : bIndex)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存顺序设置
|
||||||
|
async function savePluginOrder() {
|
||||||
|
// 顺序配置
|
||||||
|
const orderObj = dataList.value.map(item => ({ id: item.id || '' }))
|
||||||
|
orderConfig.value = orderObj
|
||||||
|
const orderString = JSON.stringify(orderObj)
|
||||||
|
localStorage.setItem('MP_PLUGIN_ORDER', orderString)
|
||||||
|
|
||||||
|
// 保存到服务端
|
||||||
|
try {
|
||||||
|
await api.post('/user/config/PluginOrder', orderObj)
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 初始化过滤选项
|
// 初始化过滤选项
|
||||||
function initOptions(item: Plugin) {
|
function initOptions(item: Plugin) {
|
||||||
const optionValue = (options: Array<string>, value: string | undefined) => {
|
const optionValue = (options: Array<string>, value: string | undefined) => {
|
||||||
@@ -208,6 +258,8 @@ async function fetchInstalledPlugins() {
|
|||||||
state: 'installed',
|
state: 'installed',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
// 排序
|
||||||
|
sortPluginOrder()
|
||||||
loading.value = false
|
loading.value = false
|
||||||
isRefreshed.value = true
|
isRefreshed.value = true
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -329,8 +381,9 @@ function handleRepoUrl(url: string | undefined) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 加载时获取数据
|
// 加载时获取数据
|
||||||
onBeforeMount(async () => {
|
onMounted(async () => {
|
||||||
await refreshData()
|
await loadPluginOrderConfig()
|
||||||
|
refreshData()
|
||||||
getPluginStatistics()
|
getPluginStatistics()
|
||||||
if (activeTab.value != 'market' && pluginId.value) {
|
if (activeTab.value != 'market' && pluginId.value) {
|
||||||
// 找到这个插件
|
// 找到这个插件
|
||||||
@@ -356,18 +409,26 @@ onBeforeMount(async () => {
|
|||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<div>
|
<div>
|
||||||
<LoadingBanner v-if="!isRefreshed" class="mt-12" />
|
<LoadingBanner v-if="!isRefreshed" class="mt-12" />
|
||||||
<div v-if="dataList.length > 0" class="grid gap-4 grid-plugin-card">
|
<draggable
|
||||||
<template v-for="(data, index) in dataList" :key="`${data.id}_v${data.plugin_version}`">
|
v-if="dataList.length > 0"
|
||||||
|
v-model="dataList"
|
||||||
|
@end="savePluginOrder"
|
||||||
|
handle=".cursor-move"
|
||||||
|
item-key="id"
|
||||||
|
tag="div"
|
||||||
|
:component-data="{ class: 'grid gap-4 grid-plugin-card' }"
|
||||||
|
>
|
||||||
|
<template #item="{ element }">
|
||||||
<PluginCard
|
<PluginCard
|
||||||
:count="PluginStatistics[data.id || '0']"
|
:count="PluginStatistics[element.id || '0']"
|
||||||
:plugin="data"
|
:plugin="element"
|
||||||
:action="pluginActions[data.id || '0']"
|
:action="pluginActions[element.id || '0']"
|
||||||
@remove="refreshData"
|
@remove="refreshData"
|
||||||
@save="refreshData"
|
@save="refreshData"
|
||||||
@action-done="pluginActions[data.id || '0'] = false"
|
@action-done="pluginActions[element.id || '0'] = false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</draggable>
|
||||||
<NoDataFound
|
<NoDataFound
|
||||||
v-if="dataList.length === 0 && isRefreshed"
|
v-if="dataList.length === 0 && isRefreshed"
|
||||||
error-code="404"
|
error-code="404"
|
||||||
@@ -446,31 +507,32 @@ onBeforeMount(async () => {
|
|||||||
</VWindow>
|
</VWindow>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 插件搜索图标 -->
|
<div v-if="isRefreshed">
|
||||||
<VFab
|
<!-- 插件搜索图标 -->
|
||||||
icon="mdi-magnify"
|
<VFab
|
||||||
color="info"
|
icon="mdi-magnify"
|
||||||
location="bottom"
|
color="info"
|
||||||
size="x-large"
|
location="bottom"
|
||||||
fixed
|
size="x-large"
|
||||||
app
|
fixed
|
||||||
appear
|
app
|
||||||
@click="SearchDialog = true"
|
appear
|
||||||
:class="appMode ? 'mb-28' : 'mb-16'"
|
@click="SearchDialog = true"
|
||||||
/>
|
:class="appMode ? 'mb-28' : 'mb-16'"
|
||||||
<!-- 插件市场设置图标 -->
|
/>
|
||||||
<VFab
|
<!-- 插件市场设置图标 -->
|
||||||
icon="mdi-store-cog"
|
<VFab
|
||||||
color="warning"
|
icon="mdi-store-cog"
|
||||||
location="bottom"
|
color="warning"
|
||||||
size="x-large"
|
location="bottom"
|
||||||
fixed
|
size="x-large"
|
||||||
app
|
fixed
|
||||||
appear
|
app
|
||||||
@click="MarketSettingDialog = true"
|
appear
|
||||||
:class="{ 'mb-12': appMode }"
|
@click="MarketSettingDialog = true"
|
||||||
/>
|
:class="{ 'mb-12': appMode }"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<!-- 插件市场设置窗口 -->
|
<!-- 插件市场设置窗口 -->
|
||||||
<PluginMarketSettingDialog
|
<PluginMarketSettingDialog
|
||||||
v-if="MarketSettingDialog"
|
v-if="MarketSettingDialog"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { useToast } from 'vue-toast-notification'
|
|||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { TransferHistory } from '@/api/types'
|
import type { TransferHistory } from '@/api/types'
|
||||||
import ReorganizeDialog from '@/components/dialog/ReorganizeDialog.vue'
|
import ReorganizeDialog from '@/components/dialog/ReorganizeDialog.vue'
|
||||||
|
import TransferQueueDialog from '@/components/dialog/TransferQueueDialog.vue'
|
||||||
import ProgressDialog from '@/components/dialog/ProgressDialog.vue'
|
import ProgressDialog from '@/components/dialog/ProgressDialog.vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
@@ -20,14 +21,21 @@ const $toast = useToast()
|
|||||||
// 路由
|
// 路由
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
// 组合式输入法状态
|
||||||
|
const isComposing = ref(false)
|
||||||
|
|
||||||
// 重新整理对话框
|
// 重新整理对话框
|
||||||
const redoDialog = ref(false)
|
const redoDialog = ref(false)
|
||||||
|
|
||||||
|
// 整理队列对话框
|
||||||
|
const transferQueueDialog = ref(false)
|
||||||
|
|
||||||
// 当前操作记录
|
// 当前操作记录
|
||||||
const currentHistory = ref<TransferHistory>()
|
const currentHistory = ref<TransferHistory>()
|
||||||
|
|
||||||
// 重新整理IDS
|
// 重新整理IDS
|
||||||
const redoIds = ref<number[]>([])
|
const redoIds = ref<number[]>([])
|
||||||
|
const redoTargetStorage = ref<string>()
|
||||||
|
|
||||||
// 已选中的数据
|
// 已选中的数据
|
||||||
const selected = ref<TransferHistory[]>([])
|
const selected = ref<TransferHistory[]>([])
|
||||||
@@ -105,6 +113,9 @@ const progressText = ref('请稍候 ...')
|
|||||||
// 进度值
|
// 进度值
|
||||||
const progressValue = ref(0)
|
const progressValue = ref(0)
|
||||||
|
|
||||||
|
// 是否已刷新
|
||||||
|
const isRefreshed = ref(false)
|
||||||
|
|
||||||
// 删除确认对话框
|
// 删除确认对话框
|
||||||
const deleteConfirmDialog = ref(false)
|
const deleteConfirmDialog = ref(false)
|
||||||
|
|
||||||
@@ -143,7 +154,7 @@ const totalPage = computed(() => {
|
|||||||
return total
|
return total
|
||||||
})
|
})
|
||||||
|
|
||||||
// 切换页签和搜索词
|
// 切换页签
|
||||||
watch(
|
watch(
|
||||||
[() => currentPage.value, () => itemsPerPage.value],
|
[() => currentPage.value, () => itemsPerPage.value],
|
||||||
debounce(async () => {
|
debounce(async () => {
|
||||||
@@ -151,10 +162,14 @@ watch(
|
|||||||
}, 1000),
|
}, 1000),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 搜索监听
|
||||||
watch(
|
watch(
|
||||||
[() => search.value],
|
[() => search.value, () => isComposing.value],
|
||||||
debounce(async () => {
|
debounce(async () => {
|
||||||
reloadPage(true)
|
if (!isComposing.value) {
|
||||||
|
console.log('search: ' + search.value)
|
||||||
|
reloadPage(true)
|
||||||
|
}
|
||||||
}, 1000),
|
}, 1000),
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -170,7 +185,7 @@ async function fetchData(page = currentPage.value, count = itemsPerPage.value) {
|
|||||||
title: search.value,
|
title: search.value,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
isRefreshed.value = true
|
||||||
dataList.value = result.data?.list
|
dataList.value = result.data?.list
|
||||||
totalItems.value = result.data?.total
|
totalItems.value = result.data?.total
|
||||||
searchHintList.value = ['失败', '成功', ...new Set(dataList.value.map(item => item.title || ''))].filter(
|
searchHintList.value = ['失败', '成功', ...new Set(dataList.value.map(item => item.title || ''))].filter(
|
||||||
@@ -301,6 +316,7 @@ const dropdownItems = ref([
|
|||||||
prependIcon: 'mdi-redo-variant',
|
prependIcon: 'mdi-redo-variant',
|
||||||
click: (item: TransferHistory) => {
|
click: (item: TransferHistory) => {
|
||||||
redoIds.value = [item.id]
|
redoIds.value = [item.id]
|
||||||
|
redoTargetStorage.value = item.dest_storage
|
||||||
redoDialog.value = true
|
redoDialog.value = true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -359,15 +375,16 @@ onMounted(fetchData)
|
|||||||
<VCardItem>
|
<VCardItem>
|
||||||
<VCardTitle>
|
<VCardTitle>
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol cols="4" md="6"> 历史记录 </VCol>
|
|
||||||
<VCol cols="8" md="6" class="flex">
|
<VCol cols="8" md="6" class="flex">
|
||||||
<VCombobox
|
<VCombobox
|
||||||
key="search_navbar"
|
key="search_navbar"
|
||||||
v-model="search"
|
v-model="search"
|
||||||
:items="searchHintList"
|
:items="searchHintList"
|
||||||
|
@compositionstart="isComposing = true"
|
||||||
|
@compositionend="isComposing = false"
|
||||||
class="text-disabled"
|
class="text-disabled"
|
||||||
density="compact"
|
density="compact"
|
||||||
label="搜索目录、状态"
|
label="搜索整理记录"
|
||||||
prepend-inner-icon="mdi-magnify"
|
prepend-inner-icon="mdi-magnify"
|
||||||
variant="solo-filled"
|
variant="solo-filled"
|
||||||
single-line
|
single-line
|
||||||
@@ -377,6 +394,16 @@ onMounted(fetchData)
|
|||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
<VCol cols="4" md="6" class="text-end">
|
||||||
|
<VBtn
|
||||||
|
color="primary"
|
||||||
|
prepend-icon="mdi-tray-full"
|
||||||
|
append-icon="mdi-dots-horizontal"
|
||||||
|
@click="transferQueueDialog = true"
|
||||||
|
>
|
||||||
|
<span v-if="display.mdAndUp.value" class="ms-2">整理队列</span>
|
||||||
|
</VBtn>
|
||||||
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
</VCardTitle>
|
</VCardTitle>
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
@@ -479,7 +506,7 @@ onMounted(fetchData)
|
|||||||
</VCard>
|
</VCard>
|
||||||
|
|
||||||
<!-- 底部操作按钮 -->
|
<!-- 底部操作按钮 -->
|
||||||
<span>
|
<div v-if="isRefreshed">
|
||||||
<VFab
|
<VFab
|
||||||
v-if="selected.length > 0"
|
v-if="selected.length > 0"
|
||||||
icon="mdi-trash-can-outline"
|
icon="mdi-trash-can-outline"
|
||||||
@@ -503,7 +530,7 @@ onMounted(fetchData)
|
|||||||
appear
|
appear
|
||||||
@click="retransferBatch"
|
@click="retransferBatch"
|
||||||
/>
|
/>
|
||||||
</span>
|
</div>
|
||||||
<!-- 底部弹窗 -->
|
<!-- 底部弹窗 -->
|
||||||
<VBottomSheet v-model="deleteConfirmDialog" inset>
|
<VBottomSheet v-model="deleteConfirmDialog" inset>
|
||||||
<VCard class="text-center rounded-t">
|
<VCard class="text-center rounded-t">
|
||||||
@@ -512,13 +539,13 @@ onMounted(fetchData)
|
|||||||
{{ confirmTitle }}
|
{{ confirmTitle }}
|
||||||
</VCardTitle>
|
</VCardTitle>
|
||||||
<div class="d-flex flex-column flex-lg-row justify-center my-3">
|
<div class="d-flex flex-column flex-lg-row justify-center my-3">
|
||||||
<VBtn color="primary" class="mb-2 mx-2" @click="deleteConfirmHandler(false, false)"> 仅删除历史记录 </VBtn>
|
<VBtn color="primary" class="mb-2 mx-2" @click="deleteConfirmHandler(false, false)"> 仅删除整理记录 </VBtn>
|
||||||
<VBtn color="warning" class="mb-2 mx-2" @click="deleteConfirmHandler(true, false)"> 删除历史记录和源文件 </VBtn>
|
<VBtn color="warning" class="mb-2 mx-2" @click="deleteConfirmHandler(true, false)"> 删除整理记录和源文件 </VBtn>
|
||||||
<VBtn color="info" class="mb-2 mx-2" @click="deleteConfirmHandler(false, true)">
|
<VBtn color="info" class="mb-2 mx-2" @click="deleteConfirmHandler(false, true)">
|
||||||
删除历史记录和媒体库文件
|
删除整理记录和媒体库文件
|
||||||
</VBtn>
|
</VBtn>
|
||||||
<VBtn color="error" class="mb-2 mx-2" @click="deleteConfirmHandler(true, true)">
|
<VBtn color="error" class="mb-2 mx-2" @click="deleteConfirmHandler(true, true)">
|
||||||
删除历史记录、源文件和媒体库文件
|
删除整理记录、源文件和媒体库文件
|
||||||
</VBtn>
|
</VBtn>
|
||||||
</div>
|
</div>
|
||||||
</VCard>
|
</VCard>
|
||||||
@@ -530,9 +557,12 @@ onMounted(fetchData)
|
|||||||
v-if="redoDialog"
|
v-if="redoDialog"
|
||||||
v-model="redoDialog"
|
v-model="redoDialog"
|
||||||
:logids="redoIds"
|
:logids="redoIds"
|
||||||
|
:target_storage="redoTargetStorage"
|
||||||
@done="transferDone"
|
@done="transferDone"
|
||||||
@close="redoDialog = false"
|
@close="redoDialog = false"
|
||||||
/>
|
/>
|
||||||
|
<!-- 整理队列进度弹窗 -->
|
||||||
|
<TransferQueueDialog v-if="transferQueueDialog" v-model="transferQueueDialog" @close="transferQueueDialog = false" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ onMounted(() => {
|
|||||||
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
|
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
|
||||||
<span class="flex-grow undefined">
|
<span class="flex-grow undefined">
|
||||||
<a
|
<a
|
||||||
href="https://github.com/jxxghp/MoviePilot/blob/main/README.md"
|
href="https://wiki.movie-pilot.org"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
class="text-indigo-500 transition duration-300 hover:underline"
|
class="text-indigo-500 transition duration-300 hover:underline"
|
||||||
|
|||||||
@@ -52,6 +52,17 @@ async function loadSystemSettings() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 重载系统生效配置
|
||||||
|
async function reloadSystem() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.get('system/reload')
|
||||||
|
if (result.success) $toast.success('系统配置已生效')
|
||||||
|
else $toast.error('重载系统失败!')
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 移动结束
|
// 移动结束
|
||||||
function orderDirectoryCards() {
|
function orderDirectoryCards() {
|
||||||
// 更新所有目录的优先级
|
// 更新所有目录的优先级
|
||||||
@@ -109,6 +120,7 @@ async function saveDirectories() {
|
|||||||
const result: { [key: string]: any } = await api.post('system/setting/Directories', directories.value)
|
const result: { [key: string]: any } = await api.post('system/setting/Directories', directories.value)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
$toast.success('目录设置保存成功')
|
$toast.success('目录设置保存成功')
|
||||||
|
await reloadSystem()
|
||||||
} else $toast.error('目录设置保存失败!')
|
} else $toast.error('目录设置保存失败!')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -129,6 +141,7 @@ function addDirectory() {
|
|||||||
monitor_type: '',
|
monitor_type: '',
|
||||||
media_type: '',
|
media_type: '',
|
||||||
media_category: '',
|
media_category: '',
|
||||||
|
transfer_type: ''
|
||||||
})
|
})
|
||||||
orderDirectoryCards()
|
orderDirectoryCards()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,6 +222,7 @@ onMounted(() => {
|
|||||||
<VRadioGroup v-model="item.action" inline>
|
<VRadioGroup v-model="item.action" inline>
|
||||||
<VRadio value="user" label="仅操作用户" />
|
<VRadio value="user" label="仅操作用户" />
|
||||||
<VRadio value="admin" label="仅管理员" />
|
<VRadio value="admin" label="仅管理员" />
|
||||||
|
<VRadio value="user,admin" label="操作用户和管理员" />
|
||||||
<VRadio value="all" label="所有用户" />
|
<VRadio value="all" label="所有用户" />
|
||||||
</VRadioGroup>
|
</VRadioGroup>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import { copyToClipboard } from '@/@core/utils/navigator'
|
import { copyToClipboard } from '@/@core/utils/navigator'
|
||||||
import draggable from 'vuedraggable'
|
import draggable from 'vuedraggable'
|
||||||
import { VRow } from 'vuetify/lib/components/index.mjs'
|
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { CustomRule, FilterRuleGroup } from '@/api/types'
|
import { CustomRule, FilterRuleGroup } from '@/api/types'
|
||||||
import CustomerRuleCard from '@/components/cards/CustomRuleCard.vue'
|
import CustomerRuleCard from '@/components/cards/CustomRuleCard.vue'
|
||||||
@@ -25,9 +24,6 @@ const mediaCategories = ref<{ [key: string]: any }>({})
|
|||||||
// 导入代码弹窗
|
// 导入代码弹窗
|
||||||
const importCodeDialog = ref(false)
|
const importCodeDialog = ref(false)
|
||||||
|
|
||||||
// 导入的代码
|
|
||||||
const importCodeString = ref('')
|
|
||||||
|
|
||||||
// 导入代码类型
|
// 导入代码类型
|
||||||
const importCodeType = ref('')
|
const importCodeType = ref('')
|
||||||
|
|
||||||
@@ -98,8 +94,6 @@ async function addCustomRule() {
|
|||||||
customRules.value.push({
|
customRules.value.push({
|
||||||
id: id,
|
id: id,
|
||||||
name: name,
|
name: name,
|
||||||
include: '',
|
|
||||||
exclude: '',
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,14 +143,11 @@ function addFilterRuleGroup() {
|
|||||||
}
|
}
|
||||||
filterRuleGroups.value.push({
|
filterRuleGroups.value.push({
|
||||||
name: name,
|
name: name,
|
||||||
rule_string: '',
|
|
||||||
media_type: '',
|
|
||||||
category: '',
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分享规则
|
// 分享规则
|
||||||
function shareRules(rules: CustomRule[] | FilterRuleGroup[]) {
|
async function shareRules(rules: CustomRule[] | FilterRuleGroup[], type: string) {
|
||||||
if (!rules || rules.length === 0) return
|
if (!rules || rules.length === 0) return
|
||||||
|
|
||||||
// 将卡片规则接装为字符串
|
// 将卡片规则接装为字符串
|
||||||
@@ -164,55 +155,136 @@ function shareRules(rules: CustomRule[] | FilterRuleGroup[]) {
|
|||||||
|
|
||||||
// 复制到剪贴板
|
// 复制到剪贴板
|
||||||
try {
|
try {
|
||||||
copyToClipboard(value)
|
let success
|
||||||
$toast.success('优先级规则已复制到剪贴板')
|
success = copyToClipboard(value)
|
||||||
} catch (error) {
|
if (await success) $toast.success(`${type === 'custom' ? '自定义规则' : '优先级规则组'}已复制到剪贴板!`)
|
||||||
$toast.error('优先级规则复制失败!')
|
else $toast.error(`${type === 'custom' ? '自定义规则' : '优先级规则组'}复制失败:可能是浏览器不支持或被用户阻止!`)
|
||||||
|
} catch (e) {
|
||||||
|
$toast.error(`${type === 'custom' ? '自定义规则' : '优先级规则组'}复制失败!`)
|
||||||
|
console.error(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导入规则
|
// 打开弹窗
|
||||||
async function importRules(ruleType: string) {
|
async function importRules(ruleType: string) {
|
||||||
importCodeType.value = ruleType
|
importCodeType.value = ruleType
|
||||||
importCodeString.value = ''
|
|
||||||
importCodeDialog.value = true
|
importCodeDialog.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 监听导入代码变化
|
// 保存导入的代码
|
||||||
watchEffect(() => {
|
function saveCodeString(type: string, codeString: any) {
|
||||||
if (!importCodeString.value) return
|
// codeString从子组件传递过来,从对象转换为JSON
|
||||||
// 导入代码需要json格式
|
let parsedCode
|
||||||
try {
|
try {
|
||||||
if (importCodeType.value === 'custom') {
|
parsedCode = JSON.parse(codeString.value)
|
||||||
// 将导入的代码转换为规则卡片,并追加到已有的 customRules
|
} catch (e) {
|
||||||
const newCustomRules = JSON.parse(importCodeString.value).map((item: any) => {
|
$toast.error('导入规则失败!无法解析输入的数据!')
|
||||||
return {
|
console.error(e)
|
||||||
id: item.id,
|
return
|
||||||
name: item.name,
|
|
||||||
include: item.include,
|
|
||||||
exclude: item.exclude,
|
|
||||||
publish_time: item.publish_time,
|
|
||||||
seeders: item.seeders,
|
|
||||||
size_range: item.size_range,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
customRules.value = [...customRules.value, ...newCustomRules] // 合并已有的和新导入的规则
|
|
||||||
} else if (importCodeType.value === 'group') {
|
|
||||||
// 将导入的代码转换为规则卡片,并追加到已有的 filterRuleGroups
|
|
||||||
const newFilterRuleGroups = JSON.parse(importCodeString.value).map((item: any) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
rule_string: item.rule_string,
|
|
||||||
media_type: item.media_type,
|
|
||||||
category: item.category,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
filterRuleGroups.value = [...filterRuleGroups.value, ...newFilterRuleGroups] // 合并已有的和新导入的规则
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
$toast.error('规则导入失败!')
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
// 更新数据
|
||||||
|
try {
|
||||||
|
if (type === 'custom') {
|
||||||
|
if (!checkValueValidity(parsedCode, type)) return false
|
||||||
|
const newCustomRules = extractCustomRules(parsedCode) || []
|
||||||
|
customRules.value = [...customRules.value, ...newCustomRules]
|
||||||
|
} else if (type === 'group') {
|
||||||
|
if (!checkValueValidity(parsedCode, type)) return false
|
||||||
|
const newFilterRuleGroups = extractFilterRuleGroups(parsedCode) || []
|
||||||
|
filterRuleGroups.value = [...filterRuleGroups.value, ...newFilterRuleGroups]
|
||||||
|
} else {
|
||||||
|
$toast.error('导入规则失败!未知的数据类型!')
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$toast.error('导入规则失败!')
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 赋值自定义规则,避免存在多余的属性
|
||||||
|
function extractCustomRules(value: any) {
|
||||||
|
try {
|
||||||
|
return value.map((item: any) => {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
name: item.name,
|
||||||
|
include: item.include,
|
||||||
|
exclude: item.exclude,
|
||||||
|
size_range: item.size_range,
|
||||||
|
seeders: item.seeders,
|
||||||
|
publish_time: item.publish_time,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 赋值规则组,避免存在多余的属性
|
||||||
|
function extractFilterRuleGroups(value: any) {
|
||||||
|
try {
|
||||||
|
return value.map((item: any) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
rule_string: item.rule_string,
|
||||||
|
media_type: item.media_type,
|
||||||
|
category: item.category,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据ID简单区分规则与规则组
|
||||||
|
function checkValueValidity(values: any, type: string): boolean {
|
||||||
|
try {
|
||||||
|
// 允许空值存在,不影响最终的导入
|
||||||
|
if (!values) return true
|
||||||
|
if (!type) return false
|
||||||
|
for (const value of values) {
|
||||||
|
const keys = Object.keys(value)
|
||||||
|
const uniqueKeys = new Set(keys)
|
||||||
|
|
||||||
|
const hasName = keys.includes('name')
|
||||||
|
const hasId = keys.includes('id')
|
||||||
|
const noDuplicates = keys.length === uniqueKeys.size
|
||||||
|
if (type == 'custom') {
|
||||||
|
if (!hasName || !hasId || !noDuplicates) {
|
||||||
|
if (!noDuplicates) $toast.warning(`存在重名值`)
|
||||||
|
if (!hasId) $toast.error(`导入失败!发现有规则不存在ID,可能属于优先级规则组!`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} else if (type == 'group') {
|
||||||
|
if (!hasName || hasId || !noDuplicates) {
|
||||||
|
if (!noDuplicates) $toast.warning(`存在重名值`)
|
||||||
|
if (hasId) $toast.error(`导入失败!发现有规则存在ID,可能属于自定义规则!`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.error(`传入了不合法的类型!`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清空规则(组)
|
||||||
|
function deleteAllRules(dateType: string) {
|
||||||
|
if (!dateType) return
|
||||||
|
if (dateType === 'custom') {
|
||||||
|
customRules.value = []
|
||||||
|
} else if (dateType === 'group') {
|
||||||
|
filterRuleGroups.value = []
|
||||||
|
} else {
|
||||||
|
console.error(`传入了不支持的类型!`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 规则变化时赋值
|
// 规则变化时赋值
|
||||||
function onRuleChange(rule: CustomRule, id: string) {
|
function onRuleChange(rule: CustomRule, id: string) {
|
||||||
@@ -310,12 +382,15 @@ onMounted(() => {
|
|||||||
<VBtn color="success" variant="tonal" @click="addCustomRule">
|
<VBtn color="success" variant="tonal" @click="addCustomRule">
|
||||||
<VIcon icon="mdi-plus" />
|
<VIcon icon="mdi-plus" />
|
||||||
</VBtn>
|
</VBtn>
|
||||||
<VBtn color="info" variant="tonal" @click="importRules('custom')">
|
<VBtn color="primary" variant="tonal" @click="importRules('custom')">
|
||||||
<VIcon icon="mdi-import" />
|
<VIcon icon="mdi-import" />
|
||||||
</VBtn>
|
</VBtn>
|
||||||
<VBtn color="info" variant="tonal" @click="shareRules(customRules)">
|
<VBtn color="info" variant="tonal" @click="shareRules(customRules, 'custom')">
|
||||||
<VIcon icon="mdi-share" />
|
<VIcon icon="mdi-share" />
|
||||||
</VBtn>
|
</VBtn>
|
||||||
|
<VBtn color="error" variant="tonal" @click="deleteAllRules('custom')">
|
||||||
|
<VIcon icon="mdi-delete" />
|
||||||
|
</VBtn>
|
||||||
</VBtnGroup>
|
</VBtnGroup>
|
||||||
</div>
|
</div>
|
||||||
</VForm>
|
</VForm>
|
||||||
@@ -358,22 +433,30 @@ onMounted(() => {
|
|||||||
<VBtn color="success" variant="tonal" @click="addFilterRuleGroup">
|
<VBtn color="success" variant="tonal" @click="addFilterRuleGroup">
|
||||||
<VIcon icon="mdi-plus" />
|
<VIcon icon="mdi-plus" />
|
||||||
</VBtn>
|
</VBtn>
|
||||||
<VBtn color="info" variant="tonal" @click="importRules('group')">
|
<VBtn color="primary" variant="tonal" @click="importRules('group')">
|
||||||
<VIcon icon="mdi-import" />
|
<VIcon icon="mdi-import" />
|
||||||
</VBtn>
|
</VBtn>
|
||||||
<VBtn color="info" variant="tonal" @click="shareRules(filterRuleGroups)">
|
<VBtn color="info" variant="tonal" @click="shareRules(filterRuleGroups, 'group')">
|
||||||
<VIcon icon="mdi-share" />
|
<VIcon icon="mdi-share" />
|
||||||
</VBtn>
|
</VBtn>
|
||||||
|
<VBtn color="error" variant="tonal" @click="deleteAllRules('group')">
|
||||||
|
<VIcon icon="mdi-delete" />
|
||||||
|
</VBtn>
|
||||||
</VBtnGroup>
|
</VBtnGroup>
|
||||||
</div>
|
</div>
|
||||||
</VForm>
|
</VForm>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VDialog v-model="importCodeDialog" width="60rem" scrollable>
|
|
||||||
<ImportCodeDialog v-model="importCodeString" title="导入规则" @close="importCodeDialog = false" />
|
|
||||||
</VDialog>
|
|
||||||
</VCard>
|
</VCard>
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
|
<ImportCodeDialog
|
||||||
|
v-if="importCodeDialog"
|
||||||
|
v-model="importCodeDialog"
|
||||||
|
:title="`导入${importCodeType === 'custom' ? '自定义规则' : '优先级规则组'}`"
|
||||||
|
:dataType="importCodeType"
|
||||||
|
@close="importCodeDialog = false"
|
||||||
|
@save="saveCodeString"
|
||||||
|
/>
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol cols="12">
|
<VCol cols="12">
|
||||||
<VCard>
|
<VCard>
|
||||||
|
|||||||
@@ -133,6 +133,11 @@ async function saveSearchSetting() {
|
|||||||
selectedMediaSource.value.join(','),
|
selectedMediaSource.value.join(','),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (!result1 || !result1.success) {
|
||||||
|
$toast.error(`媒体搜索数据源保存失败:${result1?.message}!`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const result2: { [key: string]: any } = await api.post(
|
const result2: { [key: string]: any } = await api.post(
|
||||||
'system/setting/SearchFilterRuleGroups',
|
'system/setting/SearchFilterRuleGroups',
|
||||||
selectedFilterGroup.value,
|
selectedFilterGroup.value,
|
||||||
@@ -140,7 +145,7 @@ async function saveSearchSetting() {
|
|||||||
|
|
||||||
const result3 = await saveSystemSetting(SystemSettings.value.Basic)
|
const result3 = await saveSystemSetting(SystemSettings.value.Basic)
|
||||||
|
|
||||||
if (result1.success && result2.success && result3) {
|
if (result2.success && result3) {
|
||||||
$toast.success('搜索基础设置保存成功')
|
$toast.success('搜索基础设置保存成功')
|
||||||
} else {
|
} else {
|
||||||
$toast.error('搜索基础设置保存失败!')
|
$toast.error('搜索基础设置保存失败!')
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ const siteSetting = ref<any>({
|
|||||||
},
|
},
|
||||||
Site: {
|
Site: {
|
||||||
SITEDATA_REFRESH_INTERVAL: 0,
|
SITEDATA_REFRESH_INTERVAL: 0,
|
||||||
|
SITE_MESSAGE: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -78,15 +79,7 @@ async function loadSiteSettings() {
|
|||||||
// 将API返回的值赋值给SystemSettings
|
// 将API返回的值赋值给SystemSettings
|
||||||
for (const sectionKey of Object.keys(siteSetting.value) as Array<keyof typeof siteSetting.value>) {
|
for (const sectionKey of Object.keys(siteSetting.value) as Array<keyof typeof siteSetting.value>) {
|
||||||
Object.keys(siteSetting.value[sectionKey]).forEach((key: string) => {
|
Object.keys(siteSetting.value[sectionKey]).forEach((key: string) => {
|
||||||
let v: any
|
if (result.data.hasOwnProperty(key)) (siteSetting.value[sectionKey] as any)[key] = result.data[key]
|
||||||
if (result.data.hasOwnProperty(key)) {
|
|
||||||
v = result.data[key]
|
|
||||||
// 空字符串转为null,避免空字符串导致前端显示问题
|
|
||||||
if (v === '') {
|
|
||||||
v = null
|
|
||||||
}
|
|
||||||
;(siteSetting.value[sectionKey] as any)[key] = v
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,8 +105,10 @@ async function saveSiteSetting(value: { [key: string]: any }) {
|
|||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.post('system/env', value)
|
const result: { [key: string]: any } = await api.post('system/env', value)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
$toast.success('保存设置成功')
|
$toast.success('保存站点设置成功')
|
||||||
await reloadSystem()
|
await reloadSystem()
|
||||||
|
} else {
|
||||||
|
$toast.error('站点设置保存失败!')
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -232,6 +227,16 @@ onMounted(() => {
|
|||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
|
<VRow>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VSwitch
|
||||||
|
v-model="siteSetting.Site.SITE_MESSAGE"
|
||||||
|
label="阅读站点消息"
|
||||||
|
hint="刷新数据时读取站点消息并发送通知"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
</VForm>
|
</VForm>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardText>
|
<VCardText>
|
||||||
|
|||||||
@@ -26,15 +26,16 @@ const SystemSettings = ref<any>({
|
|||||||
// 全局
|
// 全局
|
||||||
AUXILIARY_AUTH_ENABLE: false,
|
AUXILIARY_AUTH_ENABLE: false,
|
||||||
GLOBAL_IMAGE_CACHE: false,
|
GLOBAL_IMAGE_CACHE: false,
|
||||||
|
SUBSCRIBE_STATISTIC_SHARE: true,
|
||||||
|
PLUGIN_STATISTIC_SHARE: true,
|
||||||
BIG_MEMORY_MODE: false,
|
BIG_MEMORY_MODE: false,
|
||||||
|
DB_WAL_ENABLE: false,
|
||||||
// 媒体
|
// 媒体
|
||||||
TMDB_API_DOMAIN: null,
|
TMDB_API_DOMAIN: null,
|
||||||
TMDB_IMAGE_DOMAIN: null,
|
TMDB_IMAGE_DOMAIN: null,
|
||||||
META_CACHE_EXPIRE: 0,
|
META_CACHE_EXPIRE: 0,
|
||||||
FANART_ENABLE: false,
|
|
||||||
SCRAP_FOLLOW_TMDB: true,
|
SCRAP_FOLLOW_TMDB: true,
|
||||||
SUBSCRIBE_STATISTIC_SHARE: true,
|
FANART_ENABLE: false,
|
||||||
PLUGIN_STATISTIC_SHARE: true,
|
|
||||||
// 网络
|
// 网络
|
||||||
PROXY_HOST: null,
|
PROXY_HOST: null,
|
||||||
GITHUB_PROXY: null,
|
GITHUB_PROXY: null,
|
||||||
@@ -42,9 +43,16 @@ const SystemSettings = ref<any>({
|
|||||||
DOH_ENABLE: false,
|
DOH_ENABLE: false,
|
||||||
DOH_RESOLVERS: null,
|
DOH_RESOLVERS: null,
|
||||||
DOH_DOMAINS: null,
|
DOH_DOMAINS: null,
|
||||||
// 开发
|
// 日志
|
||||||
DEBUG: false,
|
DEBUG: false,
|
||||||
|
LOG_LEVEL: 'INFO',
|
||||||
|
LOG_MAX_FILE_SIZE: '5',
|
||||||
|
LOG_BACKUP_COUNT: '3',
|
||||||
|
LOG_FILE_FORMAT: '【%(levelname)s】%(asctime)s - %(message)s',
|
||||||
|
// 实验室
|
||||||
PLUGIN_AUTO_RELOAD: false,
|
PLUGIN_AUTO_RELOAD: false,
|
||||||
|
ENCODING_DETECTION_PERFORMANCE_MODE: true,
|
||||||
|
TOKENIZED_SEARCH: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -169,6 +177,9 @@ async function saveSystemSetting(value: { [key: string]: any }) {
|
|||||||
const result: { [key: string]: any } = await api.post('system/env', value)
|
const result: { [key: string]: any } = await api.post('system/env', value)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
return true
|
return true
|
||||||
|
} else {
|
||||||
|
$toast.error(`设置保存失败:${result?.message}!`)
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -181,27 +192,36 @@ async function saveBasicSettings() {
|
|||||||
if (await saveSystemSetting(SystemSettings.value.Basic)) {
|
if (await saveSystemSetting(SystemSettings.value.Basic)) {
|
||||||
$toast.success('基础设置保存成功')
|
$toast.success('基础设置保存成功')
|
||||||
await reloadSystem()
|
await reloadSystem()
|
||||||
} else {
|
|
||||||
$toast.error('基础设置保存失败!')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 高级设置变化,等待保存
|
// 保存高级设置
|
||||||
async function saveAdvancedSettings() {
|
async function saveAdvancedSettings() {
|
||||||
|
cleanEmptyFields(SystemSettings.value.Advanced, ['LOG_FILE_FORMAT'])
|
||||||
|
|
||||||
if (await saveSystemSetting(SystemSettings.value.Advanced)) {
|
if (await saveSystemSetting(SystemSettings.value.Advanced)) {
|
||||||
advancedDialog.value = false
|
advancedDialog.value = false
|
||||||
$toast.success('高级设置保存成功')
|
$toast.success('高级设置保存成功')
|
||||||
await reloadSystem()
|
await reloadSystem()
|
||||||
} else {
|
|
||||||
$toast.error('高级设置保存失败!')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 当字段为空时,将其设置为 null 提交,以便后端恢复为默认值
|
||||||
|
function cleanEmptyFields(settings: any, fields: string[]) {
|
||||||
|
fields.forEach(field => {
|
||||||
|
if (settings[field]?.trim?.() === '') {
|
||||||
|
settings[field] = null
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 快捷复制到剪贴板
|
// 快捷复制到剪贴板
|
||||||
function copyValue(value: string) {
|
async function copyValue(value: string) {
|
||||||
try {
|
try {
|
||||||
copyToClipboard(value)
|
let success
|
||||||
$toast.success('已复制到剪贴板')
|
success = copyToClipboard(value)
|
||||||
|
if (await success) $toast.success('已复制到剪贴板!')
|
||||||
|
else $toast.error(`复制失败:可能是浏览器不支持或被用户阻止!`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
$toast.error('复制失败!')
|
$toast.error('复制失败!')
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -234,6 +254,15 @@ const pipMirrorsItems = [
|
|||||||
'https://mirrors.bfsu.edu.cn/pypi/web/simple', // 北京外国语大学
|
'https://mirrors.bfsu.edu.cn/pypi/web/simple', // 北京外国语大学
|
||||||
]
|
]
|
||||||
|
|
||||||
|
// 日志等级
|
||||||
|
const logLevelItems = [
|
||||||
|
{ title: 'DEBUG - 调试 ', value: 'DEBUG' },
|
||||||
|
{ title: 'INFO - 信息 ', value: 'INFO' },
|
||||||
|
{ title: 'WARNING - 警告 ', value: 'WARNING' },
|
||||||
|
{ title: 'ERROR - 错误 ', value: 'ERROR' },
|
||||||
|
{ title: 'CRITICAL - 严重 ', value: 'CRITICAL' },
|
||||||
|
]
|
||||||
|
|
||||||
// 创建随机字符串
|
// 创建随机字符串
|
||||||
function createRandomString() {
|
function createRandomString() {
|
||||||
const charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'
|
const charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'
|
||||||
@@ -398,7 +427,14 @@ onDeactivated(() => {
|
|||||||
<div class="d-flex flex-wrap gap-4 mt-4">
|
<div class="d-flex flex-wrap gap-4 mt-4">
|
||||||
<VBtn type="submit" @click="saveBasicSettings"> 保存 </VBtn>
|
<VBtn type="submit" @click="saveBasicSettings"> 保存 </VBtn>
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn color="warning" @click="advancedDialog = true" append-icon="mdi-dots-horizontal"> 高级设置 </VBtn>
|
<VBtn
|
||||||
|
color="error"
|
||||||
|
@click="advancedDialog = true"
|
||||||
|
prepend-icon="mdi-cog"
|
||||||
|
append-icon="mdi-dots-horizontal"
|
||||||
|
>
|
||||||
|
高级设置
|
||||||
|
</VBtn>
|
||||||
</div>
|
</div>
|
||||||
</VForm>
|
</VForm>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
@@ -524,6 +560,9 @@ onDeactivated(() => {
|
|||||||
<VTab value="network">
|
<VTab value="network">
|
||||||
<div>网络</div>
|
<div>网络</div>
|
||||||
</VTab>
|
</VTab>
|
||||||
|
<VTab value="log">
|
||||||
|
<div>日志</div>
|
||||||
|
</VTab>
|
||||||
<VTab value="dev">
|
<VTab value="dev">
|
||||||
<div>实验室</div>
|
<div>实验室</div>
|
||||||
</VTab>
|
</VTab>
|
||||||
@@ -572,6 +611,14 @@ onDeactivated(() => {
|
|||||||
persistent-hint
|
persistent-hint
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VSwitch
|
||||||
|
v-model="SystemSettings.Advanced.DB_WAL_ENABLE"
|
||||||
|
label="WAL模式"
|
||||||
|
hint="可提升读写并发性能,但可能在异常情况下增加数据丢失风险,更改后需重启生效"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
</div>
|
</div>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
@@ -585,7 +632,7 @@ onDeactivated(() => {
|
|||||||
placeholder="api.themoviedb.org"
|
placeholder="api.themoviedb.org"
|
||||||
hint="自定义themoviedb API域名或代理地址"
|
hint="自定义themoviedb API域名或代理地址"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
:items="['api.themoviedb.org']"
|
:items="['api.themoviedb.org', 'api.tmdb.org']"
|
||||||
:rules="[(v: string) => !!v || '请输入TMDB API域名']"
|
:rules="[(v: string) => !!v || '请输入TMDB API域名']"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
@@ -687,18 +734,64 @@ onDeactivated(() => {
|
|||||||
</VRow>
|
</VRow>
|
||||||
</div>
|
</div>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
|
<VWindowItem value="log">
|
||||||
<VWindowItem value="dev">
|
|
||||||
<div>
|
<div>
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
<VSwitch
|
<VSwitch
|
||||||
v-model="SystemSettings.Advanced.DEBUG"
|
v-model="SystemSettings.Advanced.DEBUG"
|
||||||
label="DEBUG日志"
|
label="调试模式"
|
||||||
hint="显示DEBUG级别日志,方便排查问题"
|
hint="启用调试模式后,日志将以DEBUG级别记录,以便排查问题"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VSelect
|
||||||
|
v-if="!SystemSettings.Advanced.DEBUG"
|
||||||
|
v-model="SystemSettings.Advanced.LOG_LEVEL"
|
||||||
|
label="日志等级"
|
||||||
|
hint="设置日志记录的级别,用于控制日志输出量"
|
||||||
|
persistent-hint
|
||||||
|
:items="logLevelItems"
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VTextField
|
||||||
|
v-model="SystemSettings.Advanced.LOG_MAX_FILE_SIZE"
|
||||||
|
label="日志文件最大容量(MB)"
|
||||||
|
hint="限制单个日志文件的最大容量,超出后将自动分割日志"
|
||||||
|
persistent-hint
|
||||||
|
min="1"
|
||||||
|
type="number"
|
||||||
|
suffix="MB"
|
||||||
|
:rules="[(v: any) => v === 0 || !!v || '日志文件最大大小', (v: any) => v >= 1 || '日志文件最大容量必须大于等于1']"
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VTextField
|
||||||
|
v-model="SystemSettings.Advanced.LOG_BACKUP_COUNT"
|
||||||
|
label="日志文件最大备份数量"
|
||||||
|
hint="设置每个模块日志文件的最大备份数量,超过后将覆盖旧日志"
|
||||||
|
persistent-hint
|
||||||
|
min="1"
|
||||||
|
type="number"
|
||||||
|
:rules="[(v: any) => v === 0 || !!v || '请输入日志文件最大备份数量', (v: any) => v >= 1 || '日志文件最大备份数量必须大于等于1']"
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
<VCol cols="12">
|
||||||
|
<VTextField
|
||||||
|
v-model="SystemSettings.Advanced.LOG_FILE_FORMAT"
|
||||||
|
label="日志文件格式"
|
||||||
|
hint="设置日志文件的输出格式,用于自定义日志的显示内容"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
</div>
|
||||||
|
</VWindowItem>
|
||||||
|
<VWindowItem value="dev">
|
||||||
|
<div>
|
||||||
|
<VRow>
|
||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
<VSwitch
|
<VSwitch
|
||||||
v-model="SystemSettings.Advanced.PLUGIN_AUTO_RELOAD"
|
v-model="SystemSettings.Advanced.PLUGIN_AUTO_RELOAD"
|
||||||
@@ -707,6 +800,22 @@ onDeactivated(() => {
|
|||||||
persistent-hint
|
persistent-hint
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VSwitch
|
||||||
|
v-model="SystemSettings.Advanced.ENCODING_DETECTION_PERFORMANCE_MODE"
|
||||||
|
label="编码探测性能模式"
|
||||||
|
hint="优先提升探测效率,但可能降低编码探测的准确性"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VSwitch
|
||||||
|
v-model="SystemSettings.Advanced.TOKENIZED_SEARCH"
|
||||||
|
label="分词搜索"
|
||||||
|
hint="提升整理历史记录搜索精度,但可能增加性能开销和意外结果"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
</div>
|
</div>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ onActivated(() => {
|
|||||||
/>
|
/>
|
||||||
<!-- 新增站点按钮 -->
|
<!-- 新增站点按钮 -->
|
||||||
<VFab
|
<VFab
|
||||||
|
v-if="isRefreshed"
|
||||||
icon="mdi-plus"
|
icon="mdi-plus"
|
||||||
location="bottom"
|
location="bottom"
|
||||||
size="x-large"
|
size="x-large"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { VPullToRefresh } from 'vuetify/labs/VPullToRefresh'
|
import draggable from 'vuedraggable'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Subscribe } from '@/api/types'
|
import type { Subscribe } from '@/api/types'
|
||||||
import NoDataFound from '@/components/NoDataFound.vue'
|
import NoDataFound from '@/components/NoDataFound.vue'
|
||||||
@@ -31,11 +31,74 @@ const subscribeEditDialog = ref(false)
|
|||||||
// 历史记录弹窗
|
// 历史记录弹窗
|
||||||
const historyDialog = ref(false)
|
const historyDialog = ref(false)
|
||||||
|
|
||||||
|
// 订阅顺序配置
|
||||||
|
const orderConfig = ref<{ id: number }[]>([])
|
||||||
|
|
||||||
|
// 显示的订阅列表
|
||||||
|
const displayList = ref<Subscribe[]>([])
|
||||||
|
|
||||||
|
// 监听dataList变化,同步更新displayList
|
||||||
|
watch(dataList, () => {
|
||||||
|
// 从Vuex Store中获取用户信息
|
||||||
|
const superUser = store.state.auth.superUser
|
||||||
|
const userName = store.state.auth.userName
|
||||||
|
if (superUser) displayList.value = dataList.value.filter(data => data.type === props.type)
|
||||||
|
else displayList.value = dataList.value.filter(data => data.type === props.type && data.username === userName)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 加载顺序
|
||||||
|
async function loadSubscribeOrderConfig() {
|
||||||
|
// 顺序配置
|
||||||
|
const local_order = localStorage.getItem('MP_SUBSCRIBE_ORDER')
|
||||||
|
if (local_order) {
|
||||||
|
orderConfig.value = JSON.parse(local_order)
|
||||||
|
} else {
|
||||||
|
const response2 = await api.get('/user/config/SubscribeOrder')
|
||||||
|
if (response2 && response2.data && response2.data.value) {
|
||||||
|
orderConfig.value = response2.data.value
|
||||||
|
localStorage.setItem('MP_SUBSCRIBE_ORDER', JSON.stringify(orderConfig.value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按order的顺序排序
|
||||||
|
function sortSubscribeOrder() {
|
||||||
|
if (!orderConfig.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (dataList.value.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dataList.value.sort((a, b) => {
|
||||||
|
const aIndex = orderConfig.value.findIndex((item: { id: number }) => item.id === a.id)
|
||||||
|
const bIndex = orderConfig.value.findIndex((item: { id: number }) => item.id === b.id)
|
||||||
|
return (aIndex === -1 ? 999 : aIndex) - (bIndex === -1 ? 999 : bIndex)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存顺序设置
|
||||||
|
async function saveSubscribeOrder() {
|
||||||
|
// 顺序配置
|
||||||
|
const orderObj = displayList.value.map(item => ({ id: item.id }))
|
||||||
|
orderConfig.value = orderObj
|
||||||
|
const orderString = JSON.stringify(orderObj)
|
||||||
|
localStorage.setItem('MP_SUBSCRIBE_ORDER', orderString)
|
||||||
|
|
||||||
|
// 保存到服务端
|
||||||
|
try {
|
||||||
|
await api.post('/user/config/SubscribeOrder', orderObj)
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 获取订阅列表数据
|
// 获取订阅列表数据
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
try {
|
try {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
dataList.value = await api.get('subscribe/')
|
dataList.value = await api.get('subscribe/')
|
||||||
|
// 排序
|
||||||
|
sortSubscribeOrder()
|
||||||
loading.value = false
|
loading.value = false
|
||||||
isRefreshed.value = true
|
isRefreshed.value = true
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -46,22 +109,8 @@ async function fetchData() {
|
|||||||
// 刷新状态
|
// 刷新状态
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
// 下拉刷新
|
|
||||||
async function onRefresh({ done }: { done: any }) {
|
|
||||||
await fetchData()
|
|
||||||
done('ok')
|
|
||||||
}
|
|
||||||
|
|
||||||
// 过滤数据,管理员用户显示全部,非管理员只显示自己的订阅
|
|
||||||
const filteredDataList = computed(() => {
|
|
||||||
// 从Vuex Store中获取用户信息
|
|
||||||
const superUser = store.state.auth.superUser
|
|
||||||
const userName = store.state.auth.userName
|
|
||||||
if (superUser) return dataList.value.filter(data => data.type === props.type)
|
|
||||||
else return dataList.value.filter(data => data.type === props.type && data.username === userName)
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
await loadSubscribeOrderConfig()
|
||||||
await fetchData()
|
await fetchData()
|
||||||
if (props.subid) {
|
if (props.subid) {
|
||||||
// 找到这个订阅
|
// 找到这个订阅
|
||||||
@@ -75,54 +124,58 @@ onMounted(async () => {
|
|||||||
|
|
||||||
onActivated(async () => {
|
onActivated(async () => {
|
||||||
if (!loading.value) {
|
if (!loading.value) {
|
||||||
fetchData()
|
await fetchData()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<LoadingBanner v-if="!isRefreshed" class="mt-12" />
|
<LoadingBanner v-if="!isRefreshed" class="mt-12" />
|
||||||
<VPullToRefresh v-model="loading" @load="onRefresh">
|
<draggable
|
||||||
<div v-if="filteredDataList.length > 0" class="mx-3 grid gap-4 grid-subscribe-card p-1">
|
v-if="displayList.length > 0"
|
||||||
<SubscribeCard
|
v-model="displayList"
|
||||||
v-for="data in filteredDataList"
|
@end="saveSubscribeOrder"
|
||||||
:key="data.id"
|
handle=".cursor-move"
|
||||||
:media="data"
|
item-key="id"
|
||||||
@remove="fetchData"
|
tag="div"
|
||||||
@save="fetchData"
|
:component-data="{ class: 'mx-3 grid gap-4 grid-subscribe-card p-1' }"
|
||||||
/>
|
>
|
||||||
</div>
|
<template #item="{ element }">
|
||||||
<NoDataFound
|
<SubscribeCard :key="element.id" :media="element" @remove="fetchData" @save="fetchData" />
|
||||||
v-if="filteredDataList.length === 0 && isRefreshed"
|
</template>
|
||||||
error-code="404"
|
</draggable>
|
||||||
error-title="没有订阅"
|
<NoDataFound
|
||||||
error-description="请通过搜索添加电影、电视剧订阅。"
|
v-if="displayList.length === 0 && isRefreshed"
|
||||||
/>
|
error-code="404"
|
||||||
</VPullToRefresh>
|
error-title="没有订阅"
|
||||||
|
error-description="请通过搜索添加电影、电视剧订阅。"
|
||||||
|
/>
|
||||||
<!-- 底部操作按钮 -->
|
<!-- 底部操作按钮 -->
|
||||||
<VFab
|
<div v-if="isRefreshed">
|
||||||
v-if="store.state.auth.superUser"
|
<VFab
|
||||||
icon="mdi-clipboard-edit"
|
v-if="store.state.auth.superUser"
|
||||||
location="bottom"
|
icon="mdi-clipboard-edit"
|
||||||
size="x-large"
|
location="bottom"
|
||||||
fixed
|
size="x-large"
|
||||||
app
|
fixed
|
||||||
appear
|
app
|
||||||
@click="subscribeEditDialog = true"
|
appear
|
||||||
:class="{ 'mb-12': appMode }"
|
@click="subscribeEditDialog = true"
|
||||||
/>
|
:class="{ 'mb-12': appMode }"
|
||||||
<VFab
|
/>
|
||||||
v-if="store.state.auth.superUser"
|
<VFab
|
||||||
icon="mdi-history"
|
v-if="store.state.auth.superUser"
|
||||||
color="info"
|
icon="mdi-history"
|
||||||
location="bottom"
|
color="info"
|
||||||
:class="appMode ? 'mb-28' : 'mb-16'"
|
location="bottom"
|
||||||
size="x-large"
|
:class="appMode ? 'mb-28' : 'mb-16'"
|
||||||
fixed
|
size="x-large"
|
||||||
app
|
fixed
|
||||||
appear
|
app
|
||||||
@click="historyDialog = true"
|
appear
|
||||||
/>
|
@click="historyDialog = true"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<!-- 订阅编辑弹窗 -->
|
<!-- 订阅编辑弹窗 -->
|
||||||
<SubscribeEditDialog
|
<SubscribeEditDialog
|
||||||
v-if="subscribeEditDialog"
|
v-if="subscribeEditDialog"
|
||||||
|
|||||||
@@ -97,6 +97,11 @@ async function fetchData({ done }: { done: any }) {
|
|||||||
done('error')
|
done('error')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 将数据从列表中移除
|
||||||
|
function removeData(id: number) {
|
||||||
|
dataList.value = dataList.value.filter(item => item.id !== id)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -106,7 +111,7 @@ async function fetchData({ done }: { done: any }) {
|
|||||||
<template #empty />
|
<template #empty />
|
||||||
<div v-if="dataList.length > 0" class="grid gap-4 grid-subscribe-card mx-3" tabindex="0">
|
<div v-if="dataList.length > 0" class="grid gap-4 grid-subscribe-card mx-3" tabindex="0">
|
||||||
<div v-for="data in dataList" :key="data.id">
|
<div v-for="data in dataList" :key="data.id">
|
||||||
<SubscribeShareCard :media="data" />
|
<SubscribeShareCard :media="data" @delete="removeData(data.id || 0)" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<NoDataFound
|
<NoDataFound
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
// 日志列表
|
// 已解析的日志列表
|
||||||
const logs = ref<string[]>([])
|
const parsedLogs = ref<{ level: string; time: string; program: string; content: string }[]>([])
|
||||||
|
|
||||||
// 表头
|
// 表头
|
||||||
const headers = [
|
const headers = [
|
||||||
@@ -13,55 +13,56 @@ const headers = [
|
|||||||
// SSE消息对象
|
// SSE消息对象
|
||||||
let eventSource: EventSource | null = null
|
let eventSource: EventSource | null = null
|
||||||
|
|
||||||
|
// 日志颜色映射表
|
||||||
|
const logColorMap: Record<string, string> = {
|
||||||
|
DEBUG: 'secondary',
|
||||||
|
INFO: 'info',
|
||||||
|
WARNING: 'warning',
|
||||||
|
ERROR: 'error',
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取日志颜色
|
||||||
|
function getLogColor(level: string): string {
|
||||||
|
return logColorMap[level] || 'secondary'
|
||||||
|
}
|
||||||
|
|
||||||
// SSE持续获取日志
|
// SSE持续获取日志
|
||||||
function startSSELogging() {
|
function startSSELogging() {
|
||||||
eventSource = new EventSource(`${import.meta.env.VITE_API_BASE_URL}system/logging`)
|
eventSource = new EventSource(`${import.meta.env.VITE_API_BASE_URL}system/logging`)
|
||||||
|
const buffer: string[] = []
|
||||||
|
let timeoutId: number | null = null
|
||||||
|
|
||||||
eventSource.addEventListener('message', event => {
|
eventSource.addEventListener('message', event => {
|
||||||
const message = event.data
|
const message = event.data
|
||||||
if (message) logs.value.push(message)
|
if (message) {
|
||||||
|
buffer.push(message)
|
||||||
|
if (!timeoutId) {
|
||||||
|
timeoutId = window.setTimeout(() => {
|
||||||
|
// 解析新日志
|
||||||
|
const newParsedLogs = buffer
|
||||||
|
.map(log => {
|
||||||
|
const logPattern = /^【(.*?)】[0-9\-:]*\s(.*?)\s-\s(.*?)\s-\s(.*)$/
|
||||||
|
const matches = log.match(logPattern)
|
||||||
|
if (matches) {
|
||||||
|
const [, level, time, program, content] = matches
|
||||||
|
return { level, time, program, content }
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
})
|
||||||
|
.filter(Boolean)
|
||||||
|
// 倒序后插入parsedLogs顶部
|
||||||
|
parsedLogs.value.unshift(...(newParsedLogs.reverse() as any[]))
|
||||||
|
// 保留最新的200条日志
|
||||||
|
parsedLogs.value = parsedLogs.value.slice(0, 200)
|
||||||
|
// 重置buffer
|
||||||
|
buffer.length = 0
|
||||||
|
timeoutId = null
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从日志中提取日志详情
|
|
||||||
function extractLogDetailsFromLogs(
|
|
||||||
logs: string[],
|
|
||||||
): { level: string; time: string; program: string; content: string }[] {
|
|
||||||
const logDetails: { level: string; time: string; program: string; content: string }[] = []
|
|
||||||
|
|
||||||
const logPattern = /^【(.*?)】[0-9\-:]*\s(.*?)\s-\s(.*?)\s-\s(.*)$/
|
|
||||||
|
|
||||||
for (const log of logs) {
|
|
||||||
const matches = RegExp(logPattern).exec(log)
|
|
||||||
if (matches && matches.length === 5) {
|
|
||||||
const [_, level, time, program, content] = matches
|
|
||||||
logDetails.unshift({ level, time, program, content })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return logDetails
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算日志颜色
|
|
||||||
function getLogColor(level: string): string {
|
|
||||||
switch (level) {
|
|
||||||
case 'DEBUG':
|
|
||||||
return 'primary'
|
|
||||||
case 'INFO':
|
|
||||||
return 'secondary'
|
|
||||||
case 'WARNING':
|
|
||||||
return 'warning'
|
|
||||||
case 'ERROR':
|
|
||||||
return 'error'
|
|
||||||
default:
|
|
||||||
return 'secondary'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 拆分日志数据计算属性
|
|
||||||
const extractLogDetails = computed(() => {
|
|
||||||
return extractLogDetailsFromLogs(logs.value)
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
startSSELogging()
|
startSSELogging()
|
||||||
})
|
})
|
||||||
@@ -72,13 +73,13 @@ onBeforeUnmount(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<LoadingBanner v-if="logs.length === 0" class="mt-12" text="正在刷新 ..." />
|
<LoadingBanner v-if="parsedLogs.length === 0" class="mt-12" text="正在刷新 ..." />
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<VTable class="table-rounded" hide-default-footer disable-sort>
|
<VTable class="table-rounded" hide-default-footer disable-sort>
|
||||||
<tbody>
|
<tbody>
|
||||||
<VDataTableVirtual
|
<VDataTableVirtual
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:items="extractLogDetails"
|
:items="parsedLogs"
|
||||||
height="100%"
|
height="100%"
|
||||||
density="compact"
|
density="compact"
|
||||||
hover
|
hover
|
||||||
@@ -94,7 +95,7 @@ onBeforeUnmount(() => {
|
|||||||
<h6 class="text-sm font-weight-medium">{{ item.program }}</h6>
|
<h6 class="text-sm font-weight-medium">{{ item.program }}</h6>
|
||||||
</template>
|
</template>
|
||||||
<template #item.content="{ item }">
|
<template #item.content="{ item }">
|
||||||
<span class="text-sm">
|
<span class="text-sm" :class="`text-${getLogColor(item.level)}`">
|
||||||
{{ item.content }}
|
{{ item.content }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -129,6 +129,26 @@ const targets = ref<Address[]>([
|
|||||||
message: '未测试',
|
message: '未测试',
|
||||||
btndisable: false,
|
btndisable: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
image: github,
|
||||||
|
name: 'api.github.com',
|
||||||
|
url: 'https://api.github.com',
|
||||||
|
proxy: true,
|
||||||
|
status: 'Normal',
|
||||||
|
time: '',
|
||||||
|
message: '未测试',
|
||||||
|
btndisable: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
image: github,
|
||||||
|
name: 'raw.githubusercontent.com',
|
||||||
|
url: 'https://raw.githubusercontent.com',
|
||||||
|
proxy: true,
|
||||||
|
status: 'Normal',
|
||||||
|
time: '',
|
||||||
|
message: '未测试',
|
||||||
|
btndisable: false,
|
||||||
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
const resolveStatusColor: Status = {
|
const resolveStatusColor: Status = {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Plugin, Subscribe } from '@/api/types'
|
import type { Plugin, Subscribe } from '@/api/types'
|
||||||
import { SystemNavMenus, UserfulMenus, SettingTabs } from '@/router/menu'
|
import { SystemNavMenus, SettingTabs } from '@/router/menu'
|
||||||
import { NavMenu } from '@/@layouts/types'
|
import { NavMenu } from '@/@layouts/types'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
|
|
||||||
@@ -272,6 +272,24 @@ onMounted(() => {
|
|||||||
</VListItem>
|
</VListItem>
|
||||||
</template>
|
</template>
|
||||||
</VHover>
|
</VHover>
|
||||||
|
<VHover>
|
||||||
|
<template #default="hover">
|
||||||
|
<VListItem
|
||||||
|
prepend-icon="mdi-movie-filter"
|
||||||
|
density="compact"
|
||||||
|
link
|
||||||
|
v-bind="hover.props"
|
||||||
|
@click="searchMedia('collection')"
|
||||||
|
>
|
||||||
|
<VListItemTitle class="break-words whitespace-break-spaces">
|
||||||
|
搜索 <span class="font-bold">{{ searchWord }} </span> 相关的【系列合集】 ...
|
||||||
|
</VListItemTitle>
|
||||||
|
<template #append>
|
||||||
|
<VIcon v-if="hover.isHovering" icon="ri-corner-down-left-line" />
|
||||||
|
</template>
|
||||||
|
</VListItem>
|
||||||
|
</template>
|
||||||
|
</VHover>
|
||||||
<VHover>
|
<VHover>
|
||||||
<template #default="hover">
|
<template #default="hover">
|
||||||
<VListItem prepend-icon="mdi-account-search" link v-bind="hover.props" @click="searchMedia('person')">
|
<VListItem prepend-icon="mdi-account-search" link v-bind="hover.props" @click="searchMedia('person')">
|
||||||
@@ -300,7 +318,7 @@ onMounted(() => {
|
|||||||
<template #default="hover">
|
<template #default="hover">
|
||||||
<VListItem prepend-icon="mdi-history" link v-bind="hover.props" @click="searchHistory">
|
<VListItem prepend-icon="mdi-history" link v-bind="hover.props" @click="searchHistory">
|
||||||
<VListItemTitle class="break-words whitespace-break-spaces">
|
<VListItemTitle class="break-words whitespace-break-spaces">
|
||||||
搜索 <span class="font-bold">{{ searchWord }}</span> 相关的【历史记录】 ...
|
搜索 <span class="font-bold">{{ searchWord }}</span> 相关的【整理记录】 ...
|
||||||
</VListItemTitle>
|
</VListItemTitle>
|
||||||
<template #append>
|
<template #append>
|
||||||
<VIcon v-if="hover.isHovering" icon="ri-corner-down-left-line" />
|
<VIcon v-if="hover.isHovering" icon="ri-corner-down-left-line" />
|
||||||
@@ -391,54 +409,6 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
<VRow v-if="superUser">
|
|
||||||
<VCol cols="12" md="6">
|
|
||||||
<p class="custom-letter-spacing text-sm text-disabled text-uppercase py-2 px-4 mb-0">常用功能</p>
|
|
||||||
<VList lines="one">
|
|
||||||
<VHover v-for="(menu, index) in UserfulMenus" :key="index">
|
|
||||||
<template #default="hover">
|
|
||||||
<VListItem
|
|
||||||
:prepend-icon="menu.icon"
|
|
||||||
density="compact"
|
|
||||||
link
|
|
||||||
v-bind="hover.props"
|
|
||||||
@click="goPage(menu.to)"
|
|
||||||
>
|
|
||||||
<VListItemTitle>
|
|
||||||
{{ menu.title }}
|
|
||||||
</VListItemTitle>
|
|
||||||
<template #append>
|
|
||||||
<VIcon v-if="hover.isHovering" icon="ri-corner-down-left-line" />
|
|
||||||
</template>
|
|
||||||
</VListItem>
|
|
||||||
</template>
|
|
||||||
</VHover>
|
|
||||||
</VList>
|
|
||||||
</VCol>
|
|
||||||
<VCol cols="12" md="6">
|
|
||||||
<p class="custom-letter-spacing text-sm text-disabled text-uppercase py-2 px-4 mb-0">常用插件</p>
|
|
||||||
<VList lines="one">
|
|
||||||
<VHover v-for="plugin in pluginItems.slice(0, 5)" :key="plugin.id">
|
|
||||||
<template #default="hover">
|
|
||||||
<VListItem
|
|
||||||
prepend-icon="mdi-puzzle"
|
|
||||||
density="compact"
|
|
||||||
link
|
|
||||||
v-bind="hover.props"
|
|
||||||
@click="showPlugin(plugin.id ?? '')"
|
|
||||||
>
|
|
||||||
<VListItemTitle> {{ plugin.plugin_name }} </VListItemTitle>
|
|
||||||
<template #append>
|
|
||||||
<VIcon v-if="hover.isHovering" icon="ri-corner-down-left-line" />
|
|
||||||
</template>
|
|
||||||
</VListItem>
|
|
||||||
</template>
|
|
||||||
</VHover>
|
|
||||||
</VList>
|
|
||||||
</VCol>
|
|
||||||
<VCol cols="12" md="6"> </VCol>
|
|
||||||
<VCol cols="12" md="6"> </VCol>
|
|
||||||
</VRow>
|
|
||||||
</VCardText>
|
</VCardText>
|
||||||
</div>
|
</div>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user