commit 519589f8f510a43e5a58d1daa081337236de2f2c Author: DengDai <29502593+zzhhxx@users.noreply.github.com> Date: Mon Dec 8 14:45:14 2025 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e8de24 --- /dev/null +++ b/.gitignore @@ -0,0 +1,644 @@ +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +.idea +/cache/ +*.pyc +**/__pycache__ +**/node_modules/ +**/series_index.json +**/config.json + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Csharp template +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +### Python template +# Byte-compiled / optimized / DLL files +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +.aider* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f24888f --- /dev/null +++ b/LICENSE @@ -0,0 +1,232 @@ +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + +0. Definitions. + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on the Program. + +To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +1. Source Code. +The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. + +A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. + + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +7. Additional Terms. +“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +11. Patents. +A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + +14. Revised Versions of this License. +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. + + skit-panel + Copyright (C) 2025 zzhhxx + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: + + skit-panel Copyright (C) 2025 zzhhxx + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. + +You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . + +The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . diff --git a/backend/app.py b/backend/app.py new file mode 100644 index 0000000..54066ea --- /dev/null +++ b/backend/app.py @@ -0,0 +1,35 @@ +# skit_panel_backend/app.py +from flask import Flask +from flask_cors import CORS + +# 导入蓝图 +from routes.dashboard import dashboard_bp +from routes.system import system_bp +from routes.media import media_bp +from routes.actions import actions_bp +from services.scheduler_service import init_scheduler +def create_app(): + app = Flask(__name__) + + # 配置 CORS,允许你的前端地址访问 + # 在开发中, "*" 是最简单的设置 + CORS(app, resources={r"/api/*": {"origins": "*"}}) + + # 注册蓝图 + app.register_blueprint(dashboard_bp) + app.register_blueprint(system_bp) + app.register_blueprint(media_bp) + app.register_blueprint(actions_bp) + + @app.route("/") + def index(): + return "

SkitPanel Backend is running!

