增加评论开关,尝试修复循环依赖

This commit is contained in:
mtvpls
2025-12-03 18:20:34 +08:00
parent 567ee54c67
commit 4e05c7bcaa
11 changed files with 416 additions and 194 deletions
+3 -3
View File
@@ -40,11 +40,11 @@
"hls.js": "^1.6.10", "hls.js": "^1.6.10",
"lucide-react": "^0.438.0", "lucide-react": "^0.438.0",
"media-icons": "^1.1.5", "media-icons": "^1.1.5",
"next": "^14.2.23", "next": "^14.2.33",
"next-pwa": "^5.6.0", "next-pwa": "^5.6.0",
"next-themes": "^0.4.6", "next-themes": "^0.4.6",
"react": "^18.2.0", "react": "^18.3.1",
"react-dom": "^18.2.0", "react-dom": "^18.3.1",
"react-icons": "^5.4.0", "react-icons": "^5.4.0",
"redis": "^4.6.7", "redis": "^4.6.7",
"swiper": "^11.2.8", "swiper": "^11.2.8",
+139 -104
View File
@@ -72,19 +72,19 @@ importers:
specifier: ^1.1.5 specifier: ^1.1.5
version: 1.1.5 version: 1.1.5
next: next:
specifier: ^14.2.23 specifier: ^14.2.33
version: 14.2.30(@babel/[email protected])([email protected]([email protected]))([email protected]) version: 14.2.33(@babel/[email protected])([email protected]([email protected]))([email protected])
next-pwa: next-pwa:
specifier: ^5.6.0 specifier: ^5.6.0
version: 5.6.0(@babel/[email protected])(@types/[email protected])([email protected]0(@babel/[email protected])([email protected]([email protected]))([email protected]))([email protected]) version: 5.6.0(@babel/[email protected])(@types/[email protected])([email protected]3(@babel/[email protected])([email protected]([email protected]))([email protected]))([email protected])
next-themes: next-themes:
specifier: ^0.4.6 specifier: ^0.4.6
version: 0.4.6([email protected]([email protected]))([email protected]) version: 0.4.6([email protected]([email protected]))([email protected])
react: react:
specifier: ^18.2.0 specifier: ^18.3.1
version: 18.3.1 version: 18.3.1
react-dom: react-dom:
specifier: ^18.2.0 specifier: ^18.3.1
version: 18.3.1([email protected]) version: 18.3.1([email protected])
react-icons: react-icons:
specifier: ^5.4.0 specifier: ^5.4.0
@@ -176,7 +176,7 @@ importers:
version: 12.5.0 version: 12.5.0
next-router-mock: next-router-mock:
specifier: ^0.9.0 specifier: ^0.9.0
version: 0.9.13([email protected]0(@babel/[email protected])([email protected]([email protected]))([email protected]))([email protected]) version: 0.9.13([email protected]3(@babel/[email protected])([email protected]([email protected]))([email protected]))([email protected])
postcss: postcss:
specifier: ^8.5.1 specifier: ^8.5.1
version: 8.5.6 version: 8.5.6
@@ -1138,66 +1138,62 @@ packages:
'@napi-rs/[email protected]': '@napi-rs/[email protected]':
resolution: {integrity: sha512-9DPkXtvHydrcOsopiYpUgPHpmj0HWZKMUnL2dZqpvC42lsratuBG06V5ipyno0fUek5VlFsNQ+AcFATSrJXgMA==} resolution: {integrity: sha512-9DPkXtvHydrcOsopiYpUgPHpmj0HWZKMUnL2dZqpvC42lsratuBG06V5ipyno0fUek5VlFsNQ+AcFATSrJXgMA==}
'@next/[email protected]0': '@next/[email protected]3':
resolution: {integrity: sha512-KBiBKrDY6kxTQWGzKjQB7QirL3PiiOkV7KW98leHFjtVRKtft76Ra5qSA/SL75xT44dp6hOcqiiJ6iievLOYug==} resolution: {integrity: sha512-CgVHNZ1fRIlxkLhIX22flAZI/HmpDaZ8vwyJ/B0SDPTBuLZ1PJ+DWMjCHhqnExfmSQzA/PbZi8OAc7PAq2w9IA==}
'@next/[email protected]': '@next/[email protected]':
resolution: {integrity: sha512-mvVsMIutMxQ4NGZEMZ1kiBNc+la8Xmlk30bKUmCPQz2eFkmsLv54Mha8QZarMaCtSPkkFA1TMD+FIZk0l/PpzA==} resolution: {integrity: sha512-mvVsMIutMxQ4NGZEMZ1kiBNc+la8Xmlk30bKUmCPQz2eFkmsLv54Mha8QZarMaCtSPkkFA1TMD+FIZk0l/PpzA==}
'@next/[email protected]0': '@next/[email protected]3':
resolution: {integrity: sha512-EAqfOTb3bTGh9+ewpO/jC59uACadRHM6TSA9DdxJB/6gxOpyV+zrbqeXiFTDy9uV6bmipFDkfpAskeaDcO+7/g==} resolution: {integrity: sha512-HqYnb6pxlsshoSTubdXKu15g3iivcbsMXg4bYpjL2iS/V6aQot+iyF4BUc2qA/J/n55YtvE4PHMKWBKGCF/+wA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
'@next/[email protected]0': '@next/[email protected]3':
resolution: {integrity: sha512-TyO7Wz1IKE2kGv8dwQ0bmPL3s44EKVencOqwIY69myoS3rdpO1NPg5xPM5ymKu7nfX4oYJrpMxv8G9iqLsnL4A==} resolution: {integrity: sha512-8HGBeAE5rX3jzKvF593XTTFg3gxeU4f+UWnswa6JPhzaR6+zblO5+fjltJWIZc4aUalqTclvN2QtTC37LxvZAA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
'@next/[email protected]0': '@next/[email protected]3':
resolution: {integrity: sha512-I5lg1fgPJ7I5dk6mr3qCH1hJYKJu1FsfKSiTKoYwcuUf53HWTrEkwmMI0t5ojFKeA6Vu+SfT2zVy5NS0QLXV4Q==} resolution: {integrity: sha512-JXMBka6lNNmqbkvcTtaX8Gu5by9547bukHQvPoLe9VRBx1gHwzf5tdt4AaezW85HAB3pikcvyqBToRTDA4DeLw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [glibc]
'@next/[email protected]0': '@next/[email protected]3':
resolution: {integrity: sha512-8GkNA+sLclQyxgzCDs2/2GSwBc92QLMrmYAmoP2xehe5MUKBLB2cgo34Yu242L1siSkwQkiV4YLdCnjwc/Micw==} resolution: {integrity: sha512-Bm+QulsAItD/x6Ih8wGIMfRJy4G73tu1HJsrccPW6AfqdZd0Sfm5Imhgkgq2+kly065rYMnCOxTBvmvFY1BKfg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [musl]
'@next/[email protected]0': '@next/[email protected]3':
resolution: {integrity: sha512-8Ly7okjssLuBoe8qaRCcjGtcMsv79hwzn/63wNeIkzJVFVX06h5S737XNr7DZwlsbTBDOyI6qbL2BJB5n6TV/w==} resolution: {integrity: sha512-FnFn+ZBgsVMbGDsTqo8zsnRzydvsGV8vfiWwUo1LD8FTmPTdV+otGSWKc4LJec0oSexFnCYVO4hX8P8qQKaSlg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [glibc]
'@next/[email protected]0': '@next/[email protected]3':
resolution: {integrity: sha512-dBmV1lLNeX4mR7uI7KNVHsGQU+OgTG5RGFPi3tBJpsKPvOPtg9poyav/BYWrB3GPQL4dW5YGGgalwZ79WukbKQ==} resolution: {integrity: sha512-345tsIWMzoXaQndUTDv1qypDRiebFxGYx9pYkhwY4hBRaOLt8UGfiWKr9FSSHs25dFIf8ZqIFaPdy5MljdoawA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [musl]
'@next/[email protected]0': '@next/[email protected]3':
resolution: {integrity: sha512-6MMHi2Qc1Gkq+4YLXAgbYslE1f9zMGBikKMdmQRHXjkGPot1JY3n5/Qrbg40Uvbi8//wYnydPnyvNhI1DMUW1g==} resolution: {integrity: sha512-nscpt0G6UCTkrT2ppnJnFsYbPDQwmum4GNXYTeoTIdsmMydSKFz9Iny2jpaRupTb+Wl298+Rh82WKzt9LCcqSQ==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
'@next/[email protected]0': '@next/[email protected]3':
resolution: {integrity: sha512-pVZMnFok5qEX4RT59mK2hEVtJX+XFfak+/rjHpyFh7juiT52r177bfFKhnlafm0UOSldhXjj32b+LZIOdswGTg==} resolution: {integrity: sha512-pc9LpGNKhJ0dXQhZ5QMmYxtARwwmWLpeocFmVG5Z0DzWq5Uf0izcI8tLc+qOpqxO1PWqZ5A7J1blrUIKrIFc7Q==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [ia32] cpu: [ia32]
os: [win32] os: [win32]
'@next/[email protected]0': '@next/[email protected]3':
resolution: {integrity: sha512-4KCo8hMZXMjpTzs3HOqOGYYwAXymXIy7PEPAXNEcEOyKqkjiDlECumrWziy+JEF0Oi4ILHGxzgQ3YiMGG2t/Lg==} resolution: {integrity: sha512-nOjfZMy8B94MdisuzZo9/57xuFVLHJaDj5e/xrduJp9CV2/HrfxTRH2fbyLe+K9QT41WBLUd4iXX3R7jBp0EUg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
@@ -1587,8 +1583,8 @@ packages:
'@types/[email protected]': '@types/[email protected]':
resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==}
'@types/[email protected].2': '@types/[email protected].10':
resolution: {integrity: sha512-y7pa/oEJJ4iGYBxOpfAKn5b9+xuihvzDVnC/OSvlVnGxVg0pOqmjiMafiJ1KVNQEaPZf9HsEp5icEwGg8uIe5Q==} resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==}
'@types/[email protected]': '@types/[email protected]':
resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==}
@@ -1699,49 +1695,41 @@ packages:
resolution: {integrity: sha512-vdqBh911wc5awE2bX2zx3eflbyv8U9xbE/jVKAm425eRoOVv/VseGZsqi3A3SykckSpF4wSROkbQPvbQFn8EsA==} resolution: {integrity: sha512-vdqBh911wc5awE2bX2zx3eflbyv8U9xbE/jVKAm425eRoOVv/VseGZsqi3A3SykckSpF4wSROkbQPvbQFn8EsA==}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [glibc]
'@unrs/[email protected]': '@unrs/[email protected]':
resolution: {integrity: sha512-/8JFZ/SnuDr1lLEVsxsuVwrsGquTvT51RZGvyDB/dOK3oYK2UqeXzgeyq6Otp8FZXQcEYqJwxb9v+gtdXn03eQ==} resolution: {integrity: sha512-/8JFZ/SnuDr1lLEVsxsuVwrsGquTvT51RZGvyDB/dOK3oYK2UqeXzgeyq6Otp8FZXQcEYqJwxb9v+gtdXn03eQ==}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [musl]
'@unrs/[email protected]': '@unrs/[email protected]':
resolution: {integrity: sha512-FkJjybtrl+rajTw4loI3L6YqSOpeZfDls4SstL/5lsP2bka9TiHUjgMBjygeZEis1oC8LfJTS8FSgpKPaQx2tQ==} resolution: {integrity: sha512-FkJjybtrl+rajTw4loI3L6YqSOpeZfDls4SstL/5lsP2bka9TiHUjgMBjygeZEis1oC8LfJTS8FSgpKPaQx2tQ==}
cpu: [ppc64] cpu: [ppc64]
os: [linux] os: [linux]
libc: [glibc]
'@unrs/[email protected]': '@unrs/[email protected]':
resolution: {integrity: sha512-w/NZfHNeDusbqSZ8r/hp8iL4S39h4+vQMc9/vvzuIKMWKppyUGKm3IST0Qv0aOZ1rzIbl9SrDeIqK86ZpUK37w==} resolution: {integrity: sha512-w/NZfHNeDusbqSZ8r/hp8iL4S39h4+vQMc9/vvzuIKMWKppyUGKm3IST0Qv0aOZ1rzIbl9SrDeIqK86ZpUK37w==}
cpu: [riscv64] cpu: [riscv64]
os: [linux] os: [linux]
libc: [glibc]
'@unrs/[email protected]': '@unrs/[email protected]':
resolution: {integrity: sha512-bEPBosut8/8KQbUixPry8zg/fOzVOWyvwzOfz0C0Rw6dp+wIBseyiHKjkcSyZKv/98edrbMknBaMNJfA/UEdqw==} resolution: {integrity: sha512-bEPBosut8/8KQbUixPry8zg/fOzVOWyvwzOfz0C0Rw6dp+wIBseyiHKjkcSyZKv/98edrbMknBaMNJfA/UEdqw==}
cpu: [riscv64] cpu: [riscv64]
os: [linux] os: [linux]
libc: [musl]
'@unrs/[email protected]': '@unrs/[email protected]':
resolution: {integrity: sha512-LDtMT7moE3gK753gG4pc31AAqGUC86j3AplaFusc717EUGF9ZFJ356sdQzzZzkBk1XzMdxFyZ4f/i35NKM/lFA==} resolution: {integrity: sha512-LDtMT7moE3gK753gG4pc31AAqGUC86j3AplaFusc717EUGF9ZFJ356sdQzzZzkBk1XzMdxFyZ4f/i35NKM/lFA==}
cpu: [s390x] cpu: [s390x]
os: [linux] os: [linux]
libc: [glibc]
'@unrs/[email protected]': '@unrs/[email protected]':
resolution: {integrity: sha512-WmFd5KINHIXj8o1mPaT8QRjA9HgSXhN1gl9Da4IZihARihEnOylu4co7i/yeaIpcfsI6sYs33cNZKyHYDh0lrA==} resolution: {integrity: sha512-WmFd5KINHIXj8o1mPaT8QRjA9HgSXhN1gl9Da4IZihARihEnOylu4co7i/yeaIpcfsI6sYs33cNZKyHYDh0lrA==}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [glibc]
'@unrs/[email protected]': '@unrs/[email protected]':
resolution: {integrity: sha512-CYuXbANW+WgzVRIl8/QvZmDaZxrqvOldOwlbUjIM4pQ46FJ0W5cinJ/Ghwa/Ng1ZPMJMk1VFdsD/XwmCGIXBWg==} resolution: {integrity: sha512-CYuXbANW+WgzVRIl8/QvZmDaZxrqvOldOwlbUjIM4pQ46FJ0W5cinJ/Ghwa/Ng1ZPMJMk1VFdsD/XwmCGIXBWg==}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [musl]
'@unrs/[email protected]': '@unrs/[email protected]':
resolution: {integrity: sha512-6Rp2WH0OoitMYR57Z6VE8Y6corX8C6QEMWLgOV6qXiJIeZ1F9WGXY/yQ8yDC4iTraotyLOeJ2Asea0urWj2fKQ==} resolution: {integrity: sha512-6Rp2WH0OoitMYR57Z6VE8Y6corX8C6QEMWLgOV6qXiJIeZ1F9WGXY/yQ8yDC4iTraotyLOeJ2Asea0urWj2fKQ==}
@@ -2118,6 +2106,10 @@ packages:
[email protected]: [email protected]:
resolution: {integrity: sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==} resolution: {integrity: sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==}
[email protected]:
resolution: {integrity: sha512-OPz5aBThlyLFgxyhdwf/s2+8ab3OvT7AdTNvKHBwpXomIYeXqpUUuT8LrdtxZSsWJ4R4CU1un4XGh5Ez3nlTpw==}
hasBin: true
[email protected]: [email protected]:
resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==} resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==}
@@ -2146,8 +2138,8 @@ packages:
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true hasBin: true
[email protected]5.2: [email protected]8.0:
resolution: {integrity: sha512-0si2SJK3ooGzIawRu61ZdPCO1IncZwS8IzuX73sPZsXW6EQ/w/DAfPyKI8l1ETTCr2MnvqWitmlCUxgdul45jA==} resolution: {integrity: sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true hasBin: true
@@ -2203,8 +2195,8 @@ packages:
[email protected]: [email protected]:
resolution: {integrity: sha512-1R/elMjtehrFejxwmexeXAtae5UO9iSyFn6G/I806CYC/BLyyBk1EPhrKBkWhy6wM6Xnm47dSJQec+tLJ39WHw==} resolution: {integrity: sha512-1R/elMjtehrFejxwmexeXAtae5UO9iSyFn6G/I806CYC/BLyyBk1EPhrKBkWhy6wM6Xnm47dSJQec+tLJ39WHw==}
[email protected]34: [email protected]59:
resolution: {integrity: sha512-uhE1Ye5vgqju6OI71HTQqcBCZrvHugk0MjLak7Q+HfoBgoq5Bi+5YnwjP4fjDgrtYr/l8MVRBvzz9dPD4KyK0A==} resolution: {integrity: sha512-Pzfx9fOKoKvevQf8oCXoyNRQ5QyxJj+3O0Rqx2V5oxT61KGx8+n6hV/IUyJeifUci2clnmmKVpvtiqRzgiWjSw==}
[email protected]: [email protected]:
resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==}
@@ -2600,8 +2592,8 @@ packages:
[email protected]: [email protected]:
resolution: {integrity: sha512-RUNQmFLNIWVW6+z32EJQ5+qx8ci6RGvdtDC0Ls+F89wz6I2AthpXF0w0DIrn2jpLX0/PU9ZCo+Qp7bg/EckJmA==} resolution: {integrity: sha512-RUNQmFLNIWVW6+z32EJQ5+qx8ci6RGvdtDC0Ls+F89wz6I2AthpXF0w0DIrn2jpLX0/PU9ZCo+Qp7bg/EckJmA==}
[email protected].199: [email protected].263:
resolution: {integrity: sha512-3gl0S7zQd88kCAZRO/DnxtBKuhMO4h0EaQIN3YgZfV6+pW+5+bf2AdQeHNESCoaQqo/gjGVYEf2YM4O5HJQqpQ==} resolution: {integrity: sha512-DrqJ11Knd+lo+dv+lltvfMDLU27g14LMdH2b0O3Pio4uk0x+z7OR+JrmyacTPN2M8w3BrZ7/RTwG3R9B7irPlg==}
[email protected]: [email protected]:
resolution: {integrity: sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==} resolution: {integrity: sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==}
@@ -2982,6 +2974,10 @@ packages:
[email protected]: [email protected]:
resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==}
[email protected]:
resolution: {integrity: sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==}
engines: {node: '>= 0.4'}
[email protected]: [email protected]:
resolution: {integrity: sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==} resolution: {integrity: sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==}
engines: {node: '>= 4'} engines: {node: '>= 4'}
@@ -3277,6 +3273,10 @@ packages:
resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==} resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==}
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
[email protected]:
resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==}
engines: {node: '>= 0.4'}
[email protected]: [email protected]:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@@ -3709,8 +3709,8 @@ packages:
resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
[email protected].13: [email protected]1:
resolution: {integrity: sha512-QZXnR/OGiDcBjF4hGk0wwVrPcZvbSSyzlvkjXv5LFfktj7O2VZDrt4Xs8SgR/vOFco+qk1i8J43ikMXZoTrtPw==} resolution: {integrity: sha512-Z3IhgVgrqO1S5xPYM3K5XwbkDasU67/Vys4heW+lfSBALcUZjeIIzI8zCLifY+OCzSq+fpDdywMDa7z+4srJPQ==}
[email protected]: [email protected]:
resolution: {integrity: sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==} resolution: {integrity: sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==}
@@ -3737,8 +3737,8 @@ packages:
enquirer: enquirer:
optional: true optional: true
[email protected].0: [email protected].1:
resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==} resolution: {integrity: sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==}
engines: {node: '>=6.11.5'} engines: {node: '>=6.11.5'}
[email protected]: [email protected]:
@@ -3966,8 +3966,8 @@ packages:
react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc
react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc
[email protected]0: [email protected]3:
resolution: {integrity: sha512-+COdu6HQrHHFQ1S/8BBsCag61jZacmvbuL2avHvQFbWa2Ox7bE+d8FyNgxRLjXQ5wtPyQwEmk85js/AuaG2Sbg==} resolution: {integrity: sha512-GiKHLsD00t4ACm1p00VgrI0rUFAC9cRDGReKyERlM57aeEZkOQGcZTpIbsGn0b562FTPJWmYfKwplfO9EaT6ng==}
engines: {node: '>=18.17.0'} engines: {node: '>=18.17.0'}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
@@ -3993,6 +3993,9 @@ packages:
[email protected]: [email protected]:
resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==}
[email protected]:
resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==}
[email protected]: [email protected]:
resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==}
@@ -4558,6 +4561,10 @@ packages:
resolution: {integrity: sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==} resolution: {integrity: sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==}
engines: {node: '>= 10.13.0'} engines: {node: '>= 10.13.0'}
[email protected]:
resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==}
engines: {node: '>= 10.13.0'}
[email protected]: [email protected]:
resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==}
hasBin: true hasBin: true
@@ -4858,8 +4865,8 @@ packages:
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
hasBin: true hasBin: true
tapable@2.2.2: tapable@2.3.0:
resolution: {integrity: sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==} resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==}
engines: {node: '>=6'} engines: {node: '>=6'}
[email protected]: [email protected]:
@@ -5102,6 +5109,12 @@ packages:
peerDependencies: peerDependencies:
browserslist: '>= 4.21.0' browserslist: '>= 4.21.0'
[email protected]:
resolution: {integrity: sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==}
hasBin: true
peerDependencies:
browserslist: '>= 4.21.0'
[email protected]: [email protected]:
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
@@ -5129,8 +5142,8 @@ packages:
[email protected]: [email protected]:
resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==}
[email protected].15: [email protected].23:
resolution: {integrity: sha512-BgWVbCI72aIQy937xbawcs+hrVaN/CZ2UwutgaJ36hGqRrLNM+f5LUT/YPRbo8IV/ASeFzXszezV+y2+rq3l8A==} resolution: {integrity: sha512-4yoz1kEWqUjzi5zsPbAS/903QXSYp0UOtHsPpp7p9rHAw/W+dkInskAE386Fat3oKRROwO98d9ZB0G4cObgUyw==}
engines: {node: '>= 0.10'} engines: {node: '>= 0.10'}
[email protected]: [email protected]:
@@ -6654,37 +6667,37 @@ snapshots:
'@tybys/wasm-util': 0.9.0 '@tybys/wasm-util': 0.9.0
optional: true optional: true
'@next/[email protected]0': {} '@next/[email protected]3': {}
'@next/[email protected]': '@next/[email protected]':
dependencies: dependencies:
glob: 10.3.10 glob: 10.3.10
'@next/[email protected]0': '@next/[email protected]3':
optional: true optional: true
'@next/[email protected]0': '@next/[email protected]3':
optional: true optional: true
'@next/[email protected]0': '@next/[email protected]3':
optional: true optional: true
'@next/[email protected]0': '@next/[email protected]3':
optional: true optional: true
'@next/[email protected]0': '@next/[email protected]3':
optional: true optional: true
'@next/[email protected]0': '@next/[email protected]3':
optional: true optional: true
'@next/[email protected]0': '@next/[email protected]3':
optional: true optional: true
'@next/[email protected]0': '@next/[email protected]3':
optional: true optional: true
'@next/[email protected]0': '@next/[email protected]3':
optional: true optional: true
'@nodelib/[email protected]': '@nodelib/[email protected]':
@@ -7115,7 +7128,7 @@ snapshots:
'@types/[email protected]': {} '@types/[email protected]': {}
'@types/[email protected].2': {} '@types/[email protected].10': {}
'@types/[email protected]': {} '@types/[email protected]': {}
@@ -7695,6 +7708,8 @@ snapshots:
[email protected]: {} [email protected]: {}
[email protected]: {}
[email protected]: {} [email protected]: {}
[email protected]: {} [email protected]: {}
@@ -7723,12 +7738,13 @@ snapshots:
node-releases: 2.0.19 node-releases: 2.0.19
update-browserslist-db: 1.1.3([email protected]) update-browserslist-db: 1.1.3([email protected])
[email protected]5.2: [email protected]8.0:
dependencies: dependencies:
caniuse-lite: 1.0.30001734 baseline-browser-mapping: 2.8.32
electron-to-chromium: 1.5.199 caniuse-lite: 1.0.30001759
node-releases: 2.0.19 electron-to-chromium: 1.5.263
update-browserslist-db: 1.1.3([email protected]) node-releases: 2.0.27
update-browserslist-db: 1.1.4([email protected])
[email protected]: [email protected]:
dependencies: dependencies:
@@ -7779,7 +7795,7 @@ snapshots:
[email protected]: {} [email protected]: {}
[email protected]34: {} [email protected]59: {}
[email protected]: [email protected]:
dependencies: dependencies:
@@ -7842,9 +7858,9 @@ snapshots:
[email protected]: [email protected]:
dependencies: dependencies:
'@types/validator': 13.15.2 '@types/validator': 13.15.10
libphonenumber-js: 1.12.13 libphonenumber-js: 1.12.31
validator: 13.15.15 validator: 13.15.23
[email protected]: {} [email protected]: {}
@@ -8177,7 +8193,7 @@ snapshots:
[email protected]: {} [email protected]: {}
[email protected].199: {} [email protected].263: {}
[email protected]: {} [email protected]: {}
@@ -8195,7 +8211,7 @@ snapshots:
[email protected]: [email protected]:
dependencies: dependencies:
graceful-fs: 4.2.11 graceful-fs: 4.2.11
tapable: 2.2.2 tapable: 2.3.0
[email protected]: {} [email protected]: {}
@@ -8709,6 +8725,8 @@ snapshots:
[email protected]: {} [email protected]: {}
[email protected]: {}
[email protected]: {} [email protected]: {}
[email protected]: {} [email protected]: {}
@@ -9016,6 +9034,14 @@ snapshots:
has-tostringtag: 1.0.2 has-tostringtag: 1.0.2
safe-regex-test: 1.1.0 safe-regex-test: 1.1.0
[email protected]:
dependencies:
call-bound: 1.0.4
generator-function: 2.0.1
get-proto: 1.0.1
has-tostringtag: 1.0.2
safe-regex-test: 1.1.0
[email protected]: [email protected]:
dependencies: dependencies:
is-extglob: 2.1.1 is-extglob: 2.1.1
@@ -9718,7 +9744,7 @@ snapshots:
prelude-ls: 1.2.1 prelude-ls: 1.2.1
type-check: 0.4.0 type-check: 0.4.0
[email protected].13: {} [email protected]1: {}
[email protected]: {} [email protected]: {}
@@ -9756,7 +9782,7 @@ snapshots:
through: 2.3.8 through: 2.3.8
wrap-ansi: 7.0.0 wrap-ansi: 7.0.0
[email protected].0: {} [email protected].1: {}
[email protected]: [email protected]:
dependencies: dependencies:
@@ -9951,12 +9977,12 @@ snapshots:
[email protected]: {} [email protected]: {}
[email protected](@babel/[email protected])(@types/[email protected])([email protected]0(@babel/[email protected])([email protected]([email protected]))([email protected]))([email protected]): [email protected](@babel/[email protected])(@types/[email protected])([email protected]3(@babel/[email protected])([email protected]([email protected]))([email protected]))([email protected]):
dependencies: dependencies:
babel-loader: 8.4.1(@babel/[email protected])([email protected]) babel-loader: 8.4.1(@babel/[email protected])([email protected])
clean-webpack-plugin: 4.0.0([email protected]) clean-webpack-plugin: 4.0.0([email protected])
globby: 11.1.0 globby: 11.1.0
next: 14.2.30(@babel/[email protected])([email protected]([email protected]))([email protected]) next: 14.2.33(@babel/[email protected])([email protected]([email protected]))([email protected])
terser-webpack-plugin: 5.3.14([email protected]) terser-webpack-plugin: 5.3.14([email protected])
workbox-webpack-plugin: 6.6.0(@types/[email protected])([email protected]) workbox-webpack-plugin: 6.6.0(@types/[email protected])([email protected])
workbox-window: 6.6.0 workbox-window: 6.6.0
@@ -9969,9 +9995,9 @@ snapshots:
- uglify-js - uglify-js
- webpack - webpack
[email protected]([email protected]0(@babel/[email protected])([email protected]([email protected]))([email protected]))([email protected]): [email protected]([email protected]3(@babel/[email protected])([email protected]([email protected]))([email protected]))([email protected]):
dependencies: dependencies:
next: 14.2.30(@babel/[email protected])([email protected]([email protected]))([email protected]) next: 14.2.33(@babel/[email protected])([email protected]([email protected]))([email protected])
react: 18.3.1 react: 18.3.1
[email protected]([email protected]([email protected]))([email protected]): [email protected]([email protected]([email protected]))([email protected]):
@@ -9979,9 +10005,9 @@ snapshots:
react: 18.3.1 react: 18.3.1
react-dom: 18.3.1([email protected]) react-dom: 18.3.1([email protected])
[email protected]0(@babel/[email protected])([email protected]([email protected]))([email protected]): [email protected]3(@babel/[email protected])([email protected]([email protected]))([email protected]):
dependencies: dependencies:
'@next/env': 14.2.30 '@next/env': 14.2.33
'@swc/helpers': 0.5.5 '@swc/helpers': 0.5.5
busboy: 1.6.0 busboy: 1.6.0
caniuse-lite: 1.0.30001723 caniuse-lite: 1.0.30001723
@@ -9991,15 +10017,15 @@ snapshots:
react-dom: 18.3.1([email protected]) react-dom: 18.3.1([email protected])
styled-jsx: 5.1.1(@babel/[email protected])([email protected]) styled-jsx: 5.1.1(@babel/[email protected])([email protected])
optionalDependencies: optionalDependencies:
'@next/swc-darwin-arm64': 14.2.30 '@next/swc-darwin-arm64': 14.2.33
'@next/swc-darwin-x64': 14.2.30 '@next/swc-darwin-x64': 14.2.33
'@next/swc-linux-arm64-gnu': 14.2.30 '@next/swc-linux-arm64-gnu': 14.2.33
'@next/swc-linux-arm64-musl': 14.2.30 '@next/swc-linux-arm64-musl': 14.2.33
'@next/swc-linux-x64-gnu': 14.2.30 '@next/swc-linux-x64-gnu': 14.2.33
'@next/swc-linux-x64-musl': 14.2.30 '@next/swc-linux-x64-musl': 14.2.33
'@next/swc-win32-arm64-msvc': 14.2.30 '@next/swc-win32-arm64-msvc': 14.2.33
'@next/swc-win32-ia32-msvc': 14.2.30 '@next/swc-win32-ia32-msvc': 14.2.33
'@next/swc-win32-x64-msvc': 14.2.30 '@next/swc-win32-x64-msvc': 14.2.33
transitivePeerDependencies: transitivePeerDependencies:
- '@babel/core' - '@babel/core'
- babel-plugin-macros - babel-plugin-macros
@@ -10013,6 +10039,8 @@ snapshots:
[email protected]: {} [email protected]: {}
[email protected]: {}
[email protected]: [email protected]:
dependencies: dependencies:
hosted-git-info: 2.8.9 hosted-git-info: 2.8.9
@@ -10541,6 +10569,13 @@ snapshots:
ajv-formats: 2.1.1([email protected]) ajv-formats: 2.1.1([email protected])
ajv-keywords: 5.1.0([email protected]) ajv-keywords: 5.1.0([email protected])
[email protected]:
dependencies:
'@types/json-schema': 7.0.15
ajv: 8.17.1
ajv-formats: 2.1.1([email protected])
ajv-keywords: 5.1.0([email protected])
[email protected]: {} [email protected]: {}
[email protected]: {} [email protected]: {}
@@ -10889,7 +10924,7 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- ts-node - ts-node
tapable@2.2.2: {} tapable@2.3.0: {}
[email protected]: {} [email protected]: {}
@@ -11140,9 +11175,9 @@ snapshots:
escalade: 3.2.0 escalade: 3.2.0
picocolors: 1.1.1 picocolors: 1.1.1
[email protected].3([email protected]5.2): [email protected].4([email protected]8.0):
dependencies: dependencies:
browserslist: 4.25.2 browserslist: 4.28.0
escalade: 3.2.0 escalade: 3.2.0
picocolors: 1.1.1 picocolors: 1.1.1
@@ -11165,7 +11200,7 @@ snapshots:
dependencies: dependencies:
inherits: 2.0.4 inherits: 2.0.4
is-arguments: 1.2.0 is-arguments: 1.2.0
is-generator-function: 1.1.0 is-generator-function: 1.1.2
is-typed-array: 1.1.15 is-typed-array: 1.1.15
which-typed-array: 1.1.19 which-typed-array: 1.1.19
@@ -11182,7 +11217,7 @@ snapshots:
spdx-correct: 3.2.0 spdx-correct: 3.2.0
spdx-expression-parse: 3.0.1 spdx-expression-parse: 3.0.1
[email protected].15: {} [email protected].23: {}
[email protected]: [email protected]:
dependencies: dependencies:
@@ -11243,7 +11278,7 @@ snapshots:
'@webassemblyjs/wasm-edit': 1.14.1 '@webassemblyjs/wasm-edit': 1.14.1
'@webassemblyjs/wasm-parser': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1
acorn: 8.15.0 acorn: 8.15.0
browserslist: 4.25.2 browserslist: 4.28.0
chrome-trace-event: 1.0.4 chrome-trace-event: 1.0.4
enhanced-resolve: 5.18.3 enhanced-resolve: 5.18.3
es-module-lexer: 1.7.0 es-module-lexer: 1.7.0
@@ -11252,11 +11287,11 @@ snapshots:
glob-to-regexp: 0.4.1 glob-to-regexp: 0.4.1
graceful-fs: 4.2.11 graceful-fs: 4.2.11
json-parse-even-better-errors: 2.3.1 json-parse-even-better-errors: 2.3.1
loader-runner: 4.3.0 loader-runner: 4.3.1
mime-types: 2.1.35 mime-types: 2.1.35
neo-async: 2.6.2 neo-async: 2.6.2
schema-utils: 4.3.2 schema-utils: 4.3.3
tapable: 2.2.2 tapable: 2.3.0
terser-webpack-plugin: 5.3.14([email protected]) terser-webpack-plugin: 5.3.14([email protected])
watchpack: 2.4.4 watchpack: 2.4.4
webpack-sources: 3.3.3 webpack-sources: 3.3.3
+115
View File
@@ -269,6 +269,7 @@ interface SiteConfig {
FluidSearch: boolean; FluidSearch: boolean;
DanmakuApiBase: string; DanmakuApiBase: string;
DanmakuApiToken: string; DanmakuApiToken: string;
EnableComments: boolean;
} }
// 视频源数据类型 // 视频源数据类型
@@ -3384,6 +3385,7 @@ const ConfigFileComponent = ({ config, refreshConfig }: { config: AdminConfig |
const SiteConfigComponent = ({ config, refreshConfig }: { config: AdminConfig | null; refreshConfig: () => Promise<void> }) => { const SiteConfigComponent = ({ config, refreshConfig }: { config: AdminConfig | null; refreshConfig: () => Promise<void> }) => {
const { alertModal, showAlert, hideAlert } = useAlertModal(); const { alertModal, showAlert, hideAlert } = useAlertModal();
const { isLoading, withLoading } = useLoadingState(); const { isLoading, withLoading } = useLoadingState();
const [showEnableCommentsModal, setShowEnableCommentsModal] = useState(false);
const [siteSettings, setSiteSettings] = useState<SiteConfig>({ const [siteSettings, setSiteSettings] = useState<SiteConfig>({
SiteName: '', SiteName: '',
Announcement: '', Announcement: '',
@@ -3397,6 +3399,7 @@ const SiteConfigComponent = ({ config, refreshConfig }: { config: AdminConfig |
FluidSearch: true, FluidSearch: true,
DanmakuApiBase: 'http://localhost:9321', DanmakuApiBase: 'http://localhost:9321',
DanmakuApiToken: '87654321', DanmakuApiToken: '87654321',
EnableComments: false,
}); });
// 豆瓣数据源相关状态 // 豆瓣数据源相关状态
@@ -3461,6 +3464,7 @@ const SiteConfigComponent = ({ config, refreshConfig }: { config: AdminConfig |
FluidSearch: config.SiteConfig.FluidSearch || true, FluidSearch: config.SiteConfig.FluidSearch || true,
DanmakuApiBase: config.SiteConfig.DanmakuApiBase || 'http://localhost:9321', DanmakuApiBase: config.SiteConfig.DanmakuApiBase || 'http://localhost:9321',
DanmakuApiToken: config.SiteConfig.DanmakuApiToken || '87654321', DanmakuApiToken: config.SiteConfig.DanmakuApiToken || '87654321',
EnableComments: config.SiteConfig.EnableComments || false,
}); });
} }
}, [config]); }, [config]);
@@ -3516,6 +3520,29 @@ const SiteConfigComponent = ({ config, refreshConfig }: { config: AdminConfig |
})); }));
}; };
// 处理评论开关变化
const handleCommentsToggle = (checked: boolean) => {
if (checked) {
// 如果要开启评论,弹出确认框
setShowEnableCommentsModal(true);
} else {
// 直接关闭评论
setSiteSettings((prev) => ({
...prev,
EnableComments: false,
}));
}
};
// 确认开启评论
const handleConfirmEnableComments = () => {
setSiteSettings((prev) => ({
...prev,
EnableComments: true,
}));
setShowEnableCommentsModal(false);
};
// 保存站点配置 // 保存站点配置
const handleSave = async () => { const handleSave = async () => {
await withLoading('saveSiteConfig', async () => { await withLoading('saveSiteConfig', async () => {
@@ -3964,6 +3991,40 @@ const SiteConfigComponent = ({ config, refreshConfig }: { config: AdminConfig |
</div> </div>
</div> </div>
{/* 评论功能配置 */}
<div className='space-y-4 pt-4 border-t border-gray-200 dark:border-gray-700'>
<h3 className='text-sm font-semibold text-gray-900 dark:text-gray-100'>
</h3>
{/* 开启评论 */}
<div>
<div className='flex items-center justify-between'>
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
</label>
<button
type='button'
onClick={() => handleCommentsToggle(!siteSettings.EnableComments)}
className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 ${siteSettings.EnableComments
? buttonStyles.toggleOn
: buttonStyles.toggleOff
}`}
>
<span
className={`inline-block h-4 w-4 transform rounded-full ${buttonStyles.toggleThumb} transition-transform ${siteSettings.EnableComments
? buttonStyles.toggleThumbOn
: buttonStyles.toggleThumbOff
}`}
/>
</button>
</div>
<p className='mt-1 text-xs text-gray-500 dark:text-gray-400'>
</p>
</div>
</div>
{/* 操作按钮 */} {/* 操作按钮 */}
<div className='flex justify-end'> <div className='flex justify-end'>
<button <button
@@ -3988,6 +4049,60 @@ const SiteConfigComponent = ({ config, refreshConfig }: { config: AdminConfig |
timer={alertModal.timer} timer={alertModal.timer}
showConfirm={alertModal.showConfirm} showConfirm={alertModal.showConfirm}
/> />
{/* 开启评论确认弹窗 */}
{showEnableCommentsModal && createPortal(
<div className='fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-4' onClick={() => setShowEnableCommentsModal(false)}>
<div className='bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full' onClick={(e) => e.stopPropagation()}>
<div className='p-6'>
<div className='flex items-center justify-between mb-6'>
<h3 className='text-xl font-semibold text-gray-900 dark:text-gray-100'>
</h3>
<button
onClick={() => setShowEnableCommentsModal(false)}
className='text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors'
>
<svg className='w-6 h-6' fill='none' stroke='currentColor' viewBox='0 0 24 24'>
<path strokeLinecap='round' strokeLinejoin='round' strokeWidth={2} d='M6 18L18 6M6 6l12 12' />
</svg>
</button>
</div>
<div className='mb-6'>
<div className='bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4'>
<div className='flex items-center space-x-2 mb-2'>
<AlertTriangle className='w-5 h-5 text-yellow-600 dark:text-yellow-400' />
<span className='text-sm font-medium text-yellow-800 dark:text-yellow-300'>
</span>
</div>
<p className='text-sm text-yellow-700 dark:text-yellow-400'>
</p>
</div>
</div>
{/* 操作按钮 */}
<div className='flex justify-end space-x-3'>
<button
onClick={() => setShowEnableCommentsModal(false)}
className={`px-6 py-2.5 text-sm font-medium ${buttonStyles.secondary}`}
>
</button>
<button
onClick={handleConfirmEnableComments}
className={`px-6 py-2.5 text-sm font-medium ${buttonStyles.primary}`}
>
</button>
</div>
</div>
</div>
</div>,
document.body
)}
</div> </div>
); );
}; };
+5 -1
View File
@@ -41,6 +41,7 @@ export async function POST(request: NextRequest) {
FluidSearch, FluidSearch,
DanmakuApiBase, DanmakuApiBase,
DanmakuApiToken, DanmakuApiToken,
EnableComments,
} = body as { } = body as {
SiteName: string; SiteName: string;
Announcement: string; Announcement: string;
@@ -54,6 +55,7 @@ export async function POST(request: NextRequest) {
FluidSearch: boolean; FluidSearch: boolean;
DanmakuApiBase: string; DanmakuApiBase: string;
DanmakuApiToken: string; DanmakuApiToken: string;
EnableComments: boolean;
}; };
// 参数校验 // 参数校验
@@ -69,7 +71,8 @@ export async function POST(request: NextRequest) {
typeof DisableYellowFilter !== 'boolean' || typeof DisableYellowFilter !== 'boolean' ||
typeof FluidSearch !== 'boolean' || typeof FluidSearch !== 'boolean' ||
typeof DanmakuApiBase !== 'string' || typeof DanmakuApiBase !== 'string' ||
typeof DanmakuApiToken !== 'string' typeof DanmakuApiToken !== 'string' ||
typeof EnableComments !== 'boolean'
) { ) {
return NextResponse.json({ error: '参数格式错误' }, { status: 400 }); return NextResponse.json({ error: '参数格式错误' }, { status: 400 });
} }
@@ -101,6 +104,7 @@ export async function POST(request: NextRequest) {
FluidSearch, FluidSearch,
DanmakuApiBase, DanmakuApiBase,
DanmakuApiToken, DanmakuApiToken,
EnableComments,
}; };
// 写入数据库 // 写入数据库
+3
View File
@@ -54,6 +54,7 @@ export default async function RootLayout({
let disableYellowFilter = let disableYellowFilter =
process.env.NEXT_PUBLIC_DISABLE_YELLOW_FILTER === 'true'; process.env.NEXT_PUBLIC_DISABLE_YELLOW_FILTER === 'true';
let fluidSearch = process.env.NEXT_PUBLIC_FLUID_SEARCH !== 'false'; let fluidSearch = process.env.NEXT_PUBLIC_FLUID_SEARCH !== 'false';
let enableComments = false;
let customCategories = [] as { let customCategories = [] as {
name: string; name: string;
type: 'movie' | 'tv'; type: 'movie' | 'tv';
@@ -77,6 +78,7 @@ export default async function RootLayout({
query: category.query, query: category.query,
})); }));
fluidSearch = config.SiteConfig.FluidSearch; fluidSearch = config.SiteConfig.FluidSearch;
enableComments = config.SiteConfig.EnableComments;
} }
// 将运行时配置注入到全局 window 对象,供客户端在运行时读取 // 将运行时配置注入到全局 window 对象,供客户端在运行时读取
@@ -89,6 +91,7 @@ export default async function RootLayout({
DISABLE_YELLOW_FILTER: disableYellowFilter, DISABLE_YELLOW_FILTER: disableYellowFilter,
CUSTOM_CATEGORIES: customCategories, CUSTOM_CATEGORIES: customCategories,
FLUID_SEARCH: fluidSearch, FLUID_SEARCH: fluidSearch,
EnableComments: enableComments,
}; };
return ( return (
+107 -86
View File
@@ -41,6 +41,7 @@ import { getVideoResolutionFromM3u8, processImageUrl } from '@/lib/utils';
import EpisodeSelector from '@/components/EpisodeSelector'; import EpisodeSelector from '@/components/EpisodeSelector';
import PageLayout from '@/components/PageLayout'; import PageLayout from '@/components/PageLayout';
import DoubanComments from '@/components/DoubanComments'; import DoubanComments from '@/components/DoubanComments';
import { useEnableComments } from '@/hooks/useEnableComments';
// 扩展 HTMLVideoElement 类型以支持 hls 属性 // 扩展 HTMLVideoElement 类型以支持 hls 属性
declare global { declare global {
@@ -60,6 +61,7 @@ interface WakeLockSentinel {
function PlayPageClient() { function PlayPageClient() {
const router = useRouter(); const router = useRouter();
const searchParams = useSearchParams(); const searchParams = useSearchParams();
const enableComments = useEnableComments();
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// 状态变量(State // 状态变量(State
@@ -597,13 +599,17 @@ function PlayPageClient() {
try { try {
// 在销毁前从弹幕插件读取最新配置并保存 // 在销毁前从弹幕插件读取最新配置并保存
if (danmakuPluginRef.current?.option && artPlayerRef.current.storage) { if (danmakuPluginRef.current?.option && artPlayerRef.current.storage) {
// 获取当前弹幕设置的快照,避免循环引用
const currentDanmakuSettings = danmakuSettingsRef.current;
const danmakuPluginOption = danmakuPluginRef.current.option;
const currentSettings = { const currentSettings = {
...danmakuSettingsRef.current, ...currentDanmakuSettings,
opacity: danmakuPluginRef.current.option.opacity || danmakuSettingsRef.current.opacity, opacity: danmakuPluginOption.opacity || currentDanmakuSettings.opacity,
fontSize: danmakuPluginRef.current.option.fontSize || danmakuSettingsRef.current.fontSize, fontSize: danmakuPluginOption.fontSize || currentDanmakuSettings.fontSize,
speed: danmakuPluginRef.current.option.speed || danmakuSettingsRef.current.speed, speed: danmakuPluginOption.speed || currentDanmakuSettings.speed,
marginTop: (danmakuPluginRef.current.option.margin && danmakuPluginRef.current.option.margin[0]) ?? danmakuSettingsRef.current.marginTop, marginTop: (danmakuPluginOption.margin && danmakuPluginOption.margin[0]) ?? currentDanmakuSettings.marginTop,
marginBottom: (danmakuPluginRef.current.option.margin && danmakuPluginRef.current.option.margin[1]) ?? danmakuSettingsRef.current.marginBottom, marginBottom: (danmakuPluginOption.margin && danmakuPluginOption.margin[1]) ?? currentDanmakuSettings.marginBottom,
}; };
// 保存到 localStorage 和 art.storage // 保存到 localStorage 和 art.storage
@@ -901,63 +907,71 @@ function PlayPageClient() {
setSkipConfig(newConfig); setSkipConfig(newConfig);
if (!newConfig.enable && !newConfig.intro_time && !newConfig.outro_time) { if (!newConfig.enable && !newConfig.intro_time && !newConfig.outro_time) {
await deleteSkipConfig(currentSourceRef.current, currentIdRef.current); await deleteSkipConfig(currentSourceRef.current, currentIdRef.current);
artPlayerRef.current.setting.update({
name: '跳过片头片尾', // 安全地更新播放器设置,仅在播放器存在时执行
html: '跳过片头片尾', if (artPlayerRef.current && artPlayerRef.current.setting) {
switch: skipConfigRef.current.enable, try {
onSwitch: function (item: any) { artPlayerRef.current.setting.update({
const newConfig = { name: '跳过片头片尾',
...skipConfigRef.current, html: '跳过片头片尾',
enable: !item.switch, switch: skipConfigRef.current.enable,
}; onSwitch: function (item: any) {
handleSkipConfigChange(newConfig); const newConfig = {
return !item.switch; ...skipConfigRef.current,
}, enable: !item.switch,
}); };
artPlayerRef.current.setting.update({ handleSkipConfigChange(newConfig);
name: '设置片头', return !item.switch;
html: '设置片头', },
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="5" cy="12" r="2" fill="#ffffff"/><path d="M9 12L17 12" stroke="#ffffff" stroke-width="2"/><path d="M17 6L17 18" stroke="#ffffff" stroke-width="2"/></svg>', });
tooltip: artPlayerRef.current.setting.update({
skipConfigRef.current.intro_time === 0 name: '设置片头',
? '设置片头时间' html: '设置片头',
: `${formatTime(skipConfigRef.current.intro_time)}`, icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="5" cy="12" r="2" fill="#ffffff"/><path d="M9 12L17 12" stroke="#ffffff" stroke-width="2"/><path d="M17 6L17 18" stroke="#ffffff" stroke-width="2"/></svg>',
onClick: function () { tooltip:
const currentTime = artPlayerRef.current?.currentTime || 0; skipConfigRef.current.intro_time === 0
if (currentTime > 0) { ? '设置片头时间'
const newConfig = { : `${formatTime(skipConfigRef.current.intro_time)}`,
...skipConfigRef.current, onClick: function () {
intro_time: currentTime, const currentTime = artPlayerRef.current?.currentTime || 0;
}; if (currentTime > 0) {
handleSkipConfigChange(newConfig); const newConfig = {
return `${formatTime(currentTime)}`; ...skipConfigRef.current,
} intro_time: currentTime,
}, };
}); handleSkipConfigChange(newConfig);
artPlayerRef.current.setting.update({ return `${formatTime(currentTime)}`;
name: '设置片尾', }
html: '设置片尾', },
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 6L7 18" stroke="#ffffff" stroke-width="2"/><path d="M7 12L15 12" stroke="#ffffff" stroke-width="2"/><circle cx="19" cy="12" r="2" fill="#ffffff"/></svg>', });
tooltip: artPlayerRef.current.setting.update({
skipConfigRef.current.outro_time >= 0 name: '设置片尾',
? '设置片尾时间' html: '设置片尾',
: `-${formatTime(-skipConfigRef.current.outro_time)}`, icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 6L7 18" stroke="#ffffff" stroke-width="2"/><path d="M7 12L15 12" stroke="#ffffff" stroke-width="2"/><circle cx="19" cy="12" r="2" fill="#ffffff"/></svg>',
onClick: function () { tooltip:
const outroTime = skipConfigRef.current.outro_time >= 0
-( ? '设置片尾时间'
artPlayerRef.current?.duration - : `-${formatTime(-skipConfigRef.current.outro_time)}`,
artPlayerRef.current?.currentTime onClick: function () {
) || 0; const outroTime =
if (outroTime < 0) { -(
const newConfig = { artPlayerRef.current?.duration -
...skipConfigRef.current, artPlayerRef.current?.currentTime
outro_time: outroTime, ) || 0;
}; if (outroTime < 0) {
handleSkipConfigChange(newConfig); const newConfig = {
return `-${formatTime(-outroTime)}`; ...skipConfigRef.current,
} outro_time: outroTime,
}, };
}); handleSkipConfigChange(newConfig);
return `-${formatTime(-outroTime)}`;
}
},
});
} catch (settingErr) {
console.warn('更新播放器设置失败:', settingErr);
}
}
} else { } else {
await saveSkipConfig( await saveSkipConfig(
currentSourceRef.current, currentSourceRef.current,
@@ -1828,7 +1842,7 @@ function PlayPageClient() {
window.removeEventListener('beforeunload', handleBeforeUnload); window.removeEventListener('beforeunload', handleBeforeUnload);
document.removeEventListener('visibilitychange', handleVisibilityChange); document.removeEventListener('visibilitychange', handleVisibilityChange);
}; };
}, [currentEpisodeIndex, detail, artPlayerRef.current]); }, [currentEpisodeIndex, detail]);
// 清理定时器 // 清理定时器
useEffect(() => { useEffect(() => {
@@ -2231,15 +2245,20 @@ function PlayPageClient() {
? '设置片头时间' ? '设置片头时间'
: `${formatTime(skipConfigRef.current.intro_time)}`, : `${formatTime(skipConfigRef.current.intro_time)}`,
onClick: function () { onClick: function () {
const currentTime = artPlayerRef.current?.currentTime || 0; // 安全地获取当前播放时间,避免循环依赖
if (currentTime > 0) { const player = artPlayerRef.current;
const newConfig = { if (player && player.currentTime) {
...skipConfigRef.current, const currentTime = player.currentTime || 0;
intro_time: currentTime, if (currentTime > 0) {
}; const newConfig = {
handleSkipConfigChange(newConfig); ...skipConfigRef.current,
return `${formatTime(currentTime)}`; intro_time: currentTime,
};
handleSkipConfigChange(newConfig);
return `${formatTime(currentTime)}`;
}
} }
return '';
}, },
}, },
{ {
@@ -2251,19 +2270,21 @@ function PlayPageClient() {
? '设置片尾时间' ? '设置片尾时间'
: `-${formatTime(-skipConfigRef.current.outro_time)}`, : `-${formatTime(-skipConfigRef.current.outro_time)}`,
onClick: function () { onClick: function () {
const outroTime = // 安全地获取播放器时长和当前时间,避免循环依赖
-( const player = artPlayerRef.current;
artPlayerRef.current?.duration - if (player && player.duration && player.currentTime) {
artPlayerRef.current?.currentTime const outroTime =
) || 0; -(player.duration - player.currentTime) || 0;
if (outroTime < 0) { if (outroTime < 0) {
const newConfig = { const newConfig = {
...skipConfigRef.current, ...skipConfigRef.current,
outro_time: outroTime, outro_time: outroTime,
}; };
handleSkipConfigChange(newConfig); handleSkipConfigChange(newConfig);
return `-${formatTime(-outroTime)}`; return `-${formatTime(-outroTime)}`;
}
} }
return '';
}, },
}, },
], ],
@@ -2496,7 +2517,7 @@ function PlayPageClient() {
console.error('创建播放器失败:', err); console.error('创建播放器失败:', err);
setError('播放器初始化失败'); setError('播放器初始化失败');
} }
}, [Artplayer, Hls, videoUrl, loading, blockAdEnabled]); }, [videoUrl, loading, blockAdEnabled, currentEpisodeIndex, detail]);
// 当组件卸载时清理定时器、Wake Lock 和播放器资源 // 当组件卸载时清理定时器、Wake Lock 和播放器资源
useEffect(() => { useEffect(() => {
@@ -3283,7 +3304,7 @@ function PlayPageClient() {
</div> </div>
{/* 豆瓣评论区域 */} {/* 豆瓣评论区域 */}
{videoDoubanId !== 0 && ( {videoDoubanId !== 0 && enableComments && (
<div className='mt-6 px-4'> <div className='mt-6 px-4'>
<div className='bg-white/50 dark:bg-gray-800/50 backdrop-blur-sm rounded-xl border border-gray-200/50 dark:border-gray-700/50 overflow-hidden'> <div className='bg-white/50 dark:bg-gray-800/50 backdrop-blur-sm rounded-xl border border-gray-200/50 dark:border-gray-700/50 overflow-hidden'>
{/* 标题 */} {/* 标题 */}
+13
View File
@@ -1,6 +1,7 @@
'use client'; 'use client';
import { useEffect, useState, useCallback } from 'react'; import { useEffect, useState, useCallback } from 'react';
import { useEnableComments } from '@/hooks/useEnableComments';
interface DoubanComment { interface DoubanComment {
id: string; id: string;
@@ -17,6 +18,11 @@ interface DoubanCommentsProps {
doubanId: number; doubanId: number;
} }
// 获取运行时配置的类型
interface RuntimeConfig {
EnableComments: boolean;
}
export default function DoubanComments({ doubanId }: DoubanCommentsProps) { export default function DoubanComments({ doubanId }: DoubanCommentsProps) {
const [comments, setComments] = useState<DoubanComment[]>([]); const [comments, setComments] = useState<DoubanComment[]>([]);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
@@ -26,6 +32,13 @@ export default function DoubanComments({ doubanId }: DoubanCommentsProps) {
const [hasStartedLoading, setHasStartedLoading] = useState(false); const [hasStartedLoading, setHasStartedLoading] = useState(false);
const limit = 20; const limit = 20;
const enableComments = useEnableComments();
// 如果评论功能被禁用,不显示任何内容
if (!enableComments) {
return null;
}
const fetchComments = useCallback(async (startIndex: number) => { const fetchComments = useCallback(async (startIndex: number) => {
try { try {
console.log('正在获取评论,起始位置:', startIndex); console.log('正在获取评论,起始位置:', startIndex);
+3
View File
@@ -50,6 +50,9 @@ interface SidebarProps {
declare global { declare global {
interface Window { interface Window {
__sidebarCollapsed?: boolean; __sidebarCollapsed?: boolean;
RUNTIME_CONFIG?: {
EnableComments: boolean;
};
} }
} }
+19
View File
@@ -0,0 +1,19 @@
import { useState, useEffect } from 'react';
interface RuntimeConfig {
EnableComments: boolean;
}
export function useEnableComments(): boolean {
const [enableComments, setEnableComments] = useState(true);
useEffect(() => {
// 在客户端获取运行时配置
if (typeof window !== 'undefined') {
const runtimeConfig = (window as any).RUNTIME_CONFIG as RuntimeConfig;
setEnableComments(runtimeConfig?.EnableComments ?? true);
}
}, []);
return enableComments;
}
+2
View File
@@ -19,6 +19,8 @@ export interface AdminConfig {
// 弹幕配置 // 弹幕配置
DanmakuApiBase: string; DanmakuApiBase: string;
DanmakuApiToken: string; DanmakuApiToken: string;
// 评论功能开关
EnableComments: boolean;
}; };
UserConfig: { UserConfig: {
Users: { Users: {
+7
View File
@@ -221,6 +221,8 @@ async function getInitConfig(configFile: string, subConfig: {
// 弹幕配置 // 弹幕配置
DanmakuApiBase: process.env.DANMAKU_API_BASE || 'http://localhost:9321', DanmakuApiBase: process.env.DANMAKU_API_BASE || 'http://localhost:9321',
DanmakuApiToken: process.env.DANMAKU_API_TOKEN || '87654321', DanmakuApiToken: process.env.DANMAKU_API_TOKEN || '87654321',
// 评论功能开关
EnableComments: false,
}, },
UserConfig: { UserConfig: {
Users: [], Users: [],
@@ -332,6 +334,7 @@ export function configSelfCheck(adminConfig: AdminConfig): AdminConfig {
FluidSearch: true, FluidSearch: true,
DanmakuApiBase: 'http://localhost:9321', DanmakuApiBase: 'http://localhost:9321',
DanmakuApiToken: '87654321', DanmakuApiToken: '87654321',
EnableComments: false,
}; };
} }
// 确保弹幕配置存在 // 确保弹幕配置存在
@@ -341,6 +344,10 @@ export function configSelfCheck(adminConfig: AdminConfig): AdminConfig {
if (!adminConfig.SiteConfig.DanmakuApiToken) { if (!adminConfig.SiteConfig.DanmakuApiToken) {
adminConfig.SiteConfig.DanmakuApiToken = '87654321'; adminConfig.SiteConfig.DanmakuApiToken = '87654321';
} }
// 确保评论开关存在
if (adminConfig.SiteConfig.EnableComments === undefined) {
adminConfig.SiteConfig.EnableComments = false;
}
if (!adminConfig.UserConfig) { if (!adminConfig.UserConfig) {
adminConfig.UserConfig = { Users: [] }; adminConfig.UserConfig = { Users: [] };
} }