From 037949b715147deff21987bd5c09e546afe7f5f9 Mon Sep 17 00:00:00 2001 From: Lan Date: Sun, 9 Feb 2025 20:25:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Ewebdav=E5=AD=98?= =?UTF-8?q?=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/base/utils.py | 5 +- apps/base/views.py | 6 +- core/settings.py | 3 + core/storage.py | 314 ++++++++++++++---- core/tasks.py | 1 - core/utils.py | 6 +- ...ut-DQKUNxBs.js => AdminLayout-DGEvILen.js} | 2 +- ...-BQkdUNcj.js => DashboardView-6JCRMawe.js} | 2 +- ...FEOrQKbl.js => FileManageView-BYyHY3ZZ.js} | 2 +- ...View-DMl24bJ-.js => LoginView-CvDOmLlY.js} | 2 +- ...q0XcR.js => RetrievewFileView-BckF8ahS.js} | 2 +- ...w-DneMQ9So.js => SendFileView-Ctmzhn2X.js} | 2 +- .../assets/SystemSettingsView-DMnqdwce.js | 1 + .../assets/SystemSettingsView-DdLYY83m.js | 1 - ...jsJuVy.js => _commonjsHelpers-GlvjlJV-.js} | 2 +- .../{box-C9xlYTT6.js => box-BA8SMkDM.js} | 2 +- .../{file-AHrKtGwY.js => file-CWusGEpI.js} | 2 +- .../{index-BIfJi_O-.js => index-CiI2cp0V.js} | 4 +- .../{trash-wtxrZ93m.js => trash-dDHutUhM.js} | 2 +- themes/2024/index.html | 2 +- 20 files changed, 281 insertions(+), 82 deletions(-) rename themes/2024/assets/{AdminLayout-DQKUNxBs.js => AdminLayout-DGEvILen.js} (98%) rename themes/2024/assets/{DashboardView-BQkdUNcj.js => DashboardView-6JCRMawe.js} (98%) rename themes/2024/assets/{FileManageView-FEOrQKbl.js => FileManageView-BYyHY3ZZ.js} (98%) rename themes/2024/assets/{LoginView-DMl24bJ-.js => LoginView-CvDOmLlY.js} (98%) rename themes/2024/assets/{RetrievewFileView-C8jq0XcR.js => RetrievewFileView-BckF8ahS.js} (99%) rename themes/2024/assets/{SendFileView-DneMQ9So.js => SendFileView-Ctmzhn2X.js} (99%) create mode 100644 themes/2024/assets/SystemSettingsView-DMnqdwce.js delete mode 100644 themes/2024/assets/SystemSettingsView-DdLYY83m.js rename themes/2024/assets/{_commonjsHelpers-CljsJuVy.js => _commonjsHelpers-GlvjlJV-.js} (99%) rename themes/2024/assets/{box-C9xlYTT6.js => box-BA8SMkDM.js} (90%) rename themes/2024/assets/{file-AHrKtGwY.js => file-CWusGEpI.js} (88%) rename themes/2024/assets/{index-BIfJi_O-.js => index-CiI2cp0V.js} (99%) rename themes/2024/assets/{trash-wtxrZ93m.js => trash-dDHutUhM.js} (95%) diff --git a/apps/base/utils.py b/apps/base/utils.py index fc2bf3b..7cf2839 100644 --- a/apps/base/utils.py +++ b/apps/base/utils.py @@ -1,8 +1,9 @@ import datetime -import uuid import os +import uuid + from fastapi import UploadFile, HTTPException -from typing import Tuple, Optional +from typing import Optional, Tuple from apps.base.dependencies import IPRateLimit from apps.base.models import FileCodes diff --git a/apps/base/views.py b/apps/base/views.py index af08822..6b0aaed 100644 --- a/apps/base/views.py +++ b/apps/base/views.py @@ -135,4 +135,8 @@ async def download_file(key: str, code: str, ip: str = Depends(ip_limit['error'] if not has: return APIResponse(code=404, detail='文件不存在') - return APIResponse(detail=file_code.text) if file_code.text else await file_storage.get_file_response(file_code) + return ( + APIResponse(detail=file_code.text) + if file_code.text + else await file_storage.get_file_response(file_code) + ) diff --git a/core/settings.py b/core/settings.py index e5f90ea..a84bbc2 100644 --- a/core/settings.py +++ b/core/settings.py @@ -40,6 +40,9 @@ DEFAULT_CONFIG = { 'uploadSize': 1024 * 1024 * 10, 'expireStyle': ['day', 'hour', 'minute', 'forever', 'count'], 'uploadMinute': 1, + 'webdav_url': '', + 'webdav_password': '', + 'webdav_username': '', 'opacity': 0.9, 'background': '', 'uploadCount': 10, diff --git a/core/storage.py b/core/storage.py index c3fc3a9..085f64a 100644 --- a/core/storage.py +++ b/core/storage.py @@ -3,7 +3,7 @@ # @File : storage.py # @Software: PyCharm from typing import Optional - +from urllib.parse import quote, unquote import aiohttp import asyncio from pathlib import Path @@ -22,11 +22,13 @@ from fastapi.responses import FileResponse class FileStorageInterface: - _instance: Optional['FileStorageInterface'] = None + _instance: Optional["FileStorageInterface"] = None def __new__(cls, *args, **kwargs): if cls._instance is None: - cls._instance = super(FileStorageInterface, cls).__new__(cls, *args, **kwargs) + cls._instance = super(FileStorageInterface, cls).__new__( + cls, *args, **kwargs + ) return cls._instance async def save_file(self, file: UploadFile, save_path: str): @@ -66,7 +68,7 @@ class SystemFileStorage(FileStorageInterface): self.root_path = data_root def _save(self, file, save_path): - with open(save_path, 'wb') as f: + with open(save_path, "wb") as f: chunk = file.read(self.chunk_size) while chunk: f.write(chunk) @@ -89,7 +91,7 @@ class SystemFileStorage(FileStorageInterface): async def get_file_response(self, file_code: FileCodes): file_path = self.root_path / await file_code.get_file_path() if not file_path.exists(): - return APIResponse(code=404, detail='文件已过期删除') + return APIResponse(code=404, detail="文件已过期删除") return FileResponse(file_path, filename=file_code.prefix + file_code.suffix) @@ -101,30 +103,62 @@ class S3FileStorage(FileStorageInterface): self.s3_hostname = settings.s3_hostname self.region_name = settings.s3_region_name self.signature_version = settings.s3_signature_version - self.endpoint_url = settings.s3_endpoint_url or f'https://{self.s3_hostname}' + self.endpoint_url = settings.s3_endpoint_url or f"https://{self.s3_hostname}" self.aws_session_token = settings.aws_session_token self.proxy = settings.s3_proxy - self.session = aioboto3.Session(aws_access_key_id=self.access_key_id, aws_secret_access_key=self.secret_access_key) + self.session = aioboto3.Session( + aws_access_key_id=self.access_key_id, + aws_secret_access_key=self.secret_access_key, + ) if not settings.s3_endpoint_url: - self.endpoint_url = f'https://{self.s3_hostname}' + self.endpoint_url = f"https://{self.s3_hostname}" else: # 如果提供了 s3_endpoint_url,则优先使用它 self.endpoint_url = settings.s3_endpoint_url async def save_file(self, file: UploadFile, save_path: str): - async with self.session.client("s3", endpoint_url=self.endpoint_url, aws_session_token=self.aws_session_token, region_name=self.region_name, - config=Config(signature_version=self.signature_version)) as s3: - await s3.put_object(Bucket=self.bucket_name, Key=save_path, Body=await file.read(), ContentType=file.content_type) + async with self.session.client( + "s3", + endpoint_url=self.endpoint_url, + aws_session_token=self.aws_session_token, + region_name=self.region_name, + config=Config(signature_version=self.signature_version), + ) as s3: + await s3.put_object( + Bucket=self.bucket_name, + Key=save_path, + Body=await file.read(), + ContentType=file.content_type, + ) async def delete_file(self, file_code: FileCodes): - async with self.session.client("s3", endpoint_url=self.endpoint_url, region_name=self.region_name, config=Config(signature_version=self.signature_version)) as s3: - await s3.delete_object(Bucket=self.bucket_name, Key=await file_code.get_file_path()) + async with self.session.client( + "s3", + endpoint_url=self.endpoint_url, + region_name=self.region_name, + config=Config(signature_version=self.signature_version), + ) as s3: + await s3.delete_object( + Bucket=self.bucket_name, Key=await file_code.get_file_path() + ) async def get_file_response(self, file_code: FileCodes): try: filename = file_code.prefix + file_code.suffix - async with self.session.client("s3", endpoint_url=self.endpoint_url, region_name=self.region_name, config=Config(signature_version=self.signature_version)) as s3: - link = await s3.generate_presigned_url('get_object', Params={'Bucket': self.bucket_name, 'Key': await file_code.get_file_path()}, ExpiresIn=3600) + async with self.session.client( + "s3", + endpoint_url=self.endpoint_url, + region_name=self.region_name, + config=Config(signature_version=self.signature_version), + ) as s3: + link = await s3.generate_presigned_url( + "get_object", + Params={ + "Bucket": self.bucket_name, + "Key": await file_code.get_file_path(), + }, + ExpiresIn=3600, + ) tmp = io.BytesIO() async with aiohttp.ClientSession() as session: async with session.get(link) as resp: @@ -132,18 +166,36 @@ class S3FileStorage(FileStorageInterface): tmp.seek(0) content = tmp.read() tmp.close() - return Response(content, media_type="application/octet-stream", headers={"Content-Disposition": f'attachment; filename="{filename.encode("utf-8").decode("latin-1")}"'}) + return Response( + content, + media_type="application/octet-stream", + headers={ + "Content-Disposition": f'attachment; filename="{filename.encode("utf-8").decode("latin-1")}"' + }, + ) except Exception: - raise HTTPException(status_code=503, detail='服务代理下载异常,请稍后再试') + raise HTTPException(status_code=503, detail="服务代理下载异常,请稍后再试") async def get_file_url(self, file_code: FileCodes): - if file_code.prefix == '文本分享': + if file_code.prefix == "文本分享": return file_code.text if self.proxy: return await get_file_url(file_code.code) else: - async with self.session.client("s3", endpoint_url=self.endpoint_url, region_name=self.region_name, config=Config(signature_version=self.signature_version)) as s3: - result = await s3.generate_presigned_url('get_object', Params={'Bucket': self.bucket_name, 'Key': await file_code.get_file_path()}, ExpiresIn=3600) + async with self.session.client( + "s3", + endpoint_url=self.endpoint_url, + region_name=self.region_name, + config=Config(signature_version=self.signature_version), + ) as s3: + result = await s3.generate_presigned_url( + "get_object", + Params={ + "Bucket": self.bucket_name, + "Key": await file_code.get_file_path(), + }, + ExpiresIn=3600, + ) return result @@ -152,9 +204,11 @@ class OneDriveFileStorage(FileStorageInterface): try: import msal from office365.graph_client import GraphClient - from office365.runtime.client_request_exception import ClientRequestException + from office365.runtime.client_request_exception import ( + ClientRequestException, + ) except ImportError: - raise ImportError('请先安装`msal`和`Office365-REST-Python-Client`') + raise ImportError("请先安装`msal`和`Office365-REST-Python-Client`") self.msal = msal self.domain = settings.onedrive_domain self.client_id = settings.onedrive_client_id @@ -165,36 +219,45 @@ class OneDriveFileStorage(FileStorageInterface): try: client = GraphClient(self.acquire_token_pwd) - self.root_path = client.me.drive.root.get_by_path(settings.onedrive_root_path).get().execute_query() + self.root_path = ( + client.me.drive.root.get_by_path(settings.onedrive_root_path) + .get() + .execute_query() + ) except ClientRequestException as e: - if e.code == 'itemNotFound': + if e.code == "itemNotFound": client.me.drive.root.create_folder(settings.onedrive_root_path) - self.root_path = client.me.drive.root.get_by_path(settings.onedrive_root_path).get().execute_query() + self.root_path = ( + client.me.drive.root.get_by_path(settings.onedrive_root_path) + .get() + .execute_query() + ) else: raise e except Exception as e: - raise Exception('OneDrive验证失败,请检查配置是否正确\n' + str(e)) + raise Exception("OneDrive验证失败,请检查配置是否正确\n" + str(e)) def acquire_token_pwd(self): - authority_url = f'https://login.microsoftonline.com/{self.domain}' + authority_url = f"https://login.microsoftonline.com/{self.domain}" app = self.msal.PublicClientApplication( - authority=authority_url, - client_id=self.client_id + authority=authority_url, client_id=self.client_id + ) + result = app.acquire_token_by_username_password( + username=self.username, + password=self.password, + scopes=["https://graph.microsoft.com/.default"], ) - result = app.acquire_token_by_username_password(username=self.username, - password=self.password, - scopes=['https://graph.microsoft.com/.default']) return result def _get_path_str(self, path): if isinstance(path, str): - path = path.replace('\\', '/').replace('//', '/').split('/') + path = path.replace("\\", "/").replace("//", "/").split("/") elif isinstance(path, Path): - path = str(path).replace('\\', '/').replace('//', '/').split('/') + path = str(path).replace("\\", "/").replace("//", "/").split("/") else: - raise TypeError('path must be str or Path') - path[-1] = path[-1].split('.')[0] - return '/'.join(path) + raise TypeError("path must be str or Path") + path[-1] = path[-1].split(".")[0] + return "/".join(path) def _save(self, file, save_path): content = file.file.read() @@ -210,7 +273,7 @@ class OneDriveFileStorage(FileStorageInterface): try: self.root_path.get_by_path(path).delete_object().execute_query() except self._ClientRequestException as e: - if e.code == 'itemNotFound': + if e.code == "itemNotFound": pass else: raise e @@ -219,23 +282,29 @@ class OneDriveFileStorage(FileStorageInterface): await asyncio.to_thread(self._delete, await file_code.get_file_path()) def _convert_link_to_download_link(self, link): - p1 = re.search(r'https:\/\/(.+)\.sharepoint\.com', link).group(1) - p2 = re.search(r'personal\/(.+)\/', link).group(1) - p3 = re.search(rf'{p2}\/(.+)', link).group(1) - return f'https://{p1}.sharepoint.com/personal/{p2}/_layouts/52/download.aspx?share={p3}' + p1 = re.search(r"https:\/\/(.+)\.sharepoint\.com", link).group(1) + p2 = re.search(r"personal\/(.+)\/", link).group(1) + p3 = re.search(rf"{p2}\/(.+)", link).group(1) + return f"https://{p1}.sharepoint.com/personal/{p2}/_layouts/52/download.aspx?share={p3}" def _get_file_url(self, save_path, name): path = self._get_path_str(save_path) - remote_file = self.root_path.get_by_path(path + '/' + name) - expiration_datetime = datetime.datetime.now(tz=datetime.timezone.utc) + datetime.timedelta(hours=1) + remote_file = self.root_path.get_by_path(path + "/" + name) + expiration_datetime = datetime.datetime.now( + tz=datetime.timezone.utc + ) + datetime.timedelta(hours=1) expiration_datetime = expiration_datetime.strftime("%Y-%m-%dT%H:%M:%SZ") - premission = remote_file.create_link("view", "anonymous", expiration_datetime=expiration_datetime).execute_query() + premission = remote_file.create_link( + "view", "anonymous", expiration_datetime=expiration_datetime + ).execute_query() return self._convert_link_to_download_link(premission.link.webUrl) async def get_file_response(self, file_code: FileCodes): try: filename = file_code.prefix + file_code.suffix - link = await asyncio.to_thread(self._get_file_url, await file_code.get_file_path(), filename) + link = await asyncio.to_thread( + self._get_file_url, await file_code.get_file_path(), filename + ) tmp = io.BytesIO() async with aiohttp.ClientSession() as session: async with session.get(link) as resp: @@ -243,15 +312,25 @@ class OneDriveFileStorage(FileStorageInterface): tmp.seek(0) content = tmp.read() tmp.close() - return Response(content, media_type="application/octet-stream", headers={"Content-Disposition": f'attachment; filename="{filename.encode("utf-8").decode("latin-1")}"'}) + return Response( + content, + media_type="application/octet-stream", + headers={ + "Content-Disposition": f'attachment; filename="{filename.encode("utf-8").decode("latin-1")}"' + }, + ) except Exception: - raise HTTPException(status_code=503, detail='服务代理下载异常,请稍后再试') + raise HTTPException(status_code=503, detail="服务代理下载异常,请稍后再试") async def get_file_url(self, file_code: FileCodes): if self.proxy: return await get_file_url(file_code.code) else: - return await asyncio.to_thread(self._get_file_url, await file_code.get_file_path(), f'{file_code.prefix}{file_code.suffix}') + return await asyncio.to_thread( + self._get_file_url, + await file_code.get_file_path(), + f"{file_code.prefix}{file_code.suffix}", + ) class OpenDALFileStorage(FileStorageInterface): @@ -263,10 +342,12 @@ class OpenDALFileStorage(FileStorageInterface): self.service = settings.opendal_scheme service_settings = {} for key, value in settings.items(): - if key.startswith('opendal_' + self.service): - setting_name = key.split('_', 2)[2] + if key.startswith("opendal_" + self.service): + setting_name = key.split("_", 2)[2] service_settings[setting_name] = value - self.operator = opendal.AsyncOperator(settings.opendal_scheme, **service_settings) + self.operator = opendal.AsyncOperator( + settings.opendal_scheme, **service_settings + ) async def save_file(self, file: UploadFile, save_path: str): await self.operator.write(save_path, file.file.read()) @@ -281,18 +362,131 @@ class OpenDALFileStorage(FileStorageInterface): try: filename = file_code.prefix + file_code.suffix content = await self.operator.read(await file_code.get_file_path()) - headers = { - "Content-Disposition": f'attachment; filename="{filename}"' - } - return Response(content, headers=headers, media_type="application/octet-stream") + headers = {"Content-Disposition": f'attachment; filename="{filename}"'} + return Response( + content, headers=headers, media_type="application/octet-stream" + ) except Exception as e: print(e, file=sys.stderr) raise HTTPException(status_code=404, detail="文件已过期删除") +class WebDAVFileStorage(FileStorageInterface): + _instance: Optional["WebDAVFileStorage"] = None + + def __init__(self): + if not hasattr(self, "_initialized"): + self.base_url = settings.webdav_url.rstrip("/") + "/" + self.auth = aiohttp.BasicAuth( + login=settings.webdav_username, password=settings.webdav_password + ) + self._initialized = True + + def _build_url(self, path: str) -> str: + encoded_path = quote(str(path).lstrip("/")) + return f"{self.base_url}{encoded_path}" + + async def _mkdir_p(self, directory_path: str): + """递归创建目录(类似mkdir -p)""" + path_obj = Path(unquote(directory_path)) + current_path = "" + + async with aiohttp.ClientSession(auth=self.auth) as session: + # 逐级检查目录是否存在 + for part in path_obj.parts: + current_path = str(Path(current_path) / part) + url = self._build_url(current_path) + + # 检查目录是否存在 + async with session.head(url) as resp: + if resp.status == 404: + # 创建目录 + async with session.request("MKCOL", url) as mkcol_resp: + if mkcol_resp.status not in (200, 201, 409): + content = await mkcol_resp.text() + raise HTTPException( + status_code=mkcol_resp.status, + detail=f"目录创建失败: {content[:200]}", + ) + + async def save_file(self, file: UploadFile, save_path: str): + """保存文件(自动创建目录)""" + # 分离文件名和目录路径 + path_obj = Path(save_path) + directory_path = str(path_obj.parent) + file_name = path_obj.name + + try: + # 先创建目录结构 + await self._mkdir_p(directory_path) + + # 上传文件 + url = self._build_url(save_path) + async with aiohttp.ClientSession(auth=self.auth) as session: + content = await file.read() # 注意:大文件需要分块读取 + async with session.put( + url, data=content, headers={"Content-Type": file.content_type} + ) as resp: + if resp.status not in (200, 201, 204): + content = await resp.text() + raise HTTPException( + status_code=resp.status, + detail=f"文件上传失败: {content[:200]}", + ) + except aiohttp.ClientError as e: + raise HTTPException(status_code=503, detail=f"WebDAV连接异常: {str(e)}") + + async def delete_file(self, file_code: FileCodes): + """删除WebDAV文件""" + file_path = await file_code.get_file_path() + url = self._build_url(file_path) + + try: + async with aiohttp.ClientSession(auth=self.auth) as session: + async with session.delete(url) as resp: + if resp.status not in (200, 204): + content = await resp.text() + raise HTTPException( + status_code=resp.status, + detail=f"WebDAV删除失败: {content[:200]}", + ) + except aiohttp.ClientError as e: + raise HTTPException(status_code=503, detail=f"WebDAV连接异常: {str(e)}") + + async def get_file_url(self, file_code: FileCodes): + return await get_file_url(file_code.code) + + async def get_file_response(self, file_code: FileCodes): + """获取文件响应(代理模式)""" + try: + filename = file_code.prefix + file_code.suffix + url = self._build_url(await file_code.get_file_path()) + async with aiohttp.ClientSession(auth=self.auth) as session: + async with session.get(url) as resp: + if resp.status != 200: + raise HTTPException( + status_code=resp.status, + detail=f"文件获取失败: {await resp.text()}", + ) + # 读取内容到内存 + content = await resp.read() + return Response( + content=content, + media_type=resp.headers.get( + "Content-Type", "application/octet-stream" + ), + headers={ + "Content-Disposition": f'attachment; filename="{filename.encode("utf-8").decode()}"' + }, + ) + except aiohttp.ClientError as e: + raise HTTPException(status_code=503, detail=f"WebDAV连接异常: {str(e)}") + + storages = { - 'local': SystemFileStorage, - 's3': S3FileStorage, - 'onedrive': OneDriveFileStorage, - 'opendal': OpenDALFileStorage, + "local": SystemFileStorage, + "s3": S3FileStorage, + "onedrive": OneDriveFileStorage, + "opendal": OpenDALFileStorage, + "webdav": WebDAVFileStorage, } diff --git a/core/tasks.py b/core/tasks.py index 426d37d..d3e17ad 100644 --- a/core/tasks.py +++ b/core/tasks.py @@ -16,7 +16,6 @@ from core.utils import get_now async def delete_expire_files(): file_storage: FileStorageInterface = storages[settings.file_storage]() - print(settings.file_storage) while True: try: # 遍历 share目录下的所有文件夹,删除空的文件夹,并判断父目录是否为空,如果为空也删除 diff --git a/core/utils.py b/core/utils.py index e5812e0..0a9672d 100644 --- a/core/utils.py +++ b/core/utils.py @@ -7,9 +7,7 @@ import hashlib import random import string import time - -from apps.base.dependencies import IPRateLimit - +from core.settings import settings async def get_random_num(): """ @@ -46,7 +44,7 @@ async def get_select_token(code: str): :param code: :return: """ - token = "123456" + token = settings.admin_token return hashlib.sha256(f"{code}{int(time.time() / 1000)}000{token}".encode()).hexdigest() diff --git a/themes/2024/assets/AdminLayout-DQKUNxBs.js b/themes/2024/assets/AdminLayout-DGEvILen.js similarity index 98% rename from themes/2024/assets/AdminLayout-DQKUNxBs.js rename to themes/2024/assets/AdminLayout-DGEvILen.js index 85c0fbe..b9597e2 100644 --- a/themes/2024/assets/AdminLayout-DQKUNxBs.js +++ b/themes/2024/assets/AdminLayout-DGEvILen.js @@ -1,4 +1,4 @@ -import{c as i,B as k,r as h,o as u,I as v,d as x,e as t,n as o,g as e,i as w,f as n,X as _,F as M,q as C,p as z,y as B,J as L,m as D,K as F,t as I,z as d}from"./index-BIfJi_O-.js";import{B as j}from"./box-C9xlYTT6.js";/** +import{c as i,B as k,r as h,o as u,I as v,d as x,e as t,n as o,g as e,i as w,f as n,X as _,F as M,q as C,p as z,y as B,J as L,m as D,K as F,t as I,z as d}from"./index-CiI2cp0V.js";import{B as j}from"./box-BA8SMkDM.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/DashboardView-BQkdUNcj.js b/themes/2024/assets/DashboardView-6JCRMawe.js similarity index 98% rename from themes/2024/assets/DashboardView-BQkdUNcj.js rename to themes/2024/assets/DashboardView-6JCRMawe.js index 243a577..27670a2 100644 --- a/themes/2024/assets/DashboardView-BQkdUNcj.js +++ b/themes/2024/assets/DashboardView-6JCRMawe.js @@ -1,4 +1,4 @@ -import{c as g,B as v,H as w,o as _,d as u,e as t,n as a,g as e,i as k,t as i,f as y,F as U,q as F,A as M,z as p,J as z,K as C}from"./index-BIfJi_O-.js";import{F as m}from"./file-AHrKtGwY.js";import{H as D,T as S}from"./trash-wtxrZ93m.js";/** +import{c as g,B as v,H as w,o as _,d as u,e as t,n as a,g as e,i as k,t as i,f as y,F as U,q as F,A as M,z as p,J as z,K as C}from"./index-CiI2cp0V.js";import{F as m}from"./file-CWusGEpI.js";import{H as D,T as S}from"./trash-dDHutUhM.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/FileManageView-FEOrQKbl.js b/themes/2024/assets/FileManageView-BYyHY3ZZ.js similarity index 98% rename from themes/2024/assets/FileManageView-FEOrQKbl.js rename to themes/2024/assets/FileManageView-BYyHY3ZZ.js index e79df43..3463d88 100644 --- a/themes/2024/assets/FileManageView-FEOrQKbl.js +++ b/themes/2024/assets/FileManageView-BYyHY3ZZ.js @@ -1,4 +1,4 @@ -import{c as V,B as T,u as q,r as _,b as k,d as c,e as t,n as o,g as a,i as A,j as P,f as m,v as H,m as I,F as v,q as w,t as d,A as S,z as g}from"./index-BIfJi_O-.js";import{F as L}from"./file-AHrKtGwY.js";/** +import{c as V,B as T,u as q,r as _,b as k,d as c,e as t,n as o,g as a,i as A,j as P,f as m,v as H,m as I,F as v,q as w,t as d,A as S,z as g}from"./index-CiI2cp0V.js";import{F as L}from"./file-CWusGEpI.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/LoginView-DMl24bJ-.js b/themes/2024/assets/LoginView-CvDOmLlY.js similarity index 98% rename from themes/2024/assets/LoginView-DMl24bJ-.js rename to themes/2024/assets/LoginView-CvDOmLlY.js index 59b9e30..2e6f1ff 100644 --- a/themes/2024/assets/LoginView-DMl24bJ-.js +++ b/themes/2024/assets/LoginView-CvDOmLlY.js @@ -1 +1 @@ -import{G as y,r as u,B as v,u as b,d as w,e,n as l,g as o,i as x,f as h,h as k,j as S,v as A,m as V,t as B,y as D,z as j,A as P,_}from"./index-BIfJi_O-.js";import{B as z}from"./box-C9xlYTT6.js";const M=y("adminData",()=>{const d=u(localStorage.getItem("adminPassword")||"");function n(t){d.value=t,localStorage.setItem("token",t)}return{adminPassword:d,updateAdminPwd:n}}),I={class:"mx-auto h-16 w-16 relative"},L={class:"rounded-md shadow-sm -space-y-px"},N=["disabled"],T=v({__name:"LoginView",setup(d){const n=b(),t=u(""),i=u(!1),s=x("isDarkMode"),c=M(),p=()=>{let a=!0;return t.value?t.value.length<6&&(n.showAlert("密码长度至少为6位","error"),a=!1):(n.showAlert("无效的密码","error"),a=!1),a},m=D(),f=async()=>{if(p()){c.updateAdminPwd(t.value),P.post("/admin/login",{password:t.value}).then(()=>{m.push("/admin")}).catch(a=>{n.showAlert(a.response.data.detail,"error")}),i.value=!0;try{await new Promise(a=>setTimeout(a,2e3))}catch{}finally{i.value=!1}}};return(a,r)=>(j(),w("div",{class:l(["min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 transition-colors duration-200 relative overflow-hidden",o(s)?"bg-gray-900":"bg-gray-50"])},[r[6]||(r[6]=e("div",{class:"absolute inset-0 z-0"},[e("div",{class:"cyber-grid"}),e("div",{class:"floating-particles"})],-1)),e("div",{class:l(["max-w-md w-full space-y-8 backdrop-blur-lg bg-opacity-20 p-8 rounded-xl border border-opacity-20",[o(s)?"bg-gray-800 border-gray-600":"bg-white/70 border-gray-200"]])},[e("div",null,[e("div",I,[r[1]||(r[1]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-cyan-500 via-purple-500 to-pink-500 rounded-full animate-spin-slow"},null,-1)),r[2]||(r[2]=e("div",{class:"absolute -inset-2 bg-gradient-to-r from-cyan-500 via-purple-500 to-pink-500 rounded-full opacity-50 blur-md animate-pulse"},null,-1)),e("div",{class:l(["absolute inset-1 rounded-full flex items-center justify-center",o(s)?"bg-gray-800":"bg-white"])},[h(o(z),{class:l(["h-8 w-8",o(s)?"text-cyan-400":"text-cyan-600"])},null,8,["class"])],2)]),e("h2",{class:l(["mt-6 text-center text-3xl font-extrabold",o(s)?"text-white":"text-gray-900"])}," 登录 ",2)]),e("form",{class:"mt-8 space-y-6",onSubmit:k(f,["prevent"])},[r[5]||(r[5]=e("input",{type:"hidden",name:"remember",value:"true"},null,-1)),e("div",L,[e("div",null,[r[3]||(r[3]=e("label",{for:"password",class:"sr-only"},"密码",-1)),S(e("input",{id:"password",name:"password",type:"password",autocomplete:"current-password",required:"","onUpdate:modelValue":r[0]||(r[0]=g=>t.value=g),class:l(["appearance-none rounded-t-md relative block w-full px-4 py-3 border transition-all duration-200 placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:border-cyan-500 focus:z-10 sm:text-sm backdrop-blur-sm",o(s)?"bg-gray-800/50 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"bg-white/50 border-gray-300 text-gray-900 hover:border-gray-400"]),placeholder:"密码"},null,2),[[A,t.value]])])]),e("div",null,[e("button",{type:"submit",class:l(["group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-medium rounded-md text-white transition-all duration-300 transform hover:scale-[1.02] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cyan-500 shadow-lg hover:shadow-cyan-500/50",o(s)?"bg-gradient-to-r from-cyan-500 to-purple-500 hover:from-cyan-600 hover:to-purple-600":"bg-gradient-to-r from-cyan-600 to-purple-600 hover:from-cyan-700 hover:to-purple-700",i.value?"opacity-75 cursor-not-allowed":""]),disabled:i.value},[r[4]||(r[4]=e("span",{class:"absolute left-0 inset-y-0 flex items-center pl-3"},null,-1)),V(" "+B(i.value?"登录中...":"登录"),1)],10,N)])],32)],2)],2))}}),E=_(T,[["__scopeId","data-v-2e50c3fa"]]);export{E as default}; +import{G as y,r as u,B as v,u as b,d as w,e,n as l,g as o,i as x,f as h,h as k,j as S,v as A,m as V,t as B,y as D,z as j,A as P,_}from"./index-CiI2cp0V.js";import{B as z}from"./box-BA8SMkDM.js";const M=y("adminData",()=>{const d=u(localStorage.getItem("adminPassword")||"");function n(t){d.value=t,localStorage.setItem("token",t)}return{adminPassword:d,updateAdminPwd:n}}),I={class:"mx-auto h-16 w-16 relative"},L={class:"rounded-md shadow-sm -space-y-px"},N=["disabled"],T=v({__name:"LoginView",setup(d){const n=b(),t=u(""),i=u(!1),s=x("isDarkMode"),c=M(),p=()=>{let a=!0;return t.value?t.value.length<6&&(n.showAlert("密码长度至少为6位","error"),a=!1):(n.showAlert("无效的密码","error"),a=!1),a},m=D(),f=async()=>{if(p()){c.updateAdminPwd(t.value),P.post("/admin/login",{password:t.value}).then(()=>{m.push("/admin")}).catch(a=>{n.showAlert(a.response.data.detail,"error")}),i.value=!0;try{await new Promise(a=>setTimeout(a,2e3))}catch{}finally{i.value=!1}}};return(a,r)=>(j(),w("div",{class:l(["min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 transition-colors duration-200 relative overflow-hidden",o(s)?"bg-gray-900":"bg-gray-50"])},[r[6]||(r[6]=e("div",{class:"absolute inset-0 z-0"},[e("div",{class:"cyber-grid"}),e("div",{class:"floating-particles"})],-1)),e("div",{class:l(["max-w-md w-full space-y-8 backdrop-blur-lg bg-opacity-20 p-8 rounded-xl border border-opacity-20",[o(s)?"bg-gray-800 border-gray-600":"bg-white/70 border-gray-200"]])},[e("div",null,[e("div",I,[r[1]||(r[1]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-cyan-500 via-purple-500 to-pink-500 rounded-full animate-spin-slow"},null,-1)),r[2]||(r[2]=e("div",{class:"absolute -inset-2 bg-gradient-to-r from-cyan-500 via-purple-500 to-pink-500 rounded-full opacity-50 blur-md animate-pulse"},null,-1)),e("div",{class:l(["absolute inset-1 rounded-full flex items-center justify-center",o(s)?"bg-gray-800":"bg-white"])},[h(o(z),{class:l(["h-8 w-8",o(s)?"text-cyan-400":"text-cyan-600"])},null,8,["class"])],2)]),e("h2",{class:l(["mt-6 text-center text-3xl font-extrabold",o(s)?"text-white":"text-gray-900"])}," 登录 ",2)]),e("form",{class:"mt-8 space-y-6",onSubmit:k(f,["prevent"])},[r[5]||(r[5]=e("input",{type:"hidden",name:"remember",value:"true"},null,-1)),e("div",L,[e("div",null,[r[3]||(r[3]=e("label",{for:"password",class:"sr-only"},"密码",-1)),S(e("input",{id:"password",name:"password",type:"password",autocomplete:"current-password",required:"","onUpdate:modelValue":r[0]||(r[0]=g=>t.value=g),class:l(["appearance-none rounded-t-md relative block w-full px-4 py-3 border transition-all duration-200 placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:border-cyan-500 focus:z-10 sm:text-sm backdrop-blur-sm",o(s)?"bg-gray-800/50 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"bg-white/50 border-gray-300 text-gray-900 hover:border-gray-400"]),placeholder:"密码"},null,2),[[A,t.value]])])]),e("div",null,[e("button",{type:"submit",class:l(["group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-medium rounded-md text-white transition-all duration-300 transform hover:scale-[1.02] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cyan-500 shadow-lg hover:shadow-cyan-500/50",o(s)?"bg-gradient-to-r from-cyan-500 to-purple-500 hover:from-cyan-600 hover:to-purple-600":"bg-gradient-to-r from-cyan-600 to-purple-600 hover:from-cyan-700 hover:to-purple-700",i.value?"opacity-75 cursor-not-allowed":""]),disabled:i.value},[r[4]||(r[4]=e("span",{class:"absolute left-0 inset-y-0 flex items-center pl-3"},null,-1)),V(" "+B(i.value?"登录中...":"登录"),1)],10,N)])],32)],2)],2))}}),E=_(T,[["__scopeId","data-v-2e50c3fa"]]);export{E as default}; diff --git a/themes/2024/assets/RetrievewFileView-C8jq0XcR.js b/themes/2024/assets/RetrievewFileView-BckF8ahS.js similarity index 99% rename from themes/2024/assets/RetrievewFileView-C8jq0XcR.js rename to themes/2024/assets/RetrievewFileView-BckF8ahS.js index 9d73471..b1ca083 100644 --- a/themes/2024/assets/RetrievewFileView-C8jq0XcR.js +++ b/themes/2024/assets/RetrievewFileView-BckF8ahS.js @@ -1,4 +1,4 @@ -var De=Object.defineProperty;var Pe=(d,e,t)=>e in d?De(d,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[e]=t;var v=(d,e,t)=>Pe(d,typeof e!="symbol"?e+"":e,t);import{c as _e,_ as Fe,u as Ze,s as Oe,r as D,o as Ue,a as Qe,w as He,b as Ne,d as I,e as p,f as $,n as w,g as f,i as Ve,t as j,h as Ge,j as We,k as Y,v as Xe,l as Q,m as Z,p as Ke,X as xe,T as Je,F as Ye,q as et,x as le,y as tt,z as L,A as nt}from"./index-BIfJi_O-.js";import{c as H,u as st,S as it,C as rt,a as ot,Q as lt,E as at}from"./_commonjsHelpers-CljsJuVy.js";import{B as ct}from"./box-C9xlYTT6.js";import{F as ke}from"./file-AHrKtGwY.js";import{H as ut,T as pt}from"./trash-wtxrZ93m.js";/** +var De=Object.defineProperty;var Pe=(d,e,t)=>e in d?De(d,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[e]=t;var v=(d,e,t)=>Pe(d,typeof e!="symbol"?e+"":e,t);import{c as _e,_ as Fe,u as Ze,s as Oe,r as D,o as Ue,a as Qe,w as He,b as Ne,d as I,e as p,f as $,n as w,g as f,i as Ve,t as j,h as Ge,j as We,k as Y,v as Xe,l as Q,m as Z,p as Ke,X as xe,T as Je,F as Ye,q as et,x as le,y as tt,z as L,A as nt}from"./index-CiI2cp0V.js";import{c as H,u as st,S as it,C as rt,a as ot,Q as lt,E as at}from"./_commonjsHelpers-GlvjlJV-.js";import{B as ct}from"./box-BA8SMkDM.js";import{F as ke}from"./file-CWusGEpI.js";import{H as ut,T as pt}from"./trash-dDHutUhM.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/SendFileView-DneMQ9So.js b/themes/2024/assets/SendFileView-Ctmzhn2X.js similarity index 99% rename from themes/2024/assets/SendFileView-DneMQ9So.js rename to themes/2024/assets/SendFileView-Ctmzhn2X.js index 217ef2e..4e24666 100644 --- a/themes/2024/assets/SendFileView-DneMQ9So.js +++ b/themes/2024/assets/SendFileView-Ctmzhn2X.js @@ -1,4 +1,4 @@ -import{c as W,B as oe,r as z,o as ne,w as he,d as F,z as D,e as a,_ as se,u as ae,y as ge,i as pe,b as ye,p as ve,f as M,n as f,g as i,t as U,h as Q,l as E,k as N,j as J,v as X,x as K,C as be,F as Y,q as Z,m as V,X as xe,T as me,A as ee}from"./index-BIfJi_O-.js";import{g as we,u as _e,S as Ce,C as Ae,E as Me,a as Se,Q as Be}from"./_commonjsHelpers-CljsJuVy.js";import{F as te}from"./file-AHrKtGwY.js";import{T as Ie,H as Te}from"./trash-wtxrZ93m.js";/** +import{c as W,B as oe,r as z,o as ne,w as he,d as F,z as D,e as a,_ as se,u as ae,y as ge,i as pe,b as ye,p as ve,f as M,n as f,g as i,t as U,h as Q,l as E,k as N,j as J,v as X,x as K,C as be,F as Y,q as Z,m as V,X as xe,T as me,A as ee}from"./index-CiI2cp0V.js";import{g as we,u as _e,S as Ce,C as Ae,E as Me,a as Se,Q as Be}from"./_commonjsHelpers-GlvjlJV-.js";import{F as te}from"./file-CWusGEpI.js";import{T as Ie,H as Te}from"./trash-dDHutUhM.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/SystemSettingsView-DMnqdwce.js b/themes/2024/assets/SystemSettingsView-DMnqdwce.js new file mode 100644 index 0000000..de5952d --- /dev/null +++ b/themes/2024/assets/SystemSettingsView-DMnqdwce.js @@ -0,0 +1 @@ +import{B,r as m,u as M,d as p,e,n as t,g as s,i as F,j as n,v as d,C as x,F as f,q as w,k as _,t as b,A as k,L as A,z as v}from"./index-CiI2cp0V.js";const z={class:"p-6 h-screen overflow-y-auto custom-scrollbar"},E={class:"space-y-4"},T={class:"grid grid-cols-1 gap-6"},W={class:"space-y-2"},K={class:"space-y-2"},j={class:"space-y-2"},I={class:"relative"},G={class:"space-y-2"},L={class:"space-y-2"},N=["value"],R={class:"space-y-2"},P={class:"grid grid-cols-1 gap-6 mt-8"},$={class:"space-y-2"},q={class:"space-y-2"},H={class:"space-y-4"},J={class:"space-y-2"},O={class:"space-y-4"},Q={class:"space-y-2"},X={key:0,class:"space-y-4"},Y={class:"space-y-2"},Z={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ee={class:"space-y-2"},oe={class:"space-y-2"},re={key:1,class:"space-y-4"},te={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ae={class:"space-y-2"},se={class:"space-y-2"},le={class:"space-y-2"},ne={class:"space-y-2"},de={class:"space-y-2"},ie={class:"space-y-2"},ue={class:"space-y-2"},ge={class:"space-y-2"},ce={class:"flex items-center"},ye=["aria-checked"],pe={class:"mt-8"},be={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ve={class:"space-y-2"},me={class:"flex items-center space-x-2"},xe={class:"space-y-2"},he={class:"flex items-center space-x-2"},fe={class:"space-y-2"},we={class:"flex items-center space-x-2"},_e={class:"space-y-2"},ke={class:"flex flex-wrap gap-3"},Ue=["value"],Se={class:"space-y-2"},Ve={class:"flex items-center space-x-2"},De={class:"space-y-2"},Ce={class:"flex items-center"},Be=["aria-checked"],Me={class:"mt-8"},Fe={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Ae={class:"space-y-2"},ze={class:"flex items-center space-x-2"},Ee={class:"space-y-2"},Te={class:"flex items-center space-x-2"},je=B({__name:"SystemSettingsView",setup(We){const a=F("isDarkMode"),l=m({name:"",description:"",file_storage:"",webdav_url:"",webdav_username:"",webdav_password:"",themesChoices:[],expireStyle:[],admin_token:"",robotsText:"",keywords:"",notify_title:"",storage_path:"",notify_content:"",openUpload:1,uploadSize:1,uploadMinute:1,max_save_seconds:0,opacity:.9,s3_access_key_id:"",background:"",showAdminAddr:0,page_explain:"",s3_secret_access_key:"",aws_session_token:"",s3_signature_version:"",s3_region_name:"",s3_bucket_name:"",s3_endpoint_url:"",s3_hostname:"",uploadCount:1,errorMinute:1,errorCount:1,s3_proxy:0,themesSelect:""}),c=m(1),y=m("MB"),u=m(1),g=m("天"),U=(i,o)=>i*{秒:1,分:60,时:3600,天:86400}[o],S=()=>{k({url:"/admin/config/get",method:"get"}).then(i=>{l.value=i.detail;let o=l.value.uploadSize;o>=1024*1024*1024?(c.value=Math.round(o/(1024*1024*1024)),y.value="GB"):o>=1024*1024?(c.value=Math.round(o/(1024*1024)),y.value="MB"):(c.value=Math.round(o/1024),y.value="KB");let r=l.value.max_save_seconds;r===0?(u.value=7,g.value="天"):r%86400===0&&r>=86400?(u.value=r/86400,g.value="天"):r%3600===0&&r>=3600?(u.value=r/3600,g.value="时"):r%60===0&&r>=60?(u.value=r/60,g.value="分"):(u.value=r,g.value="秒")})},h=M(),V=(i,o)=>i*{KB:1024,MB:1048576,GB:1073741824}[o],D=()=>{const i={...l.value};i.uploadSize=V(c.value,y.value),u.value===0?i.max_save_seconds=7*86400:i.max_save_seconds=U(u.value,g.value),k({url:"/admin/config/update",method:"patch",data:i}).then(o=>{o.code==200?h.showAlert("保存成功","success"):h.showAlert(o.message,"error")})};return S(),(i,o)=>(v(),p("div",z,[e("h2",{class:t(["text-2xl font-bold mb-6",[s(a)?"text-white":"text-gray-800"]])}," 系统设置 ",2),e("div",{class:t(["space-y-6 rounded-lg shadow-md p-6",[s(a)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[e("section",E,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 基本设置 ",2),e("div",T,[e("div",W,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 网站名称 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[0]||(o[0]=r=>l.value.name=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.name]])]),e("div",K,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 网站描述 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[1]||(o[1]=r=>l.value.description=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.description]])]),e("div",j,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 管理员密码 ",2),e("div",I,[n(e("input",{type:"password","onUpdate:modelValue":o[2]||(o[2]=r=>l.value.admin_token=r),placeholder:"留空则不修改密码",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.admin_token]]),e("div",{class:t(["absolute inset-y-0 right-0 flex items-center pr-3 text-sm text-gray-400",[s(a)?"text-gray-500":"text-gray-400"]])},o[31]||(o[31]=[e("span",{class:"text-xs"},"留空则不修改",-1)]),2)])]),e("div",G,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 关键词 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[3]||(o[3]=r=>l.value.keywords=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.keywords]])]),e("div",L,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 主题选择 ",2),n(e("select",{"onUpdate:modelValue":o[4]||(o[4]=r=>l.value.themesSelect=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border appearance-none bg-no-repeat bg-right focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none cursor-pointer",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]]),style:{"background-image":"url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M7%208l3%203%203-3%22%20stroke%3D%22%236B7280%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E')"}},[(v(!0),p(f,null,w(l.value.themesChoices,r=>(v(),p("option",{value:r.key,key:r.key},b(r.name)+" (by "+b(r.author)+" V"+b(r.version)+") ",9,N))),128))],2),[[x,l.value.themesSelect]])]),e("div",R,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Robots.txt ",2),n(e("textarea",{"onUpdate:modelValue":o[5]||(o[5]=r=>l.value.robotsText=r),rows:"3",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border resize-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.robotsText]])])]),e("div",P,[e("div",$,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 通知标题 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[6]||(o[6]=r=>l.value.notify_title=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.notify_title]])]),e("div",q,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 通知内容 ",2),n(e("textarea",{"onUpdate:modelValue":o[7]||(o[7]=r=>l.value.notify_content=r),rows:"3",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border resize-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.notify_content]])])]),e("div",H,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 存储设置 ",2),e("div",J,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 存储路径 ",2),n(e("input",{type:"text",placeholder:"留空则使用默认路径,可不填写","onUpdate:modelValue":o[8]||(o[8]=r=>l.value.storage_path=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.storage_path]])]),e("div",O,[e("div",Q,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 存储方式 ",2),n(e("select",{"onUpdate:modelValue":o[9]||(o[9]=r=>l.value.file_storage=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border appearance-none bg-no-repeat bg-right focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none cursor-pointer",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]]),style:{"background-image":"url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M7%208l3%203%203-3%22%20stroke%3D%22%236B7280%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E')"}},o[32]||(o[32]=[e("option",{value:"local"},"本地存储",-1),e("option",{value:"s3"},"S3 存储",-1),e("option",{value:"webdav"},"Webdav 存储",-1)]),2),[[x,l.value.file_storage]])]),l.value.file_storage==="webdav"?(v(),p("div",X,[e("div",Y,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Webdav URL ",2),n(e("input",{type:"text",placeholder:"请输入 Webdav URL","onUpdate:modelValue":o[10]||(o[10]=r=>l.value.webdav_url=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.webdav_url]])]),e("div",Z,[e("div",ee,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Webdav Username ",2),n(e("input",{type:"text",placeholder:"请输入 Webdav Username","onUpdate:modelValue":o[11]||(o[11]=r=>l.value.webdav_username=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.webdav_username]])]),e("div",oe,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Webdav Password ",2),n(e("input",{type:"password",placeholder:"请输入 Webdav Password","onUpdate:modelValue":o[12]||(o[12]=r=>l.value.webdav_password=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.webdav_password]])])])])):_("",!0),l.value.file_storage==="s3"?(v(),p("div",re,[e("div",te,[e("div",ae,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 AccessKeyId ",2),n(e("input",{type:"text","onUpdate:modelValue":o[13]||(o[13]=r=>l.value.s3_access_key_id=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_access_key_id]])]),e("div",se,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 SecretAccessKey ",2),n(e("input",{type:"password","onUpdate:modelValue":o[14]||(o[14]=r=>l.value.s3_secret_access_key=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_secret_access_key]])]),e("div",le,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 BucketName ",2),n(e("input",{type:"text","onUpdate:modelValue":o[15]||(o[15]=r=>l.value.s3_bucket_name=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_bucket_name]])]),e("div",ne,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 EndpointUrl ",2),n(e("input",{type:"text","onUpdate:modelValue":o[16]||(o[16]=r=>l.value.s3_endpoint_url=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_endpoint_url]])]),e("div",de,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Region Name ",2),n(e("input",{type:"text","onUpdate:modelValue":o[17]||(o[17]=r=>l.value.s3_region_name=r),placeholder:"auto",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_region_name]])]),e("div",ie,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Signature Version ",2),n(e("select",{"onUpdate:modelValue":o[18]||(o[18]=r=>l.value.s3_signature_version=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[33]||(o[33]=[e("option",{value:"s3v2"},"S3v2",-1),e("option",{value:"s3v4"},"S3v4",-1)]),2),[[x,l.value.s3_signature_version]])]),e("div",ue,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Hostname ",2),n(e("input",{type:"text","onUpdate:modelValue":o[19]||(o[19]=r=>l.value.s3_hostname=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_hostname]])]),e("div",ge,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 启用代理 ",2),e("div",ce,[e("button",{type:"button",onClick:o[20]||(o[20]=r=>l.value.s3_proxy=l.value.s3_proxy===1?0:1),class:t(["relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",[l.value.s3_proxy===1?"bg-indigo-600":"bg-gray-200"]]),role:"switch","aria-checked":l.value.s3_proxy===1},[e("span",{class:t(["pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",[l.value.s3_proxy===1?"translate-x-5":"translate-x-0",s(a)&&l.value.s3_proxy!==1?"bg-gray-100":"bg-white"]])},null,2)],10,ye),e("span",{class:t(["ml-3 text-sm",[s(a)?"text-gray-300":"text-gray-700"]])},b(l.value.s3_proxy===1?"已开启":"已关闭"),3)])])])])):_("",!0)])]),e("div",pe,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 上传限制 ",2),e("div",be,[e("div",ve,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 每分钟上传限制 ",2),e("div",me,[n(e("input",{type:"number","onUpdate:modelValue":o[21]||(o[21]=r=>l.value.uploadMinute=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.uploadMinute]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"分钟",2)])]),e("div",xe,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 上传数量限制 ",2),e("div",he,[n(e("input",{type:"number","onUpdate:modelValue":o[22]||(o[22]=r=>l.value.uploadCount=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.uploadCount]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"个文件",2)])]),e("div",fe,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 文件大小限制 ",2),e("div",we,[n(e("input",{type:"number","onUpdate:modelValue":o[23]||(o[23]=r=>c.value=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,c.value]]),n(e("select",{"onUpdate:modelValue":o[24]||(o[24]=r=>y.value=r),class:t(["rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[34]||(o[34]=[e("option",{value:"KB"},"KB",-1),e("option",{value:"MB"},"MB",-1),e("option",{value:"GB"},"GB",-1)]),2),[[x,y.value]])])]),e("div",_e,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 过期方式 ",2),e("div",ke,[(v(),p(f,null,w(["day","hour","minute","forever","count"],r=>e("label",{key:r,class:"relative inline-flex items-center group cursor-pointer"},[n(e("input",{type:"checkbox",value:r,"onUpdate:modelValue":o[25]||(o[25]=C=>l.value.expireStyle=C),class:"peer sr-only"},null,8,Ue),[[A,l.value.expireStyle]]),e("div",{class:t(["px-4 py-2 rounded-full border-2 transition-all duration-200 select-none",[l.value.expireStyle.includes(r)?(s(a),"bg-indigo-600 border-indigo-600 text-white"):s(a)?"bg-gray-700 border-gray-600 text-gray-300 hover:border-indigo-500":"bg-white border-gray-300 text-gray-700 hover:border-indigo-500"]])},b({day:"按天",hour:"按小时",minute:"按分钟",forever:"永久",count:"按次数"}[r]),3)])),64))])]),e("div",Se,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 最长保存时间 ",2),e("div",Ve,[n(e("input",{type:"number","onUpdate:modelValue":o[26]||(o[26]=r=>u.value=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,u.value]]),n(e("select",{"onUpdate:modelValue":o[27]||(o[27]=r=>g.value=r),class:t(["rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[35]||(o[35]=[e("option",{value:"秒"},"秒",-1),e("option",{value:"分"},"分",-1),e("option",{value:"时"},"时",-1),e("option",{value:"天"},"天",-1)]),2),[[x,g.value]])])]),e("div",De,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 游客上传 ",2),e("div",Ce,[e("button",{type:"button",onClick:o[28]||(o[28]=r=>l.value.openUpload=l.value.openUpload===1?0:1),class:t(["relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",[l.value.openUpload===1?"bg-indigo-600":"bg-gray-200"]]),role:"switch","aria-checked":l.value.openUpload===1},[e("span",{class:t(["pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",[l.value.openUpload===1?"translate-x-5":"translate-x-0",s(a)&&l.value.openUpload!==1?"bg-gray-100":"bg-white"]])},null,2)],10,Be),e("span",{class:t(["ml-3 text-sm",[s(a)?"text-gray-300":"text-gray-700"]])},b(l.value.openUpload===1?"已开启":"已关闭"),3)])])])]),e("div",Me,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 错误限制 ",2),e("div",Fe,[e("div",Ae,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 每分钟错误限制 ",2),e("div",ze,[n(e("input",{type:"number","onUpdate:modelValue":o[29]||(o[29]=r=>l.value.errorMinute=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.errorMinute]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"分钟",2)])]),e("div",Ee,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 错误次数限制 ",2),e("div",Te,[n(e("input",{type:"number","onUpdate:modelValue":o[30]||(o[30]=r=>l.value.errorCount=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.errorCount]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"次",2)])])])]),e("div",{class:"flex justify-end mt-8"},[e("button",{onClick:D,class:"px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-200"}," 保存设置 ")])])],2)]))}});export{je as default}; diff --git a/themes/2024/assets/SystemSettingsView-DdLYY83m.js b/themes/2024/assets/SystemSettingsView-DdLYY83m.js deleted file mode 100644 index e3d4d24..0000000 --- a/themes/2024/assets/SystemSettingsView-DdLYY83m.js +++ /dev/null @@ -1 +0,0 @@ -import{B as C,r as b,u as B,d as m,e,n as t,g as s,i as M,j as l,v as i,C as v,F as f,q as _,k as F,t as p,A as w,L as A,z as x}from"./index-BIfJi_O-.js";const z={class:"p-6 h-screen overflow-y-auto custom-scrollbar"},E={class:"space-y-4"},T={class:"grid grid-cols-1 gap-6"},K={class:"space-y-2"},j={class:"space-y-2"},I={class:"space-y-2"},G={class:"relative"},N={class:"space-y-2"},L={class:"space-y-2"},R=["value"],$={class:"space-y-2"},q={class:"grid grid-cols-1 gap-6 mt-8"},H={class:"space-y-2"},J={class:"space-y-2"},O={class:"space-y-4"},P={class:"space-y-2"},Q={class:"space-y-4"},W={class:"space-y-2"},X={key:0,class:"space-y-4"},Y={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Z={class:"space-y-2"},ee={class:"space-y-2"},oe={class:"space-y-2"},re={class:"space-y-2"},te={class:"space-y-2"},ae={class:"space-y-2"},se={class:"space-y-2"},ne={class:"space-y-2"},le={class:"flex items-center"},ie=["aria-checked"],de={class:"mt-8"},ue={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ge={class:"space-y-2"},ce={class:"flex items-center space-x-2"},ye={class:"space-y-2"},pe={class:"flex items-center space-x-2"},be={class:"space-y-2"},me={class:"flex items-center space-x-2"},ve={class:"space-y-2"},xe={class:"flex flex-wrap gap-3"},he=["value"],fe={class:"space-y-2"},_e={class:"flex items-center space-x-2"},we={class:"space-y-2"},ke={class:"flex items-center"},Ue=["aria-checked"],Se={class:"mt-8"},Ve={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},De={class:"space-y-2"},Ce={class:"flex items-center space-x-2"},Be={class:"space-y-2"},Me={class:"flex items-center space-x-2"},ze=C({__name:"SystemSettingsView",setup(Fe){const a=M("isDarkMode"),n=b({name:"",description:"",file_storage:"",themesChoices:[],expireStyle:[],admin_token:"",robotsText:"",keywords:"",notify_title:"",storage_path:"",notify_content:"",openUpload:1,uploadSize:1,uploadMinute:1,max_save_seconds:0,opacity:.9,s3_access_key_id:"",background:"",showAdminAddr:0,page_explain:"",s3_secret_access_key:"",aws_session_token:"",s3_signature_version:"",s3_region_name:"",s3_bucket_name:"",s3_endpoint_url:"",s3_hostname:"",uploadCount:1,errorMinute:1,errorCount:1,s3_proxy:0,themesSelect:""}),c=b(1),y=b("MB"),u=b(1),g=b("天"),k=(d,o)=>d*{秒:1,分:60,时:3600,天:86400}[o],U=()=>{w({url:"/admin/config/get",method:"get"}).then(d=>{n.value=d.detail;let o=n.value.uploadSize;o>=1024*1024*1024?(c.value=Math.round(o/(1024*1024*1024)),y.value="GB"):o>=1024*1024?(c.value=Math.round(o/(1024*1024)),y.value="MB"):(c.value=Math.round(o/1024),y.value="KB");let r=n.value.max_save_seconds;r===0?(u.value=7,g.value="天"):r%86400===0&&r>=86400?(u.value=r/86400,g.value="天"):r%3600===0&&r>=3600?(u.value=r/3600,g.value="时"):r%60===0&&r>=60?(u.value=r/60,g.value="分"):(u.value=r,g.value="秒")})},h=B(),S=(d,o)=>d*{KB:1024,MB:1048576,GB:1073741824}[o],V=()=>{const d={...n.value};d.uploadSize=S(c.value,y.value),u.value===0?d.max_save_seconds=7*86400:d.max_save_seconds=k(u.value,g.value),w({url:"/admin/config/update",method:"patch",data:d}).then(o=>{o.code==200?h.showAlert("保存成功","success"):h.showAlert(o.message,"error")})};return U(),(d,o)=>(x(),m("div",z,[e("h2",{class:t(["text-2xl font-bold mb-6",[s(a)?"text-white":"text-gray-800"]])}," 系统设置 ",2),e("div",{class:t(["space-y-6 rounded-lg shadow-md p-6",[s(a)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[e("section",E,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 基本设置 ",2),e("div",T,[e("div",K,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 网站名称 ",2),l(e("input",{type:"text","onUpdate:modelValue":o[0]||(o[0]=r=>n.value.name=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.name]])]),e("div",j,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 网站描述 ",2),l(e("input",{type:"text","onUpdate:modelValue":o[1]||(o[1]=r=>n.value.description=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.description]])]),e("div",I,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 管理员密码 ",2),e("div",G,[l(e("input",{type:"password","onUpdate:modelValue":o[2]||(o[2]=r=>n.value.admin_token=r),placeholder:"留空则不修改密码",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.admin_token]]),e("div",{class:t(["absolute inset-y-0 right-0 flex items-center pr-3 text-sm text-gray-400",[s(a)?"text-gray-500":"text-gray-400"]])},o[28]||(o[28]=[e("span",{class:"text-xs"},"留空则不修改",-1)]),2)])]),e("div",N,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 关键词 ",2),l(e("input",{type:"text","onUpdate:modelValue":o[3]||(o[3]=r=>n.value.keywords=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.keywords]])]),e("div",L,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 主题选择 ",2),l(e("select",{"onUpdate:modelValue":o[4]||(o[4]=r=>n.value.themesSelect=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border appearance-none bg-no-repeat bg-right focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none cursor-pointer",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]]),style:{"background-image":"url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M7%208l3%203%203-3%22%20stroke%3D%22%236B7280%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E')"}},[(x(!0),m(f,null,_(n.value.themesChoices,r=>(x(),m("option",{value:r.key,key:r.key},p(r.name)+" (by "+p(r.author)+" V"+p(r.version)+") ",9,R))),128))],2),[[v,n.value.themesSelect]])]),e("div",$,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Robots.txt ",2),l(e("textarea",{"onUpdate:modelValue":o[5]||(o[5]=r=>n.value.robotsText=r),rows:"3",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border resize-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.robotsText]])])]),e("div",q,[e("div",H,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 通知标题 ",2),l(e("input",{type:"text","onUpdate:modelValue":o[6]||(o[6]=r=>n.value.notify_title=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.notify_title]])]),e("div",J,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 通知内容 ",2),l(e("textarea",{"onUpdate:modelValue":o[7]||(o[7]=r=>n.value.notify_content=r),rows:"3",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border resize-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.notify_content]])])]),e("div",O,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 存储设置 ",2),e("div",P,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 存储路径 ",2),l(e("input",{type:"text",placeholder:"留空则使用默认路径,可不填写","onUpdate:modelValue":o[8]||(o[8]=r=>n.value.storage_path=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.storage_path]])]),e("div",Q,[e("div",W,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 存储方式 ",2),l(e("select",{"onUpdate:modelValue":o[9]||(o[9]=r=>n.value.file_storage=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border appearance-none bg-no-repeat bg-right focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none cursor-pointer",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]]),style:{"background-image":"url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M7%208l3%203%203-3%22%20stroke%3D%22%236B7280%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E')"}},o[29]||(o[29]=[e("option",{value:"local"},"本地存储",-1),e("option",{value:"s3"},"S3 存储",-1)]),2),[[v,n.value.file_storage]])]),n.value.file_storage==="s3"?(x(),m("div",X,[e("div",Y,[e("div",Z,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 AccessKeyId ",2),l(e("input",{type:"text","onUpdate:modelValue":o[10]||(o[10]=r=>n.value.s3_access_key_id=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.s3_access_key_id]])]),e("div",ee,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 SecretAccessKey ",2),l(e("input",{type:"password","onUpdate:modelValue":o[11]||(o[11]=r=>n.value.s3_secret_access_key=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.s3_secret_access_key]])]),e("div",oe,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 BucketName ",2),l(e("input",{type:"text","onUpdate:modelValue":o[12]||(o[12]=r=>n.value.s3_bucket_name=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.s3_bucket_name]])]),e("div",re,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 EndpointUrl ",2),l(e("input",{type:"text","onUpdate:modelValue":o[13]||(o[13]=r=>n.value.s3_endpoint_url=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.s3_endpoint_url]])]),e("div",te,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Region Name ",2),l(e("input",{type:"text","onUpdate:modelValue":o[14]||(o[14]=r=>n.value.s3_region_name=r),placeholder:"auto",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.s3_region_name]])]),e("div",ae,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Signature Version ",2),l(e("select",{"onUpdate:modelValue":o[15]||(o[15]=r=>n.value.s3_signature_version=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[30]||(o[30]=[e("option",{value:"s3v2"},"S3v2",-1),e("option",{value:"s3v4"},"S3v4",-1)]),2),[[v,n.value.s3_signature_version]])]),e("div",se,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Hostname ",2),l(e("input",{type:"text","onUpdate:modelValue":o[16]||(o[16]=r=>n.value.s3_hostname=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.s3_hostname]])]),e("div",ne,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 启用代理 ",2),e("div",le,[e("button",{type:"button",onClick:o[17]||(o[17]=r=>n.value.s3_proxy=n.value.s3_proxy===1?0:1),class:t(["relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",[n.value.s3_proxy===1?"bg-indigo-600":"bg-gray-200"]]),role:"switch","aria-checked":n.value.s3_proxy===1},[e("span",{class:t(["pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",[n.value.s3_proxy===1?"translate-x-5":"translate-x-0",s(a)&&n.value.s3_proxy!==1?"bg-gray-100":"bg-white"]])},null,2)],10,ie),e("span",{class:t(["ml-3 text-sm",[s(a)?"text-gray-300":"text-gray-700"]])},p(n.value.s3_proxy===1?"已开启":"已关闭"),3)])])])])):F("",!0)])]),e("div",de,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 上传限制 ",2),e("div",ue,[e("div",ge,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 每分钟上传限制 ",2),e("div",ce,[l(e("input",{type:"number","onUpdate:modelValue":o[18]||(o[18]=r=>n.value.uploadMinute=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.uploadMinute]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"分钟",2)])]),e("div",ye,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 上传数量限制 ",2),e("div",pe,[l(e("input",{type:"number","onUpdate:modelValue":o[19]||(o[19]=r=>n.value.uploadCount=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.uploadCount]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"个文件",2)])]),e("div",be,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 文件大小限制 ",2),e("div",me,[l(e("input",{type:"number","onUpdate:modelValue":o[20]||(o[20]=r=>c.value=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,c.value]]),l(e("select",{"onUpdate:modelValue":o[21]||(o[21]=r=>y.value=r),class:t(["rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[31]||(o[31]=[e("option",{value:"KB"},"KB",-1),e("option",{value:"MB"},"MB",-1),e("option",{value:"GB"},"GB",-1)]),2),[[v,y.value]])])]),e("div",ve,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 过期方式 ",2),e("div",xe,[(x(),m(f,null,_(["day","hour","minute","forever","count"],r=>e("label",{key:r,class:"relative inline-flex items-center group cursor-pointer"},[l(e("input",{type:"checkbox",value:r,"onUpdate:modelValue":o[22]||(o[22]=D=>n.value.expireStyle=D),class:"peer sr-only"},null,8,he),[[A,n.value.expireStyle]]),e("div",{class:t(["px-4 py-2 rounded-full border-2 transition-all duration-200 select-none",[n.value.expireStyle.includes(r)?(s(a),"bg-indigo-600 border-indigo-600 text-white"):s(a)?"bg-gray-700 border-gray-600 text-gray-300 hover:border-indigo-500":"bg-white border-gray-300 text-gray-700 hover:border-indigo-500"]])},p({day:"按天",hour:"按小时",minute:"按分钟",forever:"永久",count:"按次数"}[r]),3)])),64))])]),e("div",fe,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 最长保存时间 ",2),e("div",_e,[l(e("input",{type:"number","onUpdate:modelValue":o[23]||(o[23]=r=>u.value=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,u.value]]),l(e("select",{"onUpdate:modelValue":o[24]||(o[24]=r=>g.value=r),class:t(["rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[32]||(o[32]=[e("option",{value:"秒"},"秒",-1),e("option",{value:"分"},"分",-1),e("option",{value:"时"},"时",-1),e("option",{value:"天"},"天",-1)]),2),[[v,g.value]])])]),e("div",we,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 游客上传 ",2),e("div",ke,[e("button",{type:"button",onClick:o[25]||(o[25]=r=>n.value.openUpload=n.value.openUpload===1?0:1),class:t(["relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",[n.value.openUpload===1?"bg-indigo-600":"bg-gray-200"]]),role:"switch","aria-checked":n.value.openUpload===1},[e("span",{class:t(["pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",[n.value.openUpload===1?"translate-x-5":"translate-x-0",s(a)&&n.value.openUpload!==1?"bg-gray-100":"bg-white"]])},null,2)],10,Ue),e("span",{class:t(["ml-3 text-sm",[s(a)?"text-gray-300":"text-gray-700"]])},p(n.value.openUpload===1?"已开启":"已关闭"),3)])])])]),e("div",Se,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 错误限制 ",2),e("div",Ve,[e("div",De,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 每分钟错误限制 ",2),e("div",Ce,[l(e("input",{type:"number","onUpdate:modelValue":o[26]||(o[26]=r=>n.value.errorMinute=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.errorMinute]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"分钟",2)])]),e("div",Be,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 错误次数限制 ",2),e("div",Me,[l(e("input",{type:"number","onUpdate:modelValue":o[27]||(o[27]=r=>n.value.errorCount=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[i,n.value.errorCount]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"次",2)])])])]),e("div",{class:"flex justify-end mt-8"},[e("button",{onClick:V,class:"px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-200"}," 保存设置 ")])])],2)]))}});export{ze as default}; diff --git a/themes/2024/assets/_commonjsHelpers-CljsJuVy.js b/themes/2024/assets/_commonjsHelpers-GlvjlJV-.js similarity index 99% rename from themes/2024/assets/_commonjsHelpers-CljsJuVy.js rename to themes/2024/assets/_commonjsHelpers-GlvjlJV-.js index 62d3d43..757d891 100644 --- a/themes/2024/assets/_commonjsHelpers-CljsJuVy.js +++ b/themes/2024/assets/_commonjsHelpers-GlvjlJV-.js @@ -1,4 +1,4 @@ -import{c as k,B as F,D as R,r as _,E as K,o as V,F as X,G as x,H as Y}from"./index-BIfJi_O-.js";/** +import{c as k,B as F,D as R,r as _,E as K,o as V,F as X,G as x,H as Y}from"./index-CiI2cp0V.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/box-C9xlYTT6.js b/themes/2024/assets/box-BA8SMkDM.js similarity index 90% rename from themes/2024/assets/box-C9xlYTT6.js rename to themes/2024/assets/box-BA8SMkDM.js index 13462e3..0969ac1 100644 --- a/themes/2024/assets/box-C9xlYTT6.js +++ b/themes/2024/assets/box-BA8SMkDM.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-BIfJi_O-.js";/** +import{c as a}from"./index-CiI2cp0V.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/file-AHrKtGwY.js b/themes/2024/assets/file-CWusGEpI.js similarity index 88% rename from themes/2024/assets/file-AHrKtGwY.js rename to themes/2024/assets/file-CWusGEpI.js index a84074a..b5c024f 100644 --- a/themes/2024/assets/file-AHrKtGwY.js +++ b/themes/2024/assets/file-CWusGEpI.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-BIfJi_O-.js";/** +import{c as a}from"./index-CiI2cp0V.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/index-BIfJi_O-.js b/themes/2024/assets/index-CiI2cp0V.js similarity index 99% rename from themes/2024/assets/index-BIfJi_O-.js rename to themes/2024/assets/index-CiI2cp0V.js index 2f49fbf..5da341f 100644 --- a/themes/2024/assets/index-BIfJi_O-.js +++ b/themes/2024/assets/index-CiI2cp0V.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RetrievewFileView-C8jq0XcR.js","assets/_commonjsHelpers-CljsJuVy.js","assets/box-C9xlYTT6.js","assets/file-AHrKtGwY.js","assets/trash-wtxrZ93m.js","assets/RetrievewFileView-DguaL712.css","assets/SendFileView-DneMQ9So.js","assets/SendFileView-D1tJweYo.css","assets/AdminLayout-DQKUNxBs.js","assets/AdminLayout-BA8HwEVA.css","assets/DashboardView-BQkdUNcj.js","assets/FileManageView-FEOrQKbl.js","assets/LoginView-DMl24bJ-.js","assets/LoginView-Cf0iN_2x.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RetrievewFileView-BckF8ahS.js","assets/_commonjsHelpers-GlvjlJV-.js","assets/box-BA8SMkDM.js","assets/file-CWusGEpI.js","assets/trash-dDHutUhM.js","assets/RetrievewFileView-DguaL712.css","assets/SendFileView-Ctmzhn2X.js","assets/SendFileView-D1tJweYo.css","assets/AdminLayout-DGEvILen.js","assets/AdminLayout-BA8HwEVA.css","assets/DashboardView-6JCRMawe.js","assets/FileManageView-BYyHY3ZZ.js","assets/LoginView-CvDOmLlY.js","assets/LoginView-Cf0iN_2x.css"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();/** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -83,4 +83,4 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RetrievewFileVi `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[hi]=this[hi]={accessors:{}}).accessors,r=this.prototype;function o(i){const l=gn(i);s[l]||(Jh(r,i),s[l]=!0)}return b.isArray(t)?t.forEach(o):o(t),this}};Le.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);b.reduceDescriptors(Le.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});b.freezeMethods(Le);function or(e,t){const n=this||Wn,s=t||n,r=Le.from(s.headers);let o=s.data;return b.forEach(e,function(l){o=l.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function Rc(e){return!!(e&&e.__CANCEL__)}function fn(e,t,n){J.call(this,e??"canceled",J.ERR_CANCELED,t,n),this.name="CanceledError"}b.inherits(fn,J,{__CANCEL__:!0});function Cc(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new J("Request failed with status code "+n.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Gh(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xh(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,o=0,i;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),a=s[o];i||(i=u),n[r]=c,s[r]=u;let f=o,p=0;for(;f!==r;)p+=n[f++],f=f%e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),u-i{n=a,r=null,o&&(clearTimeout(o),o=null),e.apply(null,u)};return[(...u)=>{const a=Date.now(),f=a-n;f>=s?i(u,a):(r=u,o||(o=setTimeout(()=>{o=null,i(r)},s-f)))},()=>r&&i(r)]}const gs=(e,t,n=3)=>{let s=0;const r=Xh(50,250);return Qh(o=>{const i=o.loaded,l=o.lengthComputable?o.total:void 0,c=i-s,u=r(c),a=i<=l;s=i;const f={loaded:i,total:l,progress:l?i/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&a?(l-i)/u:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},pi=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},mi=e=>(...t)=>b.asap(()=>e(...t)),Yh=ve.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ve.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ve.origin),ve.navigator&&/(msie|trident)/i.test(ve.navigator.userAgent)):()=>!0,Zh=ve.hasStandardBrowserEnv?{write(e,t,n,s,r,o){const i=[e+"="+encodeURIComponent(t)];b.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),b.isString(s)&&i.push("path="+s),b.isString(r)&&i.push("domain="+r),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ep(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function tp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Tc(e,t){return e&&!ep(t)?tp(e,t):t}const gi=e=>e instanceof Le?{...e}:e;function Ut(e,t){t=t||{};const n={};function s(u,a,f,p){return b.isPlainObject(u)&&b.isPlainObject(a)?b.merge.call({caseless:p},u,a):b.isPlainObject(a)?b.merge({},a):b.isArray(a)?a.slice():a}function r(u,a,f,p){if(b.isUndefined(a)){if(!b.isUndefined(u))return s(void 0,u,f,p)}else return s(u,a,f,p)}function o(u,a){if(!b.isUndefined(a))return s(void 0,a)}function i(u,a){if(b.isUndefined(a)){if(!b.isUndefined(u))return s(void 0,u)}else return s(void 0,a)}function l(u,a,f){if(f in t)return s(u,a);if(f in e)return s(void 0,u)}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(u,a,f)=>r(gi(u),gi(a),f,!0)};return b.forEach(Object.keys(Object.assign({},e,t)),function(a){const f=c[a]||r,p=f(e[a],t[a],a);b.isUndefined(p)&&f!==l||(n[a]=p)}),n}const Ac=e=>{const t=Ut({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:o,headers:i,auth:l}=t;t.headers=i=Le.from(i),t.url=Ec(Tc(t.baseURL,t.url),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(b.isFormData(n)){if(ve.hasStandardBrowserEnv||ve.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((c=i.getContentType())!==!1){const[u,...a]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...a].join("; "))}}if(ve.hasStandardBrowserEnv&&(s&&b.isFunction(s)&&(s=s(t)),s||s!==!1&&Yh(t.url))){const u=r&&o&&Zh.read(o);u&&i.set(r,u)}return t},np=typeof XMLHttpRequest<"u",sp=np&&function(e){return new Promise(function(n,s){const r=Ac(e);let o=r.data;const i=Le.from(r.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=r,a,f,p,m,y;function _(){m&&m(),y&&y(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let x=new XMLHttpRequest;x.open(r.method.toUpperCase(),r.url,!0),x.timeout=r.timeout;function A(){if(!x)return;const P=Le.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),j={data:!l||l==="text"||l==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:P,config:e,request:x};Cc(function(z){n(z),_()},function(z){s(z),_()},j),x=null}"onloadend"in x?x.onloadend=A:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(A)},x.onabort=function(){x&&(s(new J("Request aborted",J.ECONNABORTED,e,x)),x=null)},x.onerror=function(){s(new J("Network Error",J.ERR_NETWORK,e,x)),x=null},x.ontimeout=function(){let L=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const j=r.transitional||Sc;r.timeoutErrorMessage&&(L=r.timeoutErrorMessage),s(new J(L,j.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,x)),x=null},o===void 0&&i.setContentType(null),"setRequestHeader"in x&&b.forEach(i.toJSON(),function(L,j){x.setRequestHeader(j,L)}),b.isUndefined(r.withCredentials)||(x.withCredentials=!!r.withCredentials),l&&l!=="json"&&(x.responseType=r.responseType),u&&([p,y]=gs(u,!0),x.addEventListener("progress",p)),c&&x.upload&&([f,m]=gs(c),x.upload.addEventListener("progress",f),x.upload.addEventListener("loadend",m)),(r.cancelToken||r.signal)&&(a=P=>{x&&(s(!P||P.type?new fn(null,e,x):P),x.abort(),x=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const C=Gh(r.url);if(C&&ve.protocols.indexOf(C)===-1){s(new J("Unsupported protocol "+C+":",J.ERR_BAD_REQUEST,e));return}x.send(o||null)})},rp=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,r;const o=function(u){if(!r){r=!0,l();const a=u instanceof Error?u:this.reason;s.abort(a instanceof J?a:new fn(a instanceof Error?a.message:a))}};let i=t&&setTimeout(()=>{i=null,o(new J(`timeout ${t} of ms exceeded`,J.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:c}=s;return c.unsubscribe=()=>b.asap(l),c}},op=function*(e,t){let n=e.byteLength;if(n{const r=ip(e,t);let o=0,i,l=c=>{i||(i=!0,s&&s(c))};return new ReadableStream({async pull(c){try{const{done:u,value:a}=await r.next();if(u){l(),c.close();return}let f=a.byteLength;if(n){let p=o+=f;n(p)}c.enqueue(new Uint8Array(a))}catch(u){throw l(u),u}},cancel(c){return l(c),r.return()}},{highWaterMark:2})},Bs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Oc=Bs&&typeof ReadableStream=="function",cp=Bs&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Pc=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ap=Oc&&Pc(()=>{let e=!1;const t=new Request(ve.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),bi=64*1024,Cr=Oc&&Pc(()=>b.isReadableStream(new Response("").body)),ys={stream:Cr&&(e=>e.body)};Bs&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ys[t]&&(ys[t]=b.isFunction(e[t])?n=>n[t]():(n,s)=>{throw new J(`Response type '${t}' is not supported`,J.ERR_NOT_SUPPORT,s)})})})(new Response);const up=async e=>{if(e==null)return 0;if(b.isBlob(e))return e.size;if(b.isSpecCompliantForm(e))return(await new Request(ve.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(b.isArrayBufferView(e)||b.isArrayBuffer(e))return e.byteLength;if(b.isURLSearchParams(e)&&(e=e+""),b.isString(e))return(await cp(e)).byteLength},fp=async(e,t)=>{const n=b.toFiniteNumber(e.getContentLength());return n??up(t)},dp=Bs&&(async e=>{let{url:t,method:n,data:s,signal:r,cancelToken:o,timeout:i,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:a,withCredentials:f="same-origin",fetchOptions:p}=Ac(e);u=u?(u+"").toLowerCase():"text";let m=rp([r,o&&o.toAbortSignal()],i),y;const _=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let x;try{if(c&&ap&&n!=="get"&&n!=="head"&&(x=await fp(a,s))!==0){let j=new Request(t,{method:"POST",body:s,duplex:"half"}),X;if(b.isFormData(s)&&(X=j.headers.get("content-type"))&&a.setContentType(X),j.body){const[z,V]=pi(x,gs(mi(c)));s=yi(j.body,bi,z,V)}}b.isString(f)||(f=f?"include":"omit");const A="credentials"in Request.prototype;y=new Request(t,{...p,signal:m,method:n.toUpperCase(),headers:a.normalize().toJSON(),body:s,duplex:"half",credentials:A?f:void 0});let C=await fetch(y);const P=Cr&&(u==="stream"||u==="response");if(Cr&&(l||P&&_)){const j={};["status","statusText","headers"].forEach(N=>{j[N]=C[N]});const X=b.toFiniteNumber(C.headers.get("content-length")),[z,V]=l&&pi(X,gs(mi(l),!0))||[];C=new Response(yi(C.body,bi,z,()=>{V&&V(),_&&_()}),j)}u=u||"text";let L=await ys[b.findKey(ys,u)||"text"](C,e);return!P&&_&&_(),await new Promise((j,X)=>{Cc(j,X,{data:L,headers:Le.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:y})})}catch(A){throw _&&_(),A&&A.name==="TypeError"&&/fetch/i.test(A.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,e,y),{cause:A.cause||A}):J.from(A,A&&A.code,e,y)}}),Tr={http:Th,xhr:sp,fetch:dp};b.forEach(Tr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const _i=e=>`- ${e}`,hp=e=>b.isFunction(e)||e===null||e===!1,Lc={getAdapter:e=>{e=b.isArray(e)?e:[e];const{length:t}=e;let n,s;const r={};for(let o=0;o`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since : `+o.map(_i).join(` `):" "+_i(o[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return s},adapters:Tr};function ir(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new fn(null,e)}function vi(e){return ir(e),e.headers=Le.from(e.headers),e.data=or.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Lc.getAdapter(e.adapter||Wn.adapter)(e).then(function(s){return ir(e),s.data=or.call(e,e.transformResponse,s),s.headers=Le.from(s.headers),s},function(s){return Rc(s)||(ir(e),s&&s.response&&(s.response.data=or.call(e,e.transformResponse,s.response),s.response.headers=Le.from(s.response.headers))),Promise.reject(s)})}const Ic="1.7.9",$s={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$s[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const wi={};$s.transitional=function(t,n,s){function r(o,i){return"[Axios v"+Ic+"] Transitional option '"+o+"'"+i+(s?". "+s:"")}return(o,i,l)=>{if(t===!1)throw new J(r(i," has been removed"+(n?" in "+n:"")),J.ERR_DEPRECATED);return n&&!wi[i]&&(wi[i]=!0,console.warn(r(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,l):!0}};$s.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function pp(e,t,n){if(typeof e!="object")throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const o=s[r],i=t[o];if(i){const l=e[o],c=l===void 0||i(l,o,e);if(c!==!0)throw new J("option "+o+" must be "+c,J.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new J("Unknown option "+o,J.ERR_BAD_OPTION)}}const rs={assertOptions:pp,validators:$s},et=rs.validators;let Bt=class{constructor(t){this.defaults=t,this.interceptors={request:new di,response:new di}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const o=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=` -`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ut(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&rs.assertOptions(s,{silentJSONParsing:et.transitional(et.boolean),forcedJSONParsing:et.transitional(et.boolean),clarifyTimeoutError:et.transitional(et.boolean)},!1),r!=null&&(b.isFunction(r)?n.paramsSerializer={serialize:r}:rs.assertOptions(r,{encode:et.function,serialize:et.function},!0)),rs.assertOptions(n,{baseUrl:et.spelling("baseURL"),withXsrfToken:et.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&b.merge(o.common,o[n.method]);o&&b.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),n.headers=Le.concat(i,o);const l=[];let c=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(n)===!1||(c=c&&_.synchronous,l.unshift(_.fulfilled,_.rejected))});const u=[];this.interceptors.response.forEach(function(_){u.push(_.fulfilled,_.rejected)});let a,f=0,p;if(!c){const y=[vi.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,u),p=y.length,a=Promise.resolve(n);f{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const i=new Promise(l=>{s.subscribe(l),o=l}).then(r);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,l){s.reason||(s.reason=new fn(o,i,l),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Nc(function(r){t=r}),cancel:t}}};function gp(e){return function(n){return e.apply(null,n)}}function yp(e){return b.isObject(e)&&e.isAxiosError===!0}const Ar={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ar).forEach(([e,t])=>{Ar[t]=e});function Mc(e){const t=new Bt(e),n=uc(Bt.prototype.request,t);return b.extend(n,Bt.prototype,t,{allOwnKeys:!0}),b.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Mc(Ut(e,r))},n}const he=Mc(Wn);he.Axios=Bt;he.CanceledError=fn;he.CancelToken=mp;he.isCancel=Rc;he.VERSION=Ic;he.toFormData=js;he.AxiosError=J;he.Cancel=he.CanceledError;he.all=function(t){return Promise.all(t)};he.spread=gp;he.isAxiosError=yp;he.mergeConfig=Ut;he.AxiosHeaders=Le;he.formToJSON=e=>xc(b.isHTMLForm(e)?new FormData(e):e);he.getAdapter=Lc.getAdapter;he.HttpStatusCode=Ar;he.default=he;const{Axios:qp,AxiosError:Kp,CanceledError:Wp,isCancel:zp,CancelToken:Jp,VERSION:Gp,all:Xp,Cancel:Qp,isAxiosError:Yp,spread:Zp,toFormData:em,AxiosHeaders:tm,HttpStatusCode:nm,formToJSON:sm,getAdapter:rm,mergeConfig:om}=he,bp="",kc=bp,Zr=he.create({baseURL:kc,timeout:1e15,headers:{"Content-Type":"application/json"}});Zr.interceptors.request.use(e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=`Bearer ${t}`),e.url&&!e.url.startsWith("http")&&(e.url=`${kc}/${e.url.replace(/^\//,"")}`),e},e=>Promise.reject(e));Zr.interceptors.response.use(e=>e.data,e=>{if(e.response)switch(e.response.status){case 401:console.error("未授权,请重新登录"),localStorage.clear(),window.location.href="/#/login";break;case 403:console.error("禁止访问");break;case 404:console.error("请求的资源不存在");break;default:console.error("发生错误:",e.response.data)}else e.request?console.error("未收到响应:",e.request):console.error("请求配置错误:",e.message);return Promise.reject(e)});const Fc=Cf("alert",{state:()=>({alerts:[]}),actions:{showAlert(e,t="info",n=5e3){const s=Date.now(),r=Date.now();this.alerts.push({id:s,message:e,type:t,progress:100,duration:n,startTime:r}),setTimeout(()=>this.removeAlert(s),n)},removeAlert(e){const t=this.alerts.findIndex(n=>n.id===e);t>-1&&this.alerts.splice(t,1)},updateAlertProgress(e){const t=this.alerts.find(n=>n.id===e);if(t){const s=100-(Date.now()-t.startTime)/t.duration*100;t.progress=Math.max(0,s),t.progress<=0&&this.removeAlert(e)}}}}),_p={class:"p-4"},vp={class:"flex items-start"},wp={class:"flex-shrink-0"},Ep={class:"ml-3 flex-1 pt-0.5"},Sp=["innerHTML"],xp={class:"ml-4 flex-shrink-0 flex"},Rp=["onClick"],Cp={class:"h-1 bg-white bg-opacity-25"},Tp=Vn({__name:"AlertComponent",setup(e){const t=Fc(),{alerts:n}=Tf(t),{removeAlert:s,updateAlertProgress:r}=t,o={success:"from-green-500 to-green-600",error:"from-red-500 to-red-600",warning:"from-yellow-500 to-yellow-600",info:"from-blue-500 to-blue-600"},i={success:kd,error:Bd,warning:Md,info:Fd};let l;return As(()=>{l=setInterval(()=>{n.value.forEach(c=>{r(c.id)})},100)}),qr(()=>{clearInterval(l)}),(c,u)=>(qe(),tn(lf,{name:"alert-fade",tag:"div",class:"fixed top-4 left-4 z-50 w-full sm:max-w-sm md:max-w-md space-y-4 px-4 sm:px-0"},{default:us(()=>[(qe(!0),Nn(He,null,Va(Oe(n),a=>(qe(),Nn("div",{key:a.id,class:an(["w-full rounded-lg shadow-xl overflow-hidden","bg-gradient-to-r",o[a.type]])},[ke("div",_p,[ke("div",vp,[ke("div",wp,[(qe(),tn(ml(i[a.type]),{class:"h-6 w-6 text-white"}))]),ke("div",Ep,[ke("p",{class:"text-sm font-medium text-white",innerHTML:a.message},null,8,Sp)]),ke("div",xp,[ke("button",{onClick:f=>Oe(s)(a.id),class:"inline-flex text-white hover:text-gray-200 focus:outline-none transition-colors duration-200"},[u[0]||(u[0]=ke("span",{class:"sr-only"},"关闭",-1)),me(Oe($d),{class:"h-5 w-5"})],8,Rp)])])]),ke("div",Cp,[ke("div",{class:"h-full bg-white transition-all duration-100 ease-out",style:Es({width:`${a.progress}%`})},null,4)])],2))),128))]),_:1}))}}),Ap=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Op=Ap(Tp,[["__scopeId","data-v-6fdbaa84"]]),Pp={key:0,class:"loading-overlay"},Lp=Vn({__name:"App",setup(e){const t=en(!1),n=en(!1),s=Ld(),r=Fc(),o=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>{const c=localStorage.getItem("colorMode");return c?c==="dark":null},l=c=>{t.value=c,localStorage.setItem("colorMode",c?"dark":"light")};return As(()=>{const c=i();l(c!==null?c:o()),Zr.post("/",{}).then(u=>{u.code===200&&(localStorage.setItem("config",JSON.stringify(u.detail)),u.detail.notify_title&&u.detail.notify_content&&localStorage.getItem("notify")!==u.detail.notify_title+u.detail.notify_content&&(localStorage.setItem("notify",u.detail.notify_title+u.detail.notify_content),r.showAlert(u.detail.notify_title+": "+u.detail.notify_content,"success")))})}),fu(()=>{document.documentElement.classList.toggle("dark",t.value)}),s.beforeEach((c,u,a)=>{n.value=!0,a()}),s.afterEach(()=>{setTimeout(()=>{n.value=!1},200)}),jt("isDarkMode",t),jt("setColorMode",l),jt("isLoading",n),(c,u)=>(qe(),Nn("div",{class:an(["app-container",t.value?"dark":"light"])},[me(Hd,{modelValue:t.value,"onUpdate:modelValue":u[0]||(u[0]=a=>t.value=a)},null,8,["modelValue"]),n.value?(qe(),Nn("div",Pp,u[1]||(u[1]=[ke("div",{class:"loading-spinner"},null,-1)]))):xu("",!0),me(Oe(ac),null,{default:us(({Component:a})=>[me($u,{name:"fade",mode:"out-in"},{default:us(()=>[(qe(),tn(ml(a),{key:c.$route.fullPath}))]),_:2},1024)]),_:1}),me(Op)],2))}}),Ip="modulepreload",Np=function(e){return"/"+e},Ei={},vt=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=Np(c),c in Ei)return;Ei[c]=!0;const u=c.endsWith(".css"),a=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${a}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Ip,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return r.then(i=>{for(const l of i||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})},Mp=Od({history:od("/"),routes:[{path:"/",name:"Retrieve",component:()=>vt(()=>import("./RetrievewFileView-C8jq0XcR.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/send",name:"Send",component:()=>vt(()=>import("./SendFileView-DneMQ9So.js"),__vite__mapDeps([6,1,3,4,7]))},{path:"/admin",name:"Manage",component:()=>vt(()=>import("./AdminLayout-DQKUNxBs.js"),__vite__mapDeps([8,2,9])),redirect:"/admin/dashboard",children:[{path:"/admin/dashboard",name:"Dashboard",component:()=>vt(()=>import("./DashboardView-BQkdUNcj.js"),__vite__mapDeps([10,3,4]))},{path:"/admin/files",name:"FileManage",component:()=>vt(()=>import("./FileManageView-FEOrQKbl.js"),__vite__mapDeps([11,3]))},{path:"/admin/settings",name:"Settings",component:()=>vt(()=>import("./SystemSettingsView-DdLYY83m.js"),[])}]},{path:"/login",name:"Login",component:()=>vt(()=>import("./LoginView-DMl24bJ-.js"),__vite__mapDeps([12,2,13]))}]});vt(()=>import("./SendFileView-DneMQ9So.js"),__vite__mapDeps([6,1,3,4,7]));const eo=yf(Lp);eo.use(vf());eo.use(Mp);eo.mount("#app");export{Zr as A,Vn as B,Bp as C,nn as D,fl as E,He as F,Cf as G,Hn as H,qr as I,tn as J,ml as K,jp as L,lf as T,$d as X,Ap as _,Hp as a,Fe as b,qt as c,Nn as d,ke as e,me as f,Oe as g,$p as h,Pe as i,kp as j,xu as k,us as l,Su as m,an as n,As as o,Fp as p,Va as q,en as r,Tf as s,Xc as t,Fc as u,Dp as v,Sn as w,$u as x,Ld as y,qe as z}; +`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ut(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&rs.assertOptions(s,{silentJSONParsing:et.transitional(et.boolean),forcedJSONParsing:et.transitional(et.boolean),clarifyTimeoutError:et.transitional(et.boolean)},!1),r!=null&&(b.isFunction(r)?n.paramsSerializer={serialize:r}:rs.assertOptions(r,{encode:et.function,serialize:et.function},!0)),rs.assertOptions(n,{baseUrl:et.spelling("baseURL"),withXsrfToken:et.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&b.merge(o.common,o[n.method]);o&&b.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),n.headers=Le.concat(i,o);const l=[];let c=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(n)===!1||(c=c&&_.synchronous,l.unshift(_.fulfilled,_.rejected))});const u=[];this.interceptors.response.forEach(function(_){u.push(_.fulfilled,_.rejected)});let a,f=0,p;if(!c){const y=[vi.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,u),p=y.length,a=Promise.resolve(n);f{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const i=new Promise(l=>{s.subscribe(l),o=l}).then(r);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,l){s.reason||(s.reason=new fn(o,i,l),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Nc(function(r){t=r}),cancel:t}}};function gp(e){return function(n){return e.apply(null,n)}}function yp(e){return b.isObject(e)&&e.isAxiosError===!0}const Ar={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ar).forEach(([e,t])=>{Ar[t]=e});function Mc(e){const t=new Bt(e),n=uc(Bt.prototype.request,t);return b.extend(n,Bt.prototype,t,{allOwnKeys:!0}),b.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Mc(Ut(e,r))},n}const he=Mc(Wn);he.Axios=Bt;he.CanceledError=fn;he.CancelToken=mp;he.isCancel=Rc;he.VERSION=Ic;he.toFormData=js;he.AxiosError=J;he.Cancel=he.CanceledError;he.all=function(t){return Promise.all(t)};he.spread=gp;he.isAxiosError=yp;he.mergeConfig=Ut;he.AxiosHeaders=Le;he.formToJSON=e=>xc(b.isHTMLForm(e)?new FormData(e):e);he.getAdapter=Lc.getAdapter;he.HttpStatusCode=Ar;he.default=he;const{Axios:qp,AxiosError:Kp,CanceledError:Wp,isCancel:zp,CancelToken:Jp,VERSION:Gp,all:Xp,Cancel:Qp,isAxiosError:Yp,spread:Zp,toFormData:em,AxiosHeaders:tm,HttpStatusCode:nm,formToJSON:sm,getAdapter:rm,mergeConfig:om}=he,bp="",kc=bp,Zr=he.create({baseURL:kc,timeout:1e15,headers:{"Content-Type":"application/json"}});Zr.interceptors.request.use(e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=`Bearer ${t}`),e.url&&!e.url.startsWith("http")&&(e.url=`${kc}/${e.url.replace(/^\//,"")}`),e},e=>Promise.reject(e));Zr.interceptors.response.use(e=>e.data,e=>{if(e.response)switch(e.response.status){case 401:console.error("未授权,请重新登录"),localStorage.clear(),window.location.href="/#/login";break;case 403:console.error("禁止访问");break;case 404:console.error("请求的资源不存在");break;default:console.error("发生错误:",e.response.data)}else e.request?console.error("未收到响应:",e.request):console.error("请求配置错误:",e.message);return Promise.reject(e)});const Fc=Cf("alert",{state:()=>({alerts:[]}),actions:{showAlert(e,t="info",n=5e3){const s=Date.now(),r=Date.now();this.alerts.push({id:s,message:e,type:t,progress:100,duration:n,startTime:r}),setTimeout(()=>this.removeAlert(s),n)},removeAlert(e){const t=this.alerts.findIndex(n=>n.id===e);t>-1&&this.alerts.splice(t,1)},updateAlertProgress(e){const t=this.alerts.find(n=>n.id===e);if(t){const s=100-(Date.now()-t.startTime)/t.duration*100;t.progress=Math.max(0,s),t.progress<=0&&this.removeAlert(e)}}}}),_p={class:"p-4"},vp={class:"flex items-start"},wp={class:"flex-shrink-0"},Ep={class:"ml-3 flex-1 pt-0.5"},Sp=["innerHTML"],xp={class:"ml-4 flex-shrink-0 flex"},Rp=["onClick"],Cp={class:"h-1 bg-white bg-opacity-25"},Tp=Vn({__name:"AlertComponent",setup(e){const t=Fc(),{alerts:n}=Tf(t),{removeAlert:s,updateAlertProgress:r}=t,o={success:"from-green-500 to-green-600",error:"from-red-500 to-red-600",warning:"from-yellow-500 to-yellow-600",info:"from-blue-500 to-blue-600"},i={success:kd,error:Bd,warning:Md,info:Fd};let l;return As(()=>{l=setInterval(()=>{n.value.forEach(c=>{r(c.id)})},100)}),qr(()=>{clearInterval(l)}),(c,u)=>(qe(),tn(lf,{name:"alert-fade",tag:"div",class:"fixed top-4 left-4 z-50 w-full sm:max-w-sm md:max-w-md space-y-4 px-4 sm:px-0"},{default:us(()=>[(qe(!0),Nn(He,null,Va(Oe(n),a=>(qe(),Nn("div",{key:a.id,class:an(["w-full rounded-lg shadow-xl overflow-hidden","bg-gradient-to-r",o[a.type]])},[ke("div",_p,[ke("div",vp,[ke("div",wp,[(qe(),tn(ml(i[a.type]),{class:"h-6 w-6 text-white"}))]),ke("div",Ep,[ke("p",{class:"text-sm font-medium text-white",innerHTML:a.message},null,8,Sp)]),ke("div",xp,[ke("button",{onClick:f=>Oe(s)(a.id),class:"inline-flex text-white hover:text-gray-200 focus:outline-none transition-colors duration-200"},[u[0]||(u[0]=ke("span",{class:"sr-only"},"关闭",-1)),me(Oe($d),{class:"h-5 w-5"})],8,Rp)])])]),ke("div",Cp,[ke("div",{class:"h-full bg-white transition-all duration-100 ease-out",style:Es({width:`${a.progress}%`})},null,4)])],2))),128))]),_:1}))}}),Ap=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Op=Ap(Tp,[["__scopeId","data-v-6fdbaa84"]]),Pp={key:0,class:"loading-overlay"},Lp=Vn({__name:"App",setup(e){const t=en(!1),n=en(!1),s=Ld(),r=Fc(),o=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>{const c=localStorage.getItem("colorMode");return c?c==="dark":null},l=c=>{t.value=c,localStorage.setItem("colorMode",c?"dark":"light")};return As(()=>{const c=i();l(c!==null?c:o()),Zr.post("/",{}).then(u=>{u.code===200&&(localStorage.setItem("config",JSON.stringify(u.detail)),u.detail.notify_title&&u.detail.notify_content&&localStorage.getItem("notify")!==u.detail.notify_title+u.detail.notify_content&&(localStorage.setItem("notify",u.detail.notify_title+u.detail.notify_content),r.showAlert(u.detail.notify_title+": "+u.detail.notify_content,"success")))})}),fu(()=>{document.documentElement.classList.toggle("dark",t.value)}),s.beforeEach((c,u,a)=>{n.value=!0,a()}),s.afterEach(()=>{setTimeout(()=>{n.value=!1},200)}),jt("isDarkMode",t),jt("setColorMode",l),jt("isLoading",n),(c,u)=>(qe(),Nn("div",{class:an(["app-container",t.value?"dark":"light"])},[me(Hd,{modelValue:t.value,"onUpdate:modelValue":u[0]||(u[0]=a=>t.value=a)},null,8,["modelValue"]),n.value?(qe(),Nn("div",Pp,u[1]||(u[1]=[ke("div",{class:"loading-spinner"},null,-1)]))):xu("",!0),me(Oe(ac),null,{default:us(({Component:a})=>[me($u,{name:"fade",mode:"out-in"},{default:us(()=>[(qe(),tn(ml(a),{key:c.$route.fullPath}))]),_:2},1024)]),_:1}),me(Op)],2))}}),Ip="modulepreload",Np=function(e){return"/"+e},Ei={},vt=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=Np(c),c in Ei)return;Ei[c]=!0;const u=c.endsWith(".css"),a=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${a}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Ip,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return r.then(i=>{for(const l of i||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})},Mp=Od({history:od("/"),routes:[{path:"/",name:"Retrieve",component:()=>vt(()=>import("./RetrievewFileView-BckF8ahS.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/send",name:"Send",component:()=>vt(()=>import("./SendFileView-Ctmzhn2X.js"),__vite__mapDeps([6,1,3,4,7]))},{path:"/admin",name:"Manage",component:()=>vt(()=>import("./AdminLayout-DGEvILen.js"),__vite__mapDeps([8,2,9])),redirect:"/admin/dashboard",children:[{path:"/admin/dashboard",name:"Dashboard",component:()=>vt(()=>import("./DashboardView-6JCRMawe.js"),__vite__mapDeps([10,3,4]))},{path:"/admin/files",name:"FileManage",component:()=>vt(()=>import("./FileManageView-BYyHY3ZZ.js"),__vite__mapDeps([11,3]))},{path:"/admin/settings",name:"Settings",component:()=>vt(()=>import("./SystemSettingsView-DMnqdwce.js"),[])}]},{path:"/login",name:"Login",component:()=>vt(()=>import("./LoginView-CvDOmLlY.js"),__vite__mapDeps([12,2,13]))}]});vt(()=>import("./SendFileView-Ctmzhn2X.js"),__vite__mapDeps([6,1,3,4,7]));const eo=yf(Lp);eo.use(vf());eo.use(Mp);eo.mount("#app");export{Zr as A,Vn as B,Bp as C,nn as D,fl as E,He as F,Cf as G,Hn as H,qr as I,tn as J,ml as K,jp as L,lf as T,$d as X,Ap as _,Hp as a,Fe as b,qt as c,Nn as d,ke as e,me as f,Oe as g,$p as h,Pe as i,kp as j,xu as k,us as l,Su as m,an as n,As as o,Fp as p,Va as q,en as r,Tf as s,Xc as t,Fc as u,Dp as v,Sn as w,$u as x,Ld as y,qe as z}; diff --git a/themes/2024/assets/trash-wtxrZ93m.js b/themes/2024/assets/trash-dDHutUhM.js similarity index 95% rename from themes/2024/assets/trash-wtxrZ93m.js rename to themes/2024/assets/trash-dDHutUhM.js index 4a9cb82..6746ade 100644 --- a/themes/2024/assets/trash-wtxrZ93m.js +++ b/themes/2024/assets/trash-dDHutUhM.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-BIfJi_O-.js";/** +import{c as a}from"./index-CiI2cp0V.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/index.html b/themes/2024/index.html index b0b7588..140ed51 100644 --- a/themes/2024/index.html +++ b/themes/2024/index.html @@ -11,7 +11,7 @@ {{title}} - +