mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-09 22:15:01 +08:00
Compare commits
100 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc585a3900 | ||
|
|
973f8529c2 | ||
|
|
1ff9dc50fd | ||
|
|
065c9053da | ||
|
|
6905be1bcd | ||
|
|
a550f9616c | ||
|
|
bcee3e5373 | ||
|
|
d377ced6b6 | ||
|
|
6e0ceb093c | ||
|
|
745f99e52e | ||
|
|
7197034eda | ||
|
|
264748652f | ||
|
|
48e214564a | ||
|
|
5424e7e02a | ||
|
|
0c9c70b067 | ||
|
|
0ff24f4b09 | ||
|
|
cfa75b7643 | ||
|
|
b72ad1d78d | ||
|
|
5d1f293606 | ||
|
|
2dc0eca4aa | ||
|
|
f5808c1c81 | ||
|
|
321037477f | ||
|
|
43589c66e9 | ||
|
|
435f299a8b | ||
|
|
083db80251 | ||
|
|
92bf520cf4 | ||
|
|
ab354f21c4 | ||
|
|
c7a2c045c7 | ||
|
|
d33c8942e4 | ||
|
|
5e630097b9 | ||
|
|
3b5d03c1c8 | ||
|
|
298ae2c354 | ||
|
|
d936b68597 | ||
|
|
41471b9fd6 | ||
|
|
cc071c0911 | ||
|
|
628164d2bd | ||
|
|
999af85262 | ||
|
|
07e075ad8b | ||
|
|
18098f8aef | ||
|
|
f335b4e436 | ||
|
|
ab293edf4c | ||
|
|
88917070bf | ||
|
|
5bba5cb2bc | ||
|
|
098916bfa5 | ||
|
|
bb79aaed8b | ||
|
|
bc5c5a2835 | ||
|
|
4c11199de2 | ||
|
|
2e987701a8 | ||
|
|
4f625291a5 | ||
|
|
048f2abd87 | ||
|
|
31dea532c5 | ||
|
|
3d54e5d965 | ||
|
|
aee2a5a161 | ||
|
|
198ea0104d | ||
|
|
1abdf6d15c | ||
|
|
e5b836462f | ||
|
|
552b20b5d9 | ||
|
|
7d500aedb5 | ||
|
|
751e823b8c | ||
|
|
59d47b2b15 | ||
|
|
b1635b0715 | ||
|
|
4d778e9ca9 | ||
|
|
af433286d0 | ||
|
|
2a41e8a726 | ||
|
|
6b41f3bb64 | ||
|
|
78c178b1f6 | ||
|
|
20a6dd1aeb | ||
|
|
3773dfb4a1 | ||
|
|
e156b662a3 | ||
|
|
38193a870b | ||
|
|
e3a636772a | ||
|
|
46b043fdc7 | ||
|
|
a774ae87c2 | ||
|
|
a332a7b402 | ||
|
|
2ee4d874da | ||
|
|
4f051e5251 | ||
|
|
e4a0b29162 | ||
|
|
09234296f4 | ||
|
|
679228c8a7 | ||
|
|
a752e19878 | ||
|
|
0880c0e3b3 | ||
|
|
948e65d383 | ||
|
|
7cce57496d | ||
|
|
e54e851f61 | ||
|
|
17020cf62d | ||
|
|
0c7be28eaa | ||
|
|
0d5a183f2e | ||
|
|
c222594bea | ||
|
|
3df8bdfbf2 | ||
|
|
5722547d93 | ||
|
|
dea5ebd95d | ||
|
|
048e41c1ca | ||
|
|
5078036c51 | ||
|
|
e7a128bf0d | ||
|
|
0e46936231 | ||
|
|
d91d3ef0ef | ||
|
|
1f0dd907f9 | ||
|
|
3c555cbfca | ||
|
|
9a8e4d8600 | ||
|
|
444aaa5cdc |
222
index.html
222
index.html
@@ -1,143 +1,198 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="initial-scale=1, viewport-fit=cover, width=device-width, user-scalable=no" />
|
||||
<title>MoviePilot</title>
|
||||
<meta name="Robots" content="noindex,nofollow,noarchive" />
|
||||
<meta name="referrer" content="origin" />
|
||||
<link rel="icon" type="image/png" href="/logo.png" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<link rel="apple-touch-startup-image" href="/splash/apple-splash.jpg" />
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
||||
<link rel="manifest" href="manifest.json" crossorigin="use-credentials" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="apple-mobile-web-app-title" content="MoviePilot" />
|
||||
<meta name="description" content="MoviePilot" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="referrer" content="never" />
|
||||
<meta name="msapplication-TileColor" content="#7D34FD" />
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<meta name="theme-color" content="#28243D" media="(prefers-color-scheme: dark)" />
|
||||
<meta name="theme-color" content="#F4F5FA" media="(prefers-color-scheme: light)" />
|
||||
<meta name="HandheldFriendly" content="True" />
|
||||
<meta name="MobileOptimized" content="320" />
|
||||
<link rel="stylesheet" type="text/css" href="/loader.css" />
|
||||
</head>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="initial-scale=1, viewport-fit=cover, width=device-width, user-scalable=no" />
|
||||
<title>MoviePilot</title>
|
||||
<meta name="Robots" content="noindex,nofollow,noarchive">
|
||||
<meta name="referrer" content="origin">
|
||||
<link rel="icon" type="image/png" href="/logo.png">
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
||||
<link rel="apple-touch-startup-image" href="/splash/apple-splash.jpg">
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
|
||||
<link rel="manifest" href="manifest.json" crossorigin="use-credentials">
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="apple-mobile-web-app-title" content="MoviePilot">
|
||||
<meta name="description" content="MoviePilot">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="referrer" content="never">
|
||||
<meta name="msapplication-TileColor" content="#7D34FD" />
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<meta name="theme-color" content="#28243D" media="(prefers-color-scheme: dark)">
|
||||
<meta name="theme-color" content="#F4F5FA" media="(prefers-color-scheme: light)">
|
||||
<meta name="HandheldFriendly" content="True" />
|
||||
<meta name="MobileOptimized" content="320" />
|
||||
<link rel="stylesheet" type="text/css" href="/loader.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<body>
|
||||
<div id="loading-bg">
|
||||
<div class="loading-logo">
|
||||
<!-- Logo -->
|
||||
<svg width="100px" height="100px" viewBox="0 0 192 192" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/"
|
||||
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<svg
|
||||
width="100px"
|
||||
height="100px"
|
||||
viewBox="0 0 192 192"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
style="fill-rule: evenodd; clip-rule: evenodd; stroke-linejoin: round; stroke-miterlimit: 2"
|
||||
>
|
||||
<g transform="matrix(1,0,0,1,-2606,-236)">
|
||||
<g id="a2-c" transform="matrix(1,0,0,1,2606,236)">
|
||||
<rect x="0" y="0" width="192" height="192" style="fill:none;" />
|
||||
<rect x="0" y="0" width="192" height="192" style="fill: none" />
|
||||
<g transform="matrix(-0.800798,0.462341,-0.769972,-1.33363,1869.11,-896.718)">
|
||||
<path
|
||||
d="M2241.27,-28.175C2238.86,-28.931 2236.64,-29.181 2234.48,-29.254L2159.78,-29.286L2165.01,-11.207C2167.16,-13.121 2169.64,-13.722 2172.26,-13.808L2222.12,-13.822C2223.52,-13.824 2225,-13.701 2226.78,-13.108L2241.27,-28.175Z"
|
||||
style="fill:url(#_Linear1);" />
|
||||
style="fill: url(#_Linear1)"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-2157.67,-208.423)">
|
||||
<path
|
||||
d="M2205.67,331.428L2205.67,332.25L2205.67,352.835C2205.67,354.263 2204.91,355.583 2203.67,356.298C2202.43,357.012 2200.91,357.013 2199.67,356.3L2190.78,351.174C2189.73,350.595 2188.83,350.083 2188.03,349.59L2187.45,349.257C2186.66,348.725 2185.91,348.142 2185.21,347.461C2185.08,347.331 2184.95,347.198 2184.82,347.061C2184.26,346.457 2183.75,345.778 2183.3,344.995C2182.16,343.05 2181.69,341.024 2181.68,338.948L2181.67,268.923L2209.77,274.425C2207.5,275.639 2205.68,278.3 2205.67,281.429L2205.67,331.428Z"
|
||||
style="fill:url(#_Linear2);" />
|
||||
style="fill: url(#_Linear2)"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-2157.67,-208.423)">
|
||||
<path
|
||||
d="M2295.93,363.064C2299.48,360.882 2301.46,357.55 2301.67,352.926L2301.67,277.879L2301.67,276.775L2301.67,252.515C2301.67,251.801 2302.05,251.14 2302.67,250.783C2303.29,250.426 2304.05,250.426 2304.67,250.784L2319.81,259.54C2321.59,260.617 2322.95,262.115 2324.04,263.875C2325.03,265.551 2325.56,267.37 2325.67,269.835L2325.67,339.91C2325.18,343.645 2323.51,346.705 2320.3,348.887L2295.93,363.064ZM2295.93,363.064C2295.73,363.184 2295.53,363.301 2295.32,363.414L2295.93,363.064Z"
|
||||
style="fill:rgb(141,81,249);" />
|
||||
style="fill: rgb(141, 81, 249)"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-2157.67,-208.423)">
|
||||
<path
|
||||
d="M2295.93,363.064C2299.48,360.882 2301.46,357.55 2301.67,352.926L2301.67,277.879L2301.67,276.775L2301.67,252.515C2301.67,251.801 2302.05,251.14 2302.67,250.783C2303.29,250.426 2304.05,250.426 2304.67,250.784L2319.81,259.54C2321.59,260.617 2322.95,262.115 2324.04,263.875C2325.03,265.551 2325.56,267.37 2325.67,269.835L2325.67,339.91C2325.18,343.645 2323.51,346.705 2320.3,348.887L2295.93,363.064ZM2299.79,360.238C2299.79,360.238 2320.03,348.464 2320.04,348.461C2323.1,346.372 2324.69,343.444 2325.17,339.877C2325.17,339.877 2325.17,269.846 2325.17,269.839C2325.06,267.482 2324.56,265.739 2323.61,264.133C2322.56,262.445 2321.26,261.005 2319.55,259.97L2304.42,251.217C2303.96,250.949 2303.39,250.948 2302.92,251.216C2302.46,251.484 2302.17,251.979 2302.17,252.515L2302.17,276.775L2302.17,277.879L2302.17,352.926C2302.17,352.933 2302.17,352.941 2302.17,352.948C2302.04,355.861 2301.23,358.279 2299.79,360.238Z"
|
||||
style="fill:url(#_Linear3);" />
|
||||
style="fill: url(#_Linear3)"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-2157.67,-208.423)">
|
||||
<path
|
||||
d="M2253.67,223.256C2255.26,223.245 2257.02,223.56 2259.11,224.557L2275.67,234.102C2276.91,234.816 2277.67,236.138 2277.67,237.568L2277.67,259.508C2277.67,260.222 2277.29,260.882 2276.67,261.239C2276.05,261.597 2275.29,261.597 2274.67,261.24L2257.52,251.353C2256.38,250.731 2255.12,250.341 2253.67,250.347C2252.26,250.339 2250.99,250.721 2249.82,251.353L2187.87,287.04C2184.23,289.147 2181.96,292.478 2181.67,297.57L2181.68,269.865C2181.85,265.167 2183.93,261.653 2187.92,259.322L2248.23,224.557C2249.69,223.796 2251.5,223.29 2253.67,223.256Z"
|
||||
style="fill:rgb(165,118,255);" />
|
||||
style="fill: rgb(165, 118, 255)"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-2157.67,-208.423)">
|
||||
<path
|
||||
d="M2253.67,223.256C2255.26,223.245 2257.02,223.56 2259.11,224.557L2275.67,234.102C2276.91,234.816 2277.67,236.138 2277.67,237.568L2277.67,259.508C2277.67,260.222 2277.29,260.882 2276.67,261.239C2276.05,261.597 2275.29,261.597 2274.67,261.24L2257.52,251.353C2256.38,250.731 2255.12,250.341 2253.67,250.347C2252.26,250.339 2250.99,250.721 2249.82,251.353L2187.87,287.04C2184.23,289.147 2181.96,292.478 2181.67,297.57L2181.68,269.865C2181.85,265.167 2183.93,261.653 2187.92,259.322L2248.23,224.557C2249.69,223.796 2251.5,223.29 2253.67,223.256ZM2253.68,223.756C2251.6,223.789 2249.87,224.269 2248.47,224.996L2188.17,259.754C2184.35,261.992 2182.35,265.367 2182.18,269.874C2182.18,269.874 2182.17,292.759 2182.17,292.757C2183.25,290.047 2185.13,288.051 2187.62,286.607L2249.57,250.919C2249.58,250.917 2249.58,250.915 2249.59,250.913C2250.83,250.243 2252.17,249.839 2253.67,249.847C2255.21,249.841 2256.54,250.253 2257.76,250.914C2257.76,250.916 2257.76,250.917 2257.76,250.919L2274.92,260.807C2275.38,261.075 2275.95,261.074 2276.42,260.806C2276.88,260.538 2277.17,260.043 2277.17,259.508L2277.17,237.568C2277.17,236.317 2276.5,235.16 2275.42,234.535C2275.42,234.535 2258.88,225 2258.87,224.996C2256.87,224.049 2255.2,223.746 2253.68,223.756Z"
|
||||
style="fill:url(#_Linear4);" />
|
||||
style="fill: url(#_Linear4)"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(0.800798,0.462341,0.769972,-1.33363,-1677.22,-896.858)">
|
||||
<path
|
||||
d="M2241.55,-28.184C2239.1,-28.989 2236.83,-29.204 2234.68,-29.295C2234.68,-29.295 2220.82,-29.3 2215.03,-29.303C2213.48,-29.303 2212.05,-28.808 2211.28,-28.004C2208.65,-25.275 2202.56,-18.936 2199.45,-15.709C2199.07,-15.306 2199.07,-14.809 2199.46,-14.406C2199.85,-14.004 2200.57,-13.758 2201.34,-13.761C2208.36,-13.788 2222.72,-13.845 2222.72,-13.845C2223.98,-13.851 2225.44,-13.657 2227.06,-13.117L2241.55,-28.184Z"
|
||||
style="fill:rgb(141,81,249);" />
|
||||
style="fill: rgb(141, 81, 249)"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(-4.32309,0,0,12.4454,9610.35,-1450.35)">
|
||||
<path
|
||||
d="M2205.31,121.966C2205.31,121.88 2205.18,121.8 2204.96,121.757C2204.74,121.714 2204.48,121.714 2204.27,121.757C2201.75,122.263 2195.36,123.547 2192.85,124.052C2192.63,124.095 2192.5,124.174 2192.5,124.261C2192.5,124.347 2192.63,124.426 2192.85,124.469C2195.36,124.974 2201.75,126.255 2204.27,126.759C2204.48,126.802 2204.74,126.802 2204.96,126.759C2205.18,126.716 2205.31,126.636 2205.31,126.55C2205.31,125.541 2205.31,122.976 2205.31,121.966Z"
|
||||
style="fill:rgb(104,0,197);" />
|
||||
style="fill: rgb(104, 0, 197)"
|
||||
/>
|
||||
<clipPath id="_clip5">
|
||||
<path
|
||||
d="M2205.31,121.966C2205.31,121.88 2205.18,121.8 2204.96,121.757C2204.74,121.714 2204.48,121.714 2204.27,121.757C2201.75,122.263 2195.36,123.547 2192.85,124.052C2192.63,124.095 2192.5,124.174 2192.5,124.261C2192.5,124.347 2192.63,124.426 2192.85,124.469C2195.36,124.974 2201.75,126.255 2204.27,126.759C2204.48,126.802 2204.74,126.802 2204.96,126.759C2205.18,126.716 2205.31,126.636 2205.31,126.55C2205.31,125.541 2205.31,122.976 2205.31,121.966Z" />
|
||||
d="M2205.31,121.966C2205.31,121.88 2205.18,121.8 2204.96,121.757C2204.74,121.714 2204.48,121.714 2204.27,121.757C2201.75,122.263 2195.36,123.547 2192.85,124.052C2192.63,124.095 2192.5,124.174 2192.5,124.261C2192.5,124.347 2192.63,124.426 2192.85,124.469C2195.36,124.974 2201.75,126.255 2204.27,126.759C2204.48,126.802 2204.74,126.802 2204.96,126.759C2205.18,126.716 2205.31,126.636 2205.31,126.55C2205.31,125.541 2205.31,122.976 2205.31,121.966Z"
|
||||
/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#_clip5)">
|
||||
<g transform="matrix(0.124502,0.074907,0.206623,-0.0414384,1997.62,-7.40235)">
|
||||
<path
|
||||
d="M1726.17,-64.249L1708.16,-72.303L1708.05,-23.514L1721.88,-32.386C1722.96,-33.241 1723.09,-33.944 1723.15,-34.636L1723.15,-54.373C1723.19,-56.238 1724.96,-57.594 1726.87,-56.686L1726.17,-64.249Z"
|
||||
style="fill:url(#_Linear6);" />
|
||||
style="fill: url(#_Linear6)"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(-0.126036,0.0767377,0.569859,0.112933,2435.01,-3.09225)">
|
||||
<path
|
||||
d="M1726.17,-45.661L1704.47,-40.254C1706.28,-40.527 1708.14,-40.212 1708.16,-39.416L1708.16,-18.976L1726.17,-18.976L1726.17,-45.661Z"
|
||||
style="fill:rgb(141,81,249);" />
|
||||
style="fill: rgb(141, 81, 249)"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(-0.126036,0.0767377,0.569859,0.112933,2435.01,-3.09225)">
|
||||
<path
|
||||
d="M1726.17,-45.661L1726.17,-18.976L1708.16,-18.976L1708.16,-39.416C1707.79,-40.732 1704.5,-40.298 1702.68,-40.025L1726.17,-45.661ZM1705.49,-40.491C1706.2,-40.507 1706.87,-40.464 1707.4,-40.327C1708.01,-40.173 1708.48,-39.899 1708.62,-39.436C1708.62,-39.429 1708.62,-39.423 1708.62,-39.416L1708.62,-19.152C1708.62,-19.152 1725.72,-19.152 1725.72,-19.152L1725.72,-45.345L1705.49,-40.491Z"
|
||||
style="fill:url(#_Radial7);" />
|
||||
style="fill: url(#_Radial7)"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-70.0711,-0.927611,1.54482,-42.0752,2233.59,-20.1891)">
|
||||
<stop offset="0" style="stop-color:rgb(141,81,249);stop-opacity:1" />
|
||||
<stop offset="1" style="stop-color:rgb(116,50,223);stop-opacity:1" />
|
||||
<linearGradient
|
||||
id="_Linear1"
|
||||
x1="0"
|
||||
y1="0"
|
||||
x2="1"
|
||||
y2="0"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-70.0711,-0.927611,1.54482,-42.0752,2233.59,-20.1891)"
|
||||
>
|
||||
<stop offset="0" style="stop-color: rgb(141, 81, 249); stop-opacity: 1" />
|
||||
<stop offset="1" style="stop-color: rgb(116, 50, 223); stop-opacity: 1" />
|
||||
</linearGradient>
|
||||
<linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(4.78193e-15,-78.0949,78.0949,4.78193e-15,2195.72,354.021)">
|
||||
<stop offset="0" style="stop-color:rgb(141,81,249);stop-opacity:1" />
|
||||
<stop offset="1" style="stop-color:rgb(116,50,223);stop-opacity:1" />
|
||||
<linearGradient
|
||||
id="_Linear2"
|
||||
x1="0"
|
||||
y1="0"
|
||||
x2="1"
|
||||
y2="0"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(4.78193e-15,-78.0949,78.0949,4.78193e-15,2195.72,354.021)"
|
||||
>
|
||||
<stop offset="0" style="stop-color: rgb(141, 81, 249); stop-opacity: 1" />
|
||||
<stop offset="1" style="stop-color: rgb(116, 50, 223); stop-opacity: 1" />
|
||||
</linearGradient>
|
||||
<linearGradient id="_Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(41.6089,41.5866,-41.5866,41.6089,2282.31,262.837)">
|
||||
<stop offset="0" style="stop-color:rgb(211,187,255);stop-opacity:1" />
|
||||
<stop offset="1" style="stop-color:rgb(211,187,255);stop-opacity:0" />
|
||||
<linearGradient
|
||||
id="_Linear3"
|
||||
x1="0"
|
||||
y1="0"
|
||||
x2="1"
|
||||
y2="0"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(41.6089,41.5866,-41.5866,41.6089,2282.31,262.837)"
|
||||
>
|
||||
<stop offset="0" style="stop-color: rgb(211, 187, 255); stop-opacity: 1" />
|
||||
<stop offset="1" style="stop-color: rgb(211, 187, 255); stop-opacity: 0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="_Linear4" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(9.25616,16.7005,-16.7005,9.25616,2215,243.712)">
|
||||
<stop offset="0" style="stop-color:rgb(211,187,255);stop-opacity:1" />
|
||||
<stop offset="1" style="stop-color:rgb(211,187,255);stop-opacity:0" />
|
||||
<linearGradient
|
||||
id="_Linear4"
|
||||
x1="0"
|
||||
y1="0"
|
||||
x2="1"
|
||||
y2="0"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(9.25616,16.7005,-16.7005,9.25616,2215,243.712)"
|
||||
>
|
||||
<stop offset="0" style="stop-color: rgb(211, 187, 255); stop-opacity: 1" />
|
||||
<stop offset="1" style="stop-color: rgb(211, 187, 255); stop-opacity: 0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="_Linear6" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.130164,-61.9937,59.4003,-0.135847,1711.63,-25.7957)">
|
||||
<stop offset="0" style="stop-color:rgb(116,50,223);stop-opacity:1" />
|
||||
<stop offset="0.51" style="stop-color:rgb(110,38,217);stop-opacity:1" />
|
||||
<stop offset="1" style="stop-color:rgb(91,0,197);stop-opacity:1" />
|
||||
<linearGradient
|
||||
id="_Linear6"
|
||||
x1="0"
|
||||
y1="0"
|
||||
x2="1"
|
||||
y2="0"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.130164,-61.9937,59.4003,-0.135847,1711.63,-25.7957)"
|
||||
>
|
||||
<stop offset="0" style="stop-color: rgb(116, 50, 223); stop-opacity: 1" />
|
||||
<stop offset="0.51" style="stop-color: rgb(110, 38, 217); stop-opacity: 1" />
|
||||
<stop offset="1" style="stop-color: rgb(91, 0, 197); stop-opacity: 1" />
|
||||
</linearGradient>
|
||||
<radialGradient id="_Radial7" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(13.8659,4.71436,-12.1609,5.37534,1708.16,-32.287)">
|
||||
<stop offset="0" style="stop-color:rgb(211,187,255);stop-opacity:1" />
|
||||
<stop offset="1" style="stop-color:rgb(211,187,255);stop-opacity:0" />
|
||||
<radialGradient
|
||||
id="_Radial7"
|
||||
cx="0"
|
||||
cy="0"
|
||||
r="1"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(13.8659,4.71436,-12.1609,5.37534,1708.16,-32.287)"
|
||||
>
|
||||
<stop offset="0" style="stop-color: rgb(211, 187, 255); stop-opacity: 1" />
|
||||
<stop offset="1" style="stop-color: rgb(211, 187, 255); stop-opacity: 0" />
|
||||
</radialGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
<div class="loading">
|
||||
<div class="effect-1 effects"></div>
|
||||
@@ -145,18 +200,15 @@
|
||||
<div class="effect-3 effects"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
<script>
|
||||
const loaderColor = localStorage.getItem('materio-initial-loader-bg') || '#FFFFFF'
|
||||
const primaryColor = localStorage.getItem('materio-initial-loader-color') || '#9155FD'
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
<script>
|
||||
const loaderColor = localStorage.getItem('materio-initial-loader-bg') || '#FFFFFF'
|
||||
const primaryColor = localStorage.getItem('materio-initial-loader-color') || '#9155FD'
|
||||
|
||||
if (loaderColor)
|
||||
document.documentElement.style.setProperty('--initial-loader-bg', loaderColor)
|
||||
if (loaderColor) document.documentElement.style.setProperty('--initial-loader-bg', loaderColor)
|
||||
|
||||
if (primaryColor)
|
||||
document.documentElement.style.setProperty('--initial-loader-color', primaryColor)
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
if (primaryColor) document.documentElement.style.setProperty('--initial-loader-color', primaryColor)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "moviepilot",
|
||||
"version": "1.1.7",
|
||||
"version": "1.2.7",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --host",
|
||||
|
||||
@@ -11,10 +11,11 @@ html {
|
||||
|
||||
#loading-bg {
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
display: block;
|
||||
background: var(--initial-loader-bg, #fff);
|
||||
block-size: 100%;
|
||||
inline-size: 100%;
|
||||
block-size: 100vh;
|
||||
inline-size: 100vw;
|
||||
}
|
||||
|
||||
.loading-logo {
|
||||
@@ -82,4 +83,4 @@ html {
|
||||
opacity: 1;
|
||||
transform: rotate(1turn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
public/plugin/clean.png
Normal file
BIN
public/plugin/clean.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
BIN
public/plugin/downloadmsg.png
Normal file
BIN
public/plugin/downloadmsg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -17,7 +17,6 @@
|
||||
// ℹ️ This mixin is inspired from vuetify for adding hover styles via before pseudo element
|
||||
@mixin before-pseudo() {
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
background: currentcolor;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
// ℹ️ This mixin is inspired from vuetify for adding hover styles via before pseudo element
|
||||
@mixin before-pseudo() {
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
border-radius: inherit;
|
||||
|
||||
@@ -33,3 +33,11 @@ $ps-track-size: 0.5rem;
|
||||
.ps__thumb-y {
|
||||
background-color: rgb(var(--v-theme-perfect-scrollbar-thumb)) !important;
|
||||
}
|
||||
|
||||
// fix bug
|
||||
@media(hover: none) {
|
||||
.ps > .ps__rail-x,
|
||||
.ps > .ps__rail-y {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export default defineComponent({
|
||||
<style scoped>
|
||||
* {
|
||||
backface-visibility: hidden;
|
||||
perspective: 1000px;
|
||||
perspective: 62.5rem;
|
||||
transform: translateZ(0);
|
||||
will-change: block-size;
|
||||
}
|
||||
|
||||
@@ -15,13 +15,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
})
|
||||
|
||||
const { mdAndDown } = useDisplay()
|
||||
|
||||
const refNav = ref()
|
||||
|
||||
/*
|
||||
ℹ️ Close overlay side when route is changed
|
||||
Close overlay vertical nav when link is clicked
|
||||
*/
|
||||
const route = useRoute()
|
||||
|
||||
watch(
|
||||
@@ -31,9 +25,11 @@ watch(
|
||||
},
|
||||
)
|
||||
|
||||
// 是否滚动
|
||||
const isVerticalNavScrolled = ref(false)
|
||||
const updateIsVerticalNavScrolled = (val: boolean) => (isVerticalNavScrolled.value = val)
|
||||
|
||||
// 滚动响应
|
||||
function handleNavScroll(evt: Event) {
|
||||
isVerticalNavScrolled.value = (evt.target as HTMLElement).scrollTop > 0
|
||||
}
|
||||
@@ -83,9 +79,12 @@ function handleNavScroll(evt: Event) {
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
@use "@configured-variables" as variables;
|
||||
@use "@layouts/styles/mixins";
|
||||
@use '@configured-variables' as variables;
|
||||
@use '@layouts/styles/mixins';
|
||||
|
||||
.visible {
|
||||
visibility: visible !important;
|
||||
}
|
||||
// 👉 Vertical Nav
|
||||
.layout-vertical-nav {
|
||||
position: fixed;
|
||||
@@ -98,6 +97,11 @@ function handleNavScroll(evt: Event) {
|
||||
inset-inline-start: 0;
|
||||
transition: transform 0.25s ease-in-out, inline-size 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
|
||||
will-change: transform, inline-size;
|
||||
visibility: hidden;
|
||||
|
||||
&:not(.overlay-nav) {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.nav-header {
|
||||
display: flex;
|
||||
|
||||
@@ -7,9 +7,6 @@ import store from './store'
|
||||
const { global: globalTheme } = useTheme()
|
||||
globalTheme.name.value = localStorage.getItem('theme') || 'light'
|
||||
|
||||
// 路由
|
||||
const route = useRoute()
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
@@ -41,6 +38,6 @@ onBeforeMount(async () => {
|
||||
|
||||
<template>
|
||||
<VApp>
|
||||
<RouterView :key="route.fullPath" />
|
||||
<RouterView />
|
||||
</VApp>
|
||||
</template>
|
||||
|
||||
@@ -832,6 +832,7 @@ export interface NotificationSwitch {
|
||||
wechat: boolean
|
||||
telegram: boolean
|
||||
slack: boolean
|
||||
synologychat: boolean
|
||||
}
|
||||
|
||||
// 环境设置
|
||||
@@ -840,55 +841,6 @@ export interface Setting {
|
||||
DOWNLOAD_PATH: string
|
||||
}
|
||||
|
||||
// 自定义订阅
|
||||
export interface Rss {
|
||||
id?: number
|
||||
// 名称
|
||||
name?: string
|
||||
// RSS地址
|
||||
url?: string
|
||||
// 类型
|
||||
type?: string
|
||||
// 标题
|
||||
title?: string
|
||||
// 年份
|
||||
year?: string
|
||||
// TMDBID
|
||||
tmdbid?: number
|
||||
// 季号
|
||||
season?: number
|
||||
// 海报
|
||||
poster?: string
|
||||
// 背景图
|
||||
backdrop?: string
|
||||
// 评分
|
||||
vote?: number
|
||||
// 简介
|
||||
description?: string
|
||||
// 总集数
|
||||
total_episode?: number
|
||||
// 包含
|
||||
include?: string
|
||||
// 排除
|
||||
exclude?: string
|
||||
// 洗版
|
||||
best_version?: number
|
||||
// 是否使用代理服务器
|
||||
proxy?: number
|
||||
// 是否使用过滤规则
|
||||
filter?: boolean
|
||||
// 保存路径
|
||||
save_path?: string
|
||||
// 已处理数量
|
||||
processed?: number
|
||||
// 附加信息
|
||||
note?: string
|
||||
// 最后更新时间
|
||||
last_update?: string
|
||||
// 状态 0-停用,1-启用
|
||||
state?: number
|
||||
}
|
||||
|
||||
// 文件浏览接口
|
||||
export interface EndPoints {
|
||||
list: any
|
||||
|
||||
@@ -2,19 +2,30 @@
|
||||
// 输入参数
|
||||
const props = defineProps({
|
||||
pri: String,
|
||||
maxpri: String,
|
||||
rules: Array as PropType<string[]>,
|
||||
width: String,
|
||||
height: String,
|
||||
})
|
||||
|
||||
// 定义触发的自定义事件
|
||||
const emit = defineEmits(['close', 'changed'])
|
||||
const emit = defineEmits(['close', 'changed', 'levelup', 'leveldown'])
|
||||
|
||||
// 按钮点击
|
||||
function onClose() {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
// 上升优先级
|
||||
function onLevelUp() {
|
||||
emit('levelup', props.pri)
|
||||
}
|
||||
|
||||
// 下降优先级
|
||||
function onLevelDown() {
|
||||
emit('leveldown', props.pri)
|
||||
}
|
||||
|
||||
// 选项变化
|
||||
function filtersChanged(value: string[]) {
|
||||
emit('changed', props.pri, value)
|
||||
@@ -54,6 +65,20 @@ const selectFilterOptions = ref<{ [key: string]: string }[]>([
|
||||
|
||||
<template>
|
||||
<VCard variant="tonal" :width="props.width" :height="props.height">
|
||||
<span class="absolute top-3 right-14">
|
||||
<IconBtn
|
||||
v-if="props.pri !== '1'"
|
||||
@click.stop="onLevelUp"
|
||||
>
|
||||
<VIcon icon="mdi-arrow-up" />
|
||||
</IconBtn>
|
||||
<IconBtn
|
||||
v-if="props.pri !== props.maxpri"
|
||||
@click.stop="onLevelDown"
|
||||
>
|
||||
<VIcon icon="mdi-arrow-down" />
|
||||
</IconBtn>
|
||||
</span>
|
||||
<DialogCloseBtn @click="onClose" />
|
||||
<VCardItem>
|
||||
<VCardTitle>优先级 {{ props.pri }}</VCardTitle>
|
||||
|
||||
@@ -112,7 +112,7 @@ async function addSubscribe(season = 0) {
|
||||
// 全部存在时洗版
|
||||
best_version = !seasonsNotExisted.value[season] ? 1 : 0
|
||||
// 请求API
|
||||
const result: { [key: string]: any } = await api.post('subscribe', {
|
||||
const result: { [key: string]: any } = await api.post('subscribe/', {
|
||||
name: props.media?.title,
|
||||
type: props.media?.type,
|
||||
year: props.media?.year,
|
||||
@@ -360,14 +360,6 @@ onBeforeMount(() => {
|
||||
handleCheckExists()
|
||||
})
|
||||
|
||||
// 订阅季表头
|
||||
const seasonsHeaders = [
|
||||
{ title: '季', key: 'title', sortable: false },
|
||||
{ title: '集数', key: 'episodes', sortable: false },
|
||||
{ title: '评分', key: 'vote', sortable: false },
|
||||
{ title: '状态', key: 'status', sortable: false },
|
||||
]
|
||||
|
||||
// 计算图片地址
|
||||
const getImgUrl: Ref<string> = computed(() => {
|
||||
if (imageLoadError.value)
|
||||
@@ -379,6 +371,28 @@ const getImgUrl: Ref<string> = computed(() => {
|
||||
|
||||
return url
|
||||
})
|
||||
|
||||
// 拼装季图片地址
|
||||
function getSeasonPoster(posterPath: string) {
|
||||
if (!posterPath)
|
||||
return ''
|
||||
return `https://image.tmdb.org/t/p/w500${posterPath}`
|
||||
}
|
||||
|
||||
// 将yyyy-mm-dd转换为yyyy年mm月dd日
|
||||
function formatAirDate(airDate: string) {
|
||||
if (!airDate)
|
||||
return ''
|
||||
const date = new Date(airDate)
|
||||
return `${date.getFullYear()}年${date.getMonth() + 1}月${date.getDate()}日`
|
||||
}
|
||||
// 从yyyy-mm-dd中提取年份
|
||||
function getYear(airDate: string) {
|
||||
if (!airDate)
|
||||
return ''
|
||||
const date = new Date(airDate)
|
||||
return date.getFullYear()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -460,72 +474,89 @@ const getImgUrl: Ref<string> = computed(() => {
|
||||
</VCard>
|
||||
</template>
|
||||
</VHover>
|
||||
<VDialog
|
||||
<!-- 订阅季弹窗 -->
|
||||
<VBottomSheet
|
||||
v-model="subscribeSeasonDialog"
|
||||
max-width="50rem"
|
||||
content-class="whitespace-nowrap"
|
||||
inset
|
||||
scrollable
|
||||
>
|
||||
<!-- Dialog Content -->
|
||||
<VCard title="选择订阅季">
|
||||
<VCardText style="padding: 0;">
|
||||
<VDataTable
|
||||
v-model="seasonsSelected"
|
||||
:headers="seasonsHeaders"
|
||||
:items="seasonInfos"
|
||||
item-value="season_number"
|
||||
return-object
|
||||
fixed-header
|
||||
show-select
|
||||
:items-per-page="100"
|
||||
density="compact"
|
||||
height="auto"
|
||||
<VCard>
|
||||
<DialogCloseBtn @click="subscribeSeasonDialog = false" />
|
||||
<VCardTitle class="pe-10">
|
||||
订阅 - {{ props.media?.title }}
|
||||
</VCardTitle>
|
||||
<VCardText>
|
||||
<VList
|
||||
v-model:selected="seasonsSelected"
|
||||
lines="three"
|
||||
select-strategy="classic"
|
||||
>
|
||||
<template #item.title="{ item }">
|
||||
<span class="d-block whitespace-nowrap">第 {{ item.raw.season_number }} 季
|
||||
</span>
|
||||
</template>
|
||||
<template #item.episodes="{ item }">
|
||||
<VChip
|
||||
variant="outlined"
|
||||
size="small"
|
||||
>
|
||||
{{ item.raw.episode_count }}
|
||||
</VChip>
|
||||
</template>
|
||||
<template #item.vote="{ item }">
|
||||
{{ item.raw.vote_average }}
|
||||
</template>
|
||||
<template #item.status="{ item }">
|
||||
<VChip
|
||||
v-if="seasonsNotExisted"
|
||||
:color="getExistColor(item.raw.season_number)"
|
||||
flat
|
||||
size="small"
|
||||
>
|
||||
{{ getExistText(item.raw.season_number) }}
|
||||
</VChip>
|
||||
</template>
|
||||
<template #no-data>
|
||||
没有数据
|
||||
</template>
|
||||
<template #bottom />
|
||||
</VDataTable>
|
||||
<VListItem
|
||||
v-for="(item, i) in seasonInfos" :key="i"
|
||||
:value="item"
|
||||
>
|
||||
<template #prepend>
|
||||
<VImg
|
||||
height="90"
|
||||
width="60"
|
||||
:src="getSeasonPoster(item.poster_path || '')"
|
||||
aspect-ratio="2/3"
|
||||
class="object-cover rounded shadow ring-gray-500 me-3"
|
||||
cover
|
||||
>
|
||||
<template #placeholder>
|
||||
<div class="w-full h-full">
|
||||
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
|
||||
</div>
|
||||
</template>
|
||||
</VImg>
|
||||
</template>
|
||||
<VListItemTitle>
|
||||
第 {{ item.season_number }} 季
|
||||
</VListItemTitle>
|
||||
<VListItemSubtitle class="mt-1 me-2">
|
||||
<VChip
|
||||
v-if="item.vote_average"
|
||||
color="primary"
|
||||
size="small"
|
||||
class="mb-1"
|
||||
>
|
||||
<VIcon icon="mdi-star" /> {{ item.vote_average }}
|
||||
</VChip>
|
||||
{{ getYear(item.air_date || '') }} • {{ item.episode_count }} 集
|
||||
</VListItemSubtitle>
|
||||
<VListItemSubtitle>
|
||||
《{{ media?.title }}》第 {{ item.season_number }} 季于 {{ formatAirDate(item.air_date || '') }} 首播。
|
||||
</VListItemSubtitle>
|
||||
<VListItemSubtitle>
|
||||
<VChip
|
||||
v-if="seasonsNotExisted"
|
||||
class="mt-2"
|
||||
size="small"
|
||||
:color="getExistColor(item.season_number || 0)"
|
||||
>
|
||||
{{ getExistText(item.season_number || 0) }}
|
||||
</VChip>
|
||||
</VListItemSubtitle>
|
||||
<template #append="{ isSelected }">
|
||||
<VListItemAction start>
|
||||
<VSwitch :model-value="isSelected" />
|
||||
</VListItemAction>
|
||||
</template>
|
||||
</VListItem>
|
||||
</VList>
|
||||
</VCardText>
|
||||
<VCardActions>
|
||||
<VBtn @click="subscribeSeasonDialog = false">
|
||||
取消
|
||||
</VBtn>
|
||||
<VSpacer />
|
||||
<div class="my-2 text-center">
|
||||
<VBtn
|
||||
:disabled="seasonsSelected.length === 0"
|
||||
width="30%"
|
||||
@click="subscribeSeasons"
|
||||
@keydown.enter="subscribeSeasons"
|
||||
>
|
||||
确定
|
||||
{{ seasonsSelected.length === 0 ? '请选择订阅季' : '提交订阅' }}
|
||||
</VBtn>
|
||||
</VCardActions>
|
||||
</div>
|
||||
</VCard>
|
||||
</VDialog>
|
||||
</VBottomSheet>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -53,7 +53,7 @@ async function installPlugin() {
|
||||
:style="{ background: `${props.plugin?.plugin_color}` }"
|
||||
>
|
||||
<VAvatar
|
||||
size="128"
|
||||
size="8rem"
|
||||
:class="{ shadow: isImageLoaded }"
|
||||
>
|
||||
<VImg
|
||||
|
||||
@@ -148,7 +148,7 @@ const dropdownItems = ref([
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '插件配置',
|
||||
title: '配置',
|
||||
value: 2,
|
||||
show: true,
|
||||
props: {
|
||||
@@ -157,7 +157,7 @@ const dropdownItems = ref([
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '卸载插件',
|
||||
title: '卸载',
|
||||
value: 3,
|
||||
show: true,
|
||||
props: {
|
||||
@@ -212,7 +212,7 @@ const dropdownItems = ref([
|
||||
</IconBtn>
|
||||
</div>
|
||||
<VAvatar
|
||||
size="128"
|
||||
size="8rem"
|
||||
:class="{ shadow: isImageLoaded }"
|
||||
>
|
||||
<VImg
|
||||
@@ -236,11 +236,11 @@ const dropdownItems = ref([
|
||||
<!-- 插件配置页面 -->
|
||||
<VDialog
|
||||
v-model="pluginConfigDialog"
|
||||
max-width="800"
|
||||
max-width="50rem"
|
||||
scrollable
|
||||
persistent
|
||||
>
|
||||
<VCard :title="props.plugin?.plugin_name">
|
||||
<VCard :title="`${props.plugin?.plugin_name} - 配置`">
|
||||
<DialogCloseBtn @click="pluginConfigDialog = false" />
|
||||
<VCardText>
|
||||
<FormRender
|
||||
@@ -252,7 +252,7 @@ const dropdownItems = ref([
|
||||
</VCardText>
|
||||
<VCardActions>
|
||||
<VBtn v-if="pluginPageItems.length > 0" @click="showPluginInfo">
|
||||
详情
|
||||
查看详情
|
||||
</VBtn>
|
||||
<VSpacer />
|
||||
<VBtn @click="savePluginConf">
|
||||
@@ -265,11 +265,11 @@ const dropdownItems = ref([
|
||||
<!-- 插件详情页面 -->
|
||||
<VDialog
|
||||
v-model="pluginInfoDialog"
|
||||
max-width="1000"
|
||||
max-width="62.5rem"
|
||||
scrollable
|
||||
persistent
|
||||
>
|
||||
<VCard :title="`${props.plugin?.plugin_name} - 详情`">
|
||||
<VCard :title="`${props.plugin?.plugin_name}`">
|
||||
<DialogCloseBtn @click="pluginInfoDialog = false" />
|
||||
<VCardText>
|
||||
<PageRender
|
||||
|
||||
@@ -1,594 +0,0 @@
|
||||
<script lang="ts" setup>
|
||||
import { useToast } from 'vue-toast-notification'
|
||||
import { calculateTimeDifference } from '@/@core/utils'
|
||||
import { formatFileSize, formatSeason } from '@/@core/utils/formatters'
|
||||
import api from '@/api'
|
||||
import type { Rss, Site, TorrentInfo } from '@/api/types'
|
||||
|
||||
// 输入参数
|
||||
const props = defineProps({
|
||||
media: Object as PropType<Rss>,
|
||||
})
|
||||
|
||||
// 定义触发的自定义事件
|
||||
const emit = defineEmits(['remove', 'save'])
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
// 图片是否加载完成
|
||||
const imageLoaded = ref(false)
|
||||
|
||||
// 订阅弹窗
|
||||
const rssInfoDialog = ref(false)
|
||||
|
||||
// RSS预览窗口
|
||||
const rssPreviewDialog = ref(false)
|
||||
|
||||
// 加载状态
|
||||
const previewLoading = ref(false)
|
||||
|
||||
// 总条数
|
||||
const previewTotalItems = ref(0)
|
||||
|
||||
// 每页条数
|
||||
const previewItemsPerPage = ref(25)
|
||||
|
||||
// 预览表头
|
||||
const previewHeaders = [
|
||||
{ title: '标题', key: 'title', sortable: true },
|
||||
{ title: '时间', key: 'pubdate', sortable: true },
|
||||
{ title: '大小', key: 'size', sortable: true },
|
||||
{ title: '', key: 'actions', sortable: false },
|
||||
]
|
||||
|
||||
// 预览数据
|
||||
const previewDataList = ref<TorrentInfo[]>([])
|
||||
|
||||
// 站点名称
|
||||
const siteName = ref('')
|
||||
|
||||
// 订阅编辑表单
|
||||
const rssForm = reactive<any>(props.media ?? {})
|
||||
|
||||
// 类型转换
|
||||
rssForm.best_version = rssForm.best_version === 1
|
||||
rssForm.proxy = rssForm.proxy === 1
|
||||
rssForm.filter = rssForm.filter === 1
|
||||
|
||||
// 上一次更新时间
|
||||
const lastUpdateText = ref(
|
||||
`${
|
||||
props.media?.last_update
|
||||
? `${calculateTimeDifference(props.media?.last_update || '')}前`
|
||||
: ''
|
||||
}`,
|
||||
)
|
||||
|
||||
// 图片加载完成响应
|
||||
function imageLoadHandler() {
|
||||
imageLoaded.value = true
|
||||
}
|
||||
|
||||
// 根据 type 返回不同的图标
|
||||
function getIcon() {
|
||||
if (props.media?.type === '电影')
|
||||
return 'mdi-movie'
|
||||
else if (props.media?.type === '电视剧')
|
||||
return 'mdi-television-classic'
|
||||
else
|
||||
return 'mdi-help-circle'
|
||||
}
|
||||
|
||||
// 计算文本颜色
|
||||
function getTextColor() {
|
||||
return imageLoaded.value ? 'white' : ''
|
||||
}
|
||||
|
||||
// 计算文本类
|
||||
function getTextClass() {
|
||||
return imageLoaded.value ? 'text-white' : ''
|
||||
}
|
||||
|
||||
// 删除订阅
|
||||
async function removerRss() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.delete(
|
||||
`rss/${props.media?.id}`,
|
||||
)
|
||||
|
||||
if (result.success) {
|
||||
// 通知父组件刷新
|
||||
emit('remove')
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
// 调用API修改订阅
|
||||
async function updateRssInfo() {
|
||||
rssInfoDialog.value = false
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.put('rss', rssForm)
|
||||
|
||||
// 提示
|
||||
if (result.success) {
|
||||
$toast.success(`${props.media?.name} 更新成功!`)
|
||||
// 通知父组件刷新
|
||||
emit('remove')
|
||||
}
|
||||
else { $toast.error(`${props.media?.name} 更新失败:${result.message}!`) }
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
// 查询站点名称
|
||||
async function querySiteName() {
|
||||
try {
|
||||
const result: Site = await api.get(
|
||||
`site/domain/${props.media?.url?.split('/')[2]}`,
|
||||
)
|
||||
|
||||
if (result)
|
||||
siteName.value = result.name
|
||||
}
|
||||
catch (e) {
|
||||
// 截取URL中的主域名作为站点名称
|
||||
siteName.value = props.media?.url?.split('/')[2] ?? '未知'
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
// 预览按钮响应
|
||||
async function handleRssPreview() {
|
||||
rssPreviewDialog.value = true
|
||||
previewLoading.value = true
|
||||
await previewRss()
|
||||
previewLoading.value = false
|
||||
}
|
||||
|
||||
// 预览站点RSS
|
||||
async function previewRss() {
|
||||
try {
|
||||
const result: TorrentInfo[] = await api.get(
|
||||
`rss/preview/${props.media?.id}`,
|
||||
)
|
||||
previewDataList.value = result
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
// 编辑订阅响应
|
||||
async function editRssDialog() {
|
||||
rssInfoDialog.value = true
|
||||
}
|
||||
|
||||
// 刷新按钮响应
|
||||
async function refreshRss() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get(
|
||||
`rss/refresh/${props.media?.id}`,
|
||||
)
|
||||
|
||||
if (result.success)
|
||||
$toast.success(`${props.media?.name} 已提交刷新任务!`)
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
// 生成1到50季的下拉框选项
|
||||
const seasonItems = ref(
|
||||
Array.from({ length: 50 }, (_, i) => i + 1).map(item => ({
|
||||
title: `第 ${item} 季`,
|
||||
value: item,
|
||||
})),
|
||||
)
|
||||
|
||||
// 打开种子详情页面
|
||||
function openTorrentDetail(page_url: string) {
|
||||
window.open(page_url, '_blank')
|
||||
}
|
||||
|
||||
// 下载种子文件
|
||||
async function downloadTorrentFile(enclosure: string) {
|
||||
window.open(enclosure, '_blank')
|
||||
}
|
||||
|
||||
// 弹出菜单
|
||||
const dropdownItems = ref([
|
||||
{
|
||||
title: '编辑',
|
||||
value: 1,
|
||||
props: {
|
||||
prependIcon: 'mdi-file-edit-outline',
|
||||
click: editRssDialog,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '预览',
|
||||
value: 2,
|
||||
props: {
|
||||
prependIcon: 'mdi-eye-outline',
|
||||
click: handleRssPreview,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '刷新',
|
||||
value: 3,
|
||||
props: {
|
||||
prependIcon: 'mdi-refresh',
|
||||
click: refreshRss,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '取消订阅',
|
||||
value: 4,
|
||||
props: {
|
||||
prependIcon: 'mdi-trash-can-outline',
|
||||
color: 'error',
|
||||
click: removerRss,
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
onMounted(() => {
|
||||
querySiteName()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VCard
|
||||
:key="props.media?.id"
|
||||
:class="`${rssForm.best_version ? 'outline-dashed outline-1' : ''}`"
|
||||
@click="editRssDialog"
|
||||
>
|
||||
<template #image>
|
||||
<VImg
|
||||
:src="props.media?.backdrop || props.media?.poster"
|
||||
aspect-ratio="2/3"
|
||||
cover
|
||||
class="brightness-50"
|
||||
@load="imageLoadHandler"
|
||||
/>
|
||||
</template>
|
||||
<VCardItem>
|
||||
<template #prepend>
|
||||
<VIcon
|
||||
size="1.9rem"
|
||||
:color="getTextColor()"
|
||||
:icon="getIcon()"
|
||||
/>
|
||||
</template>
|
||||
<VCardTitle :class="getTextClass()">
|
||||
{{ props.media?.name }}
|
||||
{{ formatSeason(props.media?.season ? props.media?.season.toString() : "") }}
|
||||
</VCardTitle>
|
||||
<template #append>
|
||||
<div class="me-n3">
|
||||
<IconBtn>
|
||||
<VIcon
|
||||
icon="mdi-dots-vertical"
|
||||
:color="getTextColor()"
|
||||
/>
|
||||
<VMenu
|
||||
activator="parent"
|
||||
close-on-content-click
|
||||
>
|
||||
<VList>
|
||||
<VListItem
|
||||
v-for="(item, i) in dropdownItems"
|
||||
: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>
|
||||
</template>
|
||||
</VCardItem>
|
||||
|
||||
<VCardText>
|
||||
<p
|
||||
class="clamp-text mb-0"
|
||||
:class="getTextClass()"
|
||||
>
|
||||
{{ props.media?.description }}
|
||||
</p>
|
||||
</VCardText>
|
||||
|
||||
<VCardText class="d-flex justify-space-between align-center flex-wrap">
|
||||
<div class="d-flex align-center">
|
||||
<IconBtn
|
||||
icon="mdi-star"
|
||||
:color="getTextColor()"
|
||||
class="me-1"
|
||||
/>
|
||||
<span
|
||||
class="text-subtitle-2 me-4"
|
||||
:class="getTextClass()"
|
||||
>{{
|
||||
props.media?.vote
|
||||
}}</span>
|
||||
<IconBtn
|
||||
v-bind="props"
|
||||
icon="mdi-progress-clock"
|
||||
:color="getTextColor()"
|
||||
class="me-1"
|
||||
/>
|
||||
<span
|
||||
class="text-subtitle-2 me-4"
|
||||
:class="getTextClass()"
|
||||
>{{ props.media?.processed || 0 }}</span>
|
||||
<IconBtn
|
||||
v-if="siteName"
|
||||
icon="mdi-web"
|
||||
:color="getTextColor()"
|
||||
class="me-1"
|
||||
/>
|
||||
<span
|
||||
v-if="siteName"
|
||||
class="text-subtitle-2 me-4"
|
||||
:class="getTextClass()"
|
||||
>
|
||||
{{ siteName }}
|
||||
</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>
|
||||
</VCard>
|
||||
<!-- 订阅编辑弹窗 -->
|
||||
<VDialog
|
||||
v-model="rssInfoDialog"
|
||||
max-width="800"
|
||||
persistent
|
||||
scrollable
|
||||
>
|
||||
<!-- Dialog Content -->
|
||||
<VCard :title="`订阅 - ${props.media?.name}`">
|
||||
<DialogCloseBtn @click="rssInfoDialog = false" />
|
||||
<VCardText class="pt-2">
|
||||
<VForm @submit.prevent="() => {}">
|
||||
<VRow>
|
||||
<VCol
|
||||
cols="12"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.url"
|
||||
label="RSS地址"
|
||||
placeholder="https://example.com/rss"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VSelect
|
||||
v-model="rssForm.type"
|
||||
label="类型"
|
||||
:items="[{ title: '电影', value: '电影' }, { title: '电视剧', value: '电视剧' }]"
|
||||
readonly
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.title"
|
||||
label="标题"
|
||||
readonly
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.year"
|
||||
label="年份"
|
||||
readonly
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VSelect
|
||||
v-show="rssForm.type === '电视剧'"
|
||||
v-model="rssForm.season"
|
||||
label="季"
|
||||
:items="seasonItems"
|
||||
readonly
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.include"
|
||||
label="包含"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.exclude"
|
||||
label="排除"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.save_path"
|
||||
label="保存路径"
|
||||
placeholder="留空自动"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VSelect
|
||||
v-model="rssForm.state"
|
||||
label="状态"
|
||||
:items="[{
|
||||
title: '启用',
|
||||
value: 1,
|
||||
}, {
|
||||
title: '停用',
|
||||
value: 0,
|
||||
}]"
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
<VRow>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
>
|
||||
<VSwitch
|
||||
v-model="rssForm.best_version"
|
||||
label="洗版"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
>
|
||||
<VSwitch
|
||||
v-model="rssForm.proxy"
|
||||
label="代理服务器"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
>
|
||||
<VSwitch
|
||||
v-model="rssForm.filter"
|
||||
label="过滤规则"
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</VForm>
|
||||
</VCardText>
|
||||
|
||||
<VCardActions>
|
||||
<VBtn @click="rssInfoDialog = false">
|
||||
取消
|
||||
</VBtn>
|
||||
<VSpacer />
|
||||
<VBtn @click="updateRssInfo">
|
||||
确定
|
||||
</VBtn>
|
||||
</VCardActions>
|
||||
</VCard>
|
||||
</VDialog>
|
||||
<!-- RSS预览窗口 -->
|
||||
<VDialog
|
||||
v-model="rssPreviewDialog"
|
||||
max-width="1280"
|
||||
scrollable
|
||||
>
|
||||
<!-- Dialog Content -->
|
||||
<VCard title="RSS预览">
|
||||
<DialogCloseBtn @click="rssPreviewDialog = false" />
|
||||
<VCardText class="pt-2">
|
||||
<VDataTable
|
||||
v-model:items-per-page="previewItemsPerPage"
|
||||
:headers="previewHeaders"
|
||||
:items="previewDataList"
|
||||
:items-length="previewTotalItems"
|
||||
:loading="previewLoading"
|
||||
density="compact"
|
||||
item-value="title"
|
||||
return-object
|
||||
fixed-header
|
||||
items-per-page-text="每页条数"
|
||||
page-text="{0}-{1} 共 {2} 条"
|
||||
>
|
||||
<template #item.title="{ item }">
|
||||
<div class="text-high-emphasis">
|
||||
{{ item.raw.title }}
|
||||
</div>
|
||||
</template>
|
||||
<template #item.size="{ item }">
|
||||
<div class="text-nowrap whitespace-nowrap">
|
||||
{{ formatFileSize(item.raw.size) }}
|
||||
</div>
|
||||
</template>
|
||||
<template #item.pubdate="{ item }">
|
||||
<div class="text-sm">
|
||||
{{ item.raw.pubdate }}
|
||||
</div>
|
||||
</template>
|
||||
<template #item.actions="{ item }">
|
||||
<div class="me-n3">
|
||||
<IconBtn>
|
||||
<VIcon
|
||||
icon="mdi-dots-vertical"
|
||||
/>
|
||||
<VMenu
|
||||
activator="parent"
|
||||
close-on-content-click
|
||||
>
|
||||
<VList>
|
||||
<VListItem
|
||||
variant="plain"
|
||||
@click="openTorrentDetail(item.raw.page_url)"
|
||||
>
|
||||
<template #prepend>
|
||||
<VIcon icon="mdi-information" />
|
||||
</template>
|
||||
<VListItemTitle>查看详情</VListItemTitle>
|
||||
</VListItem>
|
||||
<VListItem
|
||||
variant="plain"
|
||||
@click="downloadTorrentFile(item.raw.enclosure)"
|
||||
>
|
||||
<template #prepend>
|
||||
<VIcon icon="mdi-download" />
|
||||
</template>
|
||||
<VListItemTitle>下载种子</VListItemTitle>
|
||||
</VListItem>
|
||||
</VList>
|
||||
</VMenu>
|
||||
</IconBtn>
|
||||
</div>
|
||||
</template>
|
||||
<template #no-data>
|
||||
没有数据
|
||||
</template>
|
||||
</VDataTable>
|
||||
</VCardText>
|
||||
</VCard>
|
||||
</VDialog>
|
||||
</template>
|
||||
@@ -72,9 +72,6 @@ const resourceTotalItems = ref(0)
|
||||
// 每页条数
|
||||
const resourceItemsPerPage = ref(25)
|
||||
|
||||
// 当前页码
|
||||
const resourceCurrentPage = ref(0)
|
||||
|
||||
// 用户名密码表单
|
||||
const userPwForm = ref({
|
||||
username: '',
|
||||
@@ -215,7 +212,7 @@ async function updateSiteInfo() {
|
||||
// 更新按钮状态
|
||||
siteInfoDialog.value = false
|
||||
|
||||
const result: { [key: string]: any } = await api.put('site', siteForm)
|
||||
const result: { [key: string]: any } = await api.put('site/', siteForm)
|
||||
if (result.success) {
|
||||
$toast.success(`${cardProps.site?.name} 更新成功!`)
|
||||
emit('update')
|
||||
@@ -244,13 +241,7 @@ function getVolumeFactorClass(downloadVolume: number, uploadVolume: number) {
|
||||
async function getResourceList() {
|
||||
resourceLoading.value = true
|
||||
try {
|
||||
resourceDataList.value = await api.get('search/title', {
|
||||
params: {
|
||||
keyword: resourceSearch.value,
|
||||
page: resourceCurrentPage.value,
|
||||
site: cardProps.site?.id,
|
||||
},
|
||||
})
|
||||
resourceDataList.value = await api.get(`site/resource/${cardProps.site?.id}`)
|
||||
resourceLoading.value = false
|
||||
}
|
||||
catch (error) {
|
||||
@@ -437,7 +428,7 @@ onMounted(() => {
|
||||
<!-- 站点编辑弹窗 -->
|
||||
<VDialog
|
||||
v-model="siteInfoDialog"
|
||||
max-width="1000"
|
||||
max-width="50rem"
|
||||
persistent
|
||||
scrollable
|
||||
>
|
||||
@@ -480,6 +471,12 @@ onMounted(() => {
|
||||
</VCol>
|
||||
</VRow>
|
||||
<VRow>
|
||||
<VCol cols="12">
|
||||
<VTextField
|
||||
v-model="siteForm.rss"
|
||||
label="RSS地址"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VTextarea
|
||||
v-model="siteForm.cookie"
|
||||
@@ -562,7 +559,7 @@ onMounted(() => {
|
||||
<!-- 站点资源弹窗 -->
|
||||
<VDialog
|
||||
v-model="resourceDialog"
|
||||
max-width="1280"
|
||||
max-width="80rem"
|
||||
scrollable
|
||||
>
|
||||
<!-- Dialog Content -->
|
||||
@@ -650,6 +647,7 @@ onMounted(() => {
|
||||
<VListItemTitle>查看详情</VListItemTitle>
|
||||
</VListItem>
|
||||
<VListItem
|
||||
v-if="item.raw.enclosure?.startsWith('http')"
|
||||
variant="plain"
|
||||
@click="downloadTorrentFile(item.raw.enclosure)"
|
||||
>
|
||||
|
||||
@@ -118,7 +118,7 @@ async function searchSubscribe() {
|
||||
async function updateSubscribeInfo() {
|
||||
subscribeInfoDialog.value = false
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.put('subscribe', subscribeForm)
|
||||
const result: { [key: string]: any } = await api.put('subscribe/', subscribeForm)
|
||||
|
||||
// 提示
|
||||
if (result.success) {
|
||||
@@ -325,7 +325,7 @@ const dropdownItems = ref([
|
||||
<!-- 订阅编辑弹窗 -->
|
||||
<VDialog
|
||||
v-model="subscribeInfoDialog"
|
||||
max-width="1000"
|
||||
max-width="50rem"
|
||||
persistent
|
||||
scrollable
|
||||
>
|
||||
|
||||
139
src/components/cards/TmdbSelectorCard.vue
Normal file
139
src/components/cards/TmdbSelectorCard.vue
Normal file
@@ -0,0 +1,139 @@
|
||||
<script lang="ts" setup>
|
||||
import api from '@/api'
|
||||
import type { MediaInfo } from '@/api/types'
|
||||
|
||||
interface TmdbItem {
|
||||
title: string
|
||||
overview: string
|
||||
tmdbid: number
|
||||
poster: string
|
||||
}
|
||||
|
||||
// update:modelValue 事件
|
||||
const emit = defineEmits(['update:modelValue', 'close'])
|
||||
|
||||
const items = ref<TmdbItem[]>([])
|
||||
|
||||
// 搜索词
|
||||
const keyword = ref('')
|
||||
|
||||
// 加载中
|
||||
const loading = ref(false)
|
||||
|
||||
// ref
|
||||
const tmdbKeyword = ref<HTMLElement | null>(null)
|
||||
|
||||
// 选中条目
|
||||
function selectMedia(item: TmdbItem) {
|
||||
console.log(item)
|
||||
emit('update:modelValue', item.tmdbid)
|
||||
emit('close')
|
||||
}
|
||||
|
||||
// TMDB图片转换为w500大小
|
||||
function getW500Image(url = '') {
|
||||
if (!url)
|
||||
return ''
|
||||
return url.replace('original', 'w500')
|
||||
}
|
||||
|
||||
// 搜索词条
|
||||
async function searchMedias() {
|
||||
if (!keyword)
|
||||
return
|
||||
|
||||
// 调用API搜索词条
|
||||
try {
|
||||
loading.value = true
|
||||
const result: MediaInfo[] = await api.get('media/search', {
|
||||
params: {
|
||||
title: keyword.value,
|
||||
page: 1,
|
||||
count: 20,
|
||||
},
|
||||
})
|
||||
|
||||
// 清空
|
||||
items.value = []
|
||||
|
||||
// 赋值
|
||||
for (const item of result) {
|
||||
items.value.push({
|
||||
tmdbid: item.tmdb_id || 0,
|
||||
poster: getW500Image(item.poster_path),
|
||||
title: `${item.title}(${item.year})`,
|
||||
overview: `<span class="text-primary">${item.type}</span> ${item.overview}`,
|
||||
})
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
// 加载时聚焦搜索框
|
||||
onMounted(() => {
|
||||
// 500ms后聚焦
|
||||
setTimeout(() => {
|
||||
tmdbKeyword.value?.focus()
|
||||
}, 500)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VCard
|
||||
class="mx-auto"
|
||||
width="100%"
|
||||
>
|
||||
<VToolbar flat class="p-0">
|
||||
<VTextField
|
||||
ref="tmdbKeyword"
|
||||
v-model="keyword"
|
||||
label="输入名称搜索"
|
||||
single-line
|
||||
placeholder="电影或电视剧名称"
|
||||
variant="solo"
|
||||
append-inner-icon="mdi-magnify"
|
||||
flat
|
||||
class="mx-1"
|
||||
:loading="loading"
|
||||
@click:append-inner="searchMedias"
|
||||
@keydown.enter="searchMedias"
|
||||
/>
|
||||
</VToolbar>
|
||||
|
||||
<VList
|
||||
v-if="items.length > 0"
|
||||
lines="three"
|
||||
>
|
||||
<template v-for="(item, i) in items" :key="i">
|
||||
<VListItem
|
||||
@click="selectMedia(item)"
|
||||
>
|
||||
<template #prepend>
|
||||
<VImg
|
||||
height="75"
|
||||
width="50"
|
||||
:src="item.poster"
|
||||
aspect-ratio="2/3"
|
||||
class="object-cover rounded shadow ring-gray-500 me-3"
|
||||
cover
|
||||
>
|
||||
<template #placeholder>
|
||||
<div class="w-full h-full">
|
||||
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
|
||||
</div>
|
||||
</template>
|
||||
</VImg>
|
||||
</template>
|
||||
<VListItemTitle>
|
||||
{{ item.title }}
|
||||
</VListItemTitle>
|
||||
<VListItemSubtitle class="mt-2" v-html="item.overview" />
|
||||
</VListItem>
|
||||
<VDivider v-if="i < items.length - 1" class="mt-1" inset />
|
||||
</template>
|
||||
</VList>
|
||||
</VCard>
|
||||
</template>
|
||||
@@ -76,7 +76,7 @@ async function handleAddDownload(_site: any = undefined,
|
||||
async function addDownload(_media: any, _torrent: any) {
|
||||
startNProgress()
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.post('download', {
|
||||
const result: { [key: string]: any } = await api.post('download/', {
|
||||
media_in: _media,
|
||||
torrent_in: _torrent,
|
||||
})
|
||||
@@ -122,26 +122,6 @@ function getVolumeFactorClass(downloadVolume: number, uploadVolume: number) {
|
||||
onMounted(() => {
|
||||
getSiteIcon()
|
||||
})
|
||||
|
||||
// 弹出菜单
|
||||
const dropdownItems = ref([
|
||||
{
|
||||
title: '查看详情',
|
||||
value: 1,
|
||||
props: {
|
||||
prependIcon: 'mdi-information',
|
||||
click: openTorrentDetail,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '下载种子',
|
||||
value: 2,
|
||||
props: {
|
||||
prependIcon: 'mdi-download',
|
||||
click: downloadTorrentFile,
|
||||
},
|
||||
},
|
||||
])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -180,15 +160,23 @@ const dropdownItems = ref([
|
||||
>
|
||||
<VList>
|
||||
<VListItem
|
||||
v-for="(item, i) in dropdownItems"
|
||||
:key="i"
|
||||
variant="plain"
|
||||
@click="item.props.click"
|
||||
@click="openTorrentDetail()"
|
||||
>
|
||||
<template #prepend>
|
||||
<VIcon :icon="item.props.prependIcon" />
|
||||
<VIcon icon="mdi-information" />
|
||||
</template>
|
||||
<VListItemTitle v-text="item.title" />
|
||||
<VListItemTitle>查看详情</VListItemTitle>
|
||||
</VListItem>
|
||||
<VListItem
|
||||
v-if="props.torrent?.torrent_info?.enclosure?.startsWith('http')"
|
||||
variant="plain"
|
||||
@click="downloadTorrentFile()"
|
||||
>
|
||||
<template #prepend>
|
||||
<VIcon icon="mdi-download" />
|
||||
</template>
|
||||
<VListItemTitle>下载种子</VListItemTitle>
|
||||
</VListItem>
|
||||
</VList>
|
||||
</VMenu>
|
||||
|
||||
@@ -10,6 +10,7 @@ import type { Context, EndPoints, FileItem } from '@/api/types'
|
||||
import store from '@/store'
|
||||
import api from '@/api'
|
||||
import MediaInfoCard from '@/components/cards/MediaInfoCard.vue'
|
||||
import TmdbSelectorCard from '@/components/cards/TmdbSelectorCard.vue'
|
||||
|
||||
// 输入参数
|
||||
const inProps = defineProps({
|
||||
@@ -92,6 +93,9 @@ const nameTestResult = ref<Context>()
|
||||
// 识别结果对话框
|
||||
const nameTestDialog = ref(false)
|
||||
|
||||
// TMDB选择对话框
|
||||
const tmdbSelectorDialog = ref(false)
|
||||
|
||||
// 生成1到50季的下拉框选项
|
||||
const seasonItems = ref(
|
||||
Array.from({ length: 51 }, (_, i) => i).map(item => ({
|
||||
@@ -262,7 +266,7 @@ async function transfer() {
|
||||
stopLoadingProgress()
|
||||
// 显示结果
|
||||
if (res.success) {
|
||||
$toast.success(`${currentItem.value?.name} 整理成功!`)
|
||||
$toast.success(`${currentItem.value?.name} 整理完成!`)
|
||||
// 重新加载
|
||||
load()
|
||||
}
|
||||
@@ -609,7 +613,7 @@ onMounted(() => {
|
||||
<!-- 文件整理弹窗 -->
|
||||
<VDialog
|
||||
v-model="transferPopper"
|
||||
max-width="800"
|
||||
max-width="50rem"
|
||||
scrollable
|
||||
>
|
||||
<template #activator="{ props }">
|
||||
@@ -628,6 +632,7 @@ onMounted(() => {
|
||||
<VTextField
|
||||
v-model="transferForm.target"
|
||||
label="目的路径"
|
||||
placeholder="留空自动"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
@@ -667,6 +672,8 @@ onMounted(() => {
|
||||
label="TMDBID"
|
||||
placeholder="留空自动识别"
|
||||
:rules="[numberValidator]"
|
||||
append-inner-icon="mdi-magnify"
|
||||
@click:append-inner="tmdbSelectorDialog = true"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
@@ -722,10 +729,10 @@ onMounted(() => {
|
||||
</VForm>
|
||||
</VCardText>
|
||||
<VCardActions>
|
||||
<div class="flex-grow-1" />
|
||||
<VBtn depressed @click="transferPopper = false">
|
||||
取消
|
||||
</VBtn>
|
||||
<VSpacer />
|
||||
<VBtn
|
||||
@click="transfer"
|
||||
>
|
||||
@@ -738,7 +745,7 @@ onMounted(() => {
|
||||
<vDialog
|
||||
v-model="progressDialog"
|
||||
:scrim="false"
|
||||
width="400"
|
||||
width="25rem"
|
||||
>
|
||||
<vCard
|
||||
color="primary"
|
||||
@@ -757,7 +764,7 @@ onMounted(() => {
|
||||
<!-- 识别结果对话框 -->
|
||||
<vDialog
|
||||
v-model="nameTestDialog"
|
||||
width="800"
|
||||
width="50rem"
|
||||
>
|
||||
<vCard>
|
||||
<DialogCloseBtn @click="nameTestDialog = false" />
|
||||
@@ -766,6 +773,17 @@ onMounted(() => {
|
||||
</VCardItem>
|
||||
</vCard>
|
||||
</vDialog>
|
||||
<!-- TMDB ID搜索框 -->
|
||||
<vDialog
|
||||
v-model="tmdbSelectorDialog"
|
||||
width="40rem"
|
||||
scrollable
|
||||
>
|
||||
<TmdbSelectorCard
|
||||
v-model="transferForm.tmdbid"
|
||||
@close="tmdbSelectorDialog = false"
|
||||
/>
|
||||
</vDialog>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -180,9 +180,3 @@ const sortIcon = computed(() => {
|
||||
</VDialog>
|
||||
</VToolbar>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.v-toolbar{
|
||||
background: rgb(var(--v-table-header-background));
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -35,6 +35,7 @@ function init() {
|
||||
name: 'root',
|
||||
children: [],
|
||||
size: 0,
|
||||
modify_time: 0,
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import { type PropType, ref } from 'vue'
|
||||
interface RenderProps {
|
||||
component: string
|
||||
text: string
|
||||
html: string
|
||||
content?: any
|
||||
props?: any
|
||||
}
|
||||
@@ -16,9 +17,10 @@ const elementProps = defineProps({
|
||||
})
|
||||
|
||||
// 配置元素
|
||||
const formItem = ref<RenderProps>(elementProps.config || {
|
||||
const formItem = ref<RenderProps>(elementProps.config ?? {
|
||||
component: 'div',
|
||||
text: '',
|
||||
html: '',
|
||||
props: {},
|
||||
content: [],
|
||||
})
|
||||
@@ -30,6 +32,7 @@ const formData = ref<any>(elementProps.form || {})
|
||||
<template>
|
||||
<Component
|
||||
:is="formItem.component"
|
||||
v-if="!formItem.html"
|
||||
v-bind="formItem.props"
|
||||
v-model="formData[formItem.props?.model || '']"
|
||||
>
|
||||
@@ -42,4 +45,10 @@ const formData = ref<any>(elementProps.form || {})
|
||||
:form="formData"
|
||||
/>
|
||||
</Component>
|
||||
<Component
|
||||
:is="formItem.component"
|
||||
v-if="formItem.html"
|
||||
v-bind="formItem.props"
|
||||
v-html="formItem.html"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -13,11 +13,10 @@ interface RenderProps {
|
||||
// 输入参数
|
||||
const elementProps = defineProps({
|
||||
config: Object as PropType<RenderProps>,
|
||||
handler: Boolean,
|
||||
})
|
||||
|
||||
// 配置元素
|
||||
const formItem = ref<RenderProps>(elementProps.config || {
|
||||
const formItem = ref<RenderProps>(elementProps.config ?? {
|
||||
component: 'div',
|
||||
text: '',
|
||||
html: '',
|
||||
|
||||
@@ -11,6 +11,8 @@ const props = defineProps({
|
||||
const slideview_content = ref()
|
||||
// 分页切换状态
|
||||
const disabled = ref(0)
|
||||
// 记录滚动值
|
||||
const slideview_scrollLeft = ref(0)
|
||||
// 所有卡片数量
|
||||
let slide_card_length: number
|
||||
// 卡片间距
|
||||
@@ -58,6 +60,7 @@ function countMaxNumber() {
|
||||
|
||||
// 修改分页切换按钮状态
|
||||
function countDisabled() {
|
||||
slideview_scrollLeft.value = slideview_content.value.scrollLeft
|
||||
card_current = slideview_content.value.scrollLeft === 0 ? 0 : Math.trunc((slideview_content.value.scrollLeft + card_width / 2) / card_width)
|
||||
if (slide_card_length * card_width <= slideview_content.value.clientWidth)
|
||||
disabled.value = 3
|
||||
@@ -81,6 +84,12 @@ onUnmounted(() => {
|
||||
// 卸载事件
|
||||
window.removeEventListener('resize', countMaxNumber)
|
||||
})
|
||||
onActivated(() => {
|
||||
if (slideview_scrollLeft.value !== 0) {
|
||||
// console.log(`onActivated: to_scrollLeft, ${slideview_scrollLeft.value}`)
|
||||
slideview_content.value.scrollLeft = slideview_scrollLeft.value
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -106,14 +106,6 @@ const superUser = store.state.auth.superUser
|
||||
to: '/subscribe-tv',
|
||||
}"
|
||||
/>
|
||||
<VerticalNavLink
|
||||
v-if="superUser"
|
||||
:item="{
|
||||
title: '自定义',
|
||||
icon: 'mdi-rss',
|
||||
to: '/subscribe-rss',
|
||||
}"
|
||||
/>
|
||||
<VerticalNavLink
|
||||
:item="{
|
||||
title: '日历',
|
||||
|
||||
@@ -132,9 +132,9 @@ const ruleTestDialog = ref(false)
|
||||
<VIcon icon="mdi-filter-cog-outline" />
|
||||
</VAvatar>
|
||||
<h6 class="text-base font-weight-medium mt-2 mb-0">
|
||||
规则
|
||||
优先级
|
||||
</h6>
|
||||
<span class="text-sm">过滤规则测试</span>
|
||||
<span class="text-sm">优先级规则测试</span>
|
||||
</VListItem>
|
||||
</VCol>
|
||||
</VRow>
|
||||
@@ -184,7 +184,7 @@ const ruleTestDialog = ref(false)
|
||||
max-width="50rem"
|
||||
scrollable
|
||||
>
|
||||
<VCard title="过滤规则测试">
|
||||
<VCard title="优先级测试">
|
||||
<DialogCloseBtn @click="ruleTestDialog = false" />
|
||||
<VCardText>
|
||||
<RuleTestView />
|
||||
|
||||
@@ -172,7 +172,7 @@ const avatar = store.state.auth.avatar
|
||||
<!-- 重启进度框 -->
|
||||
<vDialog
|
||||
v-model="progressDialog"
|
||||
width="400"
|
||||
width="25rem"
|
||||
>
|
||||
<vCard
|
||||
color="primary"
|
||||
|
||||
@@ -6,14 +6,14 @@ import DefaultLayoutWithVerticalNav from './components/DefaultLayoutWithVertical
|
||||
<DefaultLayoutWithVerticalNav>
|
||||
<router-view v-slot="{ Component }">
|
||||
<keep-alive>
|
||||
<component :is="Component" v-if="$route.meta.keepAlive" :key="$route.name" />
|
||||
<component :is="Component" v-if="$route.meta.keepAlive" :key="$route.fullPath" />
|
||||
</keep-alive>
|
||||
<component :is="Component" v-if="!$route.meta.keepAlive" :key="$route.name" />
|
||||
<component :is="Component" v-if="!$route.meta.keepAlive" :key="$route.fullPath" />
|
||||
</router-view>
|
||||
</DefaultLayoutWithVerticalNav>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
// As we are using `layouts` plugin we need its styles to be imported
|
||||
@use '@layouts/styles/default-layout';
|
||||
@use "@layouts/styles/default-layout";
|
||||
</style>
|
||||
|
||||
45
src/main.ts
45
src/main.ts
@@ -2,7 +2,6 @@ import { createApp } from 'vue'
|
||||
import '@/@iconify/icons-bundle'
|
||||
import ToastPlugin from 'vue-toast-notification'
|
||||
import VuetifyUseDialog from 'vuetify-use-dialog'
|
||||
import { configureNProgress, doneNProgress, startNProgress } from '@/api/nprogress'
|
||||
import App from '@/App.vue'
|
||||
import vuetify from '@/plugins/vuetify'
|
||||
import { loadFonts } from '@/plugins/webfontloader'
|
||||
@@ -12,53 +11,21 @@ import '@core/scss/template/index.scss'
|
||||
import '@layouts/styles/index.scss'
|
||||
import '@styles/styles.scss'
|
||||
import 'vue-toast-notification/dist/theme-default.css'
|
||||
import { removeEl } from '@/util'
|
||||
|
||||
loadFonts()
|
||||
|
||||
// Nprogress
|
||||
configureNProgress()
|
||||
|
||||
// Create vue app
|
||||
const app = createApp(App)
|
||||
|
||||
// Use plugins Mount vue app
|
||||
app.use(vuetify)
|
||||
app
|
||||
.use(vuetify)
|
||||
.use(router)
|
||||
.use(store)
|
||||
.use(ToastPlugin, {
|
||||
position: 'bottom-right',
|
||||
})
|
||||
.use(VuetifyUseDialog).mount('#app')
|
||||
|
||||
// 记录和恢复滚动位置
|
||||
const scrollPositions: { [key: string]: number } = {} // 用于存储每个路由的滚动位置
|
||||
|
||||
// 路由导航守卫
|
||||
router.beforeEach((to, from, next) => {
|
||||
const isAuthenticated = store.state.auth.token !== null
|
||||
|
||||
if (to.meta.requiresAuth && !isAuthenticated) {
|
||||
next('/login')
|
||||
}
|
||||
else {
|
||||
// 只有 meta 中 keepAlive 为 true 的情况下才记录滚动位置
|
||||
if (from.meta.keepAlive)
|
||||
scrollPositions[from.fullPath] = window.scrollY
|
||||
|
||||
startNProgress()
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
router.afterEach((to) => {
|
||||
// 只有 meta 中 keepAlive 为 true 的情况下才恢复滚动位置
|
||||
if (to.meta.keepAlive) {
|
||||
const savedPosition = scrollPositions[to.fullPath]
|
||||
if (savedPosition !== undefined) {
|
||||
setTimeout(() => {
|
||||
window.scrollTo(0, savedPosition)
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
doneNProgress()
|
||||
})
|
||||
.use(VuetifyUseDialog)
|
||||
.mount('#app')
|
||||
.$nextTick(() => removeEl('#loading-bg'))
|
||||
|
||||
@@ -130,7 +130,7 @@ onMounted(() => {
|
||||
<VCardItem class="justify-center mb-7">
|
||||
<template #prepend>
|
||||
<div class="d-flex pe-0">
|
||||
<VImg :src="logo" width="64" />
|
||||
<VImg :src="logo" width="64" height="64" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@ import AccountSettingRule from '@/views/setting/AccountSettingRule.vue'
|
||||
import AccountSettingSite from '@/views/setting/AccountSettingSite.vue'
|
||||
import AccountSettingWords from '@/views/setting/AccountSettingWords.vue'
|
||||
import AccountSettingAbout from '@/views/setting/AccountSettingAbout.vue'
|
||||
import AccountSettingSearch from '@/views/setting/AccountSettingSearch.vue'
|
||||
import AccountSettingSubscribe from '@/views/setting/AccountSettingSubscribe.vue'
|
||||
import AccountSettingService from '@/views/setting/AccountSettingService.vue'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
@@ -23,6 +26,21 @@ const tabs = [
|
||||
icon: 'mdi-web',
|
||||
tab: 'site',
|
||||
},
|
||||
{
|
||||
title: '搜索',
|
||||
icon: 'mdi-magnify',
|
||||
tab: 'search',
|
||||
},
|
||||
{
|
||||
title: '订阅',
|
||||
icon: 'mdi-rss',
|
||||
tab: 'subscribe',
|
||||
},
|
||||
{
|
||||
title: '服务',
|
||||
icon: 'mdi-list-box',
|
||||
tab: 'service',
|
||||
},
|
||||
{
|
||||
title: '规则',
|
||||
icon: 'mdi-filter-cog',
|
||||
@@ -48,7 +66,10 @@ const tabs = [
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<VTabs v-model="activeTab" show-arrows>
|
||||
<VTabs
|
||||
v-model="activeTab"
|
||||
show-arrows
|
||||
>
|
||||
<VTab v-for="item in tabs" :key="item.icon" :value="item.tab">
|
||||
<VIcon size="20" start :icon="item.icon" />
|
||||
{{ item.title }}
|
||||
@@ -56,41 +77,66 @@ const tabs = [
|
||||
</VTabs>
|
||||
<VDivider />
|
||||
|
||||
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition">
|
||||
<!-- Account -->
|
||||
<VWindow
|
||||
v-model="activeTab"
|
||||
class="mt-5 disable-tab-transition"
|
||||
:touch="false"
|
||||
>
|
||||
<!-- 用户 -->
|
||||
<VWindowItem value="account">
|
||||
<transition name="fade-slide" appear>
|
||||
<AccountSettingAccount />
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
|
||||
<!-- System -->
|
||||
<!-- 站点 -->
|
||||
<VWindowItem value="site">
|
||||
<transition name="fade-slide" appear>
|
||||
<AccountSettingSite />
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
|
||||
<!-- Notification -->
|
||||
<!-- 搜索 -->
|
||||
<VWindowItem value="search">
|
||||
<transition name="fade-slide" appear>
|
||||
<AccountSettingSearch />
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
|
||||
<!-- 订阅 -->
|
||||
<VWindowItem value="subscribe">
|
||||
<transition name="fade-slide" appear>
|
||||
<AccountSettingSubscribe />
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
|
||||
<!-- 服务 -->
|
||||
<VWindowItem value="service">
|
||||
<transition name="fade-slide" appear>
|
||||
<AccountSettingService />
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
|
||||
<!-- 规则 -->
|
||||
<VWindowItem value="filter">
|
||||
<transition name="fade-slide" appear>
|
||||
<AccountSettingRule />
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
|
||||
<!-- Notification -->
|
||||
<!-- 通知 -->
|
||||
<VWindowItem value="notification">
|
||||
<transition name="fade-slide" appear>
|
||||
<AccountSettingNotification />
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
<!-- Words -->
|
||||
<!-- 词表 -->
|
||||
<VWindowItem value="words">
|
||||
<transition name="fade-slide" appear>
|
||||
<AccountSettingWords />
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
<!-- About -->
|
||||
<!-- 关于 -->
|
||||
<VWindowItem value="about">
|
||||
<transition name="fade-slide" appear>
|
||||
<AccountSettingAbout />
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import RssListView from '@/views/subscribe/RssListView.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<RssListView />
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,9 +1,17 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import { configureNProgress, doneNProgress, startNProgress } from '@/api/nprogress'
|
||||
import store from '@/store'
|
||||
|
||||
// Nprogress
|
||||
configureNProgress()
|
||||
|
||||
// Router
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
scrollBehavior() {
|
||||
// 始终滚动到顶部
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
// 如果页面有缓存那么恢复其位置, 否则始终滚动到顶部
|
||||
if (to.meta.keepAlive && savedPosition)
|
||||
return savedPosition
|
||||
return { top: 0 }
|
||||
},
|
||||
routes: [
|
||||
@@ -48,13 +56,6 @@ const router = createRouter({
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'subscribe-rss',
|
||||
component: () => import('../pages/subscribe-rss.vue'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'calendar',
|
||||
component: () => import('../pages/calendar.vue'),
|
||||
@@ -154,4 +155,21 @@ const router = createRouter({
|
||||
],
|
||||
})
|
||||
|
||||
// 路由导航守卫
|
||||
router.beforeEach((to, from, next) => {
|
||||
const isAuthenticated = store.state.auth.token !== null
|
||||
|
||||
if (to.meta.requiresAuth && !isAuthenticated) {
|
||||
next('/login')
|
||||
}
|
||||
else {
|
||||
startNProgress()
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
router.afterEach(() => {
|
||||
doneNProgress()
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
/* router view transition fade-slide */
|
||||
.fade-slide-leave-active,
|
||||
.fade-slide-enter-active {
|
||||
@@ -107,8 +106,10 @@
|
||||
border-radius: 3px;
|
||||
background: rgb(var(--v-theme-perfect-scrollbar-thumb));
|
||||
-webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
|
||||
&:hover{
|
||||
background: #a1a1a1;
|
||||
@media(hover){
|
||||
&:hover{
|
||||
background: #a1a1a1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,3 +123,7 @@
|
||||
-webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)!important;
|
||||
backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)!important;
|
||||
}
|
||||
|
||||
.v-toolbar{
|
||||
background: rgb(var(--v-table-header-background));
|
||||
}
|
||||
|
||||
6
src/util/dom.ts
Normal file
6
src/util/dom.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export function removeEl(selector: string) {
|
||||
if (selector) {
|
||||
const el = document.querySelector(selector)
|
||||
el?.parentNode?.removeChild(el)
|
||||
}
|
||||
}
|
||||
1
src/util/index.ts
Normal file
1
src/util/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dom'
|
||||
@@ -185,7 +185,7 @@ async function addSubscribe(season = 0) {
|
||||
// 全部存在时洗版
|
||||
best_version = !seasonsNotExisted.value[season] ? 1 : 0
|
||||
// 请求API
|
||||
const result: { [key: string]: any } = await api.post('subscribe', {
|
||||
const result: { [key: string]: any } = await api.post('subscribe/', {
|
||||
name: mediaDetail.value?.title,
|
||||
type: mediaDetail.value?.type,
|
||||
year: mediaDetail.value?.year,
|
||||
|
||||
@@ -38,7 +38,7 @@ function pluginInstalled() {
|
||||
// 获取插件列表数据
|
||||
async function fetchData() {
|
||||
try {
|
||||
dataList.value = await api.get('plugin')
|
||||
dataList.value = await api.get('plugin/')
|
||||
isRefreshed.value = true
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
@@ -17,7 +17,7 @@ const isRefreshed = ref(false)
|
||||
// 获取订阅列表数据
|
||||
async function fetchData() {
|
||||
try {
|
||||
dataList.value = await api.get('download')
|
||||
dataList.value = await api.get('download/')
|
||||
isRefreshed.value = true
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useToast } from 'vue-toast-notification'
|
||||
import { useConfirm } from 'vuetify-use-dialog'
|
||||
import { numberValidator, requiredValidator } from '@/@validators'
|
||||
import { numberValidator } from '@/@validators'
|
||||
import api from '@/api'
|
||||
import type { TransferHistory } from '@/api/types'
|
||||
|
||||
// 确认框
|
||||
const createConfirm = useConfirm()
|
||||
import TmdbSelectorCard from '@/components/cards/TmdbSelectorCard.vue'
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
@@ -23,6 +20,7 @@ const redoType = ref('电影')
|
||||
|
||||
// 类型下拉框:电影、电视剧
|
||||
const redoTypeItems = ref([
|
||||
{ title: '自动', value: '' },
|
||||
{ title: '电影', value: '电影' },
|
||||
{ title: '电视剧', value: '电视剧' },
|
||||
])
|
||||
@@ -71,6 +69,15 @@ const progressText = ref('请稍候 ...')
|
||||
// 进度值
|
||||
const progressValue = ref(0)
|
||||
|
||||
// TMDB选择对话框
|
||||
const tmdbSelectorDialog = ref(false)
|
||||
|
||||
// 删除确认对话框
|
||||
const deleteConfirmDialog = ref(false)
|
||||
|
||||
// 确认框标题
|
||||
const confirmTitle = ref('')
|
||||
|
||||
// 获取订阅列表数据
|
||||
async function fetchData({
|
||||
page,
|
||||
@@ -125,74 +132,50 @@ const TransferDict: { [key: string]: string } = {
|
||||
|
||||
// 删除历史记录
|
||||
async function removeHistory(item: TransferHistory) {
|
||||
const isConfirmed = await createConfirm({
|
||||
title: '确认',
|
||||
content: `同步删除 ${item.title} 对应的媒体库文件 ?`,
|
||||
confirmationText: '同步删除文件',
|
||||
cancellationText: '仅删除历史记录',
|
||||
dialogProps: {
|
||||
maxWidth: '50rem',
|
||||
},
|
||||
confirmationButtonProps: {
|
||||
color: 'error',
|
||||
},
|
||||
})
|
||||
if (isConfirmed === undefined)
|
||||
return
|
||||
|
||||
// 执行删除
|
||||
remove(item, isConfirmed || false)
|
||||
// 清空选中项
|
||||
selected.value = []
|
||||
currentHistory.value = item
|
||||
confirmTitle.value = `确认删除 ${item.title} ${item.seasons}${item.episodes} ?`
|
||||
deleteConfirmDialog.value = true
|
||||
}
|
||||
|
||||
// 调用API删除记录
|
||||
async function remove(item: TransferHistory, deleteFile: boolean) {
|
||||
async function remove(item: TransferHistory, deleteSrc: boolean, deleteDest: boolean) {
|
||||
try {
|
||||
// 调用删除API
|
||||
const result: { [key: string]: any } = await api.delete(`history/transfer?delete_file=${deleteFile}`, {
|
||||
const result: { [key: string]: any } = await api.delete(`history/transfer?deletesrc=${deleteSrc}&deletedest=${deleteDest}`, {
|
||||
data: item,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
fetchData({
|
||||
page: currentPage.value,
|
||||
itemsPerPage: itemsPerPage.value,
|
||||
})
|
||||
}
|
||||
else {
|
||||
if (!result.success)
|
||||
$toast.error(`删除失败: ${result.msg}`)
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 批量删除历史记录
|
||||
async function removeHistoryBatch() {
|
||||
if (selected.value.length === 0)
|
||||
// 删除单条记录
|
||||
async function removeSingle(deleteSrc: boolean, deleteDest: boolean) {
|
||||
// 关闭弹窗
|
||||
deleteConfirmDialog.value = false
|
||||
if (!currentHistory.value)
|
||||
return
|
||||
// 确认
|
||||
const isConfirmed = await createConfirm({
|
||||
title: '确认',
|
||||
content: `同步删除 ${selected.value.length} 条记录对应的媒体库文件 ?`,
|
||||
confirmationText: '同步删除文件',
|
||||
cancellationText: '仅删除历史记录',
|
||||
dialogProps: {
|
||||
maxWidth: '50rem',
|
||||
},
|
||||
confirmationButtonProps: {
|
||||
color: 'error',
|
||||
},
|
||||
// 删除
|
||||
await remove(currentHistory.value, deleteSrc, deleteDest)
|
||||
// 刷新
|
||||
fetchData({
|
||||
page: currentPage.value,
|
||||
itemsPerPage: itemsPerPage.value,
|
||||
})
|
||||
if (isConfirmed === undefined)
|
||||
return
|
||||
|
||||
console.log(selected.value)
|
||||
}
|
||||
|
||||
// 批量删除记录
|
||||
async function removeBatch(deleteSrc: boolean, deleteDest: boolean) {
|
||||
// 关闭弹窗
|
||||
deleteConfirmDialog.value = false
|
||||
// 总条数
|
||||
const total = selected.value.length
|
||||
if (total === 0)
|
||||
return
|
||||
// 已处理条数
|
||||
let handled = 0
|
||||
// 显示进度条
|
||||
@@ -201,7 +184,7 @@ async function removeHistoryBatch() {
|
||||
for (const item of selected.value) {
|
||||
// 开始删除
|
||||
progressText.value = `正在删除 ${item.title} ${item.seasons}${item.episodes} ...`
|
||||
await remove(item, isConfirmed || false)
|
||||
await remove(item, deleteSrc, deleteDest)
|
||||
// 删除完成
|
||||
handled++
|
||||
progressValue.value = handled / total * 100
|
||||
@@ -217,27 +200,46 @@ async function removeHistoryBatch() {
|
||||
})
|
||||
}
|
||||
|
||||
// 重新整理
|
||||
async function rehandleHistory() {
|
||||
// 响应删除操作
|
||||
async function deleteConfirmHandler(deleteSrc: boolean, deleteDest: boolean) {
|
||||
if (currentHistory.value)
|
||||
await removeSingle(deleteSrc, deleteDest)
|
||||
else
|
||||
await removeBatch(deleteSrc, deleteDest)
|
||||
}
|
||||
|
||||
// 批量删除历史记录
|
||||
async function removeHistoryBatch() {
|
||||
if (selected.value.length === 0)
|
||||
return
|
||||
// 清空当前操作记录
|
||||
currentHistory.value = undefined
|
||||
confirmTitle.value = `确认删除 ${selected.value.length} 条记录 ?`
|
||||
// 打开确认弹窗
|
||||
deleteConfirmDialog.value = true
|
||||
}
|
||||
|
||||
// 批量重新整理
|
||||
async function retransferBatch() {
|
||||
if (selected.value.length === 0)
|
||||
return
|
||||
// 清空当前操作记录
|
||||
currentHistory.value = undefined
|
||||
// 打开识别弹窗
|
||||
redoType.value = ''
|
||||
redoDialog.value = true
|
||||
}
|
||||
|
||||
// 调API重新整理
|
||||
async function retransfer(item: TransferHistory, redoType = '', redoTmdbId = 0) {
|
||||
try {
|
||||
if (!redoTmdbId.value || !redoType.value)
|
||||
return
|
||||
|
||||
redoDialog.value = false
|
||||
$toast.info(`正在重新整理 ${currentHistory.value?.title} ...`)
|
||||
|
||||
// 调用API接口重新转移
|
||||
const requestData = {
|
||||
...currentHistory.value,
|
||||
}
|
||||
|
||||
const result: { [key: string]: any } = await api.post(
|
||||
'history/transfer',
|
||||
requestData,
|
||||
item,
|
||||
{
|
||||
params: {
|
||||
mtype: redoType.value,
|
||||
new_tmdbid: parseInt(redoTmdbId.value),
|
||||
mtype: redoType,
|
||||
new_tmdbid: redoTmdbId,
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -257,6 +259,50 @@ async function rehandleHistory() {
|
||||
}
|
||||
}
|
||||
|
||||
// 重新整理
|
||||
async function rehandleHistory() {
|
||||
try {
|
||||
// 关闭弹窗
|
||||
redoDialog.value = false
|
||||
|
||||
let tmdbid = 0
|
||||
|
||||
if (redoTmdbId.value)
|
||||
tmdbid = parseInt(redoTmdbId.value)
|
||||
|
||||
// 转移当前选中记录
|
||||
if (currentHistory.value) {
|
||||
$toast.info(`正在重新整理 ${currentHistory.value?.title} ...`)
|
||||
await retransfer(currentHistory.value, redoType.value, tmdbid)
|
||||
}
|
||||
else if (selected.value.length > 0) {
|
||||
// 总条数
|
||||
const total = selected.value.length
|
||||
if (total === 0)
|
||||
return
|
||||
// 已处理条数
|
||||
let handled = 0
|
||||
// 显示进度条
|
||||
progressDialog.value = true
|
||||
for (const item of selected.value) {
|
||||
progressText.value = `正在重新整理 ${item.src} ...`
|
||||
await retransfer(item, redoType.value, tmdbid)
|
||||
handled++
|
||||
progressValue.value = handled / total * 100
|
||||
}
|
||||
// 清空选中项
|
||||
selected.value = []
|
||||
// 隐藏进度条
|
||||
progressDialog.value = false
|
||||
}
|
||||
// 批量转移
|
||||
else { $toast.error('没有选中任何记录!') }
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
// 弹出菜单
|
||||
const dropdownItems = ref([
|
||||
{
|
||||
@@ -265,6 +311,8 @@ const dropdownItems = ref([
|
||||
props: {
|
||||
prependIcon: 'mdi-redo-variant',
|
||||
click: (item: TransferHistory) => {
|
||||
redoTmdbId.value = ''
|
||||
redoType.value = ''
|
||||
redoDialog.value = true
|
||||
currentHistory.value = item
|
||||
},
|
||||
@@ -276,7 +324,9 @@ const dropdownItems = ref([
|
||||
props: {
|
||||
prependIcon: 'mdi-trash-can-outline',
|
||||
color: 'error',
|
||||
click: removeHistory,
|
||||
click: (item: TransferHistory) => {
|
||||
removeHistory(item)
|
||||
},
|
||||
},
|
||||
},
|
||||
])
|
||||
@@ -403,7 +453,6 @@ const dropdownItems = ref([
|
||||
<VSelect
|
||||
v-model="redoType"
|
||||
label="类型"
|
||||
:rules="[requiredValidator]"
|
||||
:items="redoTypeItems"
|
||||
/>
|
||||
</VCol>
|
||||
@@ -411,7 +460,10 @@ const dropdownItems = ref([
|
||||
<VTextField
|
||||
v-model="redoTmdbId"
|
||||
label="TMDB编号"
|
||||
:rules="[requiredValidator, numberValidator]"
|
||||
placeholder="留空自动识别"
|
||||
:rules="[numberValidator]"
|
||||
append-inner-icon="mdi-magnify"
|
||||
@click:append-inner.stop="tmdbSelectorDialog = true"
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
@@ -429,6 +481,13 @@ const dropdownItems = ref([
|
||||
</VCard>
|
||||
</VDialog>
|
||||
<span v-if="selected.length > 0" class="fixed right-5 bottom-5">
|
||||
<VBtn
|
||||
icon="mdi-redo-variant"
|
||||
class="me-2"
|
||||
color="primary"
|
||||
size="x-large"
|
||||
@click="retransferBatch"
|
||||
/>
|
||||
<VBtn
|
||||
icon="mdi-trash-can-outline"
|
||||
color="error"
|
||||
@@ -440,7 +499,7 @@ const dropdownItems = ref([
|
||||
<vDialog
|
||||
v-model="progressDialog"
|
||||
:scrim="false"
|
||||
width="400"
|
||||
width="25rem"
|
||||
>
|
||||
<vCard
|
||||
color="primary"
|
||||
@@ -455,6 +514,56 @@ const dropdownItems = ref([
|
||||
</vCardText>
|
||||
</vCard>
|
||||
</vDialog>
|
||||
<!-- TMDB ID搜索框 -->
|
||||
<vDialog
|
||||
v-model="tmdbSelectorDialog"
|
||||
width="600"
|
||||
scrollable
|
||||
>
|
||||
<TmdbSelectorCard
|
||||
v-model="redoTmdbId"
|
||||
@close="tmdbSelectorDialog = false"
|
||||
/>
|
||||
</vDialog>
|
||||
<!-- 底部弹窗 -->
|
||||
<VBottomSheet v-model="deleteConfirmDialog" inset>
|
||||
<VCard class="text-center">
|
||||
<DialogCloseBtn @click="deleteConfirmDialog = false" />
|
||||
<VCardTitle class="pe-10">
|
||||
{{ confirmTitle }}
|
||||
</VCardTitle>
|
||||
<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="warning"
|
||||
class="mb-2 mx-2"
|
||||
@click="deleteConfirmHandler(true, false)"
|
||||
>
|
||||
删除历史记录和源文件
|
||||
</VBtn>
|
||||
<VBtn
|
||||
color="info"
|
||||
class="mb-2 mx-2"
|
||||
@click="deleteConfirmHandler(false, true)"
|
||||
>
|
||||
删除历史记录和媒体库文件
|
||||
</VBtn>
|
||||
<VBtn
|
||||
color="error"
|
||||
class="mb-2 mx-2"
|
||||
@click="deleteConfirmHandler(true, true)"
|
||||
>
|
||||
删除历史记录、源文件和媒体库文件
|
||||
</VBtn>
|
||||
</div>
|
||||
</VCard>
|
||||
</VBottomSheet>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -86,7 +86,7 @@ async function saveAccountInfo() {
|
||||
accountInfo.value.password = newPassword.value
|
||||
}
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.put('user', accountInfo.value)
|
||||
const result: { [key: string]: any } = await api.put('user/', accountInfo.value)
|
||||
if (result.success)
|
||||
$toast.success('用户信息保存成功!')
|
||||
else
|
||||
@@ -100,7 +100,7 @@ async function saveAccountInfo() {
|
||||
// 调用API,查询所有用户
|
||||
async function loadAllUsers() {
|
||||
try {
|
||||
const result: User[] = await api.get('/user')
|
||||
const result: User[] = await api.get('/user/')
|
||||
|
||||
allUsers.value = result
|
||||
}
|
||||
@@ -131,7 +131,7 @@ async function deactivateUser(user: User) {
|
||||
try {
|
||||
user.is_active = !user.is_active
|
||||
|
||||
const result: { [key: string]: any } = await api.put('user', user)
|
||||
const result: { [key: string]: any } = await api.put('user/', user)
|
||||
if (result.success) {
|
||||
$toast.success('用户冻结成功!')
|
||||
loadAllUsers()
|
||||
@@ -408,7 +408,7 @@ onMounted(() => {
|
||||
<!-- 站点编辑弹窗 -->
|
||||
<VDialog
|
||||
v-model="addUserDialog"
|
||||
max-width="800"
|
||||
max-width="50rem"
|
||||
persistent
|
||||
>
|
||||
<!-- Dialog Content -->
|
||||
|
||||
@@ -47,7 +47,7 @@ onMounted(() => {
|
||||
|
||||
<template>
|
||||
<VCard title="消息通知">
|
||||
<VCardText> 对应消息类型只会发送给选中的消息渠道 </VCardText>
|
||||
<VCardText> 对应消息类型只会发送给选中的消息渠道。 </VCardText>
|
||||
|
||||
<VTable class="text-no-wrap">
|
||||
<thead>
|
||||
@@ -64,6 +64,9 @@ onMounted(() => {
|
||||
<th scope="col">
|
||||
Slack
|
||||
</th>
|
||||
<th scope="col">
|
||||
SynologyChat
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -83,6 +86,9 @@ onMounted(() => {
|
||||
<td>
|
||||
<VCheckbox v-model="message.slack" />
|
||||
</td>
|
||||
<td>
|
||||
<VCheckbox v-model="message.synologychat" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="messagemTypes.length === 0">
|
||||
<td
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { useToast } from 'vue-toast-notification'
|
||||
import api from '@/api'
|
||||
import FilterRuleCard from '@/components/cards/FilterRuleCard.vue'
|
||||
|
||||
// 规则卡片类型
|
||||
interface FilterCard {
|
||||
// 优先级
|
||||
pri: string
|
||||
// 已选规则
|
||||
rules: string[]
|
||||
}
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
@@ -23,34 +14,11 @@ const TorrentPriorityItems = [
|
||||
{ title: '做种数优先', value: 'seeder' },
|
||||
]
|
||||
|
||||
// 规则卡片列表
|
||||
const filterCards = ref<FilterCard[]>([])
|
||||
|
||||
// 洗版规则卡片列表
|
||||
const filterCards2 = ref<FilterCard[]>([])
|
||||
|
||||
// 查询已设置过滤规则
|
||||
async function queryCustomFilters(ruleType: string) {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get(`system/setting/${ruleType}`)
|
||||
if (result.success) {
|
||||
// 保存的是个字符串,需要分割成数组
|
||||
const groups = result.data?.value?.split('>') ?? []
|
||||
|
||||
// 生成规则卡片
|
||||
const cards = ruleType === 'FilterRules' ? filterCards : filterCards2
|
||||
cards.value = groups?.map((group: string, index: number) => {
|
||||
return {
|
||||
pri: (index + 1).toString(),
|
||||
rules: group.split('&'),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
// 包含与排除规则
|
||||
const defaultFilterRules = ref({
|
||||
include: '',
|
||||
exclude: '',
|
||||
})
|
||||
|
||||
// 查询种子优先规则
|
||||
async function queryTorrentPriority() {
|
||||
@@ -66,31 +34,14 @@ async function queryTorrentPriority() {
|
||||
}
|
||||
}
|
||||
|
||||
// 保存用户设置的规则
|
||||
async function saveCustomFilters(ruleType: string) {
|
||||
// 查询包含与排除规则
|
||||
async function queryDefaultFilter() {
|
||||
try {
|
||||
// 有值才处理
|
||||
let value = ''
|
||||
if (filterCards.value.length !== 0) {
|
||||
// 将卡片规则接装为字符串
|
||||
const cards = ruleType === 'FilterRules' ? filterCards : filterCards2
|
||||
value = cards.value
|
||||
.filter(card => card.rules.length > 0)
|
||||
.map(card => card.rules.join('&'))
|
||||
.join('>')
|
||||
}
|
||||
// 保存
|
||||
const result: { [key: string]: any } = await api.post(
|
||||
`system/setting/${ruleType}`,
|
||||
value,
|
||||
const result: { [key: string]: any } = await api.get(
|
||||
'system/setting/DefaultFilterRules',
|
||||
)
|
||||
|
||||
const msg = ruleType === 'FilterRules' ? '过滤规则' : '洗版规则'
|
||||
|
||||
if (result.success)
|
||||
$toast.success(`${msg}保存成功`)
|
||||
else
|
||||
$toast.error(`${msg}保存失败!`)
|
||||
if (result.data?.value)
|
||||
defaultFilterRules.value = result.data?.value
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
@@ -116,135 +67,47 @@ async function saveTorrentPriority() {
|
||||
}
|
||||
}
|
||||
|
||||
// 更新规则卡片的值
|
||||
function updateFilterCardValue(pri: string, rules: string[]) {
|
||||
const card = filterCards.value.find(card => card.pri === pri)
|
||||
if (card)
|
||||
card.rules = rules
|
||||
}
|
||||
|
||||
// 更新洗版规则卡片的值
|
||||
function updateFilterCardValue2(pri: string, rules: string[]) {
|
||||
const card = filterCards2.value.find(card => card.pri === pri)
|
||||
if (card)
|
||||
card.rules = rules
|
||||
}
|
||||
|
||||
// 移除卡片
|
||||
function filterCardClose(ruleType: string, pri: string) {
|
||||
// 将pri对应的卡片从列表中删除,并更新剩余卡片的序号
|
||||
const updatedCards = (ruleType === 'FilterRules' ? filterCards.value : filterCards2.value)
|
||||
.filter(card => card.pri !== pri)
|
||||
.map((card, index) => {
|
||||
card.pri = (index + 1).toString()
|
||||
return card
|
||||
})
|
||||
// 更新 filterCards.value
|
||||
if (ruleType === 'FilterRules')
|
||||
filterCards.value = updatedCards
|
||||
else
|
||||
filterCards2.value = updatedCards
|
||||
}
|
||||
|
||||
// 增加卡片
|
||||
function addFilterCard(ruleType: string) {
|
||||
const cards = ruleType === 'FilterRules' ? filterCards : filterCards2
|
||||
// 优先级
|
||||
const pri = (cards.value.length + 1).toString()
|
||||
|
||||
// 新卡片
|
||||
const newCard: FilterCard = { pri, rules: [] }
|
||||
|
||||
// 添加到列表
|
||||
cards.value.push(newCard)
|
||||
// 保存包含与排除规则
|
||||
async function saveDefaultFilter() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.post(
|
||||
'system/setting/DefaultFilterRules',
|
||||
defaultFilterRules.value,
|
||||
)
|
||||
if (result.success)
|
||||
$toast.success('默认包含/排除规则保存成功')
|
||||
else
|
||||
$toast.error('默认包含/排除规则保存失败!')
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
queryTorrentPriority()
|
||||
queryCustomFilters('FilterRules')
|
||||
queryCustomFilters('FilterRules2')
|
||||
queryDefaultFilter()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VRow>
|
||||
<VCol cols="12">
|
||||
<VCard title="过滤规则">
|
||||
<VCardSubtitle> 设置在搜索和订阅时默认使用的过滤规则 </VCardSubtitle>
|
||||
<VCardItem>
|
||||
<div class="grid gap-3 grid-filterrule-card">
|
||||
<FilterRuleCard
|
||||
v-for="(card, index) in filterCards"
|
||||
:key="index"
|
||||
:pri="card.pri"
|
||||
:rules="card.rules"
|
||||
@changed="updateFilterCardValue"
|
||||
@close="filterCardClose('FilterRules', card.pri)"
|
||||
/>
|
||||
</div>
|
||||
</VCardItem>
|
||||
<VCardItem>
|
||||
<VBtn
|
||||
type="submit"
|
||||
class="me-2"
|
||||
@click="saveCustomFilters('FilterRules')"
|
||||
>
|
||||
保存
|
||||
</VBtn>
|
||||
<VBtn
|
||||
color="success"
|
||||
variant="tonal"
|
||||
@click="addFilterCard('FilterRules')"
|
||||
>
|
||||
<VIcon icon="mdi-plus" />
|
||||
<span class="d-none d-sm-block">增加规则</span>
|
||||
</VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="洗版规则">
|
||||
<VCardSubtitle> 设置在订阅洗版时使用的过滤规则,匹配优先级1时洗版完成 </VCardSubtitle>
|
||||
<VCardItem>
|
||||
<div class="grid gap-3 grid-filterrule-card">
|
||||
<FilterRuleCard
|
||||
v-for="(card, index) in filterCards2"
|
||||
:key="index"
|
||||
:pri="card.pri"
|
||||
:rules="card.rules"
|
||||
@changed="updateFilterCardValue2"
|
||||
@close="filterCardClose('FilterRules2', card.pri)"
|
||||
/>
|
||||
</div>
|
||||
</VCardItem>
|
||||
<VCardItem>
|
||||
<VBtn
|
||||
type="submit"
|
||||
class="me-2"
|
||||
@click="saveCustomFilters('FilterRules2')"
|
||||
>
|
||||
保存
|
||||
</VBtn>
|
||||
<VBtn
|
||||
color="success"
|
||||
variant="tonal"
|
||||
@click="addFilterCard('FilterRules2')"
|
||||
>
|
||||
<VIcon icon="mdi-plus" />
|
||||
<span class="d-none d-sm-block">增加规则</span>
|
||||
</VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="下载优先规则">
|
||||
<VCardSubtitle> 按站点优先级或资源种子数量排序和择优下载。 </VCardSubtitle>
|
||||
<VCardText>
|
||||
<VSelect
|
||||
v-model="selectedTorrentPriority"
|
||||
:items="TorrentPriorityItems"
|
||||
label="优先规则"
|
||||
outlined
|
||||
/>
|
||||
<VForm>
|
||||
<VRow>
|
||||
<VCol cols="12" md="6">
|
||||
<VSelect
|
||||
v-model="selectedTorrentPriority"
|
||||
:items="TorrentPriorityItems"
|
||||
label="优先规则"
|
||||
outlined
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</vform>
|
||||
</VCardText>
|
||||
<VCardItem>
|
||||
<VBtn
|
||||
@@ -256,6 +119,39 @@ onMounted(() => {
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="默认过滤规则">
|
||||
<VCardSubtitle> 设置在搜索和订阅时默认使用的过滤规则。 </VCardSubtitle>
|
||||
<VCardText>
|
||||
<VForm>
|
||||
<VRow>
|
||||
<VCol cols="12" md="6">
|
||||
<VTextField
|
||||
v-model="defaultFilterRules.include"
|
||||
type="text"
|
||||
label="包含(关键字、正则式)"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol cols="12" md="6">
|
||||
<VTextField
|
||||
v-model="defaultFilterRules.exclude"
|
||||
type="text"
|
||||
label="排除(关键字、正则式)"
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</VForm>
|
||||
</VCardText>
|
||||
<VCardItem>
|
||||
<VBtn
|
||||
type="submit"
|
||||
@click="saveDefaultFilter"
|
||||
>
|
||||
保存
|
||||
</VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</template>
|
||||
|
||||
|
||||
271
src/views/setting/AccountSettingSearch.vue
Normal file
271
src/views/setting/AccountSettingSearch.vue
Normal file
@@ -0,0 +1,271 @@
|
||||
<script lang="ts" setup>
|
||||
import { useToast } from 'vue-toast-notification'
|
||||
import api from '@/api'
|
||||
import FilterRuleCard from '@/components/cards/FilterRuleCard.vue'
|
||||
import type { Site } from '@/api/types'
|
||||
|
||||
// 规则卡片类型
|
||||
interface FilterCard {
|
||||
// 优先级
|
||||
pri: string
|
||||
// 已选规则
|
||||
rules: string[]
|
||||
}
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
// 规则卡片列表
|
||||
const filterCards = ref<FilterCard[]>([])
|
||||
|
||||
// 所有站点
|
||||
const allSites = ref<Site[]>([])
|
||||
|
||||
// 选中订阅站点
|
||||
const selectedSites = ref<number[]>([])
|
||||
|
||||
// 查询已设置优先级规则
|
||||
async function queryCustomFilters() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get('system/setting/SearchFilterRules')
|
||||
if (result.success) {
|
||||
// 保存的是个字符串,需要分割成数组
|
||||
const groups = result.data?.value?.split('>') ?? []
|
||||
|
||||
// 生成规则卡片
|
||||
filterCards.value = groups?.map((group: string, index: number) => {
|
||||
return {
|
||||
pri: (index + 1).toString(),
|
||||
rules: group.split('&'),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 保存用户设置的规则
|
||||
async function saveCustomFilters() {
|
||||
try {
|
||||
// 有值才处理
|
||||
let value = ''
|
||||
if (filterCards.value.length !== 0) {
|
||||
// 将卡片规则接装为字符串
|
||||
value = filterCards.value
|
||||
.filter(card => card.rules.length > 0)
|
||||
.map(card => card.rules.join('&'))
|
||||
.join('>')
|
||||
}
|
||||
// 保存
|
||||
const result: { [key: string]: any } = await api.post(
|
||||
'system/setting/SearchFilterRules',
|
||||
value,
|
||||
)
|
||||
|
||||
if (result.success)
|
||||
$toast.success('搜索优先级保存成功')
|
||||
else
|
||||
$toast.error('搜索优先级保存失败!')
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 更新规则卡片的值
|
||||
function updateFilterCardValue(pri: string, rules: string[]) {
|
||||
const card = filterCards.value.find(card => card.pri === pri)
|
||||
if (card)
|
||||
card.rules = rules
|
||||
}
|
||||
|
||||
// 移除卡片
|
||||
function filterCardClose(pri: string) {
|
||||
// 将pri对应的卡片从列表中删除,并更新剩余卡片的序号
|
||||
const updatedCards = filterCards.value
|
||||
.filter(card => card.pri !== pri)
|
||||
.map((card, index) => {
|
||||
card.pri = (index + 1).toString()
|
||||
return card
|
||||
})
|
||||
// 更新 filterCards.value
|
||||
filterCards.value = updatedCards
|
||||
}
|
||||
|
||||
// 增加卡片
|
||||
function addFilterCard() {
|
||||
// 优先级
|
||||
const pri = (filterCards.value.length + 1).toString()
|
||||
|
||||
// 新卡片
|
||||
const newCard: FilterCard = { pri, rules: [] }
|
||||
|
||||
// 添加到列表
|
||||
filterCards.value.push(newCard)
|
||||
}
|
||||
|
||||
// 查询所有站点
|
||||
async function querySites() {
|
||||
try {
|
||||
const data: Site[] = await api.get('site/')
|
||||
|
||||
// 过滤站点,只有启用的站点才显示
|
||||
allSites.value = data.filter(item => item.is_active)
|
||||
querySelectedSites()
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 查询用户选中的站点
|
||||
async function querySelectedSites() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get('system/setting/IndexerSites')
|
||||
|
||||
selectedSites.value = result.data?.value ?? []
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 保存用户选中的站点
|
||||
async function saveSelectedSites() {
|
||||
try {
|
||||
// 用户名密码
|
||||
const result: { [key: string]: any } = await api.post('system/setting/IndexerSites', selectedSites.value)
|
||||
|
||||
if (result.success)
|
||||
$toast.success('搜索站点保存成功')
|
||||
else
|
||||
$toast.error('搜索站点保存失败!')
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 上调优先级
|
||||
function onLevelUp(pri: string) {
|
||||
// 找到当前卡片
|
||||
const card = filterCards.value.find(card => card.pri === pri)
|
||||
if (!card)
|
||||
return
|
||||
|
||||
// 找到当前卡片的上一张卡片
|
||||
const prevCard = filterCards.value.find(card => card.pri === (parseInt(pri) - 1).toString())
|
||||
if (!prevCard)
|
||||
return
|
||||
|
||||
// 交换两张卡片的优先级
|
||||
const temp = card.pri
|
||||
card.pri = prevCard.pri
|
||||
prevCard.pri = temp
|
||||
|
||||
// 卡片重新按优先级排序
|
||||
filterCards.value.sort((a, b) => parseInt(a.pri) - parseInt(b.pri))
|
||||
}
|
||||
|
||||
// 下调优先级
|
||||
function onLevelDown(pri: string) {
|
||||
// 找到当前卡片
|
||||
const card = filterCards.value.find(card => card.pri === pri)
|
||||
if (!card)
|
||||
return
|
||||
|
||||
// 找到当前卡片的下一张卡片
|
||||
const nextCard = filterCards.value.find(card => card.pri === (parseInt(pri) + 1).toString())
|
||||
if (!nextCard)
|
||||
return
|
||||
|
||||
// 交换两张卡片的优先级
|
||||
const temp = card.pri
|
||||
card.pri = nextCard.pri
|
||||
nextCard.pri = temp
|
||||
|
||||
// 卡片重新按优先级排序
|
||||
filterCards.value.sort((a, b) => parseInt(a.pri) - parseInt(b.pri))
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
queryCustomFilters()
|
||||
querySites()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VRow>
|
||||
<VCol cols="12">
|
||||
<VCard title="搜索站点">
|
||||
<VCardSubtitle> 只有选中的站点才会在搜索中使用。</VCardSubtitle>
|
||||
|
||||
<VCardItem>
|
||||
<VChipGroup v-model="selectedSites" column multiple>
|
||||
<VChip
|
||||
v-for="site in allSites"
|
||||
:key="site.id"
|
||||
:color="selectedSites.includes(site.id) ? 'primary' : ''"
|
||||
filter
|
||||
variant="outlined"
|
||||
:value="site.id"
|
||||
>
|
||||
{{ site.name }}
|
||||
</VChip>
|
||||
</VChipGroup>
|
||||
</VCardItem>
|
||||
|
||||
<VCardItem>
|
||||
<VBtn type="submit" @click="saveSelectedSites">
|
||||
保存
|
||||
</VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="搜索优先级">
|
||||
<VCardSubtitle> 设置在搜索时默认使用的优先级排序,未在优先级中的资源将不在搜索结果中显示。 </VCardSubtitle>
|
||||
<VCardItem>
|
||||
<div class="grid gap-3 grid-filterrule-card">
|
||||
<FilterRuleCard
|
||||
v-for="(card, index) in filterCards"
|
||||
:key="index"
|
||||
:pri="card.pri"
|
||||
:maxpri="filterCards.length.toString()"
|
||||
:rules="card.rules"
|
||||
@changed="updateFilterCardValue"
|
||||
@close="filterCardClose(card.pri)"
|
||||
@leveldown="onLevelDown"
|
||||
@levelup="onLevelUp"
|
||||
/>
|
||||
</div>
|
||||
</VCardItem>
|
||||
<VCardItem>
|
||||
<VBtn
|
||||
type="submit"
|
||||
class="me-2"
|
||||
@click="saveCustomFilters()"
|
||||
>
|
||||
保存
|
||||
</VBtn>
|
||||
<VBtn
|
||||
color="success"
|
||||
variant="tonal"
|
||||
@click="addFilterCard()"
|
||||
>
|
||||
<VIcon icon="mdi-plus" />
|
||||
</VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.grid-filterrule-card {
|
||||
grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
|
||||
padding-block-end: 1rem;
|
||||
}
|
||||
</style>
|
||||
138
src/views/setting/AccountSettingService.vue
Normal file
138
src/views/setting/AccountSettingService.vue
Normal file
@@ -0,0 +1,138 @@
|
||||
<script lang="ts" setup>
|
||||
import { useToast } from 'vue-toast-notification'
|
||||
import api from '@/api'
|
||||
import type { ScheduleInfo } from '@/api/types'
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
// 定时服务列表
|
||||
const schedulerList = ref<ScheduleInfo[]>([])
|
||||
|
||||
// 定时器
|
||||
let refreshTimer: NodeJS.Timer | null = null
|
||||
|
||||
// 调用API加载定时服务列表
|
||||
async function loadSchedulerList() {
|
||||
try {
|
||||
const res: ScheduleInfo[] = await api.get('dashboard/schedule')
|
||||
|
||||
schedulerList.value = res
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
// 任务状态颜色
|
||||
function getSchedulerColor(status: string) {
|
||||
switch (status) {
|
||||
case '正在运行':
|
||||
return 'success'
|
||||
case '已停止':
|
||||
return 'error'
|
||||
case '等待':
|
||||
return ''
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
// 执行命令
|
||||
function runCommand(id: string) {
|
||||
try {
|
||||
// 异步提交
|
||||
api.get('system/runscheduler', {
|
||||
params: {
|
||||
jobid: id,
|
||||
},
|
||||
})
|
||||
$toast.success('定时作业执行请求提交成功!')
|
||||
// 1秒后刷新数据
|
||||
setTimeout(() => {
|
||||
loadSchedulerList()
|
||||
}, 1000)
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadSchedulerList()
|
||||
|
||||
// 启动定时器
|
||||
refreshTimer = setInterval(() => {
|
||||
loadSchedulerList()
|
||||
}, 5000)
|
||||
})
|
||||
|
||||
// 组件卸载时停止定时器
|
||||
onUnmounted(() => {
|
||||
if (refreshTimer) {
|
||||
clearInterval(refreshTimer)
|
||||
refreshTimer = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VCard title="定时作业">
|
||||
<VCardText> 手动执行不会影响作业正常的时间表。 </VCardText>
|
||||
|
||||
<VTable class="text-no-wrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
任务名称
|
||||
</th>
|
||||
<th scope="col">
|
||||
任务状态
|
||||
</th>
|
||||
<th scope="col">
|
||||
下一次执行时间
|
||||
</th>
|
||||
<th scope="col" />
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="scheduler in schedulerList"
|
||||
:key="scheduler.id"
|
||||
>
|
||||
<td>
|
||||
{{ scheduler.name }}
|
||||
</td>
|
||||
<td>
|
||||
<VChip :color="getSchedulerColor(scheduler.status)">
|
||||
{{ scheduler.status }}
|
||||
</VChip>
|
||||
</td>
|
||||
<td>
|
||||
{{ scheduler.next_run }}
|
||||
</td>
|
||||
<td>
|
||||
<VBtn
|
||||
size="small"
|
||||
:disabled="scheduler.status === '正在运行'"
|
||||
@click="runCommand(scheduler.id)"
|
||||
>
|
||||
<template #prepend>
|
||||
<VIcon>mdi-play</VIcon>
|
||||
</template>
|
||||
执行
|
||||
</VBtn>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="schedulerList.length === 0">
|
||||
<td
|
||||
colspan="4"
|
||||
class="text-center"
|
||||
>
|
||||
没有后台服务
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</VTable>
|
||||
</VCard>
|
||||
</template>
|
||||
@@ -1,19 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
import { useToast } from 'vue-toast-notification'
|
||||
import api from '@/api'
|
||||
import type { Site } from '@/api/types'
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
// 选中搜索站点
|
||||
const selectedSites = ref<number[]>([])
|
||||
// 选中订阅站点
|
||||
const selectedRssSites = ref<number[]>([])
|
||||
|
||||
// 所有站点
|
||||
const allSites = ref<Site[]>([])
|
||||
|
||||
// 站点重置
|
||||
const isConfirmResetSites = ref(false)
|
||||
|
||||
@@ -23,76 +14,6 @@ const resetSitesText = ref('重置站点数据')
|
||||
// 站点重置按钮可用状态
|
||||
const resetSitesDisabled = ref(false)
|
||||
|
||||
// 查询所有站点
|
||||
async function querySites() {
|
||||
try {
|
||||
const data: Site[] = await api.get('site')
|
||||
|
||||
// 过滤站点,只有启用的站点才显示
|
||||
allSites.value = data.filter(item => item.is_active)
|
||||
querySelectedSites()
|
||||
querySelectedRssSites()
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 查询用户选中的站点
|
||||
async function querySelectedSites() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get('system/setting/IndexerSites')
|
||||
|
||||
selectedSites.value = result.data?.value ?? []
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 保存用户选中的站点
|
||||
async function saveSelectedSites() {
|
||||
try {
|
||||
// 用户名密码
|
||||
const result: { [key: string]: any } = await api.post('system/setting/IndexerSites', selectedSites.value)
|
||||
|
||||
if (result.success)
|
||||
$toast.success('搜索站点保存成功')
|
||||
else
|
||||
$toast.error('搜索站点保存失败!')
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 查询用户选中的订阅站点
|
||||
async function querySelectedRssSites() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get('system/setting/RssSites')
|
||||
|
||||
selectedRssSites.value = result.data?.value ?? []
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 保存用户选中的订阅站点
|
||||
async function saveSelectedRssSites() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.post('system/setting/RssSites', selectedRssSites.value)
|
||||
|
||||
if (result.success)
|
||||
$toast.success('订阅站点保存成功')
|
||||
else
|
||||
$toast.error('订阅站点保存失败!')
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 重置站点
|
||||
async function resetSites() {
|
||||
try {
|
||||
@@ -100,13 +21,12 @@ async function resetSites() {
|
||||
resetSitesText.value = '正在重置...'
|
||||
|
||||
const result: { [key: string]: any } = await api.get('site/reset')
|
||||
if (result.success) {
|
||||
if (result.success)
|
||||
$toast.success('站点重置成功,请等待CookieCloud同步完成!')
|
||||
querySites()
|
||||
}
|
||||
else {
|
||||
|
||||
else
|
||||
$toast.error('站点重置失败!')
|
||||
}
|
||||
|
||||
resetSitesDisabled.value = false
|
||||
resetSitesText.value = '重置站点数据'
|
||||
}
|
||||
@@ -114,71 +34,15 @@ async function resetSites() {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
querySites()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VRow>
|
||||
<VCol cols="12">
|
||||
<VCard title="搜索站点">
|
||||
<VCardSubtitle> 只有选中的站点才会在搜索中使用</VCardSubtitle>
|
||||
|
||||
<VCardItem>
|
||||
<VChipGroup v-model="selectedSites" column multiple>
|
||||
<VChip
|
||||
v-for="site in allSites"
|
||||
:key="site.id"
|
||||
:color="selectedSites.includes(site.id) ? 'primary' : ''"
|
||||
filter
|
||||
variant="outlined"
|
||||
:value="site.id"
|
||||
>
|
||||
{{ site.name }}
|
||||
</VChip>
|
||||
</VChipGroup>
|
||||
</VCardItem>
|
||||
|
||||
<VCardItem>
|
||||
<VBtn type="submit" @click="saveSelectedSites">
|
||||
保存
|
||||
</VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="订阅站点">
|
||||
<VCardSubtitle> 只有选中的站点才会在订阅中使用</VCardSubtitle>
|
||||
|
||||
<VCardItem>
|
||||
<VChipGroup v-model="selectedRssSites" column multiple>
|
||||
<VChip
|
||||
v-for="site in allSites"
|
||||
:key="site.id"
|
||||
:color="selectedRssSites.includes(site.id) ? 'primary' : ''"
|
||||
filter
|
||||
variant="outlined"
|
||||
:value="site.id"
|
||||
>
|
||||
{{ site.name }}
|
||||
</VChip>
|
||||
</VChipGroup>
|
||||
</VCardItem>
|
||||
|
||||
<VCardItem>
|
||||
<VBtn type="submit" @click="saveSelectedRssSites">
|
||||
保存
|
||||
</VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="站点重置">
|
||||
<VCardText>
|
||||
<div>
|
||||
<VCheckbox v-model="isConfirmResetSites" label="确认删除所有站点数据并重新同步" />
|
||||
<VCheckbox v-model="isConfirmResetSites" label="确认删除所有站点数据并重新同步。" />
|
||||
</div>
|
||||
|
||||
<VBtn :disabled="!isConfirmResetSites || resetSitesDisabled" color="error" class="mt-3" @click="resetSites">
|
||||
|
||||
325
src/views/setting/AccountSettingSubscribe.vue
Normal file
325
src/views/setting/AccountSettingSubscribe.vue
Normal file
@@ -0,0 +1,325 @@
|
||||
<script lang="ts" setup>
|
||||
import { useToast } from 'vue-toast-notification'
|
||||
import api from '@/api'
|
||||
import FilterRuleCard from '@/components/cards/FilterRuleCard.vue'
|
||||
import type { Site } from '@/api/types'
|
||||
|
||||
// 规则卡片类型
|
||||
interface FilterCard {
|
||||
// 优先级
|
||||
pri: string
|
||||
// 已选规则
|
||||
rules: string[]
|
||||
}
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
// 订阅规则卡片列表
|
||||
const subscribeFilterCards = ref<FilterCard[]>([])
|
||||
|
||||
// 洗版规则卡片列表
|
||||
const bestVersionFilterCards = ref<FilterCard[]>([])
|
||||
|
||||
// 所有站点
|
||||
const allSites = ref<Site[]>([])
|
||||
|
||||
// 选中订阅站点
|
||||
const selectedRssSites = ref<number[]>([])
|
||||
|
||||
// 查询用户选中的订阅站点
|
||||
async function querySelectedRssSites() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get('system/setting/RssSites')
|
||||
|
||||
selectedRssSites.value = result.data?.value ?? []
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 保存用户选中的订阅站点
|
||||
async function saveSelectedRssSites() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.post('system/setting/RssSites', selectedRssSites.value)
|
||||
|
||||
if (result.success)
|
||||
$toast.success('订阅站点保存成功')
|
||||
else
|
||||
$toast.error('订阅站点保存失败!')
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 查询所有站点
|
||||
async function querySites() {
|
||||
try {
|
||||
const data: Site[] = await api.get('site/')
|
||||
|
||||
// 过滤站点,只有启用的站点才显示
|
||||
allSites.value = data.filter(item => item.is_active)
|
||||
querySelectedRssSites()
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 查询已设置优先级规则
|
||||
async function queryCustomFilters(ruleType: string) {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get(`system/setting/${ruleType}`)
|
||||
if (result.success) {
|
||||
// 保存的是个字符串,需要分割成数组
|
||||
const groups = result.data?.value?.split('>') ?? []
|
||||
|
||||
// 生成规则卡片
|
||||
const cards = ruleType === 'SubscribeFilterRules' ? subscribeFilterCards : bestVersionFilterCards
|
||||
cards.value = groups?.map((group: string, index: number) => {
|
||||
return {
|
||||
pri: (index + 1).toString(),
|
||||
rules: group.split('&'),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 保存用户设置的规则
|
||||
async function saveCustomFilters(ruleType: string) {
|
||||
try {
|
||||
// 有值才处理
|
||||
let value = ''
|
||||
const cards = ruleType === 'SubscribeFilterRules' ? subscribeFilterCards : bestVersionFilterCards
|
||||
if (cards.value.length !== 0) {
|
||||
// 将卡片规则接装为字符串
|
||||
value = cards.value
|
||||
.filter(card => card.rules.length > 0)
|
||||
.map(card => card.rules.join('&'))
|
||||
.join('>')
|
||||
}
|
||||
// 保存
|
||||
const result: { [key: string]: any } = await api.post(
|
||||
`system/setting/${ruleType}`,
|
||||
value,
|
||||
)
|
||||
|
||||
const msg = ruleType === 'SubscribeFilterRules' ? '订阅优先级' : '洗版优先级'
|
||||
|
||||
if (result.success)
|
||||
$toast.success(`${msg}保存成功`)
|
||||
else
|
||||
$toast.error(`${msg}保存失败!`)
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 更新规则卡片的值
|
||||
function updateFilterCardValue(pri: string, rules: string[]) {
|
||||
const card = subscribeFilterCards.value.find(card => card.pri === pri)
|
||||
if (card)
|
||||
card.rules = rules
|
||||
}
|
||||
|
||||
// 更新洗版规则卡片的值
|
||||
function updateFilterCardValue2(pri: string, rules: string[]) {
|
||||
const card = bestVersionFilterCards.value.find(card => card.pri === pri)
|
||||
if (card)
|
||||
card.rules = rules
|
||||
}
|
||||
|
||||
// 移除卡片
|
||||
function filterCardClose(ruleType: string, pri: string) {
|
||||
// 将pri对应的卡片从列表中删除,并更新剩余卡片的序号
|
||||
const updatedCards = (ruleType === 'SubscribeFilterRules' ? subscribeFilterCards.value : bestVersionFilterCards.value)
|
||||
.filter(card => card.pri !== pri)
|
||||
.map((card, index) => {
|
||||
card.pri = (index + 1).toString()
|
||||
return card
|
||||
})
|
||||
// 更新 subscribeFilterCards.value
|
||||
if (ruleType === 'SubscribeFilterRules')
|
||||
subscribeFilterCards.value = updatedCards
|
||||
else
|
||||
bestVersionFilterCards.value = updatedCards
|
||||
}
|
||||
|
||||
// 增加卡片
|
||||
function addFilterCard(ruleType: string) {
|
||||
const cards = ruleType === 'SubscribeFilterRules' ? subscribeFilterCards : bestVersionFilterCards
|
||||
// 优先级
|
||||
const pri = (cards.value.length + 1).toString()
|
||||
|
||||
// 新卡片
|
||||
const newCard: FilterCard = { pri, rules: [] }
|
||||
|
||||
// 添加到列表
|
||||
cards.value.push(newCard)
|
||||
}
|
||||
|
||||
// 上调优先级
|
||||
function onLevelUp(filterCards: FilterCard[], pri: string) {
|
||||
// 找到当前卡片
|
||||
const card = filterCards.find(card => card.pri === pri)
|
||||
if (!card)
|
||||
return
|
||||
|
||||
// 找到当前卡片的上一张卡片
|
||||
const prevCard = filterCards.find(card => card.pri === (parseInt(pri) - 1).toString())
|
||||
if (!prevCard)
|
||||
return
|
||||
|
||||
// 交换两张卡片的优先级
|
||||
const temp = card.pri
|
||||
card.pri = prevCard.pri
|
||||
prevCard.pri = temp
|
||||
|
||||
// 卡片重新按优先级排序
|
||||
filterCards.sort((a, b) => parseInt(a.pri) - parseInt(b.pri))
|
||||
}
|
||||
|
||||
// 下调优先级
|
||||
function onLevelDown(filterCards: FilterCard[], pri: string) {
|
||||
// 找到当前卡片
|
||||
const card = filterCards.find(card => card.pri === pri)
|
||||
if (!card)
|
||||
return
|
||||
|
||||
// 找到当前卡片的下一张卡片
|
||||
const nextCard = filterCards.find(card => card.pri === (parseInt(pri) + 1).toString())
|
||||
if (!nextCard)
|
||||
return
|
||||
|
||||
// 交换两张卡片的优先级
|
||||
const temp = card.pri
|
||||
card.pri = nextCard.pri
|
||||
nextCard.pri = temp
|
||||
|
||||
// 卡片重新按优先级排序
|
||||
filterCards.sort((a, b) => parseInt(a.pri) - parseInt(b.pri))
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
querySites()
|
||||
queryCustomFilters('SubscribeFilterRules')
|
||||
queryCustomFilters('BestVersionFilterRules')
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VRow>
|
||||
<VCol cols="12">
|
||||
<VCard title="订阅站点">
|
||||
<VCardSubtitle> 只有选中的站点才会在订阅中使用。</VCardSubtitle>
|
||||
|
||||
<VCardItem>
|
||||
<VChipGroup v-model="selectedRssSites" column multiple>
|
||||
<VChip
|
||||
v-for="site in allSites"
|
||||
:key="site.id"
|
||||
:color="selectedRssSites.includes(site.id) ? 'primary' : ''"
|
||||
filter
|
||||
variant="outlined"
|
||||
:value="site.id"
|
||||
>
|
||||
{{ site.name }}
|
||||
</VChip>
|
||||
</VChipGroup>
|
||||
</VCardItem>
|
||||
|
||||
<VCardItem>
|
||||
<VBtn type="submit" @click="saveSelectedRssSites">
|
||||
保存
|
||||
</VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="订阅优先级">
|
||||
<VCardSubtitle> 设置在正常订阅时默认使用的优先级,未在优先级中的资源将不会自动下载。 </VCardSubtitle>
|
||||
<VCardItem>
|
||||
<div class="grid gap-3 grid-filterrule-card">
|
||||
<FilterRuleCard
|
||||
v-for="(card, index) in subscribeFilterCards"
|
||||
:key="index"
|
||||
:pri="card.pri"
|
||||
:maxpri="subscribeFilterCards.length.toString()"
|
||||
:rules="card.rules"
|
||||
@changed="updateFilterCardValue"
|
||||
@close="filterCardClose('SubscribeFilterRules', card.pri)"
|
||||
@leveldown="onLevelDown(subscribeFilterCards, card.pri)"
|
||||
@levelup="onLevelUp(subscribeFilterCards, card.pri)"
|
||||
/>
|
||||
</div>
|
||||
</VCardItem>
|
||||
<VCardItem>
|
||||
<VBtn
|
||||
type="submit"
|
||||
class="me-2"
|
||||
@click="saveCustomFilters('SubscribeFilterRules')"
|
||||
>
|
||||
保存
|
||||
</VBtn>
|
||||
<VBtn
|
||||
color="success"
|
||||
variant="tonal"
|
||||
@click="addFilterCard('SubscribeFilterRules')"
|
||||
>
|
||||
<VIcon icon="mdi-plus" />
|
||||
</VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="洗版优先级">
|
||||
<VCardSubtitle> 设置在订阅洗版时使用的优先级,匹配优先级1时洗版完成。 </VCardSubtitle>
|
||||
<VCardItem>
|
||||
<div class="grid gap-3 grid-filterrule-card">
|
||||
<FilterRuleCard
|
||||
v-for="(card, index) in bestVersionFilterCards"
|
||||
:key="index"
|
||||
:pri="card.pri"
|
||||
:maxpri="bestVersionFilterCards.length.toString()"
|
||||
:rules="card.rules"
|
||||
@changed="updateFilterCardValue2"
|
||||
@close="filterCardClose('BestVersionFilterRules', card.pri)"
|
||||
@leveldown="onLevelDown(bestVersionFilterCards, card.pri)"
|
||||
@levelup="onLevelUp(bestVersionFilterCards, card.pri)"
|
||||
/>
|
||||
</div>
|
||||
</VCardItem>
|
||||
<VCardItem>
|
||||
<VBtn
|
||||
type="submit"
|
||||
class="me-2"
|
||||
@click="saveCustomFilters('BestVersionFilterRules')"
|
||||
>
|
||||
保存
|
||||
</VBtn>
|
||||
<VBtn
|
||||
color="success"
|
||||
variant="tonal"
|
||||
@click="addFilterCard('BestVersionFilterRules')"
|
||||
>
|
||||
<VIcon icon="mdi-plus" />
|
||||
</VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.grid-filterrule-card {
|
||||
grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
|
||||
padding-block-end: 1rem;
|
||||
}
|
||||
</style>
|
||||
@@ -124,15 +124,16 @@ onMounted(() => {
|
||||
<VRow>
|
||||
<VCol cols="12">
|
||||
<VCard title="自定义识别词">
|
||||
<VCardSubtitle> 添加规则对种子名或者文件名进行预处理以校正识别 </VCardSubtitle>
|
||||
<VCardSubtitle> 添加规则对种子名或者文件名进行预处理以校正识别。 </VCardSubtitle>
|
||||
<VCardItem>
|
||||
<VTextarea
|
||||
v-model="customIdentifiers"
|
||||
auto-grow
|
||||
placeholder="支持正则表达式,特殊字符需要\转义,一行为一组,支持三种配置格式:
|
||||
placeholder="支持正则表达式,特殊字符需要\转义,一行为一组,支持以下几种配置格式:
|
||||
屏蔽词
|
||||
被替换词 => 替换词
|
||||
前定位词 <> 后定位词 >> 偏移量(EP)"
|
||||
前定位词 <> 后定位词 >> 集偏移量(EP)
|
||||
被替换词 => 替换词 && 前定位词 <> 后定位词 >> 集偏移量(EP)"
|
||||
/>
|
||||
</VCardItem>
|
||||
<VCardItem>
|
||||
@@ -147,7 +148,7 @@ onMounted(() => {
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="自定义制作组/字幕组">
|
||||
<VCardSubtitle> 添加无法识别的制作组/字幕组 </VCardSubtitle>
|
||||
<VCardSubtitle> 添加无法识别的制作组/字幕组。 </VCardSubtitle>
|
||||
<VCardItem>
|
||||
<VTextarea
|
||||
v-model="customReleaseGroups"
|
||||
@@ -167,7 +168,7 @@ onMounted(() => {
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="文件整理屏蔽词">
|
||||
<VCardSubtitle> 目录名或文件名中包含屏蔽词时不进行整理 </VCardSubtitle>
|
||||
<VCardSubtitle> 目录名或文件名中包含屏蔽词时不进行整理。 </VCardSubtitle>
|
||||
<VCardItem>
|
||||
<VTextarea
|
||||
v-model="transferExcludeWords"
|
||||
|
||||
@@ -58,7 +58,7 @@ const siteForm = reactive<Site>({
|
||||
// 获取站点列表数据
|
||||
async function fetchData() {
|
||||
try {
|
||||
dataList.value = await api.get('site')
|
||||
dataList.value = await api.get('site/')
|
||||
isRefreshed.value = true
|
||||
}
|
||||
catch (error) {
|
||||
@@ -77,7 +77,7 @@ async function addSite() {
|
||||
addBtnState.value = true
|
||||
|
||||
try {
|
||||
const result: { [key: string]: string } = await api.post('site', siteForm)
|
||||
const result: { [key: string]: string } = await api.post('site/', siteForm)
|
||||
if (result.success) {
|
||||
$toast.success('新增站点成功')
|
||||
|
||||
@@ -135,7 +135,7 @@ onBeforeMount(fetchData)
|
||||
<!-- Dialog Content -->
|
||||
<VDialog
|
||||
v-model="siteAddDialog"
|
||||
max-width="800"
|
||||
max-width="50rem"
|
||||
persistent
|
||||
scrollable
|
||||
>
|
||||
@@ -149,6 +149,7 @@ onBeforeMount(fetchData)
|
||||
/>
|
||||
</template>
|
||||
<VCard title="新增站点">
|
||||
<DialogCloseBtn @click="siteAddDialog = false" />
|
||||
<VCardText class="pt-2">
|
||||
<VForm @submit.prevent="() => {}">
|
||||
<VRow>
|
||||
@@ -185,6 +186,12 @@ onBeforeMount(fetchData)
|
||||
</VCol>
|
||||
</VRow>
|
||||
<VRow>
|
||||
<VCol cols="12">
|
||||
<VTextField
|
||||
v-model="siteForm.rss"
|
||||
label="RSS地址"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VTextarea
|
||||
v-model="siteForm.cookie"
|
||||
|
||||
@@ -73,23 +73,13 @@ async function eventsHander(subscribe: Subscribe | Rss) {
|
||||
async function getSubscribes() {
|
||||
try {
|
||||
// 订阅
|
||||
const subscribes: Subscribe[] = await api.get('subscribe')
|
||||
const subscribes: Subscribe[] = await api.get('subscribe/')
|
||||
|
||||
const subEvents = await Promise.all(
|
||||
subscribes.map(async sub => eventsHander(sub)),
|
||||
)
|
||||
|
||||
// 自定义订阅
|
||||
const rsses: Rss[] = await api.get('rss')
|
||||
|
||||
const rssEvents = await Promise.all(
|
||||
rsses.map(async rss => eventsHander(rss)),
|
||||
)
|
||||
|
||||
// 合并事件
|
||||
const events = [...subEvents, ...rssEvents]
|
||||
|
||||
calendarOptions.value.events = events.flat().filter(event => event.start) as EventSourceInput
|
||||
calendarOptions.value.events = subEvents.flat().filter(event => event.start) as EventSourceInput
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error)
|
||||
|
||||
@@ -1,336 +0,0 @@
|
||||
<script lang="ts" setup>
|
||||
import PullRefresh from 'pull-refresh-vue3'
|
||||
import { useToast } from 'vue-toast-notification'
|
||||
import api from '@/api'
|
||||
import type { Rss } from '@/api/types'
|
||||
import NoDataFound from '@/components/NoDataFound.vue'
|
||||
import RssCard from '@/components/cards/RssCard.vue'
|
||||
import { numberValidator, requiredValidator } from '@/@validators'
|
||||
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
// 是否刷新过
|
||||
const isRefreshed = ref(false)
|
||||
|
||||
// 新增按钮文本
|
||||
const addBtnText = ref('新增订阅')
|
||||
// 新增按钮状态
|
||||
const addBtnState = ref(false)
|
||||
|
||||
// 新增自定义订阅对话框
|
||||
const rssAddDialog = ref(false)
|
||||
|
||||
// 新增订阅表单
|
||||
const rssForm = reactive({
|
||||
// RSS地址
|
||||
url: '',
|
||||
// 类型
|
||||
type: '电影',
|
||||
// 标题
|
||||
title: '',
|
||||
// 年份
|
||||
year: '',
|
||||
// 季号
|
||||
season: 1,
|
||||
// 包含
|
||||
include: '',
|
||||
// 排除
|
||||
exclude: '',
|
||||
// 洗版
|
||||
best_version: false,
|
||||
// 是否使用代理服务器
|
||||
proxy: false,
|
||||
// 是否使用过滤规则
|
||||
filter: true,
|
||||
// 保存路径
|
||||
save_path: '',
|
||||
// 状态 0-停用,1-启用
|
||||
state: 1,
|
||||
|
||||
})
|
||||
|
||||
// 数据列表
|
||||
const dataList = ref<Rss[]>([])
|
||||
|
||||
// 获取订阅列表数据
|
||||
async function fetchData() {
|
||||
try {
|
||||
dataList.value = await api.get('rss')
|
||||
isRefreshed.value = true
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
// 调用API 新增自定义订阅
|
||||
async function addRss() {
|
||||
if (!rssForm.url || !rssForm.title)
|
||||
return
|
||||
|
||||
startNProgress()
|
||||
|
||||
addBtnText.value = '新增中...'
|
||||
addBtnState.value = true
|
||||
|
||||
if (rssForm.type === '电影')
|
||||
rssForm.season = 0
|
||||
|
||||
try {
|
||||
const result: { [key: string]: string } = await api.post('rss', rssForm)
|
||||
if (result.success) {
|
||||
$toast.success('新增自定义订阅成功')
|
||||
|
||||
// 刷新数据
|
||||
fetchData()
|
||||
}
|
||||
else { $toast.error(`新增自定义订阅失败:${result.message}`) }
|
||||
rssAddDialog.value = false
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
doneNProgress()
|
||||
|
||||
addBtnText.value = '新增订阅'
|
||||
addBtnState.value = false
|
||||
}
|
||||
|
||||
// 生成1到50季的下拉框选项
|
||||
const seasonItems = ref(
|
||||
Array.from({ length: 50 }, (_, i) => i + 1).map(item => ({
|
||||
title: `第 ${item} 季`,
|
||||
value: item,
|
||||
})),
|
||||
)
|
||||
|
||||
// 加载时获取数据
|
||||
onBeforeMount(fetchData)
|
||||
|
||||
// 刷新状态
|
||||
const loading = ref(false)
|
||||
|
||||
// 下拉刷新
|
||||
function onRefresh() {
|
||||
loading.value = true
|
||||
fetchData()
|
||||
loading.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-if="!isRefreshed"
|
||||
class="mt-12 w-full text-center text-gray-500 text-sm flex flex-col items-center"
|
||||
>
|
||||
<VProgressCircular
|
||||
v-if="!isRefreshed"
|
||||
size="48"
|
||||
indeterminate
|
||||
color="primary"
|
||||
/>
|
||||
</div>
|
||||
<PullRefresh
|
||||
v-model="loading"
|
||||
@refresh="onRefresh"
|
||||
>
|
||||
<div
|
||||
v-if="dataList.length > 0"
|
||||
class="grid gap-3 grid-rss-card p-1"
|
||||
>
|
||||
<RssCard
|
||||
v-for="data in dataList"
|
||||
:key="data.id"
|
||||
:media="data"
|
||||
@remove="fetchData"
|
||||
@save="fetchData"
|
||||
/>
|
||||
</div>
|
||||
<NoDataFound
|
||||
v-if="dataList.length === 0 && isRefreshed"
|
||||
error-code="404"
|
||||
error-title="没有自定义订阅"
|
||||
error-description="点击右下角按钮新增订阅。"
|
||||
/>
|
||||
</PullRefresh>
|
||||
|
||||
<!-- 新增订阅 -->
|
||||
<VDialog
|
||||
v-model="rssAddDialog"
|
||||
max-width="800"
|
||||
persistent
|
||||
scrollable
|
||||
>
|
||||
<!-- Dialog Activator -->
|
||||
<template #activator="{ props }">
|
||||
<VBtn
|
||||
icon="mdi-plus"
|
||||
v-bind="props"
|
||||
size="x-large"
|
||||
class="fixed right-5 bottom-5"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<!-- Dialog Content -->
|
||||
<VCard title="新增自定义订阅">
|
||||
<DialogCloseBtn @click="rssAddDialog = false" />
|
||||
<VCardText class="pt-2">
|
||||
<VForm @submit.prevent="() => {}">
|
||||
<VRow>
|
||||
<VCol
|
||||
cols="12"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.url"
|
||||
label="RSS地址"
|
||||
placeholder="https://example.com/rss"
|
||||
:rules="[requiredValidator]"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VSelect
|
||||
v-model="rssForm.type"
|
||||
label="类型"
|
||||
:items="[{ title: '电影', value: '电影' }, { title: '电视剧', value: '电视剧' }]"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.title"
|
||||
label="标题"
|
||||
:rules="[requiredValidator]"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.year"
|
||||
label="年份"
|
||||
:rules="[numberValidator]"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
v-if="rssForm.type === '电视剧'"
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VSelect
|
||||
v-model="rssForm.season"
|
||||
label="季"
|
||||
:items="seasonItems"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.include"
|
||||
label="包含"
|
||||
placeholder="支持正则表达式"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.exclude"
|
||||
label="排除"
|
||||
placeholder="支持正则表达式"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VTextField
|
||||
v-model="rssForm.save_path"
|
||||
label="保存路径"
|
||||
placeholder="留空自动"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VSelect
|
||||
v-model="rssForm.state"
|
||||
label="状态"
|
||||
:items="[{
|
||||
title: '启用',
|
||||
value: 1,
|
||||
}, {
|
||||
title: '停用',
|
||||
value: 0,
|
||||
}]"
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
<VRow>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
>
|
||||
<VSwitch
|
||||
v-model="rssForm.best_version"
|
||||
label="洗版"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
>
|
||||
<VSwitch
|
||||
v-model="rssForm.proxy"
|
||||
label="代理服务器"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
>
|
||||
<VSwitch
|
||||
v-model="rssForm.filter"
|
||||
label="过滤规则"
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</VForm>
|
||||
</VCardText>
|
||||
<VCardActions>
|
||||
<VBtn
|
||||
@click="rssAddDialog = false"
|
||||
>
|
||||
取消
|
||||
</VBtn>
|
||||
<VSpacer />
|
||||
<VBtn
|
||||
color="primary"
|
||||
:disabled="addBtnState"
|
||||
@click="addRss"
|
||||
>
|
||||
{{ addBtnText }}
|
||||
</VBtn>
|
||||
</VCardActions>
|
||||
</VCard>
|
||||
</VDialog>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.grid-rss-card {
|
||||
grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
|
||||
padding-block-end: 1rem;
|
||||
}
|
||||
</style>
|
||||
@@ -19,7 +19,7 @@ const dataList = ref<Subscribe[]>([])
|
||||
// 获取订阅列表数据
|
||||
async function fetchData() {
|
||||
try {
|
||||
dataList.value = await api.get('subscribe')
|
||||
dataList.value = await api.get('subscribe/')
|
||||
isRefreshed.value = true
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
@@ -69,11 +69,14 @@ async function ruleTest() {
|
||||
v-model="ruleTestForm.ruletype"
|
||||
label="规则类型"
|
||||
:items="[{
|
||||
title: '默认规则',
|
||||
title: '订阅优先级',
|
||||
value: '1',
|
||||
}, {
|
||||
title: '洗版规则',
|
||||
title: '洗版优先级',
|
||||
value: '2',
|
||||
}, {
|
||||
title: '搜索优先级',
|
||||
value: '3',
|
||||
}]"
|
||||
/>
|
||||
</VCol>
|
||||
|
||||
@@ -4,6 +4,9 @@ module.exports = {
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
future: {
|
||||
hoverOnlyWhenSupported: true,
|
||||
},
|
||||
corePlugins: {
|
||||
aspectRatio: false,
|
||||
},
|
||||
|
||||
@@ -43,6 +43,7 @@ export default defineConfig({
|
||||
},
|
||||
build: {
|
||||
chunkSizeWarningLimit: 5000,
|
||||
cssCodeSplit: false,
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ['vuetify'],
|
||||
|
||||
Reference in New Issue
Block a user