" + with app.app_context(): + init_scheduler() + return app + +if __name__ == '__main__': + app = create_app() + # 生产环境应使用 Gunicorn 或 uWSGI + # debug=True 模式下,修改代码后服务会自动重启 + app.run(host='0.0.0.0', port=5000, debug=True) diff --git a/backend/config.json.example b/backend/config.json.example new file mode 100644 index 0000000..f1f6879 --- /dev/null +++ b/backend/config.json.example @@ -0,0 +1,42 @@ +{ + "douban": { + "cookie": "" + }, + "skit_paths": [], + "ptskit": { + "url": "", + "cookie": "", + "user_agent": "SkitPanel/1.0" + }, + "downloader": "qbittorrent", + "qbittorrent": { + "host": "", + "port": 8080, + "username": "", + "password": "" + }, + "transmission": { + "host": "", + "port": 9091, + "username": "", + "password": "" + }, + "emby": { + "host": "", + "port": 8096, + "use_ssl": false, + "api_key": "" + }, + "plex": { + "host": "", + "port": 32400, + "use_ssl": false, + "token": "" + }, + "fnos": { + "host": "", + "port": 1999, + "use_ssl": false, + "authorization": "" + } +} diff --git a/backend/config.py b/backend/config.py new file mode 100644 index 0000000..70d06d7 --- /dev/null +++ b/backend/config.py @@ -0,0 +1,67 @@ +import json +import os +import copy +from threading import Lock + +CONFIG_PATH = 'config.json' + +class ConfigManager: + """线程安全地处理 config.json 的读取、写入和访问""" + def __init__(self, path=CONFIG_PATH): + self.path = path + self._lock = Lock() + self.config = self._load_config() + + def _load_config(self): + """加载配置文件,如果不存在则创建一个空的""" + with self._lock: + if os.path.exists(self.path): + try: + with open(self.path, 'r', encoding='utf-8') as f: + return json.load(f) + except (json.JSONDecodeError, IOError): + return {} + return {} + + def get_config(self, sensitive=False): + """ + 获取配置。 + :param sensitive: False时,将敏感信息替换为 '******' + """ + config_copy = copy.deepcopy(self.config) + if sensitive: + return config_copy + + # 隐藏敏感信息 + sensitive_keys = { + 'douban': 'cookie', 'ptskit': 'cookie', + 'emby': 'api_key', 'plex': 'token', 'fnos': 'authorization' + } + for section, key in sensitive_keys.items(): + if section in config_copy and key in config_copy[section]: + config_copy[section][key] = '******' if config_copy[section][key] else '' + + # 隐藏密码 + for section in ['qbittorrent', 'transmission']: + if section in config_copy and 'password' in config_copy[section]: + config_copy[section]['password'] = '' + + return config_copy + + def save_config(self, new_config): + """保存配置到文件""" + with self._lock: + try: + with open(self.path, 'w', encoding='utf-8') as f: + json.dump(new_config, f, indent=4, ensure_ascii=False) + self.config = new_config # 更新内存中的配置 + return True, None + except Exception as e: + return False, str(e) + + def get(self, key, default=None): + """获取特定配置项""" + return self.config.get(key, default) + +# 创建一个全局单例 +config_manager = ConfigManager() diff --git a/backend/requirements.txt b/backend/requirements.txt new file mode 100644 index 0000000..e36f698 --- /dev/null +++ b/backend/requirements.txt @@ -0,0 +1,14 @@ +# 核心框架 +flask==3.1.2 +flask-cors==6.0.1 + +# 下载器客户端 +qbittorrent-api==2025.7.0 +transmission-rpc==7.0.11 + +# 网络请求与解析 +requests==2.32.5 +beautifulsoup4==4.13.5 +lxml==6.0.1 +plexapi==4.17.1 +APScheduler==3.11.0 \ No newline at end of file diff --git a/backend/routes/__init__.py b/backend/routes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/routes/actions.py b/backend/routes/actions.py new file mode 100644 index 0000000..b936e59 --- /dev/null +++ b/backend/routes/actions.py @@ -0,0 +1,41 @@ +from flask import Blueprint, jsonify, request +from config import config_manager +from utils.placeholders import ServicePlaceholder, long_running_task + +actions_bp = Blueprint('actions', __name__, url_prefix='/api') + +@actions_bp.route('/downloader/add', methods=['POST']) +def add_download_task(): + # 逻辑: 根据配置,将下载链接添加到 qBittorrent 或 Transmission + # 返回格式: {"message": "任务添加成功"} + data = request.get_json() + if not data or 'download_url' not in data: + return jsonify({"error": "缺少 download_url"}), 400 + + downloader_type = config_manager.get('downloader') + config = config_manager.get(downloader_type) + manager = ServicePlaceholder(config) + + success, message = manager.add_task(data['download_url']) + if success: + return jsonify({"message": f"任务已成功添加至 {downloader_type}"}) + else: + return jsonify({"error": message}), 500 + +@actions_bp.route('/scrape', methods=['POST']) +def scrape_media(): + # 逻辑: 接收媒体路径,在后台线程中启动刮削任务 + # 返回格式 (202 Accepted): {"message": "刮削任务已加入队列..."} + data = request.get_json() + media_path = data.get('media_path') + if not media_path: + return jsonify({"error": "缺少 media_path"}), 400 + + douban_config = config_manager.get('douban') + manager = ServicePlaceholder(douban_config) + + # 在后台线程中执行刮削 + long_running_task(manager.scrape, media_path) + + # 立即返回 202 Accepted 响应 + return jsonify({"message": "刮削任务已加入队列,请稍后刷新查看结果"}), 202 diff --git a/backend/routes/dashboard.py b/backend/routes/dashboard.py new file mode 100644 index 0000000..47b0ef5 --- /dev/null +++ b/backend/routes/dashboard.py @@ -0,0 +1,53 @@ +from flask import Blueprint, jsonify +from config import config_manager +from utils.placeholders import ServicePlaceholder +from utils.plex_utils import PlexManager + +dashboard_bp = Blueprint('dashboard', __name__, url_prefix='/api/dashboard') + +@dashboard_bp.route('/initial_check', methods=['GET']) +def initial_check(): + # 逻辑: 检查配置文件中是否至少有一个关键项被配置,例如ptskit的URL + # 返回格式: {"is_configured": true | false} + is_configured = bool(config_manager.get('ptskit', {}).get('url')) + return jsonify({"is_configured": is_configured}) + +@dashboard_bp.route('/stats', methods=['GET']) +def get_stats(): + # 逻辑: 分别连接 qBittorrent, Transmission, Emby 等服务获取它们的项目总数 + # 返回格式: {"local_skits": int, "fnos_items": int, ...} + qb_manager = ServicePlaceholder(config_manager.get('qbittorrent')) + plex_config = config_manager.get('plex') + plex_manager = PlexManager(plex_config) + plex_items = plex_manager.get_stats() + return jsonify({ + "local_skits": 15, + "fnos_items": 12, + "emby_items": 12, + "plex_items": plex_items, + "qb_total": qb_manager.get_stats(), + "tr_total": 4 + }) + +@dashboard_bp.route('/component_statuses', methods=['GET']) +def get_component_statuses(): + # 逻辑: 对每个配置的服务进行一次连接测试,并返回其状态 + # 返回格式: {"qbittorrent": {"status": "success" | "error" | "unconfigured", "message": str}, ...} + plex_config = config_manager.get('plex') + plex_status = {"status": "unconfigured", "message": "未配置"} + if plex_config and plex_config.get('host'): + plex_manager = PlexManager(plex_config) + success, message = plex_manager.test_connection() + plex_status = {"status": "success" if success else "error", "message": message} + + + return jsonify({ + "douban_cookie": {"status": "success", "message": "Cookie已配置"}, + "ptskit_cookie": {"status": "success", "message": "Cookie已配置"}, + "local_path": {"status": "success", "message": "已挂载"}, + "qbittorrent": {"status": "success", "message": "连接成功 v4.5.2"}, + "transmission": {"status": "error", "message": "连接失败: 认证错误"}, + "fnos": {"status": "unconfigured", "message": "未配置"}, + "emby": {"status": "success", "message": "连接成功"}, + "plex": plex_status + }) diff --git a/backend/routes/media.py b/backend/routes/media.py new file mode 100644 index 0000000..d07f9ac --- /dev/null +++ b/backend/routes/media.py @@ -0,0 +1,102 @@ +from flask import Blueprint, jsonify, request +from config import config_manager +from utils.plex_utils import PlexManager +from plexapi.exceptions import Unauthorized, NotFound +from services.cache_service import CacheManager +from utils.pagination import paginate +media_bp = Blueprint('media', __name__, url_prefix='/api') + +@media_bp.route('/ptskit/torrents', methods=['GET']) +def get_ptskit_torrents(): + # 逻辑: 访问 PTSKIT 网站,解析种子列表页,支持分页和搜索 + # 返回格式: {"total": int, "list": [{"id": str, "title": str, ...}]} + page = request.args.get('page', 1, type=int) + page_size = request.args.get('pageSize', 20, type=int) + keyword = request.args.get('keyword', '') + + mock_list = [{ + "id": f"torrent-{i + (page-1)*page_size}", + "title": f"[PTSKIT] 搜索'{keyword}'的结果 {i+1}", + "size": f"{i+1}.5 GB", + "seeders": 50 - i, "leechers": i, + "download_url": f"http://example.com/download.php?id={i}" + } for i in range(page_size)] + + return jsonify({"total": 123, "list": mock_list}) + +@media_bp.route('/local-media', methods=['GET']) +def get_local_media(): + # 逻辑: 扫描配置中的 skit_paths 目录,列出所有短剧文件夹 + # 返回格式: {"total": int, "list": [{"id": str, "title": str, "path": str, ...}]} + page = request.args.get('page', 1, type=int) + page_size = request.args.get('pageSize', 20, type=int) + + mock_list = [{ + "id": f"local-{i + (page-1)*page_size}", + "title": f"本地短剧-{i+1}", + "path": f"/skits/本地短剧-{i+1}", + "poster": f"https://picsum.photos/seed/{i}/200/300", + "scraped": i % 2 == 0 + } for i in range(page_size)] + + return jsonify({"total": 88, "list": mock_list}) + +@media_bp.route('//library', methods=['GET']) +def get_media_server_library(server_type): + # 逻辑: 根据 server_type (emby, plex, fnos) 连接对应服务,获取媒体库 + # 返回格式: {"total": int, "list": [{"id": str, "title": str, ...}]} + # if server_type not in ['emby', 'plex', 'fnos']: + # return jsonify({"error": "不支持的媒体服务器类型"}), 404 + if server_type == 'plex': + try: + plex_config = config_manager.get('plex') + manager = PlexManager(plex_config) + libraries = manager.get_libraries() + return jsonify({"total": len(libraries), "list": libraries}) + except ValueError as e: # 通常是未配置错误 + return jsonify({"error": str(e)}), 400 + except Unauthorized as e: + return jsonify({"error": f"Plex 认证失败: {e}"}), 401 + except Exception as e: + return jsonify({"error": f"连接 Plex 时发生错误: {e}"}), 503 + elif server_type in ['emby', 'fnos']: + page = request.args.get('page', 1, type=int) + page_size = request.args.get('pageSize', 20, type=int) + + mock_list = [{ + "id": f"{server_type}-{i + (page-1)*page_size}", + "title": f"[{server_type.upper()}] 服务器上的短剧 {i+1}", + "year": 2023, + "poster": f"https://picsum.photos/seed/{server_type}{i}/200/300" + } for i in range(page_size)] + + return jsonify({"total": 66, "list": mock_list}) + return jsonify({"error": "不支持的媒体服务器类型"}), 404 + + +@media_bp.route('/plex/libraries//items', methods=['GET']) +def get_plex_library_items(library_id): + page = request.args.get('page', 1, type=int) + page_size = request.args.get('pageSize', 20, type=int) + try: + # 1. 初始化缓存管理器,为每个库使用单独的缓存文件 + # TTL 设置为 3660 秒(1小时+1分钟),确保比定时任务间隔稍长 + cache_mgr = CacheManager(f"plex_lib_{library_id}.json", ttl_seconds=3660) + + # 2. 初始化 Plex 管理器 + plex_config = config_manager.get('plex') + manager = PlexManager(plex_config) + # 3. 使用 cache_mgr.get_data 获取数据 + # 它会自动处理:读缓存,或在缓存失效时调用 manager.get_library_items + all_items = cache_mgr.get_data(manager.get_library_items, library_id=library_id) + # 4. 使用分页工具进行分页 + paginated_data = paginate(all_items, page, page_size) + return jsonify(paginated_data) + except ValueError as e: # 通常是配置错误 + return jsonify({"error": str(e)}), 400 + except NotFound: # get_library_items 可能会在强制刷新时抛出 + return jsonify({"error": f"ID为 '{library_id}' 的 Plex 媒体库不存在"}), 4404 + except Unauthorized as e: + return jsonify({"error": f"Plex 认证失败: {e}"}), 401 + except Exception as e: + return jsonify({"error": f"获取 Plex 项目时发生内部错误: {e}"}), 500 \ No newline at end of file diff --git a/backend/routes/system.py b/backend/routes/system.py new file mode 100644 index 0000000..8a5682b --- /dev/null +++ b/backend/routes/system.py @@ -0,0 +1,61 @@ +from flask import Blueprint, jsonify, request +from config import config_manager +from utils.plex_utils import PlexManager +from utils.placeholders import ServicePlaceholder + +system_bp = Blueprint('system', __name__, url_prefix='/api/system') +MANAGER_MAP = { + 'plex': PlexManager, + # TODO: 当你实现其他 Manager 后,在这里添加它们 + # 'qbittorrent': QBManager, + # 'transmission': TransmissionManager, + # 'emby': EmbyManager, + # 'fnos': FnosManager, +} +@system_bp.route('/config', methods=['GET']) +def get_system_config(): + """获取系统配置(屏蔽敏感信息)""" + return jsonify(config_manager.get_config(sensitive=False)) + +@system_bp.route('/config', methods=['POST']) +def save_system_config(): + """保存系统配置""" + new_config = request.get_json() + if not isinstance(new_config, dict): + return jsonify({"error": "无效的JSON格式"}), 400 + + success, error = config_manager.save_config(new_config) + if success: + return jsonify({"message": "配置保存成功!"}) + else: + return jsonify({"error": f"保存失败: {error}"}), 500 + +@system_bp.route('/test_connection', methods=['POST']) +def test_connection(): + """动态测试指定服务的连接""" + data = request.get_json() + service_type = data.get('type') + service_config = data.get('config') + + if not service_type or not service_config: + return jsonify({"error": "请求参数不完整"}), 400 + + # 3. 动态选择 Manager + # 从 MANAGER_MAP 中获取对应的类。 + # 如果 service_type 不在映射中(例如 'emby' 还没实现),则默认使用 ServicePlaceholder + ManagerClass = MANAGER_MAP.get(service_type, ServicePlaceholder) + + # 使用从前端实时传来的配置实例化 Manager + manager_instance = ManagerClass(service_config) + + try: + # 调用实例的 test_connection 方法 + # 我们新的 Manager 返回 (bool, str),正好符合这里的逻辑 + success, message = manager_instance.test_connection() + return jsonify({"success": success, "message": message}) + except Exception as e: + # 添加一个通用异常捕获,防止 Manager 内部的意外错误导致服务器崩溃 + return jsonify({ + "success": False, + "message": f"测试时发生内部错误: {str(e)}" + }), 500 \ No newline at end of file diff --git a/backend/services/__init__.py b/backend/services/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/services/cache_service.py b/backend/services/cache_service.py new file mode 100644 index 0000000..334f36a --- /dev/null +++ b/backend/services/cache_service.py @@ -0,0 +1,76 @@ +import os +import json +import time +import logging + +log = logging.getLogger(__name__) + +# 定义缓存目录 +CACHE_DIR = os.path.join(os.path.dirname(__file__), '..', 'cache') +os.makedirs(CACHE_DIR, exist_ok=True) # 自动创建目录 + +class CacheManager: + """ + 一个通用的JSON文件缓存管理器。 + """ + def __init__(self, cache_file_name: str, ttl_seconds: int = 3600): + """ + :param cache_file_name: 缓存文件名, e.g., 'plex_library.json' + :param ttl_seconds: 缓存的生命周期(秒),默认1小时 + """ + self.cache_path = os.path.join(CACHE_DIR, cache_file_name) + self.ttl = ttl_seconds + + def _is_stale(self) -> bool: + """检查缓存是否已过期""" + if not os.path.exists(self.cache_path): + return True # 文件不存在,视为过期 + + file_mod_time = os.path.getmtime(self.cache_path) + if (time.time() - file_mod_time) > self.ttl: + return True # 文件存在但已超过TTL,视为过期 + + return False + + def read_cache(self) -> list | dict | None: + """从文件读取缓存""" + try: + with open(self.cache_path, 'r', encoding='utf-8') as f: + return json.load(f) + except (FileNotFoundError, json.JSONDecodeError): + return None + + def write_cache(self, data: list | dict): + """将数据写入缓存文件""" + try: + with open(self.cache_path, 'w', encoding='utf-8') as f: + json.dump(data, f, ensure_ascii=False, indent=4) + except Exception as e: + log.error(f"写入缓存文件 {self.cache_path} 失败: {e}") + + def get_data(self, fetch_func, *args, **kwargs) -> list | dict: + """ + 获取数据的主要方法。如果缓存有效则从缓存读取,否则调用 fetch_func 获取新数据。 + + :param fetch_func: 一个用于获取实时数据的函数 (e.g., plex_manager.get_items) + :param args: 传递给 fetch_func 的位置参数 + :param kwargs: 传递给 fetch_func 的关键字参数 + :return: 数据 + """ + if not self._is_stale(): + log.debug(f"从缓存加载数据: {self.cache_path}") + cached_data = self.read_cache() + if cached_data is not None: + return cached_data + + log.info(f"缓存失效或不存在,正在从源获取新数据: {fetch_func.__name__}") + try: + fresh_data = fetch_func(*args, **kwargs) + self.write_cache(fresh_data) + return fresh_data + except Exception as e: + log.error(f"调用 fetch_func ({fetch_func.__name__}) 失败: {e}", exc_info=True) + # 如果获取新数据失败,尝试返回旧的缓存(即使已过期),这比返回错误要好 + log.warning("获取新数据失败,尝试使用旧缓存作为备用。") + old_data = self.read_cache() + return old_data if old_data is not None else [] diff --git a/backend/services/data_updater.py b/backend/services/data_updater.py new file mode 100644 index 0000000..cac2e81 --- /dev/null +++ b/backend/services/data_updater.py @@ -0,0 +1,40 @@ +import logging +from config import config_manager +from utils.plex_utils import PlexManager +from .cache_service import CacheManager + +log = logging.getLogger(__name__) + +def update_all_plex_libraries_cache(): + """ + 强制刷新所有已配置的Plex媒体库的缓存。 + 这个函数将被定时任务调用。 + """ + log.info("开始执行定时任务:更新Plex媒体库缓存...") + plex_config = config_manager.get('plex') + if not plex_config or not plex_config.get('host'): + log.info("Plex未配置,跳过更新任务。") + return + + try: + manager = PlexManager(plex_config) + libraries = manager.get_libraries() + + for lib in libraries: + lib_id = lib['id'] + # 为每个媒体库创建一个独立的缓存文件 + cache_mgr = CacheManager(f"plex_lib_{lib_id}.json") + + # 调用 get_data 并传入真正的 fetch 函数,这会强制刷新缓存 + log.debug(f"正在为Plex媒体库 '{lib['name']}' ({lib_id}) 刷新缓存...") + cache_mgr.get_data(manager.get_library_items, library_id=lib_id) + + log.info("Plex媒体库缓存更新任务完成。") + + except Exception as e: + log.error(f"更新Plex缓存时发生错误: {e}", exc_info=True) + +# TODO: 在这里添加其他更新函数,例如: +# def update_local_skits_cache(): +# log.info("开始更新本地短剧缓存...") +# ... diff --git a/backend/services/scheduler_service.py b/backend/services/scheduler_service.py new file mode 100644 index 0000000..e5c60b9 --- /dev/null +++ b/backend/services/scheduler_service.py @@ -0,0 +1,35 @@ +import logging +import atexit +from apscheduler.schedulers.background import BackgroundScheduler +from .data_updater import update_all_plex_libraries_cache + +log = logging.getLogger(__name__) +scheduler = BackgroundScheduler(daemon=True) + +def init_scheduler(): + """初始化并启动定时任务调度器""" + if scheduler.running: + log.warning("调度器已在运行中。") + return + + try: + # 在这里添加你的定时任务 + scheduler.add_job( + func=update_all_plex_libraries_cache, + trigger='interval', + hours=1, # 每1小时执行一次 + id='update_plex_job', + replace_existing=True + ) + + # TODO: 添加其他任务 + # scheduler.add_job(...) + + scheduler.start() + log.info("定时任务调度器已启动。") + + # 确保在应用退出时能优雅地关闭调度器 + atexit.register(lambda: scheduler.shutdown()) + except Exception as e: + log.error(f"启动调度器失败: {e}", exc_info=True) + diff --git a/backend/utils/__init__.py b/backend/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/utils/douban_utils.py b/backend/utils/douban_utils.py new file mode 100644 index 0000000..14f8959 --- /dev/null +++ b/backend/utils/douban_utils.py @@ -0,0 +1,54 @@ +import requests +import time +import os + +class DoubanManager: + def __init__(self, config): + self.cookie = config.get('cookie', '') + + def test_connection(self): + if not self.cookie: + return False, "未配置 Cookie" + # 简单测试,可以访问一个需要登录的页面 + headers = {'Cookie': self.cookie} + try: + res = requests.get('https://www.douban.com/mine/', headers=headers, timeout=10) + if '登录' in res.text: + return False, "Cookie 已失效" + return True, "Cookie 有效" + except Exception as e: + return False, f"网络请求失败: {e}" + + def scrape(self, media_path): + """ + 模拟耗时的刮削任务 + :param media_path: 要刮削的媒体文件夹路径 + """ + print(f"开始刮削: {media_path}") + # 1. 提取剧名 + series_name = os.path.basename(media_path) + print(f"提取剧名: {series_name}") + + # 2. 在豆瓣搜索 (模拟) + time.sleep(5) + print("模拟豆瓣搜索中...") + + # 3. 获取信息并写入 NFO 和海报 (模拟) + time.sleep(5) + nfo_path = os.path.join(media_path, 'movie.nfo') + poster_path = os.path.join(media_path, 'poster.jpg') + + with open(nfo_path, 'w', encoding='utf-8') as f: + f.write(f"{series_name}这是一个模拟刮削的剧情简介。") + + # 模拟下载海报 + try: + # 使用一个占位图 + img_data = requests.get("https://via.placeholder.com/300x450.png?text=Poster").content + with open(poster_path, 'wb') as handler: + handler.write(img_data) + except Exception as e: + print(f"下载海报失败: {e}") + + print(f"刮削完成: {media_path}") + diff --git a/backend/utils/media_server_utils.py b/backend/utils/media_server_utils.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/utils/pagination.py b/backend/utils/pagination.py new file mode 100644 index 0000000..83c99f3 --- /dev/null +++ b/backend/utils/pagination.py @@ -0,0 +1,36 @@ +# skit_panel_backend/utils/pagination.py + +def paginate(data_list: list, page: int, page_size: int): + """ + 一个简单的列表分页工具。 + + :param data_list: 要分页的完整列表。 + :param page: 当前页码 (从1开始)。 + :param page_size: 每页的项目数。 + :return: 一个包含分页后数据和总数的字典。 + """ + if not isinstance(data_list, list): + # 如果输入不是列表,返回空结果 + return {"total": 0, "list": []} + + total = len(data_list) + + # 确保页码和页面大小是正整数 + page = max(1, page) + page_size = max(1, page_size) + + start = (page - 1) * page_size + + # 防止切片索引越界 + if start >= total: + return {"total": total, "list": []} + + end = start + page_size + + paginated_list = data_list[start:end] + + return { + "total": total, + "list": paginated_list + } + diff --git a/backend/utils/placeholders.py b/backend/utils/placeholders.py new file mode 100644 index 0000000..9a63fb7 --- /dev/null +++ b/backend/utils/placeholders.py @@ -0,0 +1,45 @@ +import time +import threading + +""" +这个文件包含了所有与外部服务交互的模拟类。 +在实际开发中,您应该将每个类移动到自己的文件中(如 qbittorrent_utils.py), +并实现与真实服务的交互逻辑。 +""" + +def long_running_task(target, *args, **kwargs): + """一个辅助函数,用于在后台线程中运行耗时任务""" + thread = threading.Thread(target=target, args=args, kwargs=kwargs) + thread.daemon = True + thread.start() + +class ServicePlaceholder: + def __init__(self, config): + self.config = config + + def test_connection(self): + # 模拟:检查配置是否存在 + if self.config and all(self.config.values()): + return True, "模拟连接成功" + return False, "模拟连接失败:配置不完整" + + def get_stats(self): + # 模拟返回一个统计数字 + return 42 + + def get_library(self, page=1, page_size=20, keyword=None): + # 模拟返回一个分页的媒体库列表 + return { + "total": 50, + "list": [{"id": f"item-{i}", "title": f"服务器上的短剧 {i}", "year": 2024} for i in range(page_size)] + } + + def add_task(self, url): + # 模拟添加任务 + return True, "模拟:任务添加成功" + + def scrape(self, path): + # 模拟一个耗时的刮削过程 + print(f"[后台任务] 开始刮削: {path}") + time.sleep(10) + print(f"[后台任务] 刮削完成: {path}") diff --git a/backend/utils/plex_utils.py b/backend/utils/plex_utils.py new file mode 100644 index 0000000..09c08c0 --- /dev/null +++ b/backend/utils/plex_utils.py @@ -0,0 +1,141 @@ +import logging +from plexapi.server import PlexServer +from plexapi.exceptions import Unauthorized, NotFound + +log = logging.getLogger(__name__) + +class PlexManager: + """ + 用于与 Plex Media Server 交互的工具类。 + - 适配项目 config.json 格式。 + - 在发生错误时抛出异常,而不是返回错误字典。 + - 成功时直接返回数据。 + """ + def __init__(self, config): + """ + 根据配置初始化 PlexManager。 + :param config: 来自 config.json 的 'plex' 部分。 + """ + self.config = config + self.token = config.get('token') + + host = config.get('host') + port = config.get('port') + use_ssl = config.get('use_ssl', False) + + if not all([host, port, self.token]): + self.baseurl = None + else: + scheme = 'https' if use_ssl else 'http' + self.baseurl = f"{scheme}://{host}:{port}" + + self.server = None + log.debug(f"PlexManager initialized for URL: {self.baseurl}") + + def _connect(self): + """ + 连接到 Plex 服务器。如果连接已建立则直接返回。 + 如果失败,则会抛出异常。 + """ + if self.server: + return + + if not self.baseurl: + raise ValueError("Plex 未配置 (host, port, token)") + + try: + log.debug(f"尝试连接到 Plex: {self.baseurl}") + # plexapi 内部有重试机制,但我们可以设置一个合理的超时 + self.server = PlexServer(self.baseurl, self.token, timeout=10) + # 访问一个属性来验证连接 + _ = self.server.friendlyName + log.info(f"成功连接到 Plex 服务器: {self.server.friendlyName}") + except Unauthorized: + log.error("Plex 连接失败: Token 无效或权限不足") + raise # 将原始异常重新抛出 + except Exception as e: + log.error(f"Plex 连接失败: {e}", exc_info=True) + self.server = None # 连接失败时重置 server 对象 + raise # 重新抛出,让调用者处理 + + def test_connection(self): + """ + 测试与 Plex 的连接,并返回一个易于前端展示的状态元组。 + :return: (bool, str) -> (是否成功, 消息) + """ + try: + self._connect() + message = f"连接成功: {self.server.friendlyName} (v{self.server.version})" + return True, message + except Exception as e: + return False, f"连接失败: {e}" + + def get_stats(self): + """获取所有媒体库的项目总数,用于仪表盘。""" + try: + self._connect() + return len(self.server.library.sections()) + except Exception: + return 0 # 如果连接失败,返回0 + + def get_libraries(self): + """ + 获取媒体库列表。 + :return: list of dicts, 每个字典代表一个媒体库 + """ + self._connect() + libraries = [] + log.debug("正在获取 Plex 媒体库列表") + for section in self.server.library.sections(): + libraries.append({ + 'id': section.key, + 'name': section.title, + 'type': section.type, + 'path': ', '.join(section.locations) + }) + log.debug(f"成功获取 {len(libraries)} 个 Plex 媒体库") + return libraries + + def get_library_items(self, library_id): + """ + 获取指定媒体库中的所有项目。 + 此方法会抛出 NotFound 或 ValueError 异常,需要调用者捕获。 + :param library_id: 媒体库的 ID (key) + :return: list of dicts, 每个字典代表一个媒体项目 + """ + self._connect() + log.debug(f"正在获取 Plex 媒体库 '{library_id}' 的项目") + + # plexapi v4.12.0+ sectionByID 接受字符串或整数 + section = self.server.library.sectionByID(library_id) + + items = [] + if section.type not in ['movie', 'show']: + log.warning(f"跳过不支持的 Plex 库类型: {section.type}") + return items + + for item in section.all(): + item_data = { + 'id': item.ratingKey, + 'title': item.title, + 'type': item.type, + 'year': item.year, + 'summary': item.summary, + 'poster': self.server.url(item.thumb, True) if item.thumb else None, + 'path': ', '.join(item.locations), + } + items.append(item_data) + + log.debug(f"从库 '{section.title}' 获取到 {len(items)} 个项目") + return items + + def refresh_library(self, library_id): + """ + 发送刷新指定媒体库的请求。 + :param library_id: 媒体库的 ID (key) + """ + self._connect() + log.debug(f"正在请求刷新 Plex 媒体库: {library_id}") + section = self.server.library.sectionByID(library_id) + section.update() + log.info(f"已向 Plex 媒体库 '{section.title}' 发送刷新请求") diff --git a/backend/utils/ptskit_utils.py b/backend/utils/ptskit_utils.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/utils/qbittorrent_utils.py b/backend/utils/qbittorrent_utils.py new file mode 100644 index 0000000..07a2572 --- /dev/null +++ b/backend/utils/qbittorrent_utils.py @@ -0,0 +1,31 @@ +import qbittorrentapi + +class QBittorrentManager: + def __init__(self, config): + self.client = qbittorrentapi.Client(**config) + + def test_connection(self): + try: + self.client.auth_log_in() + version = self.client.app.version + api_version = self.client.app.webapi_version + return True, f"连接成功,qBittorrent 版本: {version} (API: {api_version})" + except qbittorrentapi.LoginFailed as e: + return False, f"登录失败: {e}" + except Exception as e: + return False, f"连接失败: {e}" + + def get_stats(self): + try: + self.client.auth_log_in() + return len(self.client.torrents_info()) + except: + return 0 + + def add_torrent(self, url): + try: + self.client.auth_log_in() + result = self.client.torrents_add(urls=url) + return result == "Ok.", "任务添加成功" if result == "Ok." else "任务添加失败" + except Exception as e: + return False, str(e) diff --git a/backend/utils/transmission_utils.py b/backend/utils/transmission_utils.py new file mode 100644 index 0000000..e69de29 diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/frontend/.vscode/extensions.json b/frontend/.vscode/extensions.json new file mode 100644 index 0000000..a7cea0b --- /dev/null +++ b/frontend/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar"] +} diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..9b33a2b --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,34 @@ +# Dockerfile + +# ---- Stage 1: Build ---- +# 使用一个包含 Node.js 的镜像来构建前端应用 +FROM node:18-alpine AS builder + +WORKDIR /app + +# 复制 package.json 和 package-lock.json 并安装依赖 +# 这样可以利用 Docker 的层缓存 +COPY package*.json ./ +RUN npm install + +# 复制所有源代码 +COPY . . + +# 执行构建命令 +RUN npm run build + +# ---- Stage 2: Production ---- +# 使用一个轻量的 Nginx 镜像来托管构建好的静态文件 +FROM nginx:alpine + +# 从构建阶段复制编译好的文件到 Nginx 的网站根目录 +COPY --from=builder /app/dist /usr/share/nginx/html + +# 复制自定义的 Nginx 配置文件 +COPY nginx.conf /etc/nginx/conf.d/default.conf + +# 暴露 80 端口 +EXPOSE 80 + +# 启动 Nginx +CMD ["nginx", "-g", "daemon off;"] diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 0000000..1511959 --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,5 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 ` + + diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..3216bdc --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,34 @@ +# nginx.conf +server { + listen 80; + server_name localhost; + + # 网站根目录 + root /usr/share/nginx/html; + index index.html index.htm; + + # API 反向代理配置 + # 所有 /api/ 的请求都转发给名为 'backend' 的服务(在 docker-compose.yml 中定义)的 8000 端口 + location /api/ { + proxy_pass http://127.0.0.1:5000/; # 这里的 skit-panel-backend 必须与 docker-compose 中的服务名一致 + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + # 播放器反向代理 (可选,但推荐,以解决跨域问题) + # 假设你的 Node.js 播放器服务在 docker-compose 中名为 skit-panel-player,端口为 3001 + # location /player/ { + # proxy_pass http://skit-panel-player:3001/; + # proxy_http_version 1.1; + # proxy_set_header Upgrade $http_upgrade; + # proxy_set_header Connection "upgrade"; + # } + + # 处理 Vue Router (SPA) 的路由 + # 如果请求的文件或目录不存在,则返回 index.html + location / { + try_files $uri $uri/ /index.html; + } +} diff --git a/frontend/package-lock.json b/frontend/package-lock.json new file mode 100644 index 0000000..61ceee5 --- /dev/null +++ b/frontend/package-lock.json @@ -0,0 +1,1956 @@ +{ + "name": "skit-panel-frontend", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "skit-panel-frontend", + "version": "0.0.0", + "dependencies": { + "@element-plus/icons-vue": "^2.3.2", + "axios": "^1.11.0", + "element-plus": "^2.11.2", + "pinia": "^3.0.3", + "vue": "^3.5.18", + "vue-router": "^4.5.1" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^6.0.1", + "vite": "^7.1.2" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.4", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.28.4.tgz", + "integrity": "sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.4" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.28.4", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.28.4.tgz", + "integrity": "sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@ctrl/tinycolor": { + "version": "3.6.1", + "resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", + "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/@element-plus/icons-vue": { + "version": "2.3.2", + "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.2.tgz", + "integrity": "sha512-OzIuTaIfC8QXEPmJvB4Y4kw34rSXdCJzxcD1kFStBvr8bK6X1zQAYDo0CNMjojnfTqRQCJ0I7prlErcoRiET2A==", + "license": "MIT", + "peerDependencies": { + "vue": "^3.2.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.9.tgz", + "integrity": "sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.25.9.tgz", + "integrity": "sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.25.9.tgz", + "integrity": "sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.25.9.tgz", + "integrity": "sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.9.tgz", + "integrity": "sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.25.9.tgz", + "integrity": "sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.9.tgz", + "integrity": "sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.9.tgz", + "integrity": "sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.25.9.tgz", + "integrity": "sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.25.9.tgz", + "integrity": "sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.25.9.tgz", + "integrity": "sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.25.9.tgz", + "integrity": "sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.9.tgz", + "integrity": "sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.9.tgz", + "integrity": "sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.9.tgz", + "integrity": "sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.25.9.tgz", + "integrity": "sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.25.9.tgz", + "integrity": "sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.9.tgz", + "integrity": "sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.9.tgz", + "integrity": "sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.9.tgz", + "integrity": "sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.9.tgz", + "integrity": "sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.9.tgz", + "integrity": "sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.25.9.tgz", + "integrity": "sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.25.9.tgz", + "integrity": "sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.25.9.tgz", + "integrity": "sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.25.9.tgz", + "integrity": "sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@floating-ui/core": { + "version": "1.7.3", + "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.7.3.tgz", + "integrity": "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==", + "license": "MIT", + "dependencies": { + "@floating-ui/utils": "^0.2.10" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.7.4", + "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.7.4.tgz", + "integrity": "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==", + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^1.7.3", + "@floating-ui/utils": "^0.2.10" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.10", + "resolved": "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.2.10.tgz", + "integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==", + "license": "MIT" + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@popperjs/core": { + "name": "@sxzz/popperjs-es", + "version": "2.11.7", + "resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", + "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.29", + "resolved": "https://registry.npmmirror.com/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.29.tgz", + "integrity": "sha512-NIJgOsMjbxAXvoGq/X0gD7VPMQ8j9g0BiDaNjVNVjvl+iKXxL3Jre0v31RmBYeLEmkbj2s02v8vFTbUXi5XS2Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.50.1.tgz", + "integrity": "sha512-HJXwzoZN4eYTdD8bVV22DN8gsPCAj3V20NHKOs8ezfXanGpmVPR7kalUHd+Y31IJp9stdB87VKPFbsGY3H/2ag==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.50.1.tgz", + "integrity": "sha512-PZlsJVcjHfcH53mOImyt3bc97Ep3FJDXRpk9sMdGX0qgLmY0EIWxCag6EigerGhLVuL8lDVYNnSo8qnTElO4xw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.50.1.tgz", + "integrity": "sha512-xc6i2AuWh++oGi4ylOFPmzJOEeAa2lJeGUGb4MudOtgfyyjr4UPNK+eEWTPLvmPJIY/pgw6ssFIox23SyrkkJw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.50.1.tgz", + "integrity": "sha512-2ofU89lEpDYhdLAbRdeyz/kX3Y2lpYc6ShRnDjY35bZhd2ipuDMDi6ZTQ9NIag94K28nFMofdnKeHR7BT0CATw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.50.1.tgz", + "integrity": "sha512-wOsE6H2u6PxsHY/BeFHA4VGQN3KUJFZp7QJBmDYI983fgxq5Th8FDkVuERb2l9vDMs1D5XhOrhBrnqcEY6l8ZA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.50.1.tgz", + "integrity": "sha512-A/xeqaHTlKbQggxCqispFAcNjycpUEHP52mwMQZUNqDUJFFYtPHCXS1VAG29uMlDzIVr+i00tSFWFLivMcoIBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.50.1.tgz", + "integrity": "sha512-54v4okehwl5TaSIkpp97rAHGp7t3ghinRd/vyC1iXqXMfjYUTm7TfYmCzXDoHUPTTf36L8pr0E7YsD3CfB3ZDg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.50.1.tgz", + "integrity": "sha512-p/LaFyajPN/0PUHjv8TNyxLiA7RwmDoVY3flXHPSzqrGcIp/c2FjwPPP5++u87DGHtw+5kSH5bCJz0mvXngYxw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.50.1.tgz", + "integrity": "sha512-2AbMhFFkTo6Ptna1zO7kAXXDLi7H9fGTbVaIq2AAYO7yzcAsuTNWPHhb2aTA6GPiP+JXh85Y8CiS54iZoj4opw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.50.1.tgz", + "integrity": "sha512-Cgef+5aZwuvesQNw9eX7g19FfKX5/pQRIyhoXLCiBOrWopjo7ycfB292TX9MDcDijiuIJlx1IzJz3IoCPfqs9w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.50.1.tgz", + "integrity": "sha512-RPhTwWMzpYYrHrJAS7CmpdtHNKtt2Ueo+BlLBjfZEhYBhK00OsEqM08/7f+eohiF6poe0YRDDd8nAvwtE/Y62Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.50.1.tgz", + "integrity": "sha512-eSGMVQw9iekut62O7eBdbiccRguuDgiPMsw++BVUg+1K7WjZXHOg/YOT9SWMzPZA+w98G+Fa1VqJgHZOHHnY0Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.50.1.tgz", + "integrity": "sha512-S208ojx8a4ciIPrLgazF6AgdcNJzQE4+S9rsmOmDJkusvctii+ZvEuIC4v/xFqzbuP8yDjn73oBlNDgF6YGSXQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.50.1.tgz", + "integrity": "sha512-3Ag8Ls1ggqkGUvSZWYcdgFwriy2lWo+0QlYgEFra/5JGtAd6C5Hw59oojx1DeqcA2Wds2ayRgvJ4qxVTzCHgzg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.50.1.tgz", + "integrity": "sha512-t9YrKfaxCYe7l7ldFERE1BRg/4TATxIg+YieHQ966jwvo7ddHJxPj9cNFWLAzhkVsbBvNA4qTbPVNsZKBO4NSg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.50.1.tgz", + "integrity": "sha512-MCgtFB2+SVNuQmmjHf+wfI4CMxy3Tk8XjA5Z//A0AKD7QXUYFMQcns91K6dEHBvZPCnhJSyDWLApk40Iq/H3tA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.50.1.tgz", + "integrity": "sha512-nEvqG+0jeRmqaUMuwzlfMKwcIVffy/9KGbAGyoa26iu6eSngAYQ512bMXuqqPrlTyfqdlB9FVINs93j534UJrg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.50.1.tgz", + "integrity": "sha512-RDsLm+phmT3MJd9SNxA9MNuEAO/J2fhW8GXk62G/B4G7sLVumNFbRwDL6v5NrESb48k+QMqdGbHgEtfU0LCpbA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.50.1.tgz", + "integrity": "sha512-hpZB/TImk2FlAFAIsoElM3tLzq57uxnGYwplg6WDyAxbYczSi8O2eQ+H2Lx74504rwKtZ3N2g4bCUkiamzS6TQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.50.1.tgz", + "integrity": "sha512-SXjv8JlbzKM0fTJidX4eVsH+Wmnp0/WcD8gJxIZyR6Gay5Qcsmdbi9zVtnbkGPG8v2vMR1AD06lGWy5FLMcG7A==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.50.1.tgz", + "integrity": "sha512-StxAO/8ts62KZVRAm4JZYq9+NqNsV7RvimNK+YM7ry//zebEH6meuugqW/P5OFUCjyQgui+9fUxT6d5NShvMvA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmmirror.com/@types/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==", + "license": "MIT" + }, + "node_modules/@types/lodash-es": { + "version": "4.17.12", + "resolved": "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.12.tgz", + "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==", + "license": "MIT", + "dependencies": { + "@types/lodash": "*" + } + }, + "node_modules/@types/web-bluetooth": { + "version": "0.0.16", + "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz", + "integrity": "sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==", + "license": "MIT" + }, + "node_modules/@vitejs/plugin-vue": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-6.0.1.tgz", + "integrity": "sha512-+MaE752hU0wfPFJEUAIxqw18+20euHHdxVtMvbFcOEpjEyfqXH/5DCoTHiVJ0J29EhTJdoTkjEv5YBKU9dnoTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "1.0.0-beta.29" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.21", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.21.tgz", + "integrity": "sha512-8i+LZ0vf6ZgII5Z9XmUvrCyEzocvWT+TeR2VBUVlzIH6Tyv57E20mPZ1bCS+tbejgUgmjrEh7q/0F0bibskAmw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.3", + "@vue/shared": "3.5.21", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.21", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.21.tgz", + "integrity": "sha512-jNtbu/u97wiyEBJlJ9kmdw7tAr5Vy0Aj5CgQmo+6pxWNQhXZDPsRr1UWPN4v3Zf82s2H3kF51IbzZ4jMWAgPlQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.21", + "@vue/shared": "3.5.21" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.21", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.21.tgz", + "integrity": "sha512-SXlyk6I5eUGBd2v8Ie7tF6ADHE9kCR6mBEuPyH1nUZ0h6Xx6nZI29i12sJKQmzbDyr2tUHMhhTt51Z6blbkTTQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.3", + "@vue/compiler-core": "3.5.21", + "@vue/compiler-dom": "3.5.21", + "@vue/compiler-ssr": "3.5.21", + "@vue/shared": "3.5.21", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.18", + "postcss": "^8.5.6", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.21", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.21.tgz", + "integrity": "sha512-vKQ5olH5edFZdf5ZrlEgSO1j1DMA4u23TVK5XR1uMhvwnYvVdDF0nHXJUblL/GvzlShQbjhZZ2uvYmDlAbgo9w==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.21", + "@vue/shared": "3.5.21" + } + }, + "node_modules/@vue/devtools-api": { + "version": "7.7.7", + "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-7.7.7.tgz", + "integrity": "sha512-lwOnNBH2e7x1fIIbVT7yF5D+YWhqELm55/4ZKf45R9T8r9dE2AIOy8HKjfqzGsoTHFbWbr337O4E0A0QADnjBg==", + "license": "MIT", + "dependencies": { + "@vue/devtools-kit": "^7.7.7" + } + }, + "node_modules/@vue/devtools-kit": { + "version": "7.7.7", + "resolved": "https://registry.npmmirror.com/@vue/devtools-kit/-/devtools-kit-7.7.7.tgz", + "integrity": "sha512-wgoZtxcTta65cnZ1Q6MbAfePVFxfM+gq0saaeytoph7nEa7yMXoi6sCPy4ufO111B9msnw0VOWjPEFCXuAKRHA==", + "license": "MIT", + "dependencies": { + "@vue/devtools-shared": "^7.7.7", + "birpc": "^2.3.0", + "hookable": "^5.5.3", + "mitt": "^3.0.1", + "perfect-debounce": "^1.0.0", + "speakingurl": "^14.0.1", + "superjson": "^2.2.2" + } + }, + "node_modules/@vue/devtools-shared": { + "version": "7.7.7", + "resolved": "https://registry.npmmirror.com/@vue/devtools-shared/-/devtools-shared-7.7.7.tgz", + "integrity": "sha512-+udSj47aRl5aKb0memBvcUG9koarqnxNM5yjuREvqwK6T3ap4mn3Zqqc17QrBFTqSMjr3HK1cvStEZpMDpfdyw==", + "license": "MIT", + "dependencies": { + "rfdc": "^1.4.1" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.21", + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.21.tgz", + "integrity": "sha512-3ah7sa+Cwr9iiYEERt9JfZKPw4A2UlbY8RbbnH2mGCE8NwHkhmlZt2VsH0oDA3P08X3jJd29ohBDtX+TbD9AsA==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.21" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.21", + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.21.tgz", + "integrity": "sha512-+DplQlRS4MXfIf9gfD1BOJpk5RSyGgGXD/R+cumhe8jdjUcq/qlxDawQlSI8hCKupBlvM+3eS1se5xW+SuNAwA==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.21", + "@vue/shared": "3.5.21" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.21", + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.21.tgz", + "integrity": "sha512-3M2DZsOFwM5qI15wrMmNF5RJe1+ARijt2HM3TbzBbPSuBHOQpoidE+Pa+XEaVN+czbHf81ETRoG1ltztP2em8w==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.21", + "@vue/runtime-core": "3.5.21", + "@vue/shared": "3.5.21", + "csstype": "^3.1.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.21", + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.21.tgz", + "integrity": "sha512-qr8AqgD3DJPJcGvLcJKQo2tAc8OnXRcfxhOJCPF+fcfn5bBGz7VCcO7t+qETOPxpWK1mgysXvVT/j+xWaHeMWA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.21", + "@vue/shared": "3.5.21" + }, + "peerDependencies": { + "vue": "3.5.21" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.21", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.21.tgz", + "integrity": "sha512-+2k1EQpnYuVuu3N7atWyG3/xoFWIVJZq4Mz8XNOdScFI0etES75fbny/oU4lKWk/577P1zmg0ioYvpGEDZ3DLw==", + "license": "MIT" + }, + "node_modules/@vueuse/core": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-9.13.0.tgz", + "integrity": "sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==", + "license": "MIT", + "dependencies": { + "@types/web-bluetooth": "^0.0.16", + "@vueuse/metadata": "9.13.0", + "@vueuse/shared": "9.13.0", + "vue-demi": "*" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/core/node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/@vueuse/metadata": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-9.13.0.tgz", + "integrity": "sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-9.13.0.tgz", + "integrity": "sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==", + "license": "MIT", + "dependencies": { + "vue-demi": "*" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared/node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/async-validator": { + "version": "4.2.5", + "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz", + "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==", + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.11.0", + "resolved": "https://registry.npmmirror.com/axios/-/axios-1.11.0.tgz", + "integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.4", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/birpc": { + "version": "2.5.0", + "resolved": "https://registry.npmmirror.com/birpc/-/birpc-2.5.0.tgz", + "integrity": "sha512-VSWO/W6nNQdyP520F1mhf+Lc2f8pjGQOtoHHm7Ze8Go1kX7akpVIrtTa0fn+HB0QJEDVacl6aO08YE0PgXfdnQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/copy-anything": { + "version": "3.0.5", + "resolved": "https://registry.npmmirror.com/copy-anything/-/copy-anything-3.0.5.tgz", + "integrity": "sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==", + "license": "MIT", + "dependencies": { + "is-what": "^4.1.8" + }, + "engines": { + "node": ">=12.13" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "license": "MIT" + }, + "node_modules/dayjs": { + "version": "1.11.18", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.18.tgz", + "integrity": "sha512-zFBQ7WFRvVRhKcWoUh+ZA1g2HVgUbsZm9sbddh8EC5iv93sui8DVVz1Npvz+r6meo9VKfa8NyLWBsQK1VvIKPA==", + "license": "MIT" + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/element-plus": { + "version": "2.11.2", + "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.11.2.tgz", + "integrity": "sha512-sTMDXtgeqy17TUsBSH/DL3h1/5sqIOVUUgXFoVbdD8lWWYssKrDX50CEYy4k29tYJhPHKZyFSwcLJsIajr+dDA==", + "license": "MIT", + "dependencies": { + "@ctrl/tinycolor": "^3.4.1", + "@element-plus/icons-vue": "^2.3.1", + "@floating-ui/dom": "^1.0.1", + "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7", + "@types/lodash": "^4.14.182", + "@types/lodash-es": "^4.17.6", + "@vueuse/core": "^9.1.0", + "async-validator": "^4.2.5", + "dayjs": "^1.11.13", + "escape-html": "^1.0.3", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "lodash-unified": "^1.0.2", + "memoize-one": "^6.0.0", + "normalize-wheel-es": "^1.2.0" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.25.9", + "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.25.9.tgz", + "integrity": "sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.9", + "@esbuild/android-arm": "0.25.9", + "@esbuild/android-arm64": "0.25.9", + "@esbuild/android-x64": "0.25.9", + "@esbuild/darwin-arm64": "0.25.9", + "@esbuild/darwin-x64": "0.25.9", + "@esbuild/freebsd-arm64": "0.25.9", + "@esbuild/freebsd-x64": "0.25.9", + "@esbuild/linux-arm": "0.25.9", + "@esbuild/linux-arm64": "0.25.9", + "@esbuild/linux-ia32": "0.25.9", + "@esbuild/linux-loong64": "0.25.9", + "@esbuild/linux-mips64el": "0.25.9", + "@esbuild/linux-ppc64": "0.25.9", + "@esbuild/linux-riscv64": "0.25.9", + "@esbuild/linux-s390x": "0.25.9", + "@esbuild/linux-x64": "0.25.9", + "@esbuild/netbsd-arm64": "0.25.9", + "@esbuild/netbsd-x64": "0.25.9", + "@esbuild/openbsd-arm64": "0.25.9", + "@esbuild/openbsd-x64": "0.25.9", + "@esbuild/openharmony-arm64": "0.25.9", + "@esbuild/sunos-x64": "0.25.9", + "@esbuild/win32-arm64": "0.25.9", + "@esbuild/win32-ia32": "0.25.9", + "@esbuild/win32-x64": "0.25.9" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.4", + "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hookable": { + "version": "5.5.3", + "resolved": "https://registry.npmmirror.com/hookable/-/hookable-5.5.3.tgz", + "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==", + "license": "MIT" + }, + "node_modules/is-what": { + "version": "4.1.16", + "resolved": "https://registry.npmmirror.com/is-what/-/is-what-4.1.16.tgz", + "integrity": "sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==", + "license": "MIT", + "engines": { + "node": ">=12.13" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "license": "MIT" + }, + "node_modules/lodash-unified": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/lodash-unified/-/lodash-unified-1.0.3.tgz", + "integrity": "sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==", + "license": "MIT", + "peerDependencies": { + "@types/lodash-es": "*", + "lodash": "*", + "lodash-es": "*" + } + }, + "node_modules/magic-string": { + "version": "0.30.19", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.19.tgz", + "integrity": "sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==", + "license": "MIT" + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/normalize-wheel-es": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz", + "integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==", + "license": "BSD-3-Clause" + }, + "node_modules/perfect-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/perfect-debounce/-/perfect-debounce-1.0.0.tgz", + "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pinia": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/pinia/-/pinia-3.0.3.tgz", + "integrity": "sha512-ttXO/InUULUXkMHpTdp9Fj4hLpD/2AoJdmAbAeW2yu1iy1k+pkFekQXw5VpC0/5p51IOR/jDaDRfRWRnMMsGOA==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^7.7.2" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "typescript": ">=4.4.4", + "vue": "^2.7.0 || ^3.5.11" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "license": "MIT" + }, + "node_modules/rollup": { + "version": "4.50.1", + "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.50.1.tgz", + "integrity": "sha512-78E9voJHwnXQMiQdiqswVLZwJIzdBKJ1GdI5Zx6XwoFKUIk09/sSrr+05QFzvYb8q6Y9pPV45zzDuYa3907TZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.50.1", + "@rollup/rollup-android-arm64": "4.50.1", + "@rollup/rollup-darwin-arm64": "4.50.1", + "@rollup/rollup-darwin-x64": "4.50.1", + "@rollup/rollup-freebsd-arm64": "4.50.1", + "@rollup/rollup-freebsd-x64": "4.50.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.50.1", + "@rollup/rollup-linux-arm-musleabihf": "4.50.1", + "@rollup/rollup-linux-arm64-gnu": "4.50.1", + "@rollup/rollup-linux-arm64-musl": "4.50.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.50.1", + "@rollup/rollup-linux-ppc64-gnu": "4.50.1", + "@rollup/rollup-linux-riscv64-gnu": "4.50.1", + "@rollup/rollup-linux-riscv64-musl": "4.50.1", + "@rollup/rollup-linux-s390x-gnu": "4.50.1", + "@rollup/rollup-linux-x64-gnu": "4.50.1", + "@rollup/rollup-linux-x64-musl": "4.50.1", + "@rollup/rollup-openharmony-arm64": "4.50.1", + "@rollup/rollup-win32-arm64-msvc": "4.50.1", + "@rollup/rollup-win32-ia32-msvc": "4.50.1", + "@rollup/rollup-win32-x64-msvc": "4.50.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/speakingurl": { + "version": "14.0.1", + "resolved": "https://registry.npmmirror.com/speakingurl/-/speakingurl-14.0.1.tgz", + "integrity": "sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/superjson": { + "version": "2.2.2", + "resolved": "https://registry.npmmirror.com/superjson/-/superjson-2.2.2.tgz", + "integrity": "sha512-5JRxVqC8I8NuOUjzBbvVJAKNM8qoVuH0O77h4WInc/qC2q5IreqKxYwgkga3PfA22OayK2ikceb/B26dztPl+Q==", + "license": "MIT", + "dependencies": { + "copy-anything": "^3.0.2" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/vite": { + "version": "7.1.5", + "resolved": "https://registry.npmmirror.com/vite/-/vite-7.1.5.tgz", + "integrity": "sha512-4cKBO9wR75r0BeIWWWId9XK9Lj6La5X846Zw9dFfzMRw38IlTk2iCcUt6hsyiDRcPidc55ZParFYDXi0nXOeLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.25.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vue": { + "version": "3.5.21", + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.21.tgz", + "integrity": "sha512-xxf9rum9KtOdwdRkiApWL+9hZEMWE90FHh8yS1+KJAiWYh+iGWV1FquPjoO9VUHQ+VIhsCXNNyZ5Sf4++RVZBA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.21", + "@vue/compiler-sfc": "3.5.21", + "@vue/runtime-dom": "3.5.21", + "@vue/server-renderer": "3.5.21", + "@vue/shared": "3.5.21" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-router": { + "version": "4.5.1", + "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.5.1.tgz", + "integrity": "sha512-ogAF3P97NPm8fJsE4by9dwSYtDwXIY1nFY9T6DyQnGHd1E2Da94w9JIolpe42LJGIl0DwOHBi8TcRPlPGwbTtw==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.6.4" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + }, + "node_modules/vue-router/node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", + "license": "MIT" + } + } +} diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 0000000..e5ea4a8 --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,23 @@ +{ + "name": "skit-panel-frontend", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "@element-plus/icons-vue": "^2.3.2", + "axios": "^1.11.0", + "element-plus": "^2.11.2", + "pinia": "^3.0.3", + "vue": "^3.5.18", + "vue-router": "^4.5.1" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^6.0.1", + "vite": "^7.1.2" + } +} diff --git a/frontend/src/App.vue b/frontend/src/App.vue new file mode 100644 index 0000000..87ed26e --- /dev/null +++ b/frontend/src/App.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/frontend/src/api/index.js b/frontend/src/api/index.js new file mode 100644 index 0000000..e97341d --- /dev/null +++ b/frontend/src/api/index.js @@ -0,0 +1,154 @@ +import axios from 'axios'; +import { ElMessage } from 'element-plus'; + +// true: 使用模拟数据, false: 请求真实后端 +const isMock = false; + +const api = axios.create({ + baseURL: '/api', // Nginx 将会把这个前缀代理到后端服务 + timeout: 10000, +}); + +// 响应拦截器 +api.interceptors.response.use( + response => response.data, + error => { + ElMessage.error(error.message || '网络请求失败'); + return Promise.reject(error); + } +); + +// ---- 模拟数据生成器 (用于分页列表) ---- +const createMockListData = (page, pageSize, total, itemGenerator) => { + const items = []; + const count = Math.min(pageSize, total - (page - 1) * pageSize); + for (let i = 0; i < count; i++) { + items.push(itemGenerator(i + (page - 1) * pageSize)); + } + // 模拟网络延迟 + return new Promise(resolve => setTimeout(() => { + resolve({ + total: total, + list: items, + }); + }, 500)); +}; + +// ---- API 接口定义 ---- + +/** 系统配置 */ +export const getSystemConfig = () => isMock + ? Promise.resolve({ + douban: { cookie: 'douban_cookie_test_value_xxxxxx' }, + skit_paths: ['/skits', '/downloads/completed'], // 现在是数组 + ptskit: { + url: 'https://ptskit.com', + cookie: 'ptskit_cookie_test_value_xxxxxx', + user_agent: '' + }, + qbittorrent: { + host: 'localhost', + port: 8080, + username: 'admin', + password: 'adminadmin' + }, + transmission: { + host: 'localhost', + port: 9091, + username: '', + password: '' + }, + emby: { + host: 'localhost', + port: 8096, + use_ssl: false, + api_key: 'emby_api_key_test' + }, + plex: { + host: 'localhost', + port: 32400, + use_ssl: false, + token: 'plex_token_test' + }, + fnos: { + host: 'localhost', + port: 1999, + use_ssl: false, + authorization: 'fnos_auth_token_test' + }, + }) + : api.get('/system/config'); +export const saveSystemConfig = (data) => isMock ? Promise.resolve({ message: '配置保存成功!' }) : api.post('/system/config', data); +export const testConnection = (data) => isMock + ? new Promise(resolve => setTimeout(() => resolve({ success: true, message: `[Mock] ${data.type} 连接成功!` }), 1000)) + : api.post('/system/test_connection', data); + + +/** 首页 / 仪表盘 */ +export const getInitialCheck = () => isMock + ? Promise.resolve({ is_configured: true }) // <-- 修改为 false 来测试顶部的“请配置”警告条 + : api.get('/dashboard/initial_check'); + +export const getDashboardStats = () => isMock + ? new Promise(resolve => setTimeout(() => resolve({ + local_skits: 2, + fnos_items: 2, + emby_items: 2, + plex_items: 0, + qb_total: 47, + tr_total: 4, + }), 800)) // 模拟网络延迟,让 loading 效果更明显 + : api.get('/dashboard/stats'); + +export const testAllComponents = () => isMock + ? new Promise(resolve => setTimeout(() => resolve({ + douban_cookie: { status: 'success', message: 'Cookie已配置' }, + ptskit_cookie: { status: 'success', message: 'Cookie已配置' }, + local_path: { status: 'success', message: '已挂载' }, + qbittorrent: { status: 'success', message: '连接成功 v4.5.2' }, + transmission: { status: 'error', message: '连接失败: 认证错误' }, + fnos: { status: 'unconfigured', message: '未配置' }, + emby: { status: 'success', message: '连接成功' }, + plex: { status: 'unconfigured', message: '未配置' }, + }), 1500)) // 模拟一个较长的测试时间 + : api.get('/dashboard/component_statuses'); + + +/** 本地媒体 */ +export const getLocalMedia = (params) => isMock + ? createMockListData(params.page, params.pageSize, 88, i => ({ + id: i + 1, + title: `短剧-本地风云-${i + 1}`, + path: `/media/短剧-本地风云-${i + 1}`, + poster: `https://picsum.photos/seed/${i}/200/300`, + scraped: i % 3 === 0, // 模拟刮削状态 + })) + : api.get('/local-media', { params }); + +/** PTSKIT 种子 */ +export const getPtskitTorrents = (params) => isMock + ? createMockListData(params.page, params.pageSize, 123, i => ({ + id: `torrent-${i}`, + title: `[PTSKIT] 超好看的短剧 S01 全集 ${i + 1}GB`, + size: `${(Math.random() * 10).toFixed(2)} GB`, + seeders: Math.floor(Math.random() * 100), + leechers: Math.floor(Math.random() * 20), + download_url: `https://ptskit.com/download.php?id=${i}` + })) + : api.get('/ptskit/torrents', { params }); + +/** 下载 */ +export const addDownloadTask = (data) => isMock ? Promise.resolve({ message: '任务添加成功' }) : api.post('/downloader/add', data); + +/** 刮削 */ +export const scrapeMedia = (data) => isMock ? Promise.resolve({ message: '开始刮削' }) : api.post('/scrape', data); + +/** 媒体服务器 */ +export const getMediaServerLibrary = (serverType, params) => isMock + ? createMockListData(params.page, params.pageSize, 50, i => ({ + id: `${serverType}-${i}`, + title: `[${serverType.toUpperCase()}] 服务器上的短剧 ${i + 1}`, + year: 2023, + poster: `https://picsum.photos/seed/${serverType}${i}/200/300`, + })) + : api.get(`/${serverType}/library`, { params }); diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css new file mode 100644 index 0000000..8faffc6 --- /dev/null +++ b/frontend/src/assets/main.css @@ -0,0 +1,15 @@ +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; +} + +.page-container { + padding: 20px; +} + +.table-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 20px; +} diff --git a/frontend/src/components/AppLayout.vue b/frontend/src/components/AppLayout.vue new file mode 100644 index 0000000..3d313dd --- /dev/null +++ b/frontend/src/components/AppLayout.vue @@ -0,0 +1,60 @@ + + + + + + diff --git a/frontend/src/main.js b/frontend/src/main.js new file mode 100644 index 0000000..eef27a7 --- /dev/null +++ b/frontend/src/main.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' +import { createPinia } from 'pinia' +import ElementPlus from 'element-plus' +import 'element-plus/dist/index.css' +import * as ElementPlusIconsVue from '@element-plus/icons-vue' +import App from './App.vue' +import router from './router' +import './assets/main.css' +const app = createApp(App) +// 全局注册 Element Plus 图标 +for (const [key, component] of Object.entries(ElementPlusIconsVue)) { + app.component(key, component) +} +app.use(createPinia()) +app.use(router) +app.use(ElementPlus) +app.mount('#app') \ No newline at end of file diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js new file mode 100644 index 0000000..d26333c --- /dev/null +++ b/frontend/src/router/index.js @@ -0,0 +1,76 @@ +import { createRouter, createWebHashHistory } from 'vue-router' +import AppLayout from '../components/AppLayout.vue' + +const routes = [ + { + path: '/', + component: AppLayout, + redirect: '/home', + children: [ + { + path: 'home', + name: 'Home', + component: () => import('../views/Home.vue'), + meta: { title: '首页', icon: 'House' } + }, + { + path: 'ptskit', + name: 'Ptskit', + component: () => import('../views/PtskitList.vue'), + meta: { title: '站点种子', icon: 'Memo' } + }, + { + path: 'local-media', + name: 'LocalMedia', + component: () => import('../views/LocalMedia.vue'), + meta: { title: '本地资源', icon: 'Folder' } + }, + { + path: 'player-iframe', + name: 'PlayerIframe', + component: () => import('../views/PlayerIframeWrapper.vue'), + meta: { title: '在线观看', icon: 'VideoPlay' } + }, + { + path: 'fnos', + name: 'Fnos', + component: () => import('../views/MediaServerView.vue'), + meta: { title: '飞牛影视', icon: 'Film', serverType: 'fnos' } + }, + { + path: 'emby', + name: 'Emby', + component: () => import('../views/MediaServerView.vue'), + meta: { title: 'EMBY 媒体库', icon: 'VideoCamera', serverType: 'emby' } + }, + { + path: 'plex', + name: 'Plex', + component: () => import('../views/MediaServerView.vue'), + meta: { title: 'Plex 媒体库', icon: 'Monitor', serverType: 'plex' } + }, + { + path: 'config', + name: 'Config', + component: () => import('../views/SystemConfig.vue'), + meta: { title: '系统配置', icon: 'Setting' } + } + ] + }, +]; + +const router = createRouter({ + history: createWebHashHistory(), + routes +}) + +const MAIN_TITLE = '短剧管理'; +router.beforeEach((to, from, next) => { + if (to.meta.title) { + document.title = `${MAIN_TITLE} - ${to.meta.title}`; + } else { + document.title = MAIN_TITLE; + } + next(); +}); +export default router; diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue new file mode 100644 index 0000000..492a5bc --- /dev/null +++ b/frontend/src/views/Home.vue @@ -0,0 +1,357 @@ + + + + + diff --git a/frontend/src/views/LocalMedia.vue b/frontend/src/views/LocalMedia.vue new file mode 100644 index 0000000..b5017da --- /dev/null +++ b/frontend/src/views/LocalMedia.vue @@ -0,0 +1,232 @@ + + + + + diff --git a/frontend/src/views/MediaServerView.vue b/frontend/src/views/MediaServerView.vue new file mode 100644 index 0000000..e1e6a80 --- /dev/null +++ b/frontend/src/views/MediaServerView.vue @@ -0,0 +1,97 @@ + + + + + diff --git a/frontend/src/views/PlayerIframeWrapper.vue b/frontend/src/views/PlayerIframeWrapper.vue new file mode 100644 index 0000000..7373de4 --- /dev/null +++ b/frontend/src/views/PlayerIframeWrapper.vue @@ -0,0 +1,36 @@ + + + + + + diff --git a/frontend/src/views/PtskitList.vue b/frontend/src/views/PtskitList.vue new file mode 100644 index 0000000..8d70fec --- /dev/null +++ b/frontend/src/views/PtskitList.vue @@ -0,0 +1,88 @@ + + + diff --git a/frontend/src/views/SystemConfig.vue b/frontend/src/views/SystemConfig.vue new file mode 100644 index 0000000..400335c --- /dev/null +++ b/frontend/src/views/SystemConfig.vue @@ -0,0 +1,336 @@ + + + + + diff --git a/frontend/vite.config.js b/frontend/vite.config.js new file mode 100644 index 0000000..3b3eb64 --- /dev/null +++ b/frontend/vite.config.js @@ -0,0 +1,24 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], + server: { + // 新增或修改 server 部分 + proxy: { + // 关键配置:将 /api 前缀的请求代理到后端服务 + '/api': { + // 你的 Python Flask 后端地址 + target: 'http://localhost:5000', + + // 允许跨域 + changeOrigin: true, + + // 可选:如果你不希望路径中保留 /api,可以重写。 + // 但根据我们的后端设计,/api 是需要的,所以不需要下面这行。 + // rewrite: (path) => path.replace(/^\/api/, ''), + }, + } + } +}) diff --git a/webplayer/.dockerignore b/webplayer/.dockerignore new file mode 100644 index 0000000..ebe597e --- /dev/null +++ b/webplayer/.dockerignore @@ -0,0 +1,24 @@ +# 忽略 Node.js 依赖目录,Docker 镜像会自己安装 +node_modules + +# 忽略 npm 的调试日志 +npm-debug.log + +# 忽略操作系统生成的文件 +.DS_Store +Thumbs.db + +# 忽略开发工具和 IDE 的配置文件 +.vscode +.idea + +# 忽略本地开发脚本 +start.bat + +# 忽略其他不必要的文件 +新建文本文档.txt + +# Docker 相关文件自身不需要被包含进镜像 +Dockerfile +.dockerignore +docker-compose.yml diff --git a/webplayer/.gitignore b/webplayer/.gitignore new file mode 100644 index 0000000..c4af2a2 --- /dev/null +++ b/webplayer/.gitignore @@ -0,0 +1,68 @@ +# Dependencies +/node_modules + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# VSCode directories/files +.vscode* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Optional eslint cache +.eslintcache + +# dotenv environment variables file +.env +.env.test + +# Mac files +.DS_Store + +# Yarn Integrity file +.yarn-integrity diff --git a/webplayer/Dockerfile b/webplayer/Dockerfile new file mode 100644 index 0000000..1f7a9d2 --- /dev/null +++ b/webplayer/Dockerfile @@ -0,0 +1,39 @@ +# ---- Stage 1: Build ---- +# 选择一个包含 Node.js 的官方镜像。使用 LTS (长期支持) 版本以保证稳定性。 +# slim 版本体积更小,适合生产环境。 +FROM node:18-slim AS builder + +# 在容器内创建一个工作目录 +WORKDIR /usr/src/app + +# 复制 package.json 和 package-lock.json 到工作目录 +# 这样可以利用 Docker 的层缓存机制,只有当这两个文件变化时才会重新安装依赖 +COPY package*.json ./ + +# 安装项目依赖 +# 使用 --only=production 参数可以避免安装 devDependencies,减小最终镜像体积 +RUN npm install --only=production + +# 复制所有项目文件到工作目录 +COPY . . + +# ---- Stage 2: Production ---- +# 使用一个更轻量的基础镜像来运行应用 +FROM node:18-slim + +# 设置容器内的工作目录 +WORKDIR /usr/src/app + +# 从 builder 阶段复制已经安装好的 node_modules +COPY --from=builder /usr/src/app/node_modules ./node_modules + +# 复制应用程序代码 +COPY --from=builder /usr/src/app . + +# 暴露应用程序运行的端口 +# 这个端口号应该与您 server.js 中监听的端口一致,后续会通过环境变量传入 +EXPOSE 8101 + +# 定义容器启动时执行的命令 +# 使用 ["node", "server.js"] 而不是 "node server.js",这是更推荐的 exec 格式 +CMD ["node", "server.js"] diff --git a/webplayer/docker-compose.yml b/webplayer/docker-compose.yml new file mode 100644 index 0000000..914802b --- /dev/null +++ b/webplayer/docker-compose.yml @@ -0,0 +1,38 @@ +version: '3.8' + +services: + webplayer: + # 使用当前目录下的 Dockerfile 进行构建 + build: . + # 为容器命名,方便管理 + container_name: webplayer_app + # 设置容器在退出时总是自动重启,除非手动停止 + restart: unless-stopped + ports: + # 将宿主机的 8101 端口映射到容器的 PORT 环境变量指定的端口 + # 格式: "HOST:CONTAINER" + - "8101:${PORT:-8101}" + volumes: + # 将宿主机上的视频目录映射到容器内的 /videos 目录 + # 请将 './your_videos_on_host' 替换为您宿主机上实际的视频目录路径 + # 例如: 'D:/program/Short:/videos' (Windows) + # 或: '/path/to/your/videos:/videos' (Linux/macOS) + - "./your_videos_on_host:/videos" + # 将索引文件挂载出来,这样即使容器重建,索引也不会丢失 + - "./series_index.json:/usr/src/app/series_index.json" + environment: + # --- 在这里配置您的环境变量 --- + # 端口号 + - PORT=8101 + # 容器内的视频目录,这个路径应与 volumes 中映射的容器路径一致 + - VIDEOS_DIR=/videos + # 索引更新间隔(毫秒),例如 15 分钟 + - UPDATE_INTERVAL_MS=900000 + # 要扫描的子目录,多个目录用逗号分隔 + - VALID_SUBDIRECTORIES=分集,剧集 + # 您的 IYUU 密钥 + - IYUU_KEY=123456789 + # 设置 Node.js 运行环境为生产环境 + - NODE_ENV=production + # 设置时区,确保容器内时间与您本地一致 (可选,但推荐) + - TZ=Asia/Shanghai diff --git a/webplayer/package-lock.json b/webplayer/package-lock.json new file mode 100644 index 0000000..2bc7d23 --- /dev/null +++ b/webplayer/package-lock.json @@ -0,0 +1,1282 @@ +{ + "name": "short", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "short", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "express": "^5.1.0", + "node-fetch": "^3.3.2" + }, + "devDependencies": { + "dotenv": "^17.2.2", + "nodemon": "^3.1.10" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", + "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.0", + "http-errors": "^2.0.0", + "iconv-lite": "^0.6.3", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.0", + "type-is": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", + "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dotenv": { + "version": "17.2.2", + "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-17.2.2.tgz", + "integrity": "sha512-Sf2LSQP+bOlhKWWyhFsn0UsfdK/kCWRv1iuA2gXAwt3dyNabr6QSj00I2V10pidqz69soatm9ZwZvpQMTIOd5Q==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", + "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.0", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", + "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true, + "license": "ISC" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", + "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/nodemon": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.10.tgz", + "integrity": "sha512-WDjw3pJ0/0jMFmyNDp3gvY2YizjLmmOUQo6DEBY+JgdvW/yQ9mEeSw6H5ythl5Ny2ytb7f9C2nIbjSxMNzbJXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true, + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", + "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.6.3", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", + "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.5", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "mime-types": "^3.0.1", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/serve-static": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", + "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true, + "license": "ISC", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true, + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + } + } +} diff --git a/webplayer/package.json b/webplayer/package.json new file mode 100644 index 0000000..ef2d856 --- /dev/null +++ b/webplayer/package.json @@ -0,0 +1,22 @@ +{ + "name": "short", + "version": "1.0.0", + "main": "server.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node server.js", + "dev": "nodemon --ignore series_index.json server.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "express": "^5.1.0", + "node-fetch": "^3.3.2" + }, + "devDependencies": { + "dotenv": "^17.2.2", + "nodemon": "^3.1.10" + } +} diff --git a/webplayer/public/default-poster.png b/webplayer/public/default-poster.png new file mode 100644 index 0000000..fd8119b Binary files /dev/null and b/webplayer/public/default-poster.png differ diff --git a/webplayer/public/favicon.png b/webplayer/public/favicon.png new file mode 100644 index 0000000..1d31651 Binary files /dev/null and b/webplayer/public/favicon.png differ diff --git a/webplayer/public/fonts/NotoSansSC-Bold.ttf b/webplayer/public/fonts/NotoSansSC-Bold.ttf new file mode 100644 index 0000000..1edc546 Binary files /dev/null and b/webplayer/public/fonts/NotoSansSC-Bold.ttf differ diff --git a/webplayer/public/fonts/NotoSansSC-Medium.ttf b/webplayer/public/fonts/NotoSansSC-Medium.ttf new file mode 100644 index 0000000..3131ae9 Binary files /dev/null and b/webplayer/public/fonts/NotoSansSC-Medium.ttf differ diff --git a/webplayer/public/fonts/NotoSansSC-Regular.ttf b/webplayer/public/fonts/NotoSansSC-Regular.ttf new file mode 100644 index 0000000..176f113 Binary files /dev/null and b/webplayer/public/fonts/NotoSansSC-Regular.ttf differ diff --git a/webplayer/public/index.html b/webplayer/public/index.html new file mode 100644 index 0000000..5e8b17c --- /dev/null +++ b/webplayer/public/index.html @@ -0,0 +1,97 @@ + + + + + + 系列剧集播放器 + + + + +
+
+
+
+

精选剧集

+

选择一个系列,开始观看

+
+ +
+
+
+ +
+
+
+ +
+
+ + + + + + + + + + + + + +
+
+
+

+
+ +
+
+ + +
+ +
+
+

正在播放系列

+
+
+
+
+
+
+ + + + diff --git a/webplayer/public/script.js b/webplayer/public/script.js new file mode 100644 index 0000000..bb442fa --- /dev/null +++ b/webplayer/public/script.js @@ -0,0 +1,467 @@ +document.addEventListener('DOMContentLoaded', () => { + // ================================================================= + // 1. DOM 元素获取 (结构清晰,无需改动) + // ================================================================= + const seriesGrid = document.getElementById('series-grid'); + const searchInput = document.getElementById('search-input'); + const modalBackdrop = document.getElementById('modal-backdrop'); + const allModals = document.querySelectorAll('.modal, .video-modal'); + const detailsModal = document.getElementById('details-modal'); + const detailTitle = document.getElementById('detail-title'); + const episodeList = document.getElementById('episode-list'); + const videoModal = document.getElementById('video-modal'); + const videoPlayer = document.getElementById('video-player'); + const playerTitle = document.getElementById('player-title'); + const prevBtn = document.getElementById('prev-episode-btn'); + const nextBtn = document.getElementById('next-episode-btn'); + const playerEpisodesContainer = document.getElementById('player-episodes'); + const requestModal = document.getElementById('request-modal'); + const requestForm = document.getElementById('request-form'); + const requestInput = document.getElementById('request-input'); + const requestStatus = document.getElementById('request-status'); + const noResultsContainer = document.getElementById('no-results-container'); + const showRequestModalBtn = document.getElementById('show-request-modal-btn'); + const historyBtn = document.getElementById('history-btn'); + const historyModal = document.getElementById('history-modal'); + const historyList = document.getElementById('history-list'); + + // ================================================================= + // 2. 应用状态变量 + // ================================================================= + let allSeriesData = []; // 存储所有剧集的基础信息 { name, posterUrl },剧集列表会按需加载 + let activeSeriesData = null; // 当前正在操作的剧集数据 { name, episodes } + let currentEpisodeIndex = -1; // 当前播放的集数索引 + let watchHistory = {}; // 从 localStorage 加载的播放历史 + const HISTORY_KEY = 'WatchHistory'; + + // ================================================================= + // 3. 核心功能函数 + // ================================================================= + + /** + * 异步获取指定剧集的剧集列表。 + * 内置缓存:如果已获取过,则直接从 allSeriesData 返回,避免重复API请求。 + * @param {string} seriesName - 剧集名称 + * @returns {Promise>} - 包含剧集文件名的数组 + */ + const fetchEpisodesForSeries = async (seriesName) => { + const seriesInfo = allSeriesData.find(s => s.name === seriesName); + if (!seriesInfo) throw new Error(`在本地数据中未找到剧集: "${seriesName}"`); + + // 如果已经获取过剧集列表,直接返回缓存的数据 + if (seriesInfo.episodes) { + return seriesInfo.episodes; + } + + try { + const response = await fetch(`./api/videos/${encodeURIComponent(seriesName)}`); + if (!response.ok) throw new Error(`API 请求失败,状态码: ${response.status}`); + + const episodes = await response.json(); + // 缓存结果到主数据对象中 + seriesInfo.episodes = episodes; + return episodes; + } catch (error) { + console.error(`获取剧集 "${seriesName}" 失败:`, error); + // 将错误向上抛出,由调用者处理用户提示 + throw error; + } + }; + + /** + * 渲染主页的剧集网格。 + * @param {Array} seriesArray - 需要渲染的剧集数组 + */ + const renderSeriesGrid = (seriesArray) => { + seriesGrid.innerHTML = ''; + if (seriesArray.length === 0) return; + + seriesArray.forEach(series => { + const card = document.createElement('div'); + card.className = 'series-card'; + card.dataset.seriesName = series.name; + card.innerHTML = ` +
+ ${series.name} Poster +
+
+

${series.name}

+
+ `; + seriesGrid.appendChild(card); + }); + setupLazyLoader(); + }; + + /** + * 播放指定索引的剧集,并处理续播逻辑。 + * @param {number} episodeIndex - 剧集索引 + */ + const playVideo = (episodeIndex) => { + if (!activeSeriesData || episodeIndex < 0 || episodeIndex >= activeSeriesData.episodes.length) { + console.error("无法播放:剧集数据无效或索引越界"); + return; + } + + currentEpisodeIndex = episodeIndex; + const { name: seriesName, episodes } = activeSeriesData; + const episodeFilename = episodes[episodeIndex]; + const readableTitle = episodeFilename.replace(/\.[^/.]+$/, ""); + + playerTitle.textContent = readableTitle; + videoPlayer.src = `./videos/${encodeURIComponent(seriesName)}/${encodeURIComponent(episodeFilename)}`; + + // play() 返回一个 Promise,处理自动播放被浏览器阻止的情况 + videoPlayer.play().then(() => { + // 检查是否有播放历史且不是已看完状态,用于续播 + const history = watchHistory[seriesName]; + if (history && history.lastIndex === episodeIndex && !history.finished) { + // 在视频总时长的合理范围内才续播 + if (history.lastTime > 0 && history.lastTime < videoPlayer.duration - 5) { + videoPlayer.currentTime = history.lastTime; + } + } + }).catch(error => console.error("视频播放失败:", error)); + + updateNavButtons(); + populatePlayerEpisodeList(); + openModal(videoModal); + }; + + // ================================================================= + // 4. 辅助函数 (UI, History, etc.) + // ================================================================= + + /** + * 创建一个剧集列表项的 DOM 元素。 + * @param {string} episode - 剧集文件名 + * @param {number} index - 剧集索引 + * @param {string} seriesName - 所属剧集名称 + * @param {string} itemClass - 元素的 CSS class + * @returns {HTMLElement} - 创建的 div 元素 + */ + const createEpisodeListItem = (episode, index, seriesName, itemClass) => { + const isWatched = isEpisodeWatched(seriesName, index); + const item = document.createElement('div'); + item.className = itemClass; + item.dataset.index = index; + if (isWatched) item.classList.add('watched'); + + item.innerHTML = ` + ${episode.replace(/\.[^/.]+$/, "")} + ${isWatched ? '' : ''} + `; + return item; + }; + + const openModal = (modal) => { + modalBackdrop.classList.add('active'); + modal.classList.add('active'); + document.body.classList.add('modal-open'); + }; + + const closeModal = () => { + modalBackdrop.classList.remove('active'); + allModals.forEach(modal => modal.classList.remove('active')); + document.body.classList.remove('modal-open'); + // 关闭弹窗时暂停视频并清空src,防止后台播放和资源占用 + if (!videoPlayer.paused) { + videoPlayer.pause(); + } + videoPlayer.src = ""; + }; + + const loadHistory = () => watchHistory = JSON.parse(localStorage.getItem(HISTORY_KEY)) || {}; + const saveHistory = () => localStorage.setItem(HISTORY_KEY, JSON.stringify(watchHistory)); + + const recordPlaybackTime = (time) => { + if (!activeSeriesData || currentEpisodeIndex < 0) return; + const seriesName = activeSeriesData.name; + watchHistory[seriesName] = { lastIndex: currentEpisodeIndex, lastTime: time, finished: false }; + saveHistory(); + }; + + const markEpisodeAsFinished = (seriesName, episodeIndex) => { + watchHistory[seriesName] = { lastIndex: episodeIndex, lastTime: 0, finished: true }; + saveHistory(); + }; + + /** + * 检查一集是否被视为“已观看”。 + * 条件:1. 历史记录中的索引大于当前集;2. 历史记录索引等于当前集且标记为finished。 + * @returns {boolean} + */ + const isEpisodeWatched = (seriesName, episodeIndex) => { + const history = watchHistory[seriesName]; + if (!history) return false; + return history.lastIndex > episodeIndex || (history.lastIndex === episodeIndex && history.finished); + }; + + const formatTime = (seconds) => { + const min = Math.floor(seconds / 60); + const sec = Math.floor(seconds % 60); + return `${String(min).padStart(2, '0')}:${String(sec).padStart(2, '0')}`; + }; + + const populateHistoryModal = async () => { + historyList.innerHTML = ''; + const historyEntries = Object.entries(watchHistory); + + if (historyEntries.length === 0) { + historyList.innerHTML = '

暂无播放记录

'; + return; + } + + // 按剧集名称排序 + historyEntries.sort((a, b) => a[0].localeCompare(b[0], 'zh-CN')); + + // 使用 for...of 循环以正确处理 await + for (const [seriesName, history] of historyEntries) { + try { + // 此处无需关心剧集是否已获取,fetchEpisodesForSeries 会处理缓存 + const episodes = await fetchEpisodesForSeries(seriesName); + + if (history.lastIndex >= episodes.length) { + console.warn(`剧集 "${seriesName}" 历史记录越界,跳过。`); + continue; + } + const episodeFilename = episodes[history.lastIndex]; + const readableEpisodeName = episodeFilename.replace(/\.[^/.]+$/, ""); + const progressText = history.finished + ? `已看完: ${readableEpisodeName}` + : `看到: ${readableEpisodeName} (${formatTime(history.lastTime)})`; + + const item = document.createElement('div'); + item.className = 'history-item'; + item.dataset.seriesName = seriesName; + item.dataset.episodeIndex = history.lastIndex; + item.innerHTML = `${seriesName}${progressText}`; + historyList.appendChild(item); + + } catch (error) { + // 如果 fetchEpisodesForSeries 失败 (例如剧集已被删除),则跳过此条目 + console.error(`处理历史记录中的 "${seriesName}" 时出错:`, error.message); + continue; + } + } + + if (historyList.childElementCount === 0) { + historyList.innerHTML = '

有播放记录,但未能匹配到现有剧集。

'; + } + }; + + const updateNavButtons = () => { + prevBtn.disabled = currentEpisodeIndex <= 0; + nextBtn.disabled = currentEpisodeIndex >= activeSeriesData.episodes.length - 1; + }; + + const populatePlayerEpisodeList = () => { + playerEpisodesContainer.innerHTML = ''; + const { name: seriesName, episodes } = activeSeriesData; + + episodes.forEach((episode, index) => { + const item = createEpisodeListItem(episode, index, seriesName, 'player-episode-item'); + if (index === currentEpisodeIndex) item.classList.add('active'); + playerEpisodesContainer.appendChild(item); + }); + + // 自动滚动到当前播放的剧集 + const activeItem = playerEpisodesContainer.querySelector('.active'); + if (activeItem) { + activeItem.scrollIntoView({ behavior: 'smooth', block: 'center' }); + } + }; + + function setupLazyLoader() { + const lazyImages = document.querySelectorAll('img.lazy'); + const imageObserver = new IntersectionObserver((entries, observer) => { + entries.forEach(entry => { + if (entry.isIntersecting) { + const img = entry.target; + img.src = img.dataset.src; + // 图片加载失败时,显示剧集名称首字母作为占位符 + img.onerror = () => { + img.parentElement.innerHTML = `
${img.dataset.seriesName.charAt(0)}
`; + }; + img.classList.remove('lazy'); + observer.unobserve(img); + } + }); + }, { rootMargin: '0px 0px 150px 0px' }); // 预加载视口下方150px的图片 + lazyImages.forEach(img => imageObserver.observe(img)); + } + + // 通用节流函数,防止事件过于频繁触发 + const throttle = (func, limit) => { + let inThrottle; + return function(...args) { + if (!inThrottle) { + func.apply(this, args); + inThrottle = true; + setTimeout(() => inThrottle = false, limit); + } + } + }; + + // ================================================================= + // 5. 事件处理 (使用事件委托提高性能) + // ================================================================= + + searchInput.addEventListener('input', (e) => { + const searchTerm = e.target.value.toLowerCase().trim(); + const filteredSeries = allSeriesData.filter(series => series.name.toLowerCase().includes(searchTerm)); + renderSeriesGrid(filteredSeries); + noResultsContainer.style.display = (filteredSeries.length === 0 && searchTerm) ? 'block' : 'none'; + }); + + showRequestModalBtn.addEventListener('click', () => { + requestInput.value = searchInput.value.trim(); // 自动填充搜索词 + openModal(requestModal); + requestInput.focus(); + }); + + requestForm.addEventListener('submit', async (e) => { + e.preventDefault(); + const dramaName = requestInput.value.trim(); + if (!dramaName) return; + + try { + const response = await fetch('./api/request', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ dramaName: dramaName }), + }); + const result = await response.json(); + if (!response.ok) { + throw new Error(result.message || '服务器返回了一个未知错误'); + } + requestStatus.textContent = result.message; + requestStatus.className = 'request-status success'; + requestInput.value = ''; + + setTimeout(() => { + closeModal(); + setTimeout(() => { + requestStatus.textContent = ''; + requestStatus.className = 'request-status'; + }, 500); + }, 2000); + + } catch (error) { + console.error('提交心愿失败:', error); + requestStatus.textContent = `出错了: ${error.message}`; + requestStatus.className = 'request-status error'; + } + }); + + + historyBtn.addEventListener('click', () => { + populateHistoryModal(); + openModal(historyModal); + }); + + // -- 使用事件委托统一处理所有动态生成的列表项的点击事件 + + // 处理剧集卡片点击 + seriesGrid.addEventListener('click', async (e) => { + const card = e.target.closest('.series-card'); + if (!card) return; + + const seriesName = card.dataset.seriesName; + try { + const episodes = await fetchEpisodesForSeries(seriesName); + activeSeriesData = { name: seriesName, episodes }; + + detailTitle.textContent = seriesName; + episodeList.innerHTML = ''; + episodes.forEach((ep, index) => { + const item = createEpisodeListItem(ep, index, seriesName, 'episode-item'); + episodeList.appendChild(item); + }); + openModal(detailsModal); + + } catch (error) { + alert(`加载 "${seriesName}" 失败,请稍后重试。`); + } + }); + + // 处理剧集详情列表点击 + episodeList.addEventListener('click', (e) => { + const item = e.target.closest('.episode-item'); + if (item) { + closeModal(); + playVideo(parseInt(item.dataset.index, 10)); + } + }); + + // 处理播放器内剧集列表点击 + playerEpisodesContainer.addEventListener('click', (e) => { + const item = e.target.closest('.player-episode-item'); + if (item) { + playVideo(parseInt(item.dataset.index, 10)); + } + }); + + // 处理历史记录列表点击 + historyList.addEventListener('click', async (e) => { + const item = e.target.closest('.history-item'); + if (!item) return; + + const seriesName = item.dataset.seriesName; + const episodeIndex = parseInt(item.dataset.episodeIndex, 10); + + try { + const episodes = await fetchEpisodesForSeries(seriesName); + activeSeriesData = { name: seriesName, episodes }; + closeModal(); + playVideo(episodeIndex); + } catch (error) { + alert('找不到该剧集,可能已被移除。'); + } + }); + + // -- 视频播放器事件 + videoPlayer.addEventListener('timeupdate', throttle(() => recordPlaybackTime(videoPlayer.currentTime), 5000)); + + videoPlayer.addEventListener('ended', () => { + markEpisodeAsFinished(activeSeriesData.name, currentEpisodeIndex); + // 自动播放下一集 + if (currentEpisodeIndex < activeSeriesData.episodes.length - 1) { + playVideo(currentEpisodeIndex + 1); + } else { + alert('全剧终!'); + closeModal(); + } + }); + + // -- 通用关闭事件 + modalBackdrop.addEventListener('click', closeModal); + document.querySelectorAll('[data-close-modal]').forEach(btn => btn.addEventListener('click', closeModal)); + + // -- 播放器导航按钮 + prevBtn.addEventListener('click', () => playVideo(currentEpisodeIndex - 1)); + nextBtn.addEventListener('click', () => playVideo(currentEpisodeIndex + 1)); + + // ================================================================= + // 6. 初始化 + // ================================================================= + async function initializeApp() { + loadHistory(); + try { + const response = await fetch('./api/series'); + if (!response.ok) throw new Error(`网络错误: ${response.statusText}`); + + allSeriesData = await response.json(); + renderSeriesGrid(allSeriesData); + historyBtn.disabled = false; // 数据加载成功后才启用历史记录按钮 + + } catch (error) { + console.error('初始化失败:', error); + seriesGrid.innerHTML = '

加载剧集列表失败,请检查网络或刷新页面。

'; + } + } + + initializeApp(); +}); diff --git a/webplayer/public/style.css b/webplayer/public/style.css new file mode 100644 index 0000000..c70b4d8 --- /dev/null +++ b/webplayer/public/style.css @@ -0,0 +1,584 @@ +/* --- 1. 全局设置 & 字体定义 (无变动) --- */ + +@font-face { + font-family:'Noto Sans SC'; + font-style:normal; + font-weight:400; + /* 常规 */ + src:url('./fonts/NotoSansSC-Regular.ttf') format('truetype'); +} +@font-face { + font-family:'Noto Sans SC'; + font-style:normal; + font-weight:500; + /* 中等 */ + src:url('./fonts/NotoSansSC-Medium.ttf') format('truetype'); +} +@font-face { + font-family:'Noto Sans SC'; + font-style:normal; + font-weight:700; + /* 粗体 */ + src:url('./fonts/NotoSansSC-Bold.ttf') format('truetype'); +} +:root { + --primary-color:#007bff; + --dark-color:#212529; + --light-color:#f8f9fa; + --background-color:#eef2f7; + --text-color:#333; + --border-radius:12px; + --shadow:0 10px 25px rgba(0,0,0,0.1); + --transition-speed:0.3s; +} +* { + box-sizing:border-box; + margin:0; + padding:0; +} +body { + font-family:'Noto Sans SC',sans-serif; + line-height:1.7; + background-color:var(--background-color); + color:var(--text-color); +} +body.modal-open { + overflow:hidden; +} +/* 【优化】修改 container 布局,使其成为页面中心卡片 */ +.container { + max-width:960px; + /* 减小最大宽度 */ + margin:40px auto; + /* 上下边距,水平居中 */ + padding:30px; + background-color:var(--light-color); + /* 添加背景色以区分 */ + border-radius:var(--border-radius); + box-shadow:var(--shadow); +} +/* --- 2. 主页面 (Header,Grid,Search) --- */ + +.main-header { + text-align:center; + margin-bottom:30px; +} +.main-header h1 { + font-size:2.5rem; + color:var(--dark-color); + font-weight:500; +} +.main-header p { + font-size:1.1rem; + color:#6c757d; +} +.header-content { + display: flex; + justify-content: space-between; + align-items: center; + gap: 20px; +} + +.header-btn { + padding: 10px 20px; + font-size: 0.9rem; + font-weight: 500; + color: var(--primary-color); + background-color: transparent; + border: 1px solid var(--primary-color); + border-radius: 50px; + cursor: pointer; + transition: background-color 0.2s, color 0.2s; + white-space: nowrap; /* 防止按钮文字换行 */ +} + +.header-btn:hover { + background-color: var(--primary-color); + color: white; +} +.header-btn:disabled { + cursor: not-allowed; + opacity: 0.5; + border-color: #ccc; + color: #999; +} +/* 在 .modal-content p 样式之后添加 */ +.history-item { + padding: 15px 20px; + border-bottom: 1px solid #e9ecef; + cursor: pointer; + transition: background-color var(--transition-speed); +} +.history-item:last-child { + border-bottom: none; +} +.history-item:hover { + background-color: #f1f1f1; +} +.history-item .series-title { + font-weight: 500; + display: block; + margin-bottom: 5px; +} +.history-item .episode-name { + color: #6c757d; + font-size: 0.9em; +} +.search-container { + margin-bottom:2rem; +} +#search-input { + width:100%; + padding:12px 15px; + font-size:1rem; + color:#333; + /* 文本颜色调整 */ + background-color:#fff; + border:1px solid #ddd; + border-radius:8px; + outline:none; + transition:border-color 0.3s ease,box-shadow 0.3s ease; +} +#search-input:focus { + border-color:var(--primary-color); + box-shadow:0 0 0 3px rgba(0,123,255,0.25); +} +#search-input::placeholder { + color:#888; +} +/* 【新增】搜索无结果容器的样式 */ +.no-results { + text-align:center; + padding:40px 20px; + background-color:#fff; + border-radius:8px; + margin-top:2rem; +} +.no-results p { + margin:0 0 20px 0; + font-size:1.1rem; + color:#6c757d; +} +/* 【新增】通用主按钮样式 */ +.btn-primary { + padding:12px 25px; + font-size:1rem; + font-weight:bold; + color:#fff; + background-color:var(--primary-color); + border:none; + border-radius:50px; + cursor:pointer; + transition:background-color 0.2s,transform 0.2s; +} +.btn-primary:hover { + background-color:#0056b3; + transform:translateY(-2px); +} +.series-grid { + display:grid; + grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); + /* 微调卡片最小宽度 */ + gap:25px; +} +/* --- 3. 系列卡片 (无变动,样式很棒) --- */ + +.series-card { + background:white; + border-radius:var(--border-radius); + box-shadow:var(--shadow); + overflow:hidden; + cursor:pointer; + transition:transform var(--transition-speed) ease,box-shadow var(--transition-speed) ease; + display:flex; + flex-direction:column; +} +.series-card:hover { + transform:translateY(-8px); + box-shadow:0 15px 30px rgba(0,0,0,0.15); +} +.series-card__thumbnail { + aspect-ratio:2 / 3; + background-color:#2a2a2e; + display:flex; + align-items:center; + justify-content:center; + overflow:hidden; +} +img.lazy { + opacity:0; + transition:opacity 0.3s ease-in-out; +} +img[src] { + opacity:1; +} +.series-card__thumbnail img { + width:100%; + height:100%; + object-fit:cover; +} +.series-card__thumbnail-placeholder { + width:100%; + height:100%; + background-color:#343a40; + color:white; + display:flex; + align-items:center; + justify-content:center; + font-size:4rem; + font-weight:bold; + user-select:none; +} +.series-card__info { + padding:20px; + flex-grow:1; +} +.series-card__info h3 { + margin:0; + font-size:1.2rem; + font-weight:500; +} +/* --- 4. 通用弹窗 (Modal) --- */ +/* (无变动,结构良好) */ +.modal-backdrop { + display:none; + position:fixed; + top:0; + left:0; + width:100%; + height:100%; + background:rgba(0,0,0,0.7); + backdrop-filter:blur(8px); + -webkit-backdrop-filter:blur(8px); + z-index:1000; + opacity:0; + transition:opacity var(--transition-speed) ease-in-out; +} +.modal-backdrop.active { + display:block; + opacity:1; +} +.modal,.video-modal { + display:none; + position:fixed; + top:0; + left:0; + width:100%; + height:100%; + z-index:1001; + opacity:0; + transition:opacity var(--transition-speed) ease-in-out; + padding:20px; + align-items:center; + justify-content:center; +} +.modal.active,.video-modal.active { + display:flex; + opacity:1; +} +.modal-content,.player-layout-container { + transform:scale(0.95); + transition:transform var(--transition-speed) ease-in-out; +} +.modal.active .modal-content,.video-modal.active .player-layout-container { + transform:scale(1); +} +/* --- 5. 剧集详情 & 心愿提交 Modal --- */ + +.modal-content { + background:white; + padding:30px; + border-radius:var(--border-radius); + box-shadow:var(--shadow); + width:90%; + max-width:500px; + display:flex; + flex-direction:column; + max-height:80vh; +} +.modal-content h3,.modal-content #detail-title { + text-align:center; + margin-bottom:10px; +} +.modal-content p { + text-align:center; + color:#6c757d; + margin-bottom:20px; +} +/* 【优化】Modal 内的表单样式 */ +#request-form { + display:flex; + flex-direction:column; + /* 垂直排列 */ + gap:15px; + width:100%; +} +#request-input { + padding:12px 15px; + font-size:1rem; + border:1px solid #ccc; + border-radius:6px; + outline:none; +} +#request-form button { + padding:12px 20px; + font-size:1rem; + font-weight:bold; + color:#fff; + background-color:var(--primary-color); + border:none; + border-radius:6px; + cursor:pointer; + transition:background-color 0.2s; +} +#request-form button:hover { + background-color:#0056b3; +} +.request-status { + margin-top:1rem; + min-height:1.2em; + font-weight:bold; + text-align:center; +} +.request-status.success { + color:#28a745; +} +.request-status.error { + color:#dc3545; +} +.episode-scroll-container { + overflow-y:auto; + border:1px solid #ddd; + border-radius:8px; + flex-grow:1; + min-height:0; +} +.episode-item,.player-episode-item { + display:flex; + /* 使用 flex 布局对齐 */ + justify-content:space-between; + /* 让内容和对勾分开 */ + align-items:center; + padding:15px 20px; + border-bottom:1px solid #e9ecef; + cursor:pointer; + transition:background-color var(--transition-speed),color var(--transition-speed); +} +.episode-item:last-child,.player-episode-item:last-child { + border-bottom:none; +} +.episode-item:hover,.player-episode-item:hover { + background-color:var(--primary-color); + color:white; +} +.player-episode-item.active { + background-color:var(--primary-color); + color:white; + font-weight:500; +} +.episode-item.watched span:first-child { + color:#888; + text-decoration:line-through; +} +.watched-check { + margin-left:auto; + font-size:0.9em; + padding-left:10px; +} +.btn-close { + display:block; + margin:20px auto 0; + padding:10px 25px; + background:#6c757d; + /* 灰色调,不那么刺眼 */ + color:white; + border:none; + border-radius:50px; + cursor:pointer; + font-weight:500; + transition:background-color var(--transition-speed),transform var(--transition-speed); + flex-shrink:0; +} +.btn-close:hover { + background-color:#5a6268; +} +/* --- 6. 视频播放器 (Video Player) (无变动) --- */ +.player-layout-container { + display:flex; + justify-content:center; + align-items:stretch; + width:100%; + max-width:1200px; + height:90vh; + gap:25px +} +.video-wrapper { + display:flex; + flex-direction:column; + justify-content:center; + align-items:center; + position:relative; + flex-grow:1; + min-width:0 +} +#player-title { + color:#fff; + text-align:center; + margin-bottom:15px; + font-weight:500; + text-shadow:1px 1px 3px rgba(0,0,0,.5); + white-space:nowrap; + overflow:hidden; + text-overflow:ellipsis; + width:100% +} +.video-container { + position:relative; + background-color:#000; + border-radius:8px; + overflow:hidden; + aspect-ratio:9/16; + height:100%; + max-height:calc(100% - 70px) +} +#video-player { + width:100%; + height:100%; + display:block +} +.player-controls { + display:flex; + justify-content:space-between; + margin-top:15px; + width:100% +} +.player-nav-btn { + padding:10px 20px; + background-color:rgba(255,255,255,.2); + color:#fff; + border:1px solid rgba(255,255,255,.4); + border-radius:50px; + cursor:pointer; + transition:background-color .2s; + flex-basis:48% +} +.player-nav-btn:hover:not(:disabled) { + background-color:rgba(255,255,255,.4) +} +.player-nav-btn:disabled { + opacity:.5; + cursor:not-allowed +} +.video-close-btn { + position:absolute; + top:10px; + right:10px; + padding:0; + width:30px; + height:30px; + line-height:30px; + text-align:center; + background:rgba(0,0,0,.5); + font-size:1.2rem; + z-index:10; + border-radius:50%; + color:#fff; + border:none; + cursor:pointer +} +.player-episode-list-container { + display:none; + background:#fff; + border-radius:var(--border-radius); + padding:20px; + width:340px; + flex-shrink:0; + flex-direction:column +} +.player-episode-list-container h4 { + margin-bottom:15px; + text-align:center; + font-weight:500; + flex-shrink:0 +} +/* --- 7. 响应式设计 (Media Queries) --- */ +/* (微调) */ +@media(min-width:801px) { + .player-episode-list-container { + display:flex +} +}@media(max-width:800px) { + .video-modal { + padding:0; + background:#000 +} +.player-layout-container { + height:100%; + max-height:100vh; + padding:0 +} +.video-wrapper { + width:100%; + height:100%; + justify-content:space-between; + padding:30px 15px +} +.video-container { + max-height:none; + height:auto; + width:100%; + flex-grow:1; + border-radius:0 +} +#player-title { + order:1 +} +.video-container { + order:2 +} +.player-controls { + order:3 +} +.video-close-btn { + top:15px; + right:15px +} +}@media (max-width:992px) { + /* 调整 container 边距的断点 */ + .container { + margin:20px; + padding:20px; +} +}@media (max-width:768px) { + .main-header h1 { + font-size:2rem; +} +.series-grid { + grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); +} +/* 在平板上允许更小的卡片 */ + .modal-content { + padding:20px; + width:95%; +} +}@media (max-width:576px) { + .header-content { + flex-direction: column; + align-items: flex-start; + text-align: left; + } + .main-header { + text-align: left; + } + .header-btn { + align-self: flex-start; /* 按钮也靠左 */ + } + .container { + margin:15px; + padding:15px; +} +.series-grid { + grid-template-columns:1fr; + gap:15px; +} +/* 在手机上变为单列 */} \ No newline at end of file diff --git a/webplayer/server.js b/webplayer/server.js new file mode 100644 index 0000000..66e1095 --- /dev/null +++ b/webplayer/server.js @@ -0,0 +1,234 @@ +// 引入 dotenv,并执行 config() +// 这会让 Node.js 从 .env 文件中加载环境变量 +require('dotenv').config(); + +const express = require('express'); +const path = require('path'); +const fs = require('fs'); +const fsp = fs.promises; // 引入 fs.promises 以便使用 async/await +const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); + +const app = express(); + +// --- 1. 配置和全局变量 --- + +// 从环境变量中读取配置,如果环境变量未设置,则使用默认值 +const port = process.env.PORT || 8101; +// Docker 容器内的视频目录路径,将通过 Docker volumes 映射到宿主机上的实际目录 +const videosDir = process.env.VIDEOS_DIR || '/videos'; +const UPDATE_INTERVAL_MS = parseInt(process.env.UPDATE_INTERVAL_MS, 10) || 30 * 60 * 1000; // 默认30分钟 +// 从环境变量读取有效的子目录列表,以逗号分隔,并去除空格 +const VALID_SUBDIRECTORIES = process.env.VALID_SUBDIRECTORIES + ? process.env.VALID_SUBDIRECTORIES.split(',').map(s => s.trim()) + : ['分集']; +const IYUU_KEY = process.env.IYUU_KEY || "IYUU20053Tcb524cc74f1cbdc348e75a25124525282bd78bd6"; + +const indexFilePath = path.join(__dirname, 'series_index.json'); // 索引文件将存放在项目根目录 +// 内存缓存,所有 /api/series 请求都将从这里以极速读取数据 +let seriesCache = []; + +// --- 2. 中间件 --- + +app.use(express.json()); // 用于解析 /api/request 的 JSON body + +// 托管 'public' 文件夹,用于前端文件 +app.use(express.static('public')); + +// 将 E:/videos/short 目录映射到 URL 的 /videos 路径下 +app.use('/videos', express.static(videosDir)); + + +// --- 3. 核心索引更新函数 (新增) --- +/** + * 异步扫描视频目录,生成剧集列表,更新缓存并写入 JSON 文件。 + * 这个函数会优先在剧集根目录查找海报,如果找不到,则会继续搜索 VALID_SUBDIRECTORIES 中定义的子目录。 + */ +async function updateAndCacheSeries() { + console.log('(后台任务)开始更新剧集索引...'); + try { + const dirents = await fsp.readdir(videosDir, { withFileTypes: true }); + + const seriesPromises = dirents + .filter(dirent => dirent.isDirectory()) + .map(async (dirent) => { + const seriesName = dirent.name; + const seriesPath = path.join(videosDir, seriesName); + const potentialPosters = ['poster.png', 'poster.jpg', '0.jpg', '0.png', "00.jpg", "poster.jpeg", "poster.webp", "0.jpeg", "00.png"]; + + // --- 核心修改:分步查找海报 --- + let posterRelativePath = null; + + // 1. 优先在剧集根目录查找 + for (const filename of potentialPosters) { + try { + await fsp.access(path.join(seriesPath, filename)); + posterRelativePath = filename; // 路径就是文件名本身 + break; // 找到了就跳出循环 + } catch (e) { /* 文件不存在,继续 */ } + } + + // 2. 如果根目录没找到,则到指定的子目录中查找 + if (!posterRelativePath) { + try { + const itemsInSeries = await fsp.readdir(seriesPath, { withFileTypes: true }); + const subdirsToScan = itemsInSeries + .filter(item => item.isDirectory() && VALID_SUBDIRECTORIES.includes(item.name)) + .map(item => item.name); + + // 使用 labeled loop 以便找到后能跳出所有循环 + search_in_subdirs: + for (const subdir of subdirsToScan) { + for (const filename of potentialPosters) { + const posterFullPath = path.join(seriesPath, subdir, filename); + try { + await fsp.access(posterFullPath); + // 【关键】路径必须包含子目录,并使用'/'作为分隔符 + posterRelativePath = path.posix.join(subdir, filename); + break search_in_subdirs; // 找到一个就彻底退出 + } catch (e) { /* 文件不存在,继续 */ } + } + } + } catch(err) { + console.warn(`[警告] 扫描 ${seriesName} 的子目录时出错:`, err.message); + } + } + + if (!posterRelativePath) { + console.warn(`[警告] 在 ${seriesName} 目录及其子目录中均未找到任何海报文件。`); + } + + // 使用找到的相对路径构建最终URL + const posterUrl = posterRelativePath + // posterRelativePath 可能是 'poster.jpg' 或 '分集/poster.jpg' + ? `./videos/${encodeURIComponent(seriesName)}/${posterRelativePath}` + : './default-poster.png'; // 备用默认海报 + + return { + name: seriesName, + posterUrl: posterUrl, + }; + }); + + const newSeriesList = await Promise.all(seriesPromises); + newSeriesList.sort((a, b) => a.name.localeCompare(b.name, 'zh-CN')); + seriesCache = newSeriesList; + await fsp.writeFile(indexFilePath, JSON.stringify(seriesCache, null, 2), 'utf-8'); + console.log(`(后台任务)索引更新成功!共找到 ${seriesCache.length} 个剧集。`); + + } catch (err) { + console.error('(后台任务)更新索引时发生严重错误:', err); + } +} + +// --- 4. API 路由 --- + +// 您的心愿单请求API +app.post('/api/request', async (req, res) => { + const { dramaName } = req.body; + + if (!dramaName || typeof dramaName !== 'string' || dramaName.trim() === '') { + return res.status(400).json({ message: '剧集名称不能为空' }); + } + const IYUU_WEBHOOK_URL = `https://iyuu.cn/${IYUU_KEY}.send`; + const message = `收到想看剧集:${dramaName.trim()}`; + const targetUrl = `${IYUU_WEBHOOK_URL}?text=${encodeURIComponent(message)}`; + + try { + console.log(`正在向 IYUU 推送心愿: ${dramaName}`); + const response = await fetch(targetUrl, { method: 'POST' }); + + if (!response.ok) { + const errorText = await response.text(); + console.error(`Webhook 推送失败: ${response.status} - ${errorText}`); + throw new Error(`推送服务返回错误`); + } + res.status(200).json({ message: "心愿提交成功!" }); + + } catch (error) { + console.error("处理心愿请求时服务器内部错误:", error); + res.status(500).json({ message: "服务器在推送心愿时发生错误" }); + } +}); + +// API: 获取短剧列表 (现在从内存缓存读取,极速响应) +app.get('/api/series', (req, res) => { + res.json(seriesCache); +}); + +// API: 获取某个短剧的视频文件列表 (改为 async/await,代码更清晰) +app.get('/api/videos/:seriesName', async (req, res) => { + // --- 修改:不再在此处定义,而是使用全局常量 --- + // const validSubdirectories = ['分集', '剧集', 'episodes', 'vids']; + + try { + const seriesName = decodeURIComponent(req.params.seriesName); + const seriesPath = path.join(videosDir, seriesName); + + if (!seriesPath.startsWith(videosDir)) { + return res.status(403).send('非法访问'); + } + + let allVideoFiles = []; + const dirents = await fsp.readdir(seriesPath, { withFileTypes: true }); + + const rootVideoFiles = dirents + .filter(dirent => dirent.isFile() && ['.mp4', '.webm', '.mov', '.mkv', '.avi'].includes(path.extname(dirent.name).toLowerCase())) + .map(dirent => dirent.name); + allVideoFiles.push(...rootVideoFiles); + + // --- 修改:使用全局常量 VALID_SUBDIRECTORIES --- + const subdirsToScan = dirents + .filter(dirent => dirent.isDirectory() && VALID_SUBDIRECTORIES.includes(dirent.name)) + .map(dirent => dirent.name); + + const subdirVideoPromises = subdirsToScan.map(async (subdirName) => { + const subdirPath = path.join(seriesPath, subdirName); + const filesInSubdir = await fsp.readdir(subdirPath); + + return filesInSubdir + .filter(file => ['.mp4', '.webm', '.mov', '.mkv', '.avi'].includes(path.extname(file).toLowerCase())) + .map(videoFile => path.posix.join(subdirName, videoFile)); + }); + + const nestedVideoArrays = await Promise.all(subdirVideoPromises); + allVideoFiles.push(...nestedVideoArrays.flat()); + + const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' }); + allVideoFiles.sort(collator.compare); + + res.json(allVideoFiles); + } catch (err) { + console.error(`读取短剧 "${req.params.seriesName}" 目录时出错:`, err); + if (err.code === 'ENOENT') { + return res.status(404).send('短剧不存在'); + } + res.status(500).send('服务器内部错误'); + } +}); + +// --- 5. 服务器启动逻辑 (新增的启动模式) --- + +(async () => { + // 步骤 A: 尝试从文件加载现有索引,实现快速启动,避免冷启动时列表为空 + try { + const indexData = await fsp.readFile(indexFilePath, 'utf-8'); + seriesCache = JSON.parse(indexData); + console.log(`成功从索引文件加载了 ${seriesCache.length} 条剧集数据到缓存。`); + } catch (err) { + console.log('未找到现有索引文件或加载失败。将在后台立即创建新的索引。'); + } + + // 步骤 B: 启动 Express 服务器,使其可以立即响应请求 + app.listen(port, () => { + // 【保持您的日志风格】 + console.log(`Server running on http://localhost:${port}`); + console.log(`Frontend served from 'public' directory.`); + console.log(`Videos & Posters served from '${videosDir}' and mapped to '/videos' URL.`); + }); + + // 步骤 C: 在后台立即执行一次完整的索引更新,以获取最新数据 + await updateAndCacheSeries(); + + // 步骤 D: 设置定时器,定期在后台更新索引 + setInterval(updateAndCacheSeries, UPDATE_INTERVAL_MS); +})();