mirror of
https://github.com/vastsa/FileCodeBox.git
synced 2026-11-20 21:57:02 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cdb972583 | ||
|
|
736e16a9f6 | ||
|
|
8e57a497f7 | ||
|
|
287d9aeedb | ||
|
|
f1a16a115a | ||
|
|
b2bfc045c2 | ||
|
|
900541baa5 | ||
|
|
8b813a2eaa | ||
|
|
4920b4b5db | ||
|
|
268f1537bb | ||
|
|
41b01b3faa | ||
|
|
c02fb7ce20 | ||
|
|
95f5e0dfbc | ||
|
|
e854eb068c | ||
|
|
c1966b3942 | ||
|
|
a20a0beb79 | ||
|
|
d7200f6b9b | ||
|
|
bd6f646f5d | ||
|
|
6eac746e83 | ||
|
|
5f82650c36 | ||
|
|
d3fe7b223e | ||
|
|
2d79fa5acd |
No files matched your search
@@ -8,9 +8,13 @@ on:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
env:
|
||||
REGISTRY_IMAGE: ${{ secrets.DOCKER_USERNAME }}/filecodebox
|
||||
|
||||
jobs:
|
||||
buildx:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -21,7 +25,7 @@ jobs:
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ secrets.DOCKER_USERNAME }}/filecodebox
|
||||
images: ${{ env.REGISTRY_IMAGE }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
@@ -35,6 +39,10 @@ jobs:
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver-opts: |
|
||||
image=moby/buildkit:latest
|
||||
network=host
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
@@ -43,7 +51,7 @@ jobs:
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
@@ -52,3 +60,4 @@ jobs:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
provenance: false
|
||||
+6
-1
@@ -156,4 +156,9 @@ data/.env
|
||||
/cloc-1.64.exe
|
||||
|
||||
# Ignore node_modules
|
||||
node_modules/
|
||||
node_modules/
|
||||
|
||||
|
||||
AGENTS.md
|
||||
|
||||
dist/
|
||||
@@ -12,7 +12,7 @@ from core.settings import settings
|
||||
from apps.admin.services import FileService, ConfigService, LocalFileService
|
||||
|
||||
|
||||
def create_token(data: dict, expires_in: int = 3600 * 24) -> str:
|
||||
def create_token(data: dict, expires_in: int = 3600 * 24 * 30) -> str:
|
||||
"""
|
||||
创建JWT token
|
||||
:param data: 数据负载
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import datetime
|
||||
from typing import Optional
|
||||
from typing import Optional, Union
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
@@ -26,5 +27,5 @@ class UpdateFileData(BaseModel):
|
||||
code: Optional[str] = None
|
||||
prefix: Optional[str] = None
|
||||
suffix: Optional[str] = None
|
||||
expired_at: Optional[datetime.datetime] = None
|
||||
expired_at: Optional[Union[datetime.datetime, str]] = None
|
||||
expired_count: Optional[int] = None
|
||||
@@ -123,10 +123,14 @@ class LocalFileClass:
|
||||
def __init__(self, file):
|
||||
self.file = file
|
||||
self.path = data_root / "local" / file
|
||||
self.ctime = time.strftime(
|
||||
"%Y-%m-%d %H:%M:%S", time.localtime(os.path.getctime(self.path))
|
||||
)
|
||||
self.size = os.path.getsize(self.path)
|
||||
if os.path.exists(self.path):
|
||||
self.ctime = time.strftime(
|
||||
"%Y-%m-%d %H:%M:%S", time.localtime(os.path.getctime(self.path))
|
||||
)
|
||||
self.size = os.path.getsize(self.path)
|
||||
else:
|
||||
self.ctime = None
|
||||
self.size = None
|
||||
|
||||
async def read(self):
|
||||
return open(self.path, "rb")
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@ async def update_file(
|
||||
update_data["prefix"] = data.prefix
|
||||
if data.suffix is not None and data.suffix != file_code.suffix:
|
||||
update_data["suffix"] = data.suffix
|
||||
if data.expired_at is not None and data.expired_at != file_code.expired_at:
|
||||
if data.expired_at is not None and data.expired_at != "" and data.expired_at != file_code.expired_at:
|
||||
update_data["expired_at"] = data.expired_at
|
||||
if data.expired_count is not None and data.expired_count != file_code.expired_count:
|
||||
update_data["expired_count"] = data.expired_count
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
from tortoise import connections
|
||||
|
||||
|
||||
async def create_presign_upload_session_table():
|
||||
conn = connections.get("default")
|
||||
await conn.execute_script(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS presignuploadsession (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
upload_id VARCHAR(36) NOT NULL UNIQUE,
|
||||
file_name VARCHAR(255) NOT NULL,
|
||||
file_size BIGINT NOT NULL,
|
||||
save_path VARCHAR(512) NOT NULL,
|
||||
mode VARCHAR(10) NOT NULL,
|
||||
expire_value INT NOT NULL DEFAULT 1,
|
||||
expire_style VARCHAR(20) NOT NULL DEFAULT 'day',
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
expires_at TIMESTAMP NOT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_presignuploadsession_upload_id ON presignuploadsession (upload_id);
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
async def migrate():
|
||||
await create_presign_upload_session_table()
|
||||
@@ -64,6 +64,25 @@ class KeyValue(Model):
|
||||
)
|
||||
|
||||
|
||||
class PresignUploadSession(models.Model):
|
||||
"""预签名上传会话模型"""
|
||||
id = fields.IntField(pk=True)
|
||||
upload_id = fields.CharField(max_length=36, unique=True, index=True)
|
||||
file_name = fields.CharField(max_length=255)
|
||||
file_size = fields.BigIntField()
|
||||
save_path = fields.CharField(max_length=512)
|
||||
mode = fields.CharField(max_length=10) # "direct" 或 "proxy"
|
||||
expire_value = fields.IntField(default=1)
|
||||
expire_style = fields.CharField(max_length=20, default="day")
|
||||
created_at = fields.DatetimeField(auto_now_add=True)
|
||||
expires_at = fields.DatetimeField() # 会话过期时间
|
||||
|
||||
async def is_expired(self):
|
||||
"""检查会话是否已过期"""
|
||||
return self.expires_at < await get_now()
|
||||
|
||||
|
||||
file_codes_pydantic = pydantic_model_creator(FileCodes, name="FileCodes")
|
||||
upload_chunk_pydantic = pydantic_model_creator(UploadChunk, name="UploadChunk")
|
||||
key_value_pydantic = pydantic_model_creator(KeyValue, name="KeyValue")
|
||||
presign_upload_session_pydantic = pydantic_model_creator(PresignUploadSession, name="PresignUploadSession")
|
||||
@@ -1,4 +1,5 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class SelectFileModel(BaseModel):
|
||||
@@ -15,3 +16,21 @@ class InitChunkUploadModel(BaseModel):
|
||||
class CompleteUploadModel(BaseModel):
|
||||
expire_value: int
|
||||
expire_style: str
|
||||
|
||||
|
||||
# 预签名上传相关模型
|
||||
class PresignUploadInitRequest(BaseModel):
|
||||
"""预签名上传初始化请求"""
|
||||
file_name: str
|
||||
file_size: int
|
||||
expire_value: int = 1
|
||||
expire_style: str = "day"
|
||||
|
||||
|
||||
class PresignUploadInitResponse(BaseModel):
|
||||
"""预签名上传初始化响应"""
|
||||
upload_id: str
|
||||
upload_url: str
|
||||
mode: str # "direct" 或 "proxy"
|
||||
save_path: str
|
||||
expires_in: int # URL过期时间(秒)
|
||||
+2
-2
@@ -109,6 +109,6 @@ async def calculate_file_hash(file: UploadFile, chunk_size=1024 * 1024) -> str:
|
||||
|
||||
|
||||
ip_limit = {
|
||||
"error": IPRateLimit(count=settings.uploadCount, minutes=settings.errorMinute),
|
||||
"upload": IPRateLimit(count=settings.errorCount, minutes=settings.errorMinute),
|
||||
"error": IPRateLimit(count=settings.errorCount, minutes=settings.errorMinute),
|
||||
"upload": IPRateLimit(count=settings.uploadCount, minutes=settings.uploadMinute),
|
||||
}
|
||||
+381
-41
@@ -1,27 +1,83 @@
|
||||
import datetime
|
||||
import hashlib
|
||||
import os
|
||||
import uuid
|
||||
from datetime import timedelta
|
||||
from urllib.parse import unquote
|
||||
|
||||
from fastapi import APIRouter, Form, UploadFile, File, Depends, HTTPException
|
||||
from starlette import status
|
||||
|
||||
from apps.admin.dependencies import share_required_login
|
||||
from apps.base.models import FileCodes, UploadChunk
|
||||
from apps.base.schemas import SelectFileModel, InitChunkUploadModel, CompleteUploadModel
|
||||
from apps.base.models import FileCodes, UploadChunk, PresignUploadSession
|
||||
from apps.base.schemas import SelectFileModel, InitChunkUploadModel, CompleteUploadModel, PresignUploadInitRequest
|
||||
from apps.base.utils import get_expire_info, get_file_path_name, ip_limit, get_chunk_file_path_name
|
||||
from core.response import APIResponse
|
||||
from core.settings import settings
|
||||
from core.storage import storages, FileStorageInterface
|
||||
from core.utils import get_select_token
|
||||
from core.utils import get_select_token, get_now, sanitize_filename
|
||||
|
||||
share_api = APIRouter(prefix="/share", tags=["分享"])
|
||||
|
||||
|
||||
async def validate_file_size(file: UploadFile, max_size: int):
|
||||
if file.size > max_size:
|
||||
# ============ 公共服务层 ============
|
||||
class FileUploadService:
|
||||
"""统一的文件上传服务"""
|
||||
|
||||
@staticmethod
|
||||
async def generate_file_path(file_name: str, upload_id: str = None) -> tuple[str, str, str, str, str]:
|
||||
"""统一的路径生成"""
|
||||
today = datetime.datetime.now()
|
||||
storage_path = settings.storage_path.strip("/")
|
||||
file_uuid = upload_id or uuid.uuid4().hex
|
||||
filename = await sanitize_filename(unquote(file_name))
|
||||
base_path = f"share/data/{today.strftime('%Y/%m/%d')}/{file_uuid}"
|
||||
path = f"{storage_path}/{base_path}" if storage_path else base_path
|
||||
prefix, suffix = os.path.splitext(filename)
|
||||
save_path = f"{path}/{filename}"
|
||||
return path, suffix, prefix, filename, save_path
|
||||
|
||||
@staticmethod
|
||||
async def create_file_record(
|
||||
file_name: str,
|
||||
file_size: int,
|
||||
file_path: str,
|
||||
expire_value: int,
|
||||
expire_style: str,
|
||||
**extra_fields
|
||||
) -> str:
|
||||
"""统一创建FileCodes记录,返回code"""
|
||||
expired_at, expired_count, used_count, code = await get_expire_info(expire_value, expire_style)
|
||||
prefix, suffix = os.path.splitext(file_name)
|
||||
|
||||
await FileCodes.create(
|
||||
code=code,
|
||||
prefix=prefix,
|
||||
suffix=suffix,
|
||||
uuid_file_name=file_name,
|
||||
file_path=file_path,
|
||||
size=file_size,
|
||||
expired_at=expired_at,
|
||||
expired_count=expired_count,
|
||||
used_count=used_count,
|
||||
**extra_fields
|
||||
)
|
||||
return code
|
||||
|
||||
|
||||
async def validate_file_size(file: UploadFile, max_size: int) -> int:
|
||||
size = file.size
|
||||
if size is None:
|
||||
# 读取流计算大小,保持指针复位
|
||||
await file.seek(0, 2)
|
||||
size = file.file.tell()
|
||||
await file.seek(0)
|
||||
if size > max_size:
|
||||
max_size_mb = max_size / (1024 * 1024)
|
||||
raise HTTPException(
|
||||
status_code=403, detail=f"大小超过限制,最大为{max_size_mb:.2f} MB"
|
||||
)
|
||||
return size
|
||||
|
||||
|
||||
async def create_file_code(code, **kwargs):
|
||||
@@ -63,7 +119,7 @@ async def share_file(
|
||||
file: UploadFile = File(...),
|
||||
ip: str = Depends(ip_limit["upload"]),
|
||||
):
|
||||
await validate_file_size(file, settings.uploadSize)
|
||||
file_size = await validate_file_size(file, settings.uploadSize)
|
||||
if expire_style not in settings.expireStyle:
|
||||
raise HTTPException(status_code=400, detail="过期时间类型错误")
|
||||
expired_at, expired_count, used_count, code = await get_expire_info(expire_value, expire_style)
|
||||
@@ -76,7 +132,7 @@ async def share_file(
|
||||
suffix=suffix,
|
||||
uuid_file_name=uuid_file_name,
|
||||
file_path=path,
|
||||
size=file.size,
|
||||
size=file_size,
|
||||
expired_at=expired_at,
|
||||
expired_count=expired_count,
|
||||
used_count=used_count,
|
||||
@@ -141,6 +197,7 @@ async def download_file(key: str, code: str, ip: str = Depends(ip_limit["error"]
|
||||
file_storage: FileStorageInterface = storages[settings.file_storage]()
|
||||
if await get_select_token(code) != key:
|
||||
ip_limit["error"].add_ip(ip)
|
||||
raise HTTPException(status_code=403, detail="下载鉴权失败")
|
||||
has, file_code = await get_code_file_by_code(code, False)
|
||||
if not has:
|
||||
return APIResponse(code=404, detail="文件不存在")
|
||||
@@ -156,6 +213,16 @@ chunk_api = APIRouter(prefix="/chunk", tags=["切片"])
|
||||
|
||||
@chunk_api.post("/upload/init/", dependencies=[Depends(share_required_login)])
|
||||
async def init_chunk_upload(data: InitChunkUploadModel):
|
||||
# 服务端校验:根据 total_chunks * chunk_size 计算理论最大上传量
|
||||
total_chunks = (data.file_size + data.chunk_size - 1) // data.chunk_size
|
||||
max_possible_size = total_chunks * data.chunk_size
|
||||
if max_possible_size > settings.uploadSize:
|
||||
max_size_mb = settings.uploadSize / (1024 * 1024)
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail=f"文件大小超过限制,最大为 {max_size_mb:.2f} MB"
|
||||
)
|
||||
|
||||
# # 秒传检查
|
||||
# existing = await FileCodes.filter(file_hash=data.file_hash).first()
|
||||
# if existing:
|
||||
@@ -171,9 +238,30 @@ async def init_chunk_upload(data: InitChunkUploadModel):
|
||||
# "name": f'{existing.prefix}{existing.suffix}'
|
||||
# })
|
||||
|
||||
# 创建上传会话
|
||||
# 断点续传:检查是否存在相同文件的未完成上传会话
|
||||
existing_session = await UploadChunk.filter(
|
||||
chunk_hash=data.file_hash,
|
||||
chunk_index=-1,
|
||||
file_size=data.file_size,
|
||||
file_name=data.file_name,
|
||||
).first()
|
||||
|
||||
if existing_session:
|
||||
# 复用已有会话,获取已上传的分片列表
|
||||
uploaded_chunks = await UploadChunk.filter(
|
||||
upload_id=existing_session.upload_id,
|
||||
completed=True
|
||||
).values_list('chunk_index', flat=True)
|
||||
return APIResponse(detail={
|
||||
"existed": False,
|
||||
"upload_id": existing_session.upload_id,
|
||||
"chunk_size": existing_session.chunk_size,
|
||||
"total_chunks": existing_session.total_chunks,
|
||||
"uploaded_chunks": list(uploaded_chunks)
|
||||
})
|
||||
|
||||
# 创建新的上传会话
|
||||
upload_id = uuid.uuid4().hex
|
||||
total_chunks = (data.file_size + data.chunk_size - 1) // data.chunk_size
|
||||
await UploadChunk.create(
|
||||
upload_id=upload_id,
|
||||
chunk_index=-1,
|
||||
@@ -183,17 +271,12 @@ async def init_chunk_upload(data: InitChunkUploadModel):
|
||||
chunk_hash=data.file_hash,
|
||||
file_name=data.file_name,
|
||||
)
|
||||
# 获取已上传的分片列表
|
||||
uploaded_chunks = await UploadChunk.filter(
|
||||
upload_id=upload_id,
|
||||
completed=True
|
||||
).values_list('chunk_index', flat=True)
|
||||
return APIResponse(detail={
|
||||
"existed": False,
|
||||
"upload_id": upload_id,
|
||||
"chunk_size": data.chunk_size,
|
||||
"total_chunks": total_chunks,
|
||||
"uploaded_chunks": uploaded_chunks
|
||||
"uploaded_chunks": []
|
||||
})
|
||||
|
||||
|
||||
@@ -212,11 +295,53 @@ async def upload_chunk(
|
||||
if chunk_index < 0 or chunk_index >= chunk_info.total_chunks:
|
||||
raise HTTPException(status.HTTP_400_BAD_REQUEST, detail="无效的分片索引")
|
||||
|
||||
# 检查是否已上传(支持断点续传)
|
||||
existing_chunk = await UploadChunk.filter(
|
||||
upload_id=upload_id,
|
||||
chunk_index=chunk_index,
|
||||
completed=True
|
||||
).first()
|
||||
if existing_chunk:
|
||||
return APIResponse(detail={"chunk_hash": existing_chunk.chunk_hash, "skipped": True})
|
||||
|
||||
# 读取分片数据并计算哈希
|
||||
chunk_data = await chunk.read()
|
||||
chunk_size = len(chunk_data)
|
||||
|
||||
# 校验分片大小不超过声明的 chunk_size
|
||||
if chunk_size > chunk_info.chunk_size:
|
||||
raise HTTPException(
|
||||
status.HTTP_400_BAD_REQUEST,
|
||||
detail=f"分片大小超过声明值: 最大 {chunk_info.chunk_size}, 实际 {chunk_size}"
|
||||
)
|
||||
|
||||
# 计算已上传分片数,校验累计大小不超限(用分片数 * chunk_size 估算)
|
||||
uploaded_count = await UploadChunk.filter(
|
||||
upload_id=upload_id,
|
||||
completed=True
|
||||
).count()
|
||||
# 已上传分片的最大可能大小 + 当前分片
|
||||
max_uploaded_size = uploaded_count * chunk_info.chunk_size + chunk_size
|
||||
if max_uploaded_size > settings.uploadSize:
|
||||
max_size_mb = settings.uploadSize / (1024 * 1024)
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail=f"累计上传大小超过限制,最大为 {max_size_mb:.2f} MB"
|
||||
)
|
||||
|
||||
chunk_hash = hashlib.sha256(chunk_data).hexdigest()
|
||||
|
||||
# 更新或创建分片记录
|
||||
# 获取文件路径
|
||||
_, _, _, _, save_path = await get_chunk_file_path_name(chunk_info.file_name, upload_id)
|
||||
|
||||
# 保存分片到存储
|
||||
storage = storages[settings.file_storage]()
|
||||
try:
|
||||
await storage.save_chunk(upload_id, chunk_index, chunk_data, chunk_hash, save_path)
|
||||
except Exception as e:
|
||||
raise HTTPException(status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"分片保存失败: {str(e)}")
|
||||
|
||||
# 更新或创建分片记录(保存成功后再记录)
|
||||
await UploadChunk.update_or_create(
|
||||
upload_id=upload_id,
|
||||
chunk_index=chunk_index,
|
||||
@@ -229,12 +354,55 @@ async def upload_chunk(
|
||||
'file_name': chunk_info.file_name
|
||||
}
|
||||
)
|
||||
return APIResponse(detail={"chunk_hash": chunk_hash})
|
||||
|
||||
|
||||
@chunk_api.delete("/upload/{upload_id}", dependencies=[Depends(share_required_login)])
|
||||
async def cancel_upload(upload_id: str):
|
||||
"""取消上传并清理临时文件"""
|
||||
chunk_info = await UploadChunk.filter(upload_id=upload_id, chunk_index=-1).first()
|
||||
if not chunk_info:
|
||||
raise HTTPException(status.HTTP_404_NOT_FOUND, detail="上传会话不存在")
|
||||
|
||||
# 获取文件路径
|
||||
_, _, _, _, save_path = await get_chunk_file_path_name(chunk_info.file_name, upload_id)
|
||||
# 保存分片到存储
|
||||
|
||||
# 清理存储中的临时文件
|
||||
storage = storages[settings.file_storage]()
|
||||
await storage.save_chunk(upload_id, chunk_index, chunk_data, chunk_hash, save_path)
|
||||
return APIResponse(detail={"chunk_hash": chunk_hash})
|
||||
try:
|
||||
await storage.clean_chunks(upload_id, save_path)
|
||||
except Exception as e:
|
||||
# 记录错误但不阻止删除数据库记录
|
||||
pass
|
||||
|
||||
# 清理数据库记录
|
||||
await UploadChunk.filter(upload_id=upload_id).delete()
|
||||
|
||||
return APIResponse(detail={"message": "上传已取消"})
|
||||
|
||||
|
||||
@chunk_api.get("/upload/status/{upload_id}", dependencies=[Depends(share_required_login)])
|
||||
async def get_upload_status(upload_id: str):
|
||||
"""获取上传状态"""
|
||||
chunk_info = await UploadChunk.filter(upload_id=upload_id, chunk_index=-1).first()
|
||||
if not chunk_info:
|
||||
raise HTTPException(status.HTTP_404_NOT_FOUND, detail="上传会话不存在")
|
||||
|
||||
# 获取已上传的分片列表
|
||||
uploaded_chunks = await UploadChunk.filter(
|
||||
upload_id=upload_id,
|
||||
completed=True
|
||||
).values_list('chunk_index', flat=True)
|
||||
|
||||
return APIResponse(detail={
|
||||
"upload_id": upload_id,
|
||||
"file_name": chunk_info.file_name,
|
||||
"file_size": chunk_info.file_size,
|
||||
"chunk_size": chunk_info.chunk_size,
|
||||
"total_chunks": chunk_info.total_chunks,
|
||||
"uploaded_chunks": list(uploaded_chunks),
|
||||
"progress": len(uploaded_chunks) / chunk_info.total_chunks * 100
|
||||
})
|
||||
|
||||
|
||||
@chunk_api.post("/upload/complete/{upload_id}", dependencies=[Depends(share_required_login)])
|
||||
@@ -246,32 +414,204 @@ async def complete_upload(upload_id: str, data: CompleteUploadModel, ip: str = D
|
||||
|
||||
storage = storages[settings.file_storage]()
|
||||
# 验证所有分片
|
||||
completed_chunks = await UploadChunk.filter(
|
||||
completed_chunks_list = await UploadChunk.filter(
|
||||
upload_id=upload_id,
|
||||
completed=True
|
||||
).count()
|
||||
if completed_chunks != chunk_info.total_chunks:
|
||||
).all()
|
||||
if len(completed_chunks_list) != chunk_info.total_chunks:
|
||||
raise HTTPException(status.HTTP_400_BAD_REQUEST, detail="分片不完整")
|
||||
|
||||
# 用分片数 * chunk_size 校验最大可能大小
|
||||
max_total_size = len(completed_chunks_list) * chunk_info.chunk_size
|
||||
if max_total_size > settings.uploadSize:
|
||||
# 清理已上传的分片
|
||||
_, _, _, _, save_path = await get_chunk_file_path_name(chunk_info.file_name, upload_id)
|
||||
try:
|
||||
await storage.clean_chunks(upload_id, save_path)
|
||||
except Exception:
|
||||
pass
|
||||
await UploadChunk.filter(upload_id=upload_id).delete()
|
||||
max_size_mb = settings.uploadSize / (1024 * 1024)
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail=f"实际上传大小超过限制,最大为 {max_size_mb:.2f} MB"
|
||||
)
|
||||
|
||||
# 获取文件路径
|
||||
path, suffix, prefix, _, save_path = await get_chunk_file_path_name(chunk_info.file_name, upload_id)
|
||||
# 合并文件并计算哈希
|
||||
await storage.merge_chunks(upload_id, chunk_info, save_path)
|
||||
# 创建文件记录
|
||||
expired_at, expired_count, used_count, code = await get_expire_info(data.expire_value, data.expire_style)
|
||||
await FileCodes.create(
|
||||
code=code,
|
||||
file_hash=chunk_info.chunk_hash,
|
||||
is_chunked=True,
|
||||
|
||||
try:
|
||||
# 合并文件并计算哈希
|
||||
_, file_hash = await storage.merge_chunks(upload_id, chunk_info, save_path)
|
||||
# 创建文件记录
|
||||
expired_at, expired_count, used_count, code = await get_expire_info(data.expire_value, data.expire_style)
|
||||
await FileCodes.create(
|
||||
code=code,
|
||||
file_hash=file_hash, # 使用合并后计算的哈希
|
||||
is_chunked=True,
|
||||
upload_id=upload_id,
|
||||
size=chunk_info.file_size,
|
||||
expired_at=expired_at,
|
||||
expired_count=expired_count,
|
||||
used_count=used_count,
|
||||
file_path=path,
|
||||
uuid_file_name=f"{prefix}{suffix}",
|
||||
prefix=prefix,
|
||||
suffix=suffix
|
||||
)
|
||||
# 清理临时文件
|
||||
await storage.clean_chunks(upload_id, save_path)
|
||||
# 清理数据库中的分片记录
|
||||
await UploadChunk.filter(upload_id=upload_id).delete()
|
||||
ip_limit["upload"].add_ip(ip)
|
||||
return APIResponse(detail={"code": code, "name": chunk_info.file_name})
|
||||
except ValueError as e:
|
||||
raise HTTPException(status.HTTP_400_BAD_REQUEST, detail=str(e))
|
||||
except Exception as e:
|
||||
# 合并失败时清理临时文件
|
||||
try:
|
||||
await storage.clean_chunks(upload_id, save_path)
|
||||
except Exception:
|
||||
pass
|
||||
raise HTTPException(status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"文件合并失败: {str(e)}")
|
||||
|
||||
|
||||
# ============ 预签名上传API ============
|
||||
presign_api = APIRouter(prefix="/presign", tags=["预签名上传"])
|
||||
|
||||
PRESIGN_SESSION_EXPIRES = 900 # 15分钟
|
||||
|
||||
|
||||
async def _get_valid_session(upload_id: str, expected_mode: str = None) -> PresignUploadSession:
|
||||
"""获取并验证会话"""
|
||||
session = await PresignUploadSession.filter(upload_id=upload_id).first()
|
||||
if not session:
|
||||
raise HTTPException(404, "上传会话不存在")
|
||||
if await session.is_expired():
|
||||
await session.delete()
|
||||
raise HTTPException(404, "上传会话已过期")
|
||||
if expected_mode and session.mode != expected_mode:
|
||||
raise HTTPException(400, f"此会话不支持{expected_mode}模式")
|
||||
return session
|
||||
|
||||
|
||||
@presign_api.post("/upload/init", dependencies=[Depends(share_required_login)])
|
||||
async def presign_upload_init(data: PresignUploadInitRequest, ip: str = Depends(ip_limit["upload"])):
|
||||
"""初始化预签名上传,S3返回直传URL,其他存储返回代理URL"""
|
||||
if data.file_size > settings.uploadSize:
|
||||
raise HTTPException(403, f"文件大小超过限制,最大为 {settings.uploadSize / (1024*1024):.2f} MB")
|
||||
if data.expire_style not in settings.expireStyle:
|
||||
raise HTTPException(400, "过期时间类型错误")
|
||||
|
||||
upload_id = uuid.uuid4().hex
|
||||
path, _, _, filename, save_path = await FileUploadService.generate_file_path(data.file_name, upload_id)
|
||||
|
||||
storage: FileStorageInterface = storages[settings.file_storage]()
|
||||
presigned_url = await storage.generate_presigned_upload_url(save_path, PRESIGN_SESSION_EXPIRES)
|
||||
|
||||
mode = "direct" if presigned_url else "proxy"
|
||||
upload_url = presigned_url or f"/api/presign/upload/proxy/{upload_id}"
|
||||
|
||||
await PresignUploadSession.create(
|
||||
upload_id=upload_id,
|
||||
size=chunk_info.file_size,
|
||||
expired_at=expired_at,
|
||||
expired_count=expired_count,
|
||||
used_count=used_count,
|
||||
file_path=path,
|
||||
uuid_file_name=f"{prefix}{suffix}",
|
||||
prefix=prefix,
|
||||
suffix=suffix
|
||||
file_name=filename,
|
||||
file_size=data.file_size,
|
||||
save_path=save_path,
|
||||
mode=mode,
|
||||
expire_value=data.expire_value,
|
||||
expire_style=data.expire_style,
|
||||
expires_at=await get_now() + timedelta(seconds=PRESIGN_SESSION_EXPIRES),
|
||||
)
|
||||
# 清理临时文件
|
||||
await storage.clean_chunks(upload_id, save_path)
|
||||
return APIResponse(detail={"code": code, "name": chunk_info.file_name})
|
||||
|
||||
ip_limit["upload"].add_ip(ip)
|
||||
return APIResponse(detail={
|
||||
"upload_id": upload_id,
|
||||
"upload_url": upload_url,
|
||||
"mode": mode,
|
||||
"expires_in": PRESIGN_SESSION_EXPIRES,
|
||||
})
|
||||
|
||||
|
||||
@presign_api.put("/upload/proxy/{upload_id}", dependencies=[Depends(share_required_login)])
|
||||
async def presign_upload_proxy(upload_id: str, file: UploadFile = File(...), ip: str = Depends(ip_limit["upload"])):
|
||||
"""代理模式上传,服务器转存到存储后端"""
|
||||
session = await _get_valid_session(upload_id, expected_mode="proxy")
|
||||
|
||||
file_size = await validate_file_size(file, settings.uploadSize)
|
||||
if abs(file_size - session.file_size) > 1024:
|
||||
raise HTTPException(400, "文件大小与声明不符")
|
||||
|
||||
storage: FileStorageInterface = storages[settings.file_storage]()
|
||||
try:
|
||||
await storage.save_file(file, session.save_path)
|
||||
except Exception as e:
|
||||
raise HTTPException(500, f"文件保存失败: {str(e)}")
|
||||
|
||||
code = await FileUploadService.create_file_record(
|
||||
session.file_name, file_size, os.path.dirname(session.save_path),
|
||||
session.expire_value, session.expire_style
|
||||
)
|
||||
|
||||
await session.delete()
|
||||
ip_limit["upload"].add_ip(ip)
|
||||
return APIResponse(detail={"code": code, "name": session.file_name})
|
||||
|
||||
|
||||
@presign_api.post("/upload/confirm/{upload_id}", dependencies=[Depends(share_required_login)])
|
||||
async def presign_upload_confirm(upload_id: str, ip: str = Depends(ip_limit["upload"])):
|
||||
"""直传确认,客户端完成S3直传后调用获取分享码"""
|
||||
session = await _get_valid_session(upload_id, expected_mode="direct")
|
||||
|
||||
storage: FileStorageInterface = storages[settings.file_storage]()
|
||||
if not await storage.file_exists(session.save_path):
|
||||
raise HTTPException(404, "文件未上传或上传失败")
|
||||
|
||||
code = await FileUploadService.create_file_record(
|
||||
session.file_name, session.file_size, os.path.dirname(session.save_path),
|
||||
session.expire_value, session.expire_style
|
||||
)
|
||||
|
||||
await session.delete()
|
||||
ip_limit["upload"].add_ip(ip)
|
||||
return APIResponse(detail={"code": code, "name": session.file_name})
|
||||
|
||||
|
||||
@presign_api.get("/upload/status/{upload_id}", dependencies=[Depends(share_required_login)])
|
||||
async def presign_upload_status(upload_id: str):
|
||||
"""查询上传会话状态"""
|
||||
session = await PresignUploadSession.filter(upload_id=upload_id).first()
|
||||
if not session:
|
||||
raise HTTPException(404, "上传会话不存在")
|
||||
|
||||
return APIResponse(detail={
|
||||
"upload_id": session.upload_id,
|
||||
"file_name": session.file_name,
|
||||
"file_size": session.file_size,
|
||||
"mode": session.mode,
|
||||
"created_at": session.created_at.isoformat(),
|
||||
"expires_at": session.expires_at.isoformat(),
|
||||
"is_expired": await session.is_expired(),
|
||||
})
|
||||
|
||||
|
||||
@presign_api.delete("/upload/{upload_id}", dependencies=[Depends(share_required_login)])
|
||||
async def presign_upload_cancel(upload_id: str):
|
||||
"""取消上传会话"""
|
||||
session = await PresignUploadSession.filter(upload_id=upload_id).first()
|
||||
if not session:
|
||||
raise HTTPException(404, "上传会话不存在")
|
||||
|
||||
if session.mode == "direct":
|
||||
storage: FileStorageInterface = storages[settings.file_storage]()
|
||||
try:
|
||||
if await storage.file_exists(session.save_path):
|
||||
temp_file_code = FileCodes(
|
||||
file_path=os.path.dirname(session.save_path),
|
||||
uuid_file_name=os.path.basename(session.save_path),
|
||||
)
|
||||
await storage.delete_file(temp_file_code)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
await session.delete()
|
||||
return APIResponse(detail={"message": "上传会话已取消"})
|
||||
+3
-2
@@ -35,7 +35,6 @@ DEFAULT_CONFIG = {
|
||||
"onedrive_password": "",
|
||||
"onedrive_root_path": "filebox_storage",
|
||||
"onedrive_proxy": 0,
|
||||
"webdav_hostname": "",
|
||||
"webdav_root_path": "filebox_storage",
|
||||
"webdav_proxy": 0,
|
||||
"admin_token": "FileCodeBox2023",
|
||||
@@ -67,7 +66,9 @@ DEFAULT_CONFIG = {
|
||||
"themesSelect": "themes/2024",
|
||||
"errorMinute": 1,
|
||||
"errorCount": 1,
|
||||
"port": 12345,
|
||||
"serverWorkers": 1,
|
||||
"serverHost": "0.0.0.0",
|
||||
"serverPort": 12345,
|
||||
"showAdminAddr": 0,
|
||||
"robotsText": "User-agent: *\nDisallow: /",
|
||||
}
|
||||
|
||||
+436
-131
@@ -27,14 +27,6 @@ from fastapi.responses import FileResponse
|
||||
|
||||
|
||||
class FileStorageInterface:
|
||||
_instance: Optional["FileStorageInterface"] = None
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
if cls._instance is None:
|
||||
cls._instance = super(FileStorageInterface, cls).__new__(
|
||||
cls, *args, **kwargs
|
||||
)
|
||||
return cls._instance
|
||||
|
||||
async def save_file(self, file: UploadFile, save_path: str):
|
||||
"""
|
||||
@@ -87,6 +79,23 @@ class FileStorageInterface:
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
async def generate_presigned_upload_url(self, save_path: str, expires_in: int = 900) -> Optional[str]:
|
||||
"""
|
||||
生成预签名上传URL
|
||||
:param save_path: 文件保存路径
|
||||
:param expires_in: URL过期时间(秒),默认15分钟
|
||||
:return: 预签名URL,如果不支持直传则返回None
|
||||
"""
|
||||
return None # 默认不支持直传,使用代理模式
|
||||
|
||||
async def file_exists(self, save_path: str) -> bool:
|
||||
"""
|
||||
检查文件是否存在
|
||||
:param save_path: 文件路径
|
||||
:return: 文件是否存在
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
async def clean_chunks(self, upload_id: str, save_path: str):
|
||||
"""
|
||||
清理临时分片文件
|
||||
@@ -152,11 +161,20 @@ class SystemFileStorage(FileStorageInterface):
|
||||
:param save_path: 文件保存路径
|
||||
"""
|
||||
chunk_dir = self.root_path / save_path
|
||||
chunk_path = chunk_dir.parent / 'chunks' / f"{chunk_index}.part"
|
||||
chunk_path = chunk_dir.parent / 'chunks' / upload_id / f"{chunk_index}.part"
|
||||
if not chunk_path.parent.exists():
|
||||
chunk_path.parent.mkdir(parents=True)
|
||||
async with aiofiles.open(chunk_path, "wb") as f:
|
||||
await f.write(chunk_data)
|
||||
chunk_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
# 使用临时文件写入,确保原子性
|
||||
temp_path = chunk_path.with_suffix('.tmp')
|
||||
try:
|
||||
async with aiofiles.open(temp_path, "wb") as f:
|
||||
await f.write(chunk_data)
|
||||
# 原子重命名
|
||||
temp_path.rename(chunk_path)
|
||||
except Exception as e:
|
||||
if temp_path.exists():
|
||||
temp_path.unlink()
|
||||
raise e
|
||||
|
||||
async def merge_chunks(self, upload_id: str, chunk_info: UploadChunk, save_path: str) -> tuple[str, str]:
|
||||
"""
|
||||
@@ -166,22 +184,37 @@ class SystemFileStorage(FileStorageInterface):
|
||||
:param save_path: 文件保存路径
|
||||
:return: (文件路径, 文件哈希值)
|
||||
"""
|
||||
output_dir = self.root_path / save_path
|
||||
output_dir.parent.mkdir(parents=True, exist_ok=True)
|
||||
output_path = self.root_path / save_path
|
||||
output_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
chunk_base_dir = output_path.parent / 'chunks' / upload_id
|
||||
file_sha256 = hashlib.sha256()
|
||||
async with aiofiles.open(output_dir, "wb") as out_file:
|
||||
for i in range(chunk_info.total_chunks):
|
||||
# 获取分片记录
|
||||
chunk_record = await UploadChunk.get(upload_id=upload_id, chunk_index=i)
|
||||
chunk_path = output_dir.parent / 'chunks' / f"{i}.part"
|
||||
async with aiofiles.open(chunk_path, "rb") as in_file:
|
||||
chunk_data = await in_file.read()
|
||||
current_hash = hashlib.sha256(chunk_data).hexdigest()
|
||||
if current_hash != chunk_record.chunk_hash:
|
||||
raise ValueError(f"分片{i}哈希不匹配")
|
||||
file_sha256.update(chunk_data)
|
||||
await out_file.write(chunk_data)
|
||||
return output_dir, file_sha256.hexdigest()
|
||||
|
||||
# 使用临时文件写入,确保原子性
|
||||
temp_output = output_path.with_suffix('.merging')
|
||||
try:
|
||||
async with aiofiles.open(temp_output, "wb") as out_file:
|
||||
for i in range(chunk_info.total_chunks):
|
||||
# 获取分片记录
|
||||
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
|
||||
if not chunk_record:
|
||||
raise ValueError(f"分片{i}记录不存在")
|
||||
chunk_path = chunk_base_dir / f"{i}.part"
|
||||
if not chunk_path.exists():
|
||||
raise ValueError(f"分片{i}文件不存在")
|
||||
async with aiofiles.open(chunk_path, "rb") as in_file:
|
||||
chunk_data = await in_file.read()
|
||||
current_hash = hashlib.sha256(chunk_data).hexdigest()
|
||||
if current_hash != chunk_record.chunk_hash:
|
||||
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
|
||||
file_sha256.update(chunk_data)
|
||||
await out_file.write(chunk_data)
|
||||
# 原子重命名
|
||||
temp_output.rename(output_path)
|
||||
except Exception as e:
|
||||
if temp_output.exists():
|
||||
temp_output.unlink()
|
||||
raise e
|
||||
return str(output_path), file_sha256.hexdigest()
|
||||
|
||||
async def clean_chunks(self, upload_id: str, save_path: str):
|
||||
"""
|
||||
@@ -189,9 +222,28 @@ class SystemFileStorage(FileStorageInterface):
|
||||
:param upload_id: 上传会话ID
|
||||
:param save_path: 文件保存路径
|
||||
"""
|
||||
chunk_dir = (self.root_path / save_path).parent / 'chunks'
|
||||
chunk_dir = (self.root_path / save_path).parent / 'chunks' / upload_id
|
||||
if chunk_dir.exists():
|
||||
shutil.rmtree(chunk_dir)
|
||||
try:
|
||||
shutil.rmtree(chunk_dir)
|
||||
except Exception as e:
|
||||
logger.info(f"清理本地分片目录失败: {e}")
|
||||
# 清理父级 chunks 目录(如果为空)
|
||||
chunks_parent = chunk_dir.parent
|
||||
if chunks_parent.exists() and not any(chunks_parent.iterdir()):
|
||||
try:
|
||||
chunks_parent.rmdir()
|
||||
except Exception as e:
|
||||
logger.info(f"清理 chunks 父目录失败: {e}")
|
||||
|
||||
async def file_exists(self, save_path: str) -> bool:
|
||||
"""
|
||||
检查文件是否存在于本地文件系统
|
||||
:param save_path: 文件路径
|
||||
:return: 文件是否存在
|
||||
"""
|
||||
file_path = self.root_path / save_path
|
||||
return file_path.exists()
|
||||
|
||||
|
||||
class S3FileStorage(FileStorageInterface):
|
||||
@@ -298,61 +350,77 @@ class S3FileStorage(FileStorageInterface):
|
||||
return result
|
||||
|
||||
async def save_chunk(self, upload_id: str, chunk_index: int, chunk_data: bytes, chunk_hash: str, save_path: str):
|
||||
chunk_key = str(Path(save_path).parent / "chunks" /
|
||||
upload_id / f"{chunk_index}.part")
|
||||
async with self.session.client('s3') as s3:
|
||||
response = await s3.upload_part(
|
||||
"""
|
||||
保存分片到 S3(使用独立对象存储每个分片)
|
||||
注意:这里不使用 S3 原生的 multipart upload,而是将每个分片作为独立对象存储
|
||||
"""
|
||||
chunk_key = str(Path(save_path).parent / "chunks" / upload_id / f"{chunk_index}.part")
|
||||
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=chunk_key,
|
||||
PartNumber=chunk_index + 1,
|
||||
UploadId=upload_id,
|
||||
Body=chunk_data
|
||||
)
|
||||
await s3.put_object_tagging(
|
||||
Bucket=self.bucket_name,
|
||||
Key=chunk_key,
|
||||
Tagging={
|
||||
'TagSet': [
|
||||
{'Key': 'ChunkHash', 'Value': chunk_hash},
|
||||
{'Key': 'ETag', 'Value': response['ETag']}
|
||||
]
|
||||
Body=chunk_data,
|
||||
Metadata={
|
||||
'chunk-hash': chunk_hash,
|
||||
'chunk-index': str(chunk_index)
|
||||
}
|
||||
)
|
||||
|
||||
async def merge_chunks(self, upload_id: str, chunk_info: UploadChunk, save_path: str) -> tuple[str, str]:
|
||||
"""
|
||||
合并 S3 上的分片文件
|
||||
由于分片是独立对象存储的,需要下载后合并再上传
|
||||
"""
|
||||
file_sha256 = hashlib.sha256()
|
||||
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
|
||||
async with self.session.client('s3') as s3:
|
||||
# 获取所有分片
|
||||
parts = await s3.list_parts(
|
||||
Bucket=self.bucket_name,
|
||||
Key=chunk_dir,
|
||||
UploadId=upload_id
|
||||
)
|
||||
part_list = []
|
||||
for part in parts['Parts']:
|
||||
part_number = part['PartNumber']
|
||||
chunk_index = part_number - 1
|
||||
chunk_record = await UploadChunk.get(upload_id=upload_id, chunk_index=chunk_index)
|
||||
response = await s3.get_object(
|
||||
Bucket=self.bucket_name,
|
||||
Key=f"{chunk_dir}/{chunk_index}.part",
|
||||
PartNumber=part_number
|
||||
)
|
||||
chunk_data = await response['Body'].read()
|
||||
merged_data = io.BytesIO()
|
||||
|
||||
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:
|
||||
# 按顺序读取并验证每个分片
|
||||
for i in range(chunk_info.total_chunks):
|
||||
chunk_key = f"{chunk_dir}/{i}.part"
|
||||
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
|
||||
if not chunk_record:
|
||||
raise ValueError(f"分片{i}记录不存在")
|
||||
|
||||
try:
|
||||
response = await s3.get_object(
|
||||
Bucket=self.bucket_name,
|
||||
Key=chunk_key
|
||||
)
|
||||
chunk_data = await response['Body'].read()
|
||||
except Exception as e:
|
||||
raise ValueError(f"分片{i}文件不存在: {e}")
|
||||
|
||||
current_hash = hashlib.sha256(chunk_data).hexdigest()
|
||||
if current_hash != chunk_record.chunk_hash:
|
||||
raise Exception(f"分片{chunk_index}哈希不匹配")
|
||||
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
|
||||
|
||||
file_sha256.update(chunk_data)
|
||||
part_list.append(
|
||||
{'PartNumber': part_number, 'ETag': part['ETag']})
|
||||
# 完成合并
|
||||
await s3.complete_multipart_upload(
|
||||
merged_data.write(chunk_data)
|
||||
|
||||
# 上传合并后的文件
|
||||
merged_data.seek(0)
|
||||
await s3.put_object(
|
||||
Bucket=self.bucket_name,
|
||||
Key=save_path,
|
||||
UploadId=upload_id,
|
||||
MultipartUpload={'Parts': part_list}
|
||||
Body=merged_data.getvalue(),
|
||||
ContentType='application/octet-stream'
|
||||
)
|
||||
|
||||
return save_path, file_sha256.hexdigest()
|
||||
|
||||
async def clean_chunks(self, upload_id: str, save_path: str):
|
||||
@@ -362,34 +430,69 @@ class S3FileStorage(FileStorageInterface):
|
||||
:param save_path: 文件保存路径
|
||||
"""
|
||||
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
|
||||
async with self.session.client('s3') as s3:
|
||||
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:
|
||||
try:
|
||||
# 终止未完成的分片上传会话
|
||||
await s3.abort_multipart_upload(
|
||||
Bucket=self.bucket_name,
|
||||
Key=chunk_dir,
|
||||
UploadId=upload_id
|
||||
)
|
||||
# 列出并删除所有分片对象
|
||||
paginator = s3.get_paginator('list_objects_v2')
|
||||
async for page in paginator.paginate(Bucket=self.bucket_name, Prefix=chunk_dir):
|
||||
objects = page.get('Contents', [])
|
||||
if objects:
|
||||
delete_objects = [{'Key': obj['Key']} for obj in objects]
|
||||
await s3.delete_objects(
|
||||
Bucket=self.bucket_name,
|
||||
Delete={'Objects': delete_objects}
|
||||
)
|
||||
except Exception as e:
|
||||
# 如果上传会话不存在或其他错误,忽略
|
||||
logger.info(f"清理 S3 分片时出错: {e}")
|
||||
|
||||
try:
|
||||
# 清理已上传的分片数据
|
||||
parts = await s3.list_parts(
|
||||
Bucket=self.bucket_name,
|
||||
Key=chunk_dir,
|
||||
UploadId=upload_id
|
||||
)
|
||||
for part in parts.get('Parts', []):
|
||||
await s3.delete_object(
|
||||
Bucket=self.bucket_name,
|
||||
Key=f"{chunk_dir}/{part['PartNumber'] - 1}.part"
|
||||
)
|
||||
except Exception as e:
|
||||
# 如果分片数据不存在或其他错误,忽略
|
||||
logger.info(f"清理 S3 分片数据时出错: {e}")
|
||||
|
||||
async def generate_presigned_upload_url(self, save_path: str, expires_in: int = 900) -> Optional[str]:
|
||||
"""
|
||||
生成S3预签名上传URL
|
||||
:param save_path: 文件保存路径
|
||||
:param expires_in: URL过期时间(秒),默认15分钟
|
||||
:return: 预签名PUT URL
|
||||
"""
|
||||
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:
|
||||
return await s3.generate_presigned_url(
|
||||
"put_object",
|
||||
Params={
|
||||
"Bucket": self.bucket_name,
|
||||
"Key": save_path,
|
||||
},
|
||||
ExpiresIn=expires_in,
|
||||
)
|
||||
|
||||
async def file_exists(self, save_path: str) -> bool:
|
||||
"""
|
||||
检查文件是否存在于S3
|
||||
:param save_path: 文件路径
|
||||
:return: 文件是否存在
|
||||
"""
|
||||
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:
|
||||
try:
|
||||
await s3.head_object(Bucket=self.bucket_name, Key=save_path)
|
||||
return True
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
class OneDriveFileStorage(FileStorageInterface):
|
||||
def __init__(self):
|
||||
@@ -526,6 +629,124 @@ class OneDriveFileStorage(FileStorageInterface):
|
||||
f"{file_code.prefix}{file_code.suffix}",
|
||||
)
|
||||
|
||||
def _save_chunk(self, chunk_path: str, chunk_data: bytes):
|
||||
"""同步保存分片到 OneDrive"""
|
||||
path_parts = chunk_path.replace("\\", "/").split("/")
|
||||
filename = path_parts[-1]
|
||||
dir_path = "/".join(path_parts[:-1])
|
||||
|
||||
# 确保目录存在
|
||||
current_folder = self.root_path
|
||||
for part in dir_path.split("/"):
|
||||
if part:
|
||||
try:
|
||||
current_folder = current_folder.get_by_path(part).get().execute_query()
|
||||
except self._ClientRequestException as e:
|
||||
if e.code == "itemNotFound":
|
||||
current_folder = current_folder.create_folder(part).execute_query()
|
||||
else:
|
||||
raise e
|
||||
|
||||
# 上传分片
|
||||
current_folder.upload(filename, chunk_data).execute_query()
|
||||
|
||||
async def save_chunk(self, upload_id: str, chunk_index: int, chunk_data: bytes, chunk_hash: str, save_path: str):
|
||||
"""保存分片到 OneDrive"""
|
||||
chunk_path = str(Path(save_path).parent / "chunks" / upload_id / f"{chunk_index}.part")
|
||||
await asyncio.to_thread(self._save_chunk, chunk_path, chunk_data)
|
||||
|
||||
def _read_chunk(self, chunk_path: str) -> bytes:
|
||||
"""同步读取分片"""
|
||||
path = self._get_path_str(chunk_path)
|
||||
file_obj = self.root_path.get_by_path(path).get().execute_query()
|
||||
return file_obj.get_content().execute_query().value
|
||||
|
||||
def _upload_merged(self, save_path: str, data: bytes):
|
||||
"""同步上传合并后的文件"""
|
||||
path_parts = save_path.replace("\\", "/").split("/")
|
||||
filename = path_parts[-1]
|
||||
dir_path = "/".join(path_parts[:-1])
|
||||
|
||||
# 确保目录存在
|
||||
current_folder = self.root_path
|
||||
for part in dir_path.split("/"):
|
||||
if part:
|
||||
try:
|
||||
current_folder = current_folder.get_by_path(part).get().execute_query()
|
||||
except self._ClientRequestException as e:
|
||||
if e.code == "itemNotFound":
|
||||
current_folder = current_folder.create_folder(part).execute_query()
|
||||
else:
|
||||
raise e
|
||||
|
||||
current_folder.upload(filename, data).execute_query()
|
||||
|
||||
async def merge_chunks(self, upload_id: str, chunk_info: UploadChunk, save_path: str) -> tuple[str, str]:
|
||||
"""合并 OneDrive 上的分片文件"""
|
||||
file_sha256 = hashlib.sha256()
|
||||
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
|
||||
merged_data = io.BytesIO()
|
||||
|
||||
for i in range(chunk_info.total_chunks):
|
||||
chunk_path = f"{chunk_dir}/{i}.part"
|
||||
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
|
||||
if not chunk_record:
|
||||
raise ValueError(f"分片{i}记录不存在")
|
||||
|
||||
try:
|
||||
chunk_data = await asyncio.to_thread(self._read_chunk, chunk_path)
|
||||
except Exception as e:
|
||||
raise ValueError(f"分片{i}文件不存在: {e}")
|
||||
|
||||
current_hash = hashlib.sha256(chunk_data).hexdigest()
|
||||
if current_hash != chunk_record.chunk_hash:
|
||||
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
|
||||
|
||||
file_sha256.update(chunk_data)
|
||||
merged_data.write(chunk_data)
|
||||
|
||||
# 上传合并后的文件
|
||||
merged_data.seek(0)
|
||||
await asyncio.to_thread(self._upload_merged, save_path, merged_data.getvalue())
|
||||
|
||||
return save_path, file_sha256.hexdigest()
|
||||
|
||||
def _delete_chunk_dir(self, chunk_dir: str):
|
||||
"""同步删除分片目录"""
|
||||
try:
|
||||
path = self._get_path_str(chunk_dir)
|
||||
self.root_path.get_by_path(path).delete_object().execute_query()
|
||||
except self._ClientRequestException as e:
|
||||
if e.code != "itemNotFound":
|
||||
raise e
|
||||
|
||||
async def clean_chunks(self, upload_id: str, save_path: str):
|
||||
"""清理 OneDrive 上的临时分片文件"""
|
||||
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
|
||||
try:
|
||||
await asyncio.to_thread(self._delete_chunk_dir, chunk_dir)
|
||||
except Exception as e:
|
||||
logger.info(f"清理 OneDrive 分片时出错: {e}")
|
||||
|
||||
def _file_exists(self, save_path: str) -> bool:
|
||||
"""同步检查文件是否存在"""
|
||||
try:
|
||||
path = self._get_path_str(save_path)
|
||||
self.root_path.get_by_path(path).get().execute_query()
|
||||
return True
|
||||
except self._ClientRequestException as e:
|
||||
if e.code == "itemNotFound":
|
||||
return False
|
||||
raise e
|
||||
|
||||
async def file_exists(self, save_path: str) -> bool:
|
||||
"""
|
||||
检查文件是否存在于OneDrive
|
||||
:param save_path: 文件路径
|
||||
:return: 文件是否存在
|
||||
"""
|
||||
return await asyncio.to_thread(self._file_exists, save_path)
|
||||
|
||||
|
||||
class OpenDALFileStorage(FileStorageInterface):
|
||||
def __init__(self):
|
||||
@@ -565,6 +786,62 @@ class OpenDALFileStorage(FileStorageInterface):
|
||||
logger.info(e)
|
||||
raise HTTPException(status_code=404, detail="文件已过期删除")
|
||||
|
||||
async def save_chunk(self, upload_id: str, chunk_index: int, chunk_data: bytes, chunk_hash: str, save_path: str):
|
||||
"""保存分片到 OpenDAL 存储"""
|
||||
chunk_path = str(Path(save_path).parent / "chunks" / upload_id / f"{chunk_index}.part")
|
||||
await self.operator.write(chunk_path, chunk_data)
|
||||
|
||||
async def merge_chunks(self, upload_id: str, chunk_info: UploadChunk, save_path: str) -> tuple[str, str]:
|
||||
"""合并 OpenDAL 存储上的分片文件"""
|
||||
file_sha256 = hashlib.sha256()
|
||||
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
|
||||
merged_data = io.BytesIO()
|
||||
|
||||
for i in range(chunk_info.total_chunks):
|
||||
chunk_path = f"{chunk_dir}/{i}.part"
|
||||
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
|
||||
if not chunk_record:
|
||||
raise ValueError(f"分片{i}记录不存在")
|
||||
|
||||
try:
|
||||
chunk_data = await self.operator.read(chunk_path)
|
||||
except Exception as e:
|
||||
raise ValueError(f"分片{i}文件不存在: {e}")
|
||||
|
||||
current_hash = hashlib.sha256(chunk_data).hexdigest()
|
||||
if current_hash != chunk_record.chunk_hash:
|
||||
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
|
||||
|
||||
file_sha256.update(chunk_data)
|
||||
merged_data.write(chunk_data)
|
||||
|
||||
# 写入合并后的文件
|
||||
merged_data.seek(0)
|
||||
await self.operator.write(save_path, merged_data.getvalue())
|
||||
|
||||
return save_path, file_sha256.hexdigest()
|
||||
|
||||
async def clean_chunks(self, upload_id: str, save_path: str):
|
||||
"""清理 OpenDAL 存储上的临时分片文件"""
|
||||
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
|
||||
try:
|
||||
# OpenDAL 支持递归删除
|
||||
await self.operator.remove_all(chunk_dir)
|
||||
except Exception as e:
|
||||
logger.info(f"清理 OpenDAL 分片时出错: {e}")
|
||||
|
||||
async def file_exists(self, save_path: str) -> bool:
|
||||
"""
|
||||
检查文件是否存在于OpenDAL存储
|
||||
:param save_path: 文件路径
|
||||
:return: 文件是否存在
|
||||
"""
|
||||
try:
|
||||
await self.operator.stat(save_path)
|
||||
return True
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
class WebDAVFileStorage(FileStorageInterface):
|
||||
_instance: Optional["WebDAVFileStorage"] = None
|
||||
@@ -717,55 +994,72 @@ class WebDAVFileStorage(FileStorageInterface):
|
||||
status_code=503, detail=f"WebDAV连接异常: {str(e)}")
|
||||
|
||||
async def save_chunk(self, upload_id: str, chunk_index: int, chunk_data: bytes, chunk_hash: str, save_path: str):
|
||||
chunk_path = str(Path(save_path).parent / "chunks" / upload_id / f"{chunk_index}.part")
|
||||
"""保存分片到 WebDAV"""
|
||||
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
|
||||
chunk_path = f"{chunk_dir}/{chunk_index}.part"
|
||||
|
||||
# 先创建目录结构
|
||||
await self._mkdir_p(chunk_dir)
|
||||
|
||||
chunk_url = self._build_url(chunk_path)
|
||||
async with aiohttp.ClientSession(auth=self.auth) as session:
|
||||
await session.put(chunk_url, data=chunk_data)
|
||||
propfind_url = self._build_url(chunk_path)
|
||||
headers = {
|
||||
'Content-Type': 'application/xml; charset=utf-8', 'Depth': '0'}
|
||||
body = f"""
|
||||
<D:propertyupdate xmlns:D="DAV:">
|
||||
<D:set>
|
||||
<D:prop>
|
||||
<ChunkHash xmlns="urn:filecodebox">{chunk_hash}</ChunkHash>
|
||||
</D:prop>
|
||||
</D:set>
|
||||
</D:propertyupdate>
|
||||
"""
|
||||
await session.request('PROPPATCH', propfind_url, headers=headers, data=body)
|
||||
async with session.put(chunk_url, data=chunk_data) as resp:
|
||||
if resp.status not in (200, 201, 204):
|
||||
content = await resp.text()
|
||||
raise HTTPException(
|
||||
status_code=resp.status,
|
||||
detail=f"分片上传失败: {content[:200]}"
|
||||
)
|
||||
|
||||
async def merge_chunks(self, upload_id: str, chunk_info: UploadChunk, save_path: str) -> tuple[str, str]:
|
||||
"""
|
||||
合并 WebDAV 上的分片文件
|
||||
由于大多数 WebDAV 服务器不支持 PATCH 追加,这里下载所有分片后合并上传
|
||||
"""
|
||||
file_sha256 = hashlib.sha256()
|
||||
output_url = self._build_url(save_path)
|
||||
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
|
||||
merged_data = io.BytesIO()
|
||||
|
||||
async with aiohttp.ClientSession(auth=self.auth) as session:
|
||||
await session.put(output_url, headers={'Content-Length': '0'})
|
||||
# 按顺序读取并验证每个分片
|
||||
for i in range(chunk_info.total_chunks):
|
||||
chunk_path = f"{chunk_dir}/{i}.part"
|
||||
chunk_url = self._build_url(chunk_path)
|
||||
propfind_url = self._build_url(chunk_path)
|
||||
headers = {
|
||||
'Content-Type': 'application/xml; charset=utf-8', 'Depth': '0'}
|
||||
body = """
|
||||
<D:propfind xmlns:D="DAV:">
|
||||
<D:prop>
|
||||
<ChunkHash xmlns="urn:filecodebox"/>
|
||||
</D:prop>
|
||||
</D:propfind>
|
||||
"""
|
||||
async with session.request('PROPFIND', propfind_url, headers=headers, data=body) as resp:
|
||||
xml_data = await resp.text()
|
||||
chunk_hash = re.search(
|
||||
r'<ChunkHash[^>]*>([^<]+)</ChunkHash>', xml_data).group(1)
|
||||
file_sha256.update(bytes.fromhex(chunk_hash))
|
||||
|
||||
# 获取分片记录
|
||||
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
|
||||
if not chunk_record:
|
||||
raise ValueError(f"分片{i}记录不存在")
|
||||
|
||||
# 下载分片数据
|
||||
async with session.get(chunk_url) as resp:
|
||||
if resp.status != 200:
|
||||
raise ValueError(f"分片{i}文件不存在或无法访问")
|
||||
chunk_data = await resp.read()
|
||||
await session.request('PATCH', output_url, headers={
|
||||
'Content-Type': 'application/octet-stream',
|
||||
'Content-Length': str(len(chunk_data)),
|
||||
'Content-Range': f'bytes */{chunk_info.file_size}'
|
||||
}, data=chunk_data)
|
||||
|
||||
# 验证哈希
|
||||
current_hash = hashlib.sha256(chunk_data).hexdigest()
|
||||
if current_hash != chunk_record.chunk_hash:
|
||||
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
|
||||
|
||||
file_sha256.update(chunk_data)
|
||||
merged_data.write(chunk_data)
|
||||
|
||||
# 确保目标目录存在
|
||||
output_dir = str(Path(save_path).parent)
|
||||
await self._mkdir_p(output_dir)
|
||||
|
||||
# 上传合并后的文件
|
||||
output_url = self._build_url(save_path)
|
||||
merged_data.seek(0)
|
||||
async with session.put(output_url, data=merged_data.getvalue()) as resp:
|
||||
if resp.status not in (200, 201, 204):
|
||||
content = await resp.text()
|
||||
raise HTTPException(
|
||||
status_code=resp.status,
|
||||
detail=f"合并文件上传失败: {content[:200]}"
|
||||
)
|
||||
|
||||
return save_path, file_sha256.hexdigest()
|
||||
|
||||
async def clean_chunks(self, upload_id: str, save_path: str):
|
||||
@@ -802,6 +1096,17 @@ class WebDAVFileStorage(FileStorageInterface):
|
||||
except Exception as e:
|
||||
logger.info(f"清理 WebDAV 分片时出错: {e}")
|
||||
|
||||
async def file_exists(self, save_path: str) -> bool:
|
||||
"""
|
||||
检查文件是否存在于WebDAV
|
||||
:param save_path: 文件路径
|
||||
:return: 文件是否存在
|
||||
"""
|
||||
url = self._build_url(save_path)
|
||||
async with aiohttp.ClientSession(auth=self.auth) as session:
|
||||
async with session.head(url) as resp:
|
||||
return resp.status == 200
|
||||
|
||||
|
||||
storages = {
|
||||
"local": SystemFileStorage,
|
||||
|
||||
+49
-4
@@ -3,13 +3,14 @@
|
||||
# @File : tasks.py
|
||||
# @Software: PyCharm
|
||||
import asyncio
|
||||
import datetime
|
||||
import logging
|
||||
import os
|
||||
|
||||
from tortoise.expressions import Q
|
||||
|
||||
from apps.base.models import FileCodes
|
||||
from apps.base.utils import ip_limit
|
||||
from apps.base.models import FileCodes, UploadChunk
|
||||
from apps.base.utils import ip_limit, get_chunk_file_path_name
|
||||
from core.settings import settings, data_root
|
||||
from core.storage import FileStorageInterface, storages
|
||||
from core.utils import get_now
|
||||
@@ -30,9 +31,53 @@ async def delete_expire_files():
|
||||
Q(expired_at__lt=await get_now()) | Q(expired_count=0)
|
||||
).all()
|
||||
for exp in expire_data:
|
||||
await file_storage.delete_file(exp)
|
||||
await exp.delete()
|
||||
try:
|
||||
await file_storage.delete_file(exp)
|
||||
except Exception as e:
|
||||
logging.error(f"删除过期文件失败 code={exp.code}: {e}")
|
||||
try:
|
||||
await exp.delete()
|
||||
except Exception as e:
|
||||
logging.error(f"删除记录失败 code={exp.code}: {e}")
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
finally:
|
||||
await asyncio.sleep(600)
|
||||
|
||||
|
||||
async def clean_incomplete_uploads():
|
||||
"""清理超时未完成的分片上传"""
|
||||
file_storage: FileStorageInterface = storages[settings.file_storage]()
|
||||
# 默认 24 小时未完成的上传视为过期
|
||||
expire_hours = getattr(settings, 'chunk_expire_hours', 24)
|
||||
while True:
|
||||
try:
|
||||
expire_time = datetime.datetime.now() - datetime.timedelta(hours=expire_hours)
|
||||
# 查找所有过期的上传会话(chunk_index=-1 的记录)
|
||||
expired_sessions = await UploadChunk.filter(
|
||||
chunk_index=-1,
|
||||
created_at__lt=expire_time
|
||||
).all()
|
||||
|
||||
for session in expired_sessions:
|
||||
try:
|
||||
# 获取分片存储路径
|
||||
_, _, _, _, save_path = await get_chunk_file_path_name(
|
||||
session.file_name, session.upload_id
|
||||
)
|
||||
# 清理存储中的临时文件
|
||||
await file_storage.clean_chunks(session.upload_id, save_path)
|
||||
except Exception as e:
|
||||
logging.error(f"清理分片文件失败 upload_id={session.upload_id}: {e}")
|
||||
|
||||
try:
|
||||
# 删除该会话的所有数据库记录
|
||||
await UploadChunk.filter(upload_id=session.upload_id).delete()
|
||||
logging.info(f"已清理过期上传会话 upload_id={session.upload_id}")
|
||||
except Exception as e:
|
||||
logging.error(f"删除分片记录失败 upload_id={session.upload_id}: {e}")
|
||||
|
||||
except Exception as e:
|
||||
logging.error(f"清理未完成上传任务异常: {e}")
|
||||
finally:
|
||||
await asyncio.sleep(3600) # 每小时执行一次
|
||||
+2
-3
@@ -9,6 +9,7 @@ import random
|
||||
import re
|
||||
import string
|
||||
import time
|
||||
|
||||
from core.settings import settings
|
||||
|
||||
|
||||
@@ -46,9 +47,7 @@ async def get_select_token(code: str):
|
||||
:return:
|
||||
"""
|
||||
token = settings.admin_token
|
||||
return hashlib.sha256(
|
||||
f"{code}{int(time.time() / 1000)}000{token}".encode()
|
||||
).hexdigest()
|
||||
return hashlib.sha256(f"{code}{int(time.time() / 1000)}000{token}".encode()).hexdigest()
|
||||
|
||||
|
||||
async def get_file_url(code: str):
|
||||
|
||||
-275
@@ -1,275 +0,0 @@
|
||||
import {
|
||||
useMediaQuery
|
||||
} from "./chunk-KT7LHMJ2.js";
|
||||
import {
|
||||
computed,
|
||||
ref,
|
||||
shallowRef,
|
||||
watch
|
||||
} from "./chunk-CQOUZRMK.js";
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/index.js
|
||||
import "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/styles/fonts.css";
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/without-fonts.js
|
||||
import "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/styles/vars.css";
|
||||
import "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/styles/base.css";
|
||||
import "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/styles/icons.css";
|
||||
import "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/styles/utils.css";
|
||||
import "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/styles/components/custom-block.css";
|
||||
import "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code.css";
|
||||
import "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code-group.css";
|
||||
import "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/styles/components/vp-doc.css";
|
||||
import "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/styles/components/vp-sponsor.css";
|
||||
import VPBadge from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue";
|
||||
import Layout from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/Layout.vue";
|
||||
import { default as default2 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue";
|
||||
import { default as default3 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPButton.vue";
|
||||
import { default as default4 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPDocAsideSponsors.vue";
|
||||
import { default as default5 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPFeatures.vue";
|
||||
import { default as default6 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPHomeContent.vue";
|
||||
import { default as default7 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPHomeFeatures.vue";
|
||||
import { default as default8 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPHomeHero.vue";
|
||||
import { default as default9 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPHomeSponsors.vue";
|
||||
import { default as default10 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPImage.vue";
|
||||
import { default as default11 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPLink.vue";
|
||||
import { default as default12 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPNavBarSearch.vue";
|
||||
import { default as default13 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPSocialLink.vue";
|
||||
import { default as default14 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPSocialLinks.vue";
|
||||
import { default as default15 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPSponsors.vue";
|
||||
import { default as default16 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPTeamMembers.vue";
|
||||
import { default as default17 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPTeamPage.vue";
|
||||
import { default as default18 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageSection.vue";
|
||||
import { default as default19 } from "/Users/lan/Project/Python/FileCodeBox/docs/node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageTitle.vue";
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/composables/local-nav.js
|
||||
import { onContentUpdated } from "vitepress";
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/composables/outline.js
|
||||
import { getScrollOffset } from "vitepress";
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/support/utils.js
|
||||
import { withBase } from "vitepress";
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/composables/data.js
|
||||
import { useData as useData$ } from "vitepress";
|
||||
var useData = useData$;
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/support/utils.js
|
||||
function ensureStartingSlash(path) {
|
||||
return path.startsWith("/") ? path : `/${path}`;
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/support/sidebar.js
|
||||
function getSidebar(_sidebar, path) {
|
||||
if (Array.isArray(_sidebar))
|
||||
return addBase(_sidebar);
|
||||
if (_sidebar == null)
|
||||
return [];
|
||||
path = ensureStartingSlash(path);
|
||||
const dir = Object.keys(_sidebar).sort((a, b) => {
|
||||
return b.split("/").length - a.split("/").length;
|
||||
}).find((dir2) => {
|
||||
return path.startsWith(ensureStartingSlash(dir2));
|
||||
});
|
||||
const sidebar = dir ? _sidebar[dir] : [];
|
||||
return Array.isArray(sidebar) ? addBase(sidebar) : addBase(sidebar.items, sidebar.base);
|
||||
}
|
||||
function getSidebarGroups(sidebar) {
|
||||
const groups = [];
|
||||
let lastGroupIndex = 0;
|
||||
for (const index in sidebar) {
|
||||
const item = sidebar[index];
|
||||
if (item.items) {
|
||||
lastGroupIndex = groups.push(item);
|
||||
continue;
|
||||
}
|
||||
if (!groups[lastGroupIndex]) {
|
||||
groups.push({ items: [] });
|
||||
}
|
||||
groups[lastGroupIndex].items.push(item);
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
function addBase(items, _base) {
|
||||
return [...items].map((_item) => {
|
||||
const item = { ..._item };
|
||||
const base = item.base || _base;
|
||||
if (base && item.link)
|
||||
item.link = base + item.link;
|
||||
if (item.items)
|
||||
item.items = addBase(item.items, base);
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/composables/sidebar.js
|
||||
function useSidebar() {
|
||||
const { frontmatter, page, theme: theme2 } = useData();
|
||||
const is960 = useMediaQuery("(min-width: 960px)");
|
||||
const isOpen = ref(false);
|
||||
const _sidebar = computed(() => {
|
||||
const sidebarConfig = theme2.value.sidebar;
|
||||
const relativePath = page.value.relativePath;
|
||||
return sidebarConfig ? getSidebar(sidebarConfig, relativePath) : [];
|
||||
});
|
||||
const sidebar = ref(_sidebar.value);
|
||||
watch(_sidebar, (next, prev) => {
|
||||
if (JSON.stringify(next) !== JSON.stringify(prev))
|
||||
sidebar.value = _sidebar.value;
|
||||
});
|
||||
const hasSidebar = computed(() => {
|
||||
return frontmatter.value.sidebar !== false && sidebar.value.length > 0 && frontmatter.value.layout !== "home";
|
||||
});
|
||||
const leftAside = computed(() => {
|
||||
if (hasAside)
|
||||
return frontmatter.value.aside == null ? theme2.value.aside === "left" : frontmatter.value.aside === "left";
|
||||
return false;
|
||||
});
|
||||
const hasAside = computed(() => {
|
||||
if (frontmatter.value.layout === "home")
|
||||
return false;
|
||||
if (frontmatter.value.aside != null)
|
||||
return !!frontmatter.value.aside;
|
||||
return theme2.value.aside !== false;
|
||||
});
|
||||
const isSidebarEnabled = computed(() => hasSidebar.value && is960.value);
|
||||
const sidebarGroups = computed(() => {
|
||||
return hasSidebar.value ? getSidebarGroups(sidebar.value) : [];
|
||||
});
|
||||
function open() {
|
||||
isOpen.value = true;
|
||||
}
|
||||
function close() {
|
||||
isOpen.value = false;
|
||||
}
|
||||
function toggle() {
|
||||
isOpen.value ? close() : open();
|
||||
}
|
||||
return {
|
||||
isOpen,
|
||||
sidebar,
|
||||
sidebarGroups,
|
||||
hasSidebar,
|
||||
hasAside,
|
||||
leftAside,
|
||||
isSidebarEnabled,
|
||||
open,
|
||||
close,
|
||||
toggle
|
||||
};
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/composables/outline.js
|
||||
var ignoreRE = /\b(?:VPBadge|header-anchor|footnote-ref|ignore-header)\b/;
|
||||
var resolvedHeaders = [];
|
||||
function getHeaders(range) {
|
||||
const headers = [
|
||||
...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")
|
||||
].filter((el) => el.id && el.hasChildNodes()).map((el) => {
|
||||
const level = Number(el.tagName[1]);
|
||||
return {
|
||||
element: el,
|
||||
title: serializeHeader(el),
|
||||
link: "#" + el.id,
|
||||
level
|
||||
};
|
||||
});
|
||||
return resolveHeaders(headers, range);
|
||||
}
|
||||
function serializeHeader(h) {
|
||||
let ret = "";
|
||||
for (const node of h.childNodes) {
|
||||
if (node.nodeType === 1) {
|
||||
if (ignoreRE.test(node.className))
|
||||
continue;
|
||||
ret += node.textContent;
|
||||
} else if (node.nodeType === 3) {
|
||||
ret += node.textContent;
|
||||
}
|
||||
}
|
||||
return ret.trim();
|
||||
}
|
||||
function resolveHeaders(headers, range) {
|
||||
if (range === false) {
|
||||
return [];
|
||||
}
|
||||
const levelsRange = (typeof range === "object" && !Array.isArray(range) ? range.level : range) || 2;
|
||||
const [high, low] = typeof levelsRange === "number" ? [levelsRange, levelsRange] : levelsRange === "deep" ? [2, 6] : levelsRange;
|
||||
return buildTree(headers, high, low);
|
||||
}
|
||||
function buildTree(data, min, max) {
|
||||
resolvedHeaders.length = 0;
|
||||
const result = [];
|
||||
const stack = [];
|
||||
data.forEach((item) => {
|
||||
const node = { ...item, children: [] };
|
||||
let parent = stack[stack.length - 1];
|
||||
while (parent && parent.level >= node.level) {
|
||||
stack.pop();
|
||||
parent = stack[stack.length - 1];
|
||||
}
|
||||
if (node.element.classList.contains("ignore-header") || parent && "shouldIgnore" in parent) {
|
||||
stack.push({ level: node.level, shouldIgnore: true });
|
||||
return;
|
||||
}
|
||||
if (node.level > max || node.level < min)
|
||||
return;
|
||||
resolvedHeaders.push({ element: node.element, link: node.link });
|
||||
if (parent)
|
||||
parent.children.push(node);
|
||||
else
|
||||
result.push(node);
|
||||
stack.push(node);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/composables/local-nav.js
|
||||
function useLocalNav() {
|
||||
const { theme: theme2, frontmatter } = useData();
|
||||
const headers = shallowRef([]);
|
||||
const hasLocalNav = computed(() => {
|
||||
return headers.value.length > 0;
|
||||
});
|
||||
onContentUpdated(() => {
|
||||
headers.value = getHeaders(frontmatter.value.outline ?? theme2.value.outline);
|
||||
});
|
||||
return {
|
||||
headers,
|
||||
hasLocalNav
|
||||
};
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/without-fonts.js
|
||||
var theme = {
|
||||
Layout,
|
||||
enhanceApp: ({ app }) => {
|
||||
app.component("Badge", VPBadge);
|
||||
}
|
||||
};
|
||||
var without_fonts_default = theme;
|
||||
export {
|
||||
default2 as VPBadge,
|
||||
default3 as VPButton,
|
||||
default4 as VPDocAsideSponsors,
|
||||
default5 as VPFeatures,
|
||||
default6 as VPHomeContent,
|
||||
default7 as VPHomeFeatures,
|
||||
default8 as VPHomeHero,
|
||||
default9 as VPHomeSponsors,
|
||||
default10 as VPImage,
|
||||
default11 as VPLink,
|
||||
default12 as VPNavBarSearch,
|
||||
default13 as VPSocialLink,
|
||||
default14 as VPSocialLinks,
|
||||
default15 as VPSponsors,
|
||||
default16 as VPTeamMembers,
|
||||
default17 as VPTeamPage,
|
||||
default18 as VPTeamPageSection,
|
||||
default19 as VPTeamPageTitle,
|
||||
without_fonts_default as default,
|
||||
useLocalNav,
|
||||
useSidebar
|
||||
};
|
||||
//# sourceMappingURL=@theme_index.js.map
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../../node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/index.js", "../../../node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/without-fonts.js", "../../../node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/composables/local-nav.js", "../../../node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/composables/outline.js", "../../../node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/support/utils.js", "../../../node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/composables/data.js", "../../../node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/support/sidebar.js", "../../../node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/composables/sidebar.js"],
|
||||
"sourcesContent": ["import './styles/fonts.css';\nexport * from './without-fonts';\nexport { default as default } from './without-fonts';\n", "import './styles/vars.css';\nimport './styles/base.css';\nimport './styles/icons.css';\nimport './styles/utils.css';\nimport './styles/components/custom-block.css';\nimport './styles/components/vp-code.css';\nimport './styles/components/vp-code-group.css';\nimport './styles/components/vp-doc.css';\nimport './styles/components/vp-sponsor.css';\nimport VPBadge from './components/VPBadge.vue';\nimport Layout from './Layout.vue';\nexport { default as VPBadge } from './components/VPBadge.vue';\nexport { default as VPButton } from './components/VPButton.vue';\nexport { default as VPDocAsideSponsors } from './components/VPDocAsideSponsors.vue';\nexport { default as VPFeatures } from './components/VPFeatures.vue';\nexport { default as VPHomeContent } from './components/VPHomeContent.vue';\nexport { default as VPHomeFeatures } from './components/VPHomeFeatures.vue';\nexport { default as VPHomeHero } from './components/VPHomeHero.vue';\nexport { default as VPHomeSponsors } from './components/VPHomeSponsors.vue';\nexport { default as VPImage } from './components/VPImage.vue';\nexport { default as VPLink } from './components/VPLink.vue';\nexport { default as VPNavBarSearch } from './components/VPNavBarSearch.vue';\nexport { default as VPSocialLink } from './components/VPSocialLink.vue';\nexport { default as VPSocialLinks } from './components/VPSocialLinks.vue';\nexport { default as VPSponsors } from './components/VPSponsors.vue';\nexport { default as VPTeamMembers } from './components/VPTeamMembers.vue';\nexport { default as VPTeamPage } from './components/VPTeamPage.vue';\nexport { default as VPTeamPageSection } from './components/VPTeamPageSection.vue';\nexport { default as VPTeamPageTitle } from './components/VPTeamPageTitle.vue';\nexport { useLocalNav } from './composables/local-nav';\nexport { useSidebar } from './composables/sidebar';\nconst theme = {\n Layout,\n enhanceApp: ({ app }) => {\n app.component('Badge', VPBadge);\n }\n};\nexport default theme;\n", "import { onContentUpdated } from 'vitepress';\nimport { computed, shallowRef } from 'vue';\nimport { getHeaders } from '../composables/outline';\nimport { useData } from './data';\nexport function useLocalNav() {\n const { theme, frontmatter } = useData();\n const headers = shallowRef([]);\n const hasLocalNav = computed(() => {\n return headers.value.length > 0;\n });\n onContentUpdated(() => {\n headers.value = getHeaders(frontmatter.value.outline ?? theme.value.outline);\n });\n return {\n headers,\n hasLocalNav\n };\n}\n", "import { getScrollOffset } from 'vitepress';\nimport { onMounted, onUnmounted, onUpdated } from 'vue';\nimport { throttleAndDebounce } from '../support/utils';\nimport { useAside } from './aside';\nconst ignoreRE = /\\b(?:VPBadge|header-anchor|footnote-ref|ignore-header)\\b/;\n// cached list of anchor elements from resolveHeaders\nconst resolvedHeaders = [];\nexport function resolveTitle(theme) {\n return ((typeof theme.outline === 'object' &&\n !Array.isArray(theme.outline) &&\n theme.outline.label) ||\n theme.outlineTitle ||\n 'On this page');\n}\nexport function getHeaders(range) {\n const headers = [\n ...document.querySelectorAll('.VPDoc :where(h1,h2,h3,h4,h5,h6)')\n ]\n .filter((el) => el.id && el.hasChildNodes())\n .map((el) => {\n const level = Number(el.tagName[1]);\n return {\n element: el,\n title: serializeHeader(el),\n link: '#' + el.id,\n level\n };\n });\n return resolveHeaders(headers, range);\n}\nfunction serializeHeader(h) {\n let ret = '';\n for (const node of h.childNodes) {\n if (node.nodeType === 1) {\n if (ignoreRE.test(node.className))\n continue;\n ret += node.textContent;\n }\n else if (node.nodeType === 3) {\n ret += node.textContent;\n }\n }\n return ret.trim();\n}\nexport function resolveHeaders(headers, range) {\n if (range === false) {\n return [];\n }\n const levelsRange = (typeof range === 'object' && !Array.isArray(range)\n ? range.level\n : range) || 2;\n const [high, low] = typeof levelsRange === 'number'\n ? [levelsRange, levelsRange]\n : levelsRange === 'deep'\n ? [2, 6]\n : levelsRange;\n return buildTree(headers, high, low);\n}\nexport function useActiveAnchor(container, marker) {\n const { isAsideEnabled } = useAside();\n const onScroll = throttleAndDebounce(setActiveLink, 100);\n let prevActiveLink = null;\n onMounted(() => {\n requestAnimationFrame(setActiveLink);\n window.addEventListener('scroll', onScroll);\n });\n onUpdated(() => {\n // sidebar update means Line truncated
|
||||
"mappings": ";;;;;;;;;;;AAAA,OAAO;;;ACAP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO,aAAa;AACpB,OAAO,YAAY;AACnB,SAAoB,WAAXA,gBAA0B;AACnC,SAAoB,WAAXA,gBAA2B;AACpC,SAAoB,WAAXA,gBAAqC;AAC9C,SAAoB,WAAXA,gBAA6B;AACtC,SAAoB,WAAXA,gBAAgC;AACzC,SAAoB,WAAXA,gBAAiC;AAC1C,SAAoB,WAAXA,gBAA6B;AACtC,SAAoB,WAAXA,gBAAiC;AAC1C,SAAoB,WAAXA,iBAA0B;AACnC,SAAoB,WAAXA,iBAAyB;AAClC,SAAoB,WAAXA,iBAAiC;AAC1C,SAAoB,WAAXA,iBAA+B;AACxC,SAAoB,WAAXA,iBAAgC;AACzC,SAAoB,WAAXA,iBAA6B;AACtC,SAAoB,WAAXA,iBAAgC;AACzC,SAAoB,WAAXA,iBAA6B;AACtC,SAAoB,WAAXA,iBAAoC;AAC7C,SAAoB,WAAXA,iBAAkC;;;AC5B3C,SAAS,wBAAwB;;;ACAjC,SAAS,uBAAuB;;;ACAhC,SAAS,gBAAgB;;;ACAzB,SAAS,WAAW,gBAAgB;AAC7B,IAAM,UAAU;;;ADgBhB,SAAS,oBAAoB,MAAM;AACtC,SAAO,KAAK,WAAW,GAAG,IAAI,OAAO,IAAI,IAAI;AACjD;;;AEXO,SAAS,WAAW,UAAU,MAAM;AACvC,MAAI,MAAM,QAAQ,QAAQ;AACtB,WAAO,QAAQ,QAAQ;AAC3B,MAAI,YAAY;AACZ,WAAO,CAAC;AACZ,SAAO,oBAAoB,IAAI;AAC/B,QAAM,MAAM,OAAO,KAAK,QAAQ,EAC3B,KAAK,CAAC,GAAG,MAAM;AAChB,WAAO,EAAE,MAAM,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,EAAE;AAAA,EAC9C,CAAC,EACI,KAAK,CAACC,SAAQ;AAEf,WAAO,KAAK,WAAW,oBAAoBA,IAAG,CAAC;AAAA,EACnD,CAAC;AACD,QAAM,UAAU,MAAM,SAAS,GAAG,IAAI,CAAC;AACvC,SAAO,MAAM,QAAQ,OAAO,IACtB,QAAQ,OAAO,IACf,QAAQ,QAAQ,OAAO,QAAQ,IAAI;AAC7C;AAIO,SAAS,iBAAiB,SAAS;AACtC,QAAM,SAAS,CAAC;AAChB,MAAI,iBAAiB;AACrB,aAAW,SAAS,SAAS;AACzB,UAAM,OAAO,QAAQ,KAAK;AAC1B,QAAI,KAAK,OAAO;AACZ,uBAAiB,OAAO,KAAK,IAAI;AACjC;AAAA,IACJ;AACA,QAAI,CAAC,OAAO,cAAc,GAAG;AACzB,aAAO,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;AAAA,IAC7B;AACA,WAAO,cAAc,EAAE,MAAM,KAAK,IAAI;AAAA,EAC1C;AACA,SAAO;AACX;AAiCA,SAAS,QAAQ,OAAO,OAAO;AAC3B,SAAO,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,UAAU;AAC7B,UAAM,OAAO,EAAE,GAAG,MAAM;AACxB,UAAM,OAAO,KAAK,QAAQ;AAC1B,QAAI,QAAQ,KAAK;AACb,WAAK,OAAO,OAAO,KAAK;AAC5B,QAAI,KAAK;AACL,WAAK,QAAQ,QAAQ,KAAK,OAAO,IAAI;AACzC,WAAO;AAAA,EACX,CAAC;AACL;;;ACnFO,SAAS,aAAa;AACzB,QAAM,EAAE,aAAa,MAAM,OAAAC,OAAM,IAAI,QAAQ;AAC7C,QAAM,QAAQ,cAAc,oBAAoB;AAChD,QAAM,SAAS,IAAI,KAAK;AACxB,QAAM,WAAW,SAAS,MAAM;AAC5B,UAAM,gBAAgBA,OAAM,MAAM;AAClC,UAAM,eAAe,KAAK,MAAM;AAChC,WAAO,gBAAgB,WAAW,eAAe,YAAY,IAAI,CAAC;AAAA,EACtE,CAAC;AACD,QAAM,UAAU,IAAI,SAAS,KAAK;AAClC,QAAM,UAAU,CAAC,MAAM,SAAS;AAC5B,QAAI,KAAK,UAAU,IAAI,MAAM,KAAK,UAAU,IAAI;AAC5C,cAAQ,QAAQ,SAAS;AAAA,EACjC,CAAC;AACD,QAAM,aAAa,SAAS,MAAM;AAC9B,WAAQ,YAAY,MAAM,YAAY,SAClC,QAAQ,MAAM,SAAS,KACvB,YAAY,MAAM,WAAW;AAAA,EACrC,CAAC;AACD,QAAM,YAAY,SAAS,MAAM;AAC7B,QAAI;AACA,aAAO,YAAY,MAAM,SAAS,OAC5BA,OAAM,MAAM,UAAU,SACtB,YAAY,MAAM,UAAU;AACtC,WAAO;AAAA,EACX,CAAC;AACD,QAAM,WAAW,SAAS,MAAM;AAC5B,QAAI,YAAY,MAAM,WAAW;AAC7B,aAAO;AACX,QAAI,YAAY,MAAM,SAAS;AAC3B,aAAO,CAAC,CAAC,YAAY,MAAM;AAC/B,WAAOA,OAAM,MAAM,UAAU;AAAA,EACjC,CAAC;AACD,QAAM,mBAAmB,SAAS,MAAM,WAAW,SAAS,MAAM,KAAK;AACvE,QAAM,gBAAgB,SAAS,MAAM;AACjC,WAAO,WAAW,QAAQ,iBAAiB,QAAQ,KAAK,IAAI,CAAC;AAAA,EACjE,CAAC;AACD,WAAS,OAAO;AACZ,WAAO,QAAQ;AAAA,EACnB;AACA,WAAS,QAAQ;AACb,WAAO,QAAQ;AAAA,EACnB;AACA,WAAS,SAAS;AACd,WAAO,QAAQ,MAAM,IAAI,KAAK;AAAA,EAClC;AACA,SAAO;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AACJ;;;AJ3DA,IAAM,WAAW;AAEjB,IAAM,kBAAkB,CAAC;AAQlB,SAAS,WAAW,OAAO;AAC9B,QAAM,UAAU;AAAA,IACZ,GAAG,SAAS,iBAAiB,kCAAkC;AAAA,EACnE,EACK,OAAO,CAAC,OAAO,GAAG,MAAM,GAAG,cAAc,CAAC,EAC1C,IAAI,CAAC,OAAO;AACb,UAAM,QAAQ,OAAO,GAAG,QAAQ,CAAC,CAAC;AAClC,WAAO;AAAA,MACH,SAAS;AAAA,MACT,OAAO,gBAAgB,EAAE;AAAA,MACzB,MAAM,MAAM,GAAG;AAAA,MACf;AAAA,IACJ;AAAA,EACJ,CAAC;AACD,SAAO,eAAe,SAAS,KAAK;AACxC;AACA,SAAS,gBAAgB,GAAG;AACxB,MAAI,MAAM;AACV,aAAW,QAAQ,EAAE,YAAY;AAC7B,QAAI,KAAK,aAAa,GAAG;AACrB,UAAI,SAAS,KAAK,KAAK,SAAS;AAC5B;AACJ,aAAO,KAAK;AAAA,IAChB,WACS,KAAK,aAAa,GAAG;AAC1B,aAAO,KAAK;AAAA,IAChB;AAAA,EACJ;AACA,SAAO,IAAI,KAAK;AACpB;AACO,SAAS,eAAe,SAAS,OAAO;AAC3C,MAAI,UAAU,OAAO;AACjB,WAAO,CAAC;AAAA,EACZ;AACA,QAAM,eAAe,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAChE,MAAM,QACN,UAAU;AAChB,QAAM,CAAC,MAAM,GAAG,IAAI,OAAO,gBAAgB,WACrC,CAAC,aAAa,WAAW,IACzB,gBAAgB,SACZ,CAAC,GAAG,CAAC,IACL;AACV,SAAO,UAAU,SAAS,MAAM,GAAG;AACvC;AA8FA,SAAS,UAAU,MAAM,KAAK,KAAK;AAC/B,kBAAgB,SAAS;AACzB,QAAM,SAAS,CAAC;AAChB,QAAM,QAAQ,CAAC;AACf,OAAK,QAAQ,CAAC,SAAS;AACnB,UAAM,OAAO,EAAE,GAAG,MAAM,UAAU,CAAC,EAAE;AACrC,QAAI,SAAS,MAAM,MAAM,SAAS,CAAC;AACnC,WAAO,UAAU,OAAO,SAAS,KAAK,OAAO;AACzC,YAAM,IAAI;AACV,eAAS,MAAM,MAAM,SAAS,CAAC;AAAA,IACnC;AACA,QAAI,KAAK,QAAQ,UAAU,SAAS,eAAe,KAC9C,UAAU,kBAAkB,QAAS;AACtC,YAAM,KAAK,EAAE,OAAO,KAAK,OAAO,cAAc,KAAK,CAAC;AACpD;AAAA,IACJ;AACA,QAAI,KAAK,QAAQ,OAAO,KAAK,QAAQ;AACjC;AACJ,oBAAgB,KAAK,EAAE,SAAS,KAAK,SAAS,MAAM,KAAK,KAAK,CAAC;AAC/D,QAAI;AACA,aAAO,SAAS,KAAK,IAAI;AAAA;AAEzB,aAAO,KAAK,IAAI;AACpB,UAAM,KAAK,IAAI;AAAA,EACnB,CAAC;AACD,SAAO;AACX;;;AD7KO,SAAS,cAAc;AAC1B,QAAM,EAAE,OAAAC,QAAO,YAAY,IAAI,QAAQ;AACvC,QAAM,UAAU,WAAW,CAAC,CAAC;AAC7B,QAAM,cAAc,SAAS,MAAM;AAC/B,WAAO,QAAQ,MAAM,SAAS;AAAA,EAClC,CAAC;AACD,mBAAiB,MAAM;AACnB,YAAQ,QAAQ,WAAW,YAAY,MAAM,WAAWA,OAAM,MAAM,OAAO;AAAA,EAC/E,CAAC;AACD,SAAO;AAAA,IACH;AAAA,IACA;AAAA,EACJ;AACJ;;;ADcA,IAAM,QAAQ;AAAA,EACV;AAAA,EACA,YAAY,CAAC,EAAE,IAAI,MAAM;AACrB,QAAI,UAAU,SAAS,OAAO;AAAA,EAClC;AACJ;AACA,IAAO,wBAAQ;",
|
||||
"names": ["default", "dir", "theme", "theme"]
|
||||
}
|
||||
+9
-15
@@ -1,49 +1,43 @@
|
||||
{
|
||||
"hash": "d07f6dee",
|
||||
"configHash": "dee2d3bc",
|
||||
"hash": "8f855eaf",
|
||||
"configHash": "1b3ca22f",
|
||||
"lockfileHash": "bd28b2c2",
|
||||
"browserHash": "b96651ac",
|
||||
"browserHash": "29e84937",
|
||||
"optimized": {
|
||||
"vue": {
|
||||
"src": "../../../node_modules/.pnpm/vue@3.5.13/node_modules/vue/dist/vue.runtime.esm-bundler.js",
|
||||
"file": "vue.js",
|
||||
"fileHash": "bc5c7f34",
|
||||
"fileHash": "3215885f",
|
||||
"needsInterop": false
|
||||
},
|
||||
"vitepress > @vue/devtools-api": {
|
||||
"src": "../../../node_modules/.pnpm/@vue+devtools-api@7.7.1/node_modules/@vue/devtools-api/dist/index.js",
|
||||
"file": "vitepress___@vue_devtools-api.js",
|
||||
"fileHash": "00859881",
|
||||
"fileHash": "5a5f95ef",
|
||||
"needsInterop": false
|
||||
},
|
||||
"vitepress > @vueuse/core": {
|
||||
"src": "../../../node_modules/.pnpm/@vueuse+core@12.5.0/node_modules/@vueuse/core/index.mjs",
|
||||
"file": "vitepress___@vueuse_core.js",
|
||||
"fileHash": "1c6da938",
|
||||
"fileHash": "0fbf66f0",
|
||||
"needsInterop": false
|
||||
},
|
||||
"vitepress > @vueuse/integrations/useFocusTrap": {
|
||||
"src": "../../../node_modules/.pnpm/@vueuse+integrations@12.5.0_focus-trap@7.6.4/node_modules/@vueuse/integrations/useFocusTrap.mjs",
|
||||
"file": "vitepress___@vueuse_integrations_useFocusTrap.js",
|
||||
"fileHash": "11c08fcf",
|
||||
"fileHash": "91b03896",
|
||||
"needsInterop": false
|
||||
},
|
||||
"vitepress > mark.js/src/vanilla.js": {
|
||||
"src": "../../../node_modules/.pnpm/mark.js@8.11.1/node_modules/mark.js/src/vanilla.js",
|
||||
"file": "vitepress___mark__js_src_vanilla__js.js",
|
||||
"fileHash": "b93dbfe7",
|
||||
"fileHash": "99e4f81c",
|
||||
"needsInterop": false
|
||||
},
|
||||
"vitepress > minisearch": {
|
||||
"src": "../../../node_modules/.pnpm/minisearch@7.1.1/node_modules/minisearch/dist/es/index.js",
|
||||
"file": "vitepress___minisearch.js",
|
||||
"fileHash": "bfb6c3ac",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@theme/index": {
|
||||
"src": "../../../node_modules/.pnpm/vitepress@1.6.3_@algolia+client-search@5.20.2_postcss@8.5.2_search-insights@2.17.3/node_modules/vitepress/dist/client/theme-default/index.js",
|
||||
"file": "@theme_index.js",
|
||||
"fileHash": "07512287",
|
||||
"fileHash": "cc176c9c",
|
||||
"needsInterop": false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -18,6 +18,7 @@ export default defineConfig({
|
||||
{ text: '首页', link: '/' },
|
||||
{ text: '指南', link: '/guide/getting-started' },
|
||||
{ text: 'API', link: '/api/' },
|
||||
{ text: '优秀案例', link: '/showcase' },
|
||||
{ text: 'Demo', link: 'https://share.lanol.cn' },
|
||||
{
|
||||
text: '了解更多',
|
||||
@@ -68,6 +69,14 @@ export default defineConfig({
|
||||
],
|
||||
},
|
||||
],
|
||||
'/showcase': [
|
||||
{
|
||||
text: '优秀案例',
|
||||
items: [
|
||||
{ text: '案例展示', link: '/showcase' },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
socialLinks: [
|
||||
{ icon: 'github', link: 'https://github.com/vastsa/FileCodeBox' },
|
||||
@@ -96,6 +105,7 @@ export default defineConfig({
|
||||
{ text: 'Home', link: '/en/' },
|
||||
{ text: 'Guide', link: '/en/guide/getting-started' },
|
||||
{ text: 'API', link: '/en/api/' },
|
||||
{ text: 'Showcase', link: '/en/showcase' },
|
||||
{ text: 'Demo', link: 'https://share.lanol.cn' },
|
||||
{
|
||||
text: 'More',
|
||||
@@ -152,6 +162,14 @@ export default defineConfig({
|
||||
],
|
||||
},
|
||||
],
|
||||
'/en/showcase': [
|
||||
{
|
||||
text: 'Showcase',
|
||||
items: [
|
||||
{ text: 'Case Studies', link: '/en/showcase' },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
socialLinks: [
|
||||
{ icon: 'github', link: 'https://github.com/vastsa/FileCodeBox' },
|
||||
|
||||
@@ -0,0 +1,473 @@
|
||||
|
||||
:root {
|
||||
/* --- 核心色板:清晨薄雾 (Teal -> Sky) --- */
|
||||
--vp-c-brand-1: #14b8a6; /* Teal 500 */
|
||||
--vp-c-brand-2: #0ea5e9; /* Sky 500 */
|
||||
--vp-c-brand-3: #0f766e; /* Teal 700 */
|
||||
--vp-c-brand-soft: rgba(20, 184, 166, 0.14);
|
||||
|
||||
/* --- 背景色:极简与通透 --- */
|
||||
--vp-c-bg: #ffffff;
|
||||
--vp-c-bg-alt: #f8fafc; /* Slate 50 */
|
||||
--vp-c-bg-elv: #ffffff;
|
||||
|
||||
/* --- 文字颜色:柔和的深灰,而非纯黑 --- */
|
||||
--vp-c-text-1: #334155; /* Slate 700 */
|
||||
--vp-c-text-2: #64748b; /* Slate 500 */
|
||||
--vp-c-text-3: #94a3b8; /* Slate 400 */
|
||||
|
||||
/* --- 边框与分隔 --- */
|
||||
--vp-c-border: #e2e8f0;
|
||||
--vp-c-divider: #f1f5f9;
|
||||
|
||||
/* --- 阴影:扩散柔光 --- */
|
||||
--vp-shadow-1: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
|
||||
--vp-shadow-2: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
|
||||
--vp-shadow-brand: 0 4px 14px 0 rgba(20, 184, 166, 0.3);
|
||||
|
||||
/* --- 布局参数 --- */
|
||||
--vp-nav-height: 64px;
|
||||
--vp-sidebar-width: 280px;
|
||||
--vp-radius-default: 12px;
|
||||
--vp-radius-small: 6px;
|
||||
}
|
||||
|
||||
/* * ==========================================
|
||||
* 暗黑模式重构 (Deep Ocean Theme)
|
||||
* ==========================================
|
||||
*/
|
||||
.dark {
|
||||
/* 背景:更深邃的蓝黑色,更有沉浸感 */
|
||||
--vp-c-bg: #020617; /* Slate 950 */
|
||||
--vp-c-bg-alt: #0f172a; /* Slate 900 */
|
||||
--vp-c-bg-elv: #1e293b; /* Slate 800 */
|
||||
|
||||
/* 文字:降低纯白刺眼感,提高舒适度 */
|
||||
--vp-c-text-1: #f8fafc; /* Slate 50 */
|
||||
--vp-c-text-2: #94a3b8; /* Slate 400 */
|
||||
--vp-c-text-3: #64748b; /* Slate 500 */
|
||||
|
||||
/* 边框:更细腻的深色线条 */
|
||||
--vp-c-border: #1e293b;
|
||||
--vp-c-divider: #0f172a;
|
||||
|
||||
/* 品牌色:调亮,产生荧光感 */
|
||||
--vp-c-brand-1: #2dd4bf; /* Teal 400 */
|
||||
--vp-c-brand-2: #38bdf8; /* Sky 400 */
|
||||
--vp-c-brand-3: #14b8a6; /* Teal 500 */
|
||||
--vp-c-brand-soft: rgba(45, 212, 191, 0.15); /* 淡淡的荧光底色 */
|
||||
|
||||
/* 阴影:暗色环境下的微光 */
|
||||
--vp-shadow-1: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
|
||||
--vp-shadow-2: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
|
||||
--vp-shadow-brand: 0 0 20px rgba(45, 212, 191, 0.3); /* 品牌色发光 */
|
||||
}
|
||||
|
||||
/* 全局基础设置 */
|
||||
body {
|
||||
font-family: 'Noto Sans SC', sans-serif;
|
||||
background-color: var(--vp-c-bg-alt);
|
||||
color: var(--vp-c-text-1);
|
||||
margin: 0;
|
||||
transition: background-color 0.3s, color 0.3s;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
a { text-decoration: none; color: inherit; transition: color 0.2s; }
|
||||
|
||||
/* -------------------------------------------
|
||||
布局结构 (模拟 VitePress 布局)
|
||||
------------------------------------------- */
|
||||
.app-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* 1. 导航栏:毛玻璃 + 悬浮感 */
|
||||
.VPNavBar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: var(--vp-nav-height);
|
||||
background-color: rgba(255, 255, 255, 0.85); /* 稍微增加不透明度 */
|
||||
backdrop-filter: blur(20px) saturate(180%);
|
||||
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
||||
border-bottom: 1px solid rgba(226, 232, 240, 0.6);
|
||||
z-index: 50;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 24px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.dark .VPNavBar {
|
||||
background-color: rgba(2, 6, 23, 0.85); /* 深色背景半透 */
|
||||
border-bottom: 1px solid rgba(30, 41, 59, 0.7);
|
||||
}
|
||||
|
||||
.nav-logo {
|
||||
font-weight: 700;
|
||||
font-size: 1.2rem;
|
||||
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
color: var(--vp-c-text-2);
|
||||
}
|
||||
|
||||
.nav-link:hover {
|
||||
color: var(--vp-c-brand-1);
|
||||
}
|
||||
|
||||
.nav-link.active {
|
||||
color: var(--vp-c-brand-1);
|
||||
position: relative;
|
||||
}
|
||||
.nav-link.active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -22px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: var(--vp-c-brand-1);
|
||||
border-radius: 2px 2px 0 0;
|
||||
box-shadow: 0 -2px 10px var(--vp-c-brand-1); /* 激活状态发光 */
|
||||
}
|
||||
|
||||
/* 2. 侧边栏:极简卡片式 */
|
||||
.VPSidebar {
|
||||
position: fixed;
|
||||
top: var(--vp-nav-height);
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: var(--vp-sidebar-width);
|
||||
background-color: var(--vp-c-bg); /* 实色背景 */
|
||||
border-right: 1px solid var(--vp-c-border);
|
||||
padding: 32px 24px;
|
||||
overflow-y: auto;
|
||||
transform: translateX(0);
|
||||
transition: transform 0.3s ease;
|
||||
z-index: 40;
|
||||
}
|
||||
.dark .VPSidebar {
|
||||
background-color: var(--vp-c-bg-alt); /* 侧边栏比内容区稍微亮一点点/或者暗一点 */
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.VPSidebar { transform: translateX(-100%); }
|
||||
.VPSidebar.open { transform: translateX(0); }
|
||||
}
|
||||
|
||||
.sidebar-group-title {
|
||||
font-weight: 700;
|
||||
color: var(--vp-c-text-1);
|
||||
margin-bottom: 12px;
|
||||
margin-top: 24px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
.sidebar-group-title:first-child { margin-top: 0; }
|
||||
|
||||
.sidebar-link {
|
||||
display: block;
|
||||
padding: 8px 12px;
|
||||
margin: 4px 0;
|
||||
border-radius: var(--vp-radius-small);
|
||||
color: var(--vp-c-text-2);
|
||||
font-size: 0.95rem;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.sidebar-link:hover {
|
||||
background-color: var(--vp-c-bg-alt);
|
||||
color: var(--vp-c-brand-1);
|
||||
}
|
||||
.dark .sidebar-link:hover {
|
||||
background-color: var(--vp-c-bg-elv);
|
||||
}
|
||||
|
||||
.sidebar-link.active {
|
||||
background-color: var(--vp-c-brand-soft);
|
||||
color: var(--vp-c-brand-3);
|
||||
font-weight: 600;
|
||||
}
|
||||
.dark .sidebar-link.active {
|
||||
color: var(--vp-c-brand-1);
|
||||
background-color: rgba(45, 212, 191, 0.1); /* 暗色模式下更通透 */
|
||||
box-shadow: inset 2px 0 0 0 var(--vp-c-brand-1); /* 左侧高亮条 */
|
||||
}
|
||||
|
||||
/* 3. 主内容区:居中与留白 */
|
||||
.VPContent {
|
||||
margin-top: var(--vp-nav-height);
|
||||
margin-left: var(--vp-sidebar-width);
|
||||
padding: 48px 64px;
|
||||
min-height: calc(100vh - var(--vp-nav-height));
|
||||
background-color: var(--vp-c-bg);
|
||||
transition: margin-left 0.3s ease;
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.VPContent { margin-left: 0; padding: 32px 24px; }
|
||||
}
|
||||
|
||||
/* 内容排版 (Typography) */
|
||||
.vp-doc h1 {
|
||||
font-size: 2.5rem;
|
||||
font-weight: 800;
|
||||
margin-bottom: 1.5rem;
|
||||
line-height: 1.2;
|
||||
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
display: inline-block;
|
||||
/* 暗色模式下加一点文字阴影增强可读性 */
|
||||
filter: drop-shadow(0 0 2em rgba(20, 184, 166, 0.2));
|
||||
}
|
||||
.dark .vp-doc h1 {
|
||||
filter: drop-shadow(0 0 25px rgba(45, 212, 191, 0.2));
|
||||
}
|
||||
|
||||
.vp-doc h2 {
|
||||
font-size: 1.8rem;
|
||||
margin-top: 3rem;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: 1px solid var(--vp-c-border);
|
||||
color: var(--vp-c-text-1);
|
||||
}
|
||||
|
||||
.vp-doc h3 {
|
||||
font-size: 1.4rem;
|
||||
margin-top: 2rem;
|
||||
margin-bottom: 0.8rem;
|
||||
color: var(--vp-c-text-1);
|
||||
}
|
||||
|
||||
.vp-doc p {
|
||||
line-height: 1.8;
|
||||
margin-bottom: 1.2rem;
|
||||
color: var(--vp-c-text-2);
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
/* 代码块美化 */
|
||||
.vp-doc pre {
|
||||
background-color: #1e293b; /* Dark Slate */
|
||||
border-radius: var(--vp-radius-default);
|
||||
padding: 20px;
|
||||
overflow-x: auto;
|
||||
color: #f8fafc;
|
||||
margin: 24px 0;
|
||||
border: 1px solid rgba(0,0,0,0.1);
|
||||
box-shadow: var(--vp-shadow-1);
|
||||
}
|
||||
.dark .vp-doc pre {
|
||||
background-color: #0f172a; /* 更深一层的背景 */
|
||||
border: 1px solid #1e293b;
|
||||
}
|
||||
|
||||
.vp-doc code {
|
||||
font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.vp-doc p code {
|
||||
background-color: var(--vp-c-brand-soft);
|
||||
color: var(--vp-c-brand-3);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.dark .vp-doc p code {
|
||||
color: var(--vp-c-brand-1);
|
||||
background-color: rgba(45, 212, 191, 0.1);
|
||||
}
|
||||
|
||||
/* 引用块 (Blockquote) */
|
||||
.vp-doc blockquote {
|
||||
margin: 1.5rem 0;
|
||||
padding: 16px 24px;
|
||||
background-color: var(--vp-c-bg-alt);
|
||||
border-left: 4px solid var(--vp-c-brand-1);
|
||||
border-radius: 0 var(--vp-radius-default) var(--vp-radius-default) 0;
|
||||
color: var(--vp-c-text-2);
|
||||
}
|
||||
.dark .vp-doc blockquote {
|
||||
background-color: rgba(30, 41, 59, 0.5);
|
||||
}
|
||||
|
||||
/* 按钮与卡片 (Features) */
|
||||
.vp-button {
|
||||
display: inline-block;
|
||||
padding: 0 24px;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
border-radius: 24px; /* Pill shape */
|
||||
font-weight: 600;
|
||||
font-size: 1rem;
|
||||
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.vp-button.brand {
|
||||
background: linear-gradient(135deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
|
||||
color: white;
|
||||
box-shadow: var(--vp-shadow-brand);
|
||||
}
|
||||
.dark .vp-button.brand {
|
||||
color: #020617; /* 暗色模式下按钮文字用深色,因为背景亮 */
|
||||
}
|
||||
|
||||
.vp-button.brand:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px -4px rgba(20, 184, 166, 0.5);
|
||||
}
|
||||
.dark .vp-button.brand:hover {
|
||||
box-shadow: 0 0 30px -4px rgba(45, 212, 191, 0.6); /* 发光增强 */
|
||||
}
|
||||
|
||||
.vp-button.alt {
|
||||
background-color: var(--vp-c-bg-alt);
|
||||
color: var(--vp-c-text-1);
|
||||
border: 1px solid var(--vp-c-border);
|
||||
}
|
||||
.dark .vp-button.alt {
|
||||
background-color: transparent;
|
||||
border-color: var(--vp-c-text-2);
|
||||
color: var(--vp-c-text-1);
|
||||
}
|
||||
|
||||
.vp-button.alt:hover {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
color: var(--vp-c-brand-1);
|
||||
}
|
||||
|
||||
/* 工具类 */
|
||||
.theme-toggle {
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-size: 1.5rem;
|
||||
color: var(--vp-c-text-2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8px;
|
||||
border-radius: 50%;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.theme-toggle:hover {
|
||||
background-color: var(--vp-c-bg-alt);
|
||||
color: var(--vp-c-brand-1);
|
||||
}
|
||||
.dark .theme-toggle:hover {
|
||||
background-color: var(--vp-c-bg-elv);
|
||||
}
|
||||
|
||||
.mobile-menu-btn {
|
||||
display: none;
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 1.5rem;
|
||||
color: var(--vp-c-text-1);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.mobile-menu-btn { display: block; }
|
||||
.nav-links { display: none; }
|
||||
}
|
||||
|
||||
/* 首页 Hero 样式模拟 */
|
||||
.hero-section {
|
||||
text-align: center;
|
||||
padding: 80px 20px;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.hero-title {
|
||||
font-size: 3.5rem;
|
||||
font-weight: 900;
|
||||
line-height: 1.1;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.hero-title span {
|
||||
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
.hero-desc {
|
||||
font-size: 1.5rem;
|
||||
color: var(--vp-c-text-2);
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* Features Grid */
|
||||
.features-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 24px;
|
||||
margin-top: 64px;
|
||||
}
|
||||
.feature-card {
|
||||
background-color: var(--vp-c-bg-alt);
|
||||
padding: 24px;
|
||||
border-radius: var(--vp-radius-default);
|
||||
transition: transform 0.3s, box-shadow 0.3s;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
.dark .feature-card {
|
||||
background-color: rgba(30, 41, 59, 0.3); /* 微微透明 */
|
||||
border: 1px solid rgba(255,255,255,0.05);
|
||||
}
|
||||
|
||||
.feature-card:hover {
|
||||
background-color: var(--vp-c-bg);
|
||||
transform: translateY(-4px);
|
||||
box-shadow: var(--vp-shadow-2);
|
||||
border-color: var(--vp-c-brand-soft);
|
||||
}
|
||||
.dark .feature-card:hover {
|
||||
background-color: var(--vp-c-bg-elv);
|
||||
border-color: var(--vp-c-brand-1);
|
||||
box-shadow: 0 0 15px rgba(45, 212, 191, 0.1);
|
||||
}
|
||||
|
||||
.feature-icon {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 16px;
|
||||
color: var(--vp-c-brand-1);
|
||||
background-color: var(--vp-c-brand-soft);
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.feature-title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 8px;
|
||||
color: var(--vp-c-text-1);
|
||||
}
|
||||
.feature-details {
|
||||
color: var(--vp-c-text-2);
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import './custom.css'
|
||||
|
||||
export default {
|
||||
...DefaultTheme,
|
||||
}
|
||||
@@ -0,0 +1,454 @@
|
||||
# 预签名上传 API 文档
|
||||
|
||||
## 概述
|
||||
|
||||
预签名上传功能提供统一的文件上传接口,根据后端存储类型自动选择最优上传方式:
|
||||
|
||||
- **S3 存储**: 返回预签名 URL,客户端直传 S3(减少服务器带宽压力)
|
||||
- **其他存储**: 返回代理上传 URL,通过服务器中转上传
|
||||
|
||||
## 上传流程
|
||||
|
||||
### 流程图
|
||||
|
||||
```
|
||||
┌─────────┐ 1. 初始化上传 ┌─────────┐
|
||||
│ 客户端 │ ──────────────────────▶ │ 服务器 │
|
||||
└─────────┘ └─────────┘
|
||||
│ │
|
||||
│◀─────── 返回 upload_url + mode ──┤
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────┐
|
||||
│ │ if mode == "direct" (S3存储) │
|
||||
│ │ 2a. PUT 文件到 upload_url (S3) │
|
||||
│ │ 3a. POST /confirm 确认上传 │
|
||||
│ │ │
|
||||
│ │ if mode == "proxy" (其他存储) │
|
||||
│ │ 2b. PUT 文件到 upload_url (服务器) │
|
||||
│ │ (自动返回分享码,无需确认) │
|
||||
│ └─────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
获取分享码
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## API 端点
|
||||
|
||||
### 1. 初始化上传
|
||||
|
||||
初始化预签名上传会话,获取上传 URL 和模式。
|
||||
|
||||
**请求**
|
||||
|
||||
```
|
||||
POST /presign/upload/init
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
**请求体**
|
||||
|
||||
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|
||||
| ------------ | ------- | ---- | ------ | --------------------------------------- |
|
||||
| file_name | string | ✅ | - | 文件名(含扩展名) |
|
||||
| file_size | integer | ✅ | - | 文件大小(字节) |
|
||||
| expire_value | integer | ❌ | 1 | 过期时间值 |
|
||||
| expire_style | string | ❌ | "day" | 过期类型:day/hour/minute/forever/count |
|
||||
|
||||
**请求示例**
|
||||
|
||||
```json
|
||||
{
|
||||
"file_name": "document.pdf",
|
||||
"file_size": 1048576,
|
||||
"expire_value": 7,
|
||||
"expire_style": "day"
|
||||
}
|
||||
```
|
||||
|
||||
**响应**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"upload_id": "a1b2c3d4e5f6...",
|
||||
"upload_url": "https://bucket.s3.amazonaws.com/path?X-Amz-Signature=...",
|
||||
"mode": "direct",
|
||||
"save_path": "share/data/2024/01/01/uuid/document.pdf",
|
||||
"expires_in": 900
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**响应字段说明**
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ---------- | ------- | ----------------------------------------------------- |
|
||||
| upload_id | string | 上传会话 ID,后续操作需要 |
|
||||
| upload_url | string | 上传目标 URL |
|
||||
| mode | string | 上传模式:`direct`(直传 S3)或 `proxy`(服务器代理) |
|
||||
| save_path | string | 文件存储路径 |
|
||||
| expires_in | integer | URL 有效期(秒),默认 900 秒(15 分钟) |
|
||||
|
||||
**错误响应**
|
||||
|
||||
| 状态码 | 说明 |
|
||||
| ------ | ------------------------------ |
|
||||
| 400 | 过期时间类型错误 |
|
||||
| 403 | 文件大小超过限制 / IP 频率限制 |
|
||||
|
||||
---
|
||||
|
||||
### 2a. 直传模式 - 上传文件到 S3
|
||||
|
||||
当 `mode == "direct"` 时,客户端直接将文件 PUT 到返回的预签名 URL。
|
||||
|
||||
**请求**
|
||||
|
||||
```
|
||||
PUT {upload_url}
|
||||
Content-Type: application/octet-stream
|
||||
|
||||
[文件二进制内容]
|
||||
```
|
||||
|
||||
**注意事项**
|
||||
|
||||
- 直接使用返回的 `upload_url`,不要修改
|
||||
- Content-Type 建议使用 `application/octet-stream`
|
||||
- 这是直接请求 S3,不经过服务器
|
||||
|
||||
**JavaScript 示例**
|
||||
|
||||
```javascript
|
||||
const response = await fetch(uploadUrl, {
|
||||
method: 'PUT',
|
||||
body: file,
|
||||
headers: {
|
||||
'Content-Type': 'application/octet-stream',
|
||||
},
|
||||
})
|
||||
|
||||
if (response.ok) {
|
||||
// 上传成功,调用确认接口
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 2b. 代理模式 - 上传文件到服务器
|
||||
|
||||
当 `mode == "proxy"` 时,客户端将文件 PUT 到服务器代理端点。
|
||||
|
||||
**请求**
|
||||
|
||||
```
|
||||
PUT /presign/upload/proxy/{upload_id}
|
||||
Content-Type: multipart/form-data
|
||||
|
||||
file: [文件]
|
||||
```
|
||||
|
||||
**路径参数**
|
||||
|
||||
| 参数 | 说明 |
|
||||
| --------- | ------------------------- |
|
||||
| upload_id | 初始化时返回的上传会话 ID |
|
||||
|
||||
**响应**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "123456",
|
||||
"name": "document.pdf"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**注意**: 代理模式上传成功后直接返回分享码,无需调用确认接口。
|
||||
|
||||
**错误响应**
|
||||
|
||||
| 状态码 | 说明 |
|
||||
| ------ | --------------------------------------- |
|
||||
| 400 | 文件大小与声明不符 / 会话不支持代理上传 |
|
||||
| 404 | 上传会话不存在或已过期 |
|
||||
| 500 | 文件保存失败 |
|
||||
|
||||
---
|
||||
|
||||
### 3. 确认上传(仅直传模式)
|
||||
|
||||
直传模式下,客户端完成 S3 上传后调用此接口确认并获取分享码。
|
||||
|
||||
**请求**
|
||||
|
||||
```
|
||||
POST /presign/upload/confirm/{upload_id}
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
**路径参数**
|
||||
|
||||
| 参数 | 说明 |
|
||||
| --------- | ------------------------- |
|
||||
| upload_id | 初始化时返回的上传会话 ID |
|
||||
|
||||
**请求体**
|
||||
|
||||
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|
||||
| ------------ | ------- | ---- | ------ | ---------- |
|
||||
| expire_value | integer | ❌ | 1 | 过期时间值 |
|
||||
| expire_style | string | ❌ | "day" | 过期类型 |
|
||||
|
||||
**请求示例**
|
||||
|
||||
```json
|
||||
{
|
||||
"expire_value": 7,
|
||||
"expire_style": "day"
|
||||
}
|
||||
```
|
||||
|
||||
**响应**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "123456",
|
||||
"name": "document.pdf"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**错误响应**
|
||||
|
||||
| 状态码 | 说明 |
|
||||
| ------ | --------------------------------------------- |
|
||||
| 400 | 会话不支持直传确认 |
|
||||
| 404 | 上传会话不存在或已过期 / 文件未上传或上传失败 |
|
||||
|
||||
---
|
||||
|
||||
### 4. 查询上传状态
|
||||
|
||||
查询上传会话的当前状态。
|
||||
|
||||
**请求**
|
||||
|
||||
```
|
||||
GET /presign/upload/status/{upload_id}
|
||||
```
|
||||
|
||||
**响应**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"upload_id": "a1b2c3d4e5f6...",
|
||||
"file_name": "document.pdf",
|
||||
"file_size": 1048576,
|
||||
"mode": "direct",
|
||||
"created_at": "2024-01-01T12:00:00",
|
||||
"expires_at": "2024-01-01T12:15:00",
|
||||
"is_expired": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**错误响应**
|
||||
|
||||
| 状态码 | 说明 |
|
||||
| ------ | -------------- |
|
||||
| 404 | 上传会话不存在 |
|
||||
|
||||
---
|
||||
|
||||
### 5. 取消上传
|
||||
|
||||
取消上传会话并清理相关资源。
|
||||
|
||||
**请求**
|
||||
|
||||
```
|
||||
DELETE /presign/upload/{upload_id}
|
||||
```
|
||||
|
||||
**响应**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"message": "上传会话已取消"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**错误响应**
|
||||
|
||||
| 状态码 | 说明 |
|
||||
| ------ | -------------- |
|
||||
| 404 | 上传会话不存在 |
|
||||
|
||||
---
|
||||
|
||||
## 前端集成示例
|
||||
|
||||
### 完整上传流程(JavaScript/TypeScript)
|
||||
|
||||
```typescript
|
||||
interface PresignInitResponse {
|
||||
upload_id: string
|
||||
upload_url: string
|
||||
mode: 'direct' | 'proxy'
|
||||
save_path: string
|
||||
expires_in: number
|
||||
}
|
||||
|
||||
interface UploadResult {
|
||||
code: string
|
||||
name: string
|
||||
}
|
||||
|
||||
async function uploadFile(
|
||||
file: File,
|
||||
expireValue: number = 1,
|
||||
expireStyle: string = 'day'
|
||||
): Promise<UploadResult> {
|
||||
// 1. 初始化上传
|
||||
const initResponse = await fetch('/presign/upload/init', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
file_name: file.name,
|
||||
file_size: file.size,
|
||||
expire_value: expireValue,
|
||||
expire_style: expireStyle,
|
||||
}),
|
||||
})
|
||||
|
||||
const initData = await initResponse.json()
|
||||
if (initData.code !== 200) {
|
||||
throw new Error(initData.detail)
|
||||
}
|
||||
|
||||
const { upload_id, upload_url, mode } = initData.detail as PresignInitResponse
|
||||
|
||||
// 2. 根据模式上传文件
|
||||
if (mode === 'direct') {
|
||||
// 直传模式:上传到S3
|
||||
const uploadResponse = await fetch(upload_url, {
|
||||
method: 'PUT',
|
||||
body: file,
|
||||
headers: { 'Content-Type': 'application/octet-stream' },
|
||||
})
|
||||
|
||||
if (!uploadResponse.ok) {
|
||||
throw new Error('S3上传失败')
|
||||
}
|
||||
|
||||
// 3. 确认上传
|
||||
const confirmResponse = await fetch(
|
||||
`/presign/upload/confirm/${upload_id}`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
expire_value: expireValue,
|
||||
expire_style: expireStyle,
|
||||
}),
|
||||
}
|
||||
)
|
||||
|
||||
const confirmData = await confirmResponse.json()
|
||||
if (confirmData.code !== 200) {
|
||||
throw new Error(confirmData.detail)
|
||||
}
|
||||
|
||||
return confirmData.detail
|
||||
} else {
|
||||
// 代理模式:上传到服务器
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
|
||||
const uploadResponse = await fetch(upload_url, {
|
||||
method: 'PUT',
|
||||
body: formData,
|
||||
})
|
||||
|
||||
const uploadData = await uploadResponse.json()
|
||||
if (uploadData.code !== 200) {
|
||||
throw new Error(uploadData.detail)
|
||||
}
|
||||
|
||||
return uploadData.detail
|
||||
}
|
||||
}
|
||||
|
||||
// 使用示例
|
||||
const file = document.querySelector('input[type="file"]').files[0]
|
||||
const result = await uploadFile(file, 7, 'day')
|
||||
console.log('分享码:', result.code)
|
||||
```
|
||||
|
||||
### Vue 3 组件示例
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<div>
|
||||
<input type="file" @change="handleFileSelect" />
|
||||
<button @click="upload" :disabled="!selectedFile || uploading">
|
||||
{{ uploading ? '上传中...' : '上传' }}
|
||||
</button>
|
||||
<div v-if="shareCode">分享码: {{ shareCode }}</div>
|
||||
<div v-if="error" class="error">{{ error }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
|
||||
const selectedFile = ref<File | null>(null)
|
||||
const uploading = ref(false)
|
||||
const shareCode = ref('')
|
||||
const error = ref('')
|
||||
|
||||
function handleFileSelect(e: Event) {
|
||||
const input = e.target as HTMLInputElement
|
||||
selectedFile.value = input.files?.[0] || null
|
||||
}
|
||||
|
||||
async function upload() {
|
||||
if (!selectedFile.value) return
|
||||
|
||||
uploading.value = true
|
||||
error.value = ''
|
||||
|
||||
try {
|
||||
const result = await uploadFile(selectedFile.value)
|
||||
shareCode.value = result.code
|
||||
} catch (e) {
|
||||
error.value = e.message
|
||||
} finally {
|
||||
uploading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. **会话有效期**: 上传会话默认 15 分钟后过期,请在有效期内完成上传
|
||||
2. **文件大小限制**: 受系统配置 `uploadSize` 限制
|
||||
3. **过期类型**: 支持 `day`、`hour`、`minute`、`forever`、`count`
|
||||
4. **CORS**: 直传模式下,S3 需要配置正确的 CORS 策略
|
||||
5. **重试机制**: 建议实现上传失败重试逻辑
|
||||
@@ -0,0 +1,207 @@
|
||||
# Configuration Guide
|
||||
|
||||
FileCodeBox provides rich configuration options that can be customized through the admin panel or by directly modifying the configuration. This document details all available configuration options.
|
||||
|
||||
## Configuration Methods
|
||||
|
||||
FileCodeBox supports two configuration methods:
|
||||
|
||||
1. **Admin Panel Configuration** (Recommended): Access `/admin` to enter the admin panel and modify settings on the settings page
|
||||
2. **Database Configuration**: Configuration is stored in the `data/filecodebox.db` database
|
||||
|
||||
::: tip Note
|
||||
On first startup, the system uses default configuration from `core/settings.py`. Modified configurations are saved to the database.
|
||||
:::
|
||||
|
||||
## Basic Settings
|
||||
|
||||
### Site Information
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `name` | string | `文件快递柜 - FileCodeBox` | Site name, displayed in page title and navigation bar |
|
||||
| `description` | string | `开箱即用的文件快传系统` | Site description, used for SEO |
|
||||
| `keywords` | string | `FileCodeBox, 文件快递柜...` | Site keywords, used for SEO |
|
||||
| `port` | int | `12345` | Service listening port |
|
||||
|
||||
### Notification Settings
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `notify_title` | string | `系统通知` | Notification title |
|
||||
| `notify_content` | string | Welcome message | Notification content, supports HTML |
|
||||
| `page_explain` | string | Legal disclaimer | Footer explanation text |
|
||||
| `robotsText` | string | `User-agent: *\nDisallow: /` | robots.txt content |
|
||||
|
||||
## Upload Settings
|
||||
|
||||
### File Upload Limits
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `openUpload` | int | `1` | Enable upload functionality (1=enabled, 0=disabled) |
|
||||
| `uploadSize` | int | `10485760` | Maximum single file upload size (bytes), default 10MB |
|
||||
| `enableChunk` | int | `0` | Enable chunked upload (1=enabled, 0=disabled) |
|
||||
|
||||
::: warning Note
|
||||
`uploadSize` is in bytes. 10MB = 10 * 1024 * 1024 = 10485760 bytes
|
||||
:::
|
||||
|
||||
### Upload Rate Limiting
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `uploadMinute` | int | `1` | Upload limit time window (minutes) |
|
||||
| `uploadCount` | int | `10` | Maximum uploads allowed within the time window |
|
||||
|
||||
Example: Default configuration allows up to 10 uploads per minute.
|
||||
|
||||
|
||||
### File Expiration Settings
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `expireStyle` | list | `["day","hour","minute","forever","count"]` | Available expiration methods |
|
||||
| `max_save_seconds` | int | `0` | Maximum file retention time (seconds), 0 means no limit |
|
||||
|
||||
Expiration methods explained:
|
||||
- `day` - Expire by days
|
||||
- `hour` - Expire by hours
|
||||
- `minute` - Expire by minutes
|
||||
- `forever` - Never expire
|
||||
- `count` - Expire by download count
|
||||
|
||||
## Theme Settings
|
||||
|
||||
### Theme Selection
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `themesSelect` | string | `themes/2024` | Currently active theme |
|
||||
| `themesChoices` | list | See below | Available themes list |
|
||||
|
||||
Default available themes:
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "2023",
|
||||
"key": "themes/2023",
|
||||
"author": "Lan",
|
||||
"version": "1.0"
|
||||
},
|
||||
{
|
||||
"name": "2024",
|
||||
"key": "themes/2024",
|
||||
"author": "Lan",
|
||||
"version": "1.0"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Interface Style
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `opacity` | float | `0.9` | Interface opacity (0-1) |
|
||||
| `background` | string | `""` | Custom background image URL, empty uses default background |
|
||||
|
||||
## Admin Settings
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `admin_token` | string | `FileCodeBox2023` | Admin login password |
|
||||
| `showAdminAddr` | int | `0` | Show admin panel entry on homepage (1=show, 0=hide) |
|
||||
|
||||
::: danger Security Warning
|
||||
Always change the default `admin_token` in production environments! Using the default password poses serious security risks.
|
||||
:::
|
||||
|
||||
## Security Settings
|
||||
|
||||
### Error Rate Limiting
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `errorMinute` | int | `1` | Error limit time window (minutes) |
|
||||
| `errorCount` | int | `1` | Maximum errors allowed within the time window |
|
||||
|
||||
This setting prevents brute-force attacks on extraction codes.
|
||||
|
||||
## Storage Settings
|
||||
|
||||
### Storage Type
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `file_storage` | string | `local` | Storage backend type |
|
||||
| `storage_path` | string | `""` | Custom storage path |
|
||||
|
||||
Supported storage types:
|
||||
- `local` - Local storage
|
||||
- `s3` - S3-compatible storage (AWS S3, Aliyun OSS, MinIO, etc.)
|
||||
- `onedrive` - OneDrive storage
|
||||
- `webdav` - WebDAV storage
|
||||
- `opendal` - OpenDAL storage
|
||||
|
||||
For detailed storage configuration, see [Storage Configuration](/en/guide/storage).
|
||||
|
||||
## Configuration Examples
|
||||
|
||||
### Example 1: Small Personal Use
|
||||
|
||||
Suitable for personal or small team use with relaxed limits:
|
||||
|
||||
```python
|
||||
{
|
||||
"name": "My File Share",
|
||||
"uploadSize": 52428800, # 50MB
|
||||
"uploadMinute": 5, # 5 minutes
|
||||
"uploadCount": 20, # Max 20 uploads
|
||||
"expireStyle": ["day", "hour", "forever"],
|
||||
"admin_token": "your-secure-password",
|
||||
"showAdminAddr": 1
|
||||
}
|
||||
```
|
||||
|
||||
### Example 2: Public Service
|
||||
|
||||
Suitable for public services requiring stricter limits:
|
||||
|
||||
```python
|
||||
{
|
||||
"name": "Public File Box",
|
||||
"uploadSize": 10485760, # 10MB
|
||||
"uploadMinute": 1, # 1 minute
|
||||
"uploadCount": 5, # Max 5 uploads
|
||||
"errorMinute": 5, # 5 minutes
|
||||
"errorCount": 3, # Max 3 errors
|
||||
"expireStyle": ["hour", "minute", "count"],
|
||||
"max_save_seconds": 86400, # Max retention 1 day
|
||||
"admin_token": "very-secure-password-123",
|
||||
"showAdminAddr": 0
|
||||
}
|
||||
```
|
||||
|
||||
### Example 3: Enterprise Internal Use
|
||||
|
||||
Suitable for enterprise internal use with large file and chunked upload support:
|
||||
|
||||
```python
|
||||
{
|
||||
"name": "Enterprise File Transfer",
|
||||
"uploadSize": 1073741824, # 1GB
|
||||
"enableChunk": 1, # Enable chunked upload
|
||||
"uploadMinute": 10, # 10 minutes
|
||||
"uploadCount": 100, # Max 100 uploads
|
||||
"expireStyle": ["day", "forever"],
|
||||
"file_storage": "s3", # Use S3 storage
|
||||
"admin_token": "enterprise-secure-token",
|
||||
"showAdminAddr": 1
|
||||
}
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Storage Configuration](/en/guide/storage) - Learn how to configure different storage backends
|
||||
- [Security Settings](/en/guide/security) - Learn how to enhance system security
|
||||
- [File Sharing](/en/guide/share) - Learn about file sharing features
|
||||
@@ -0,0 +1,413 @@
|
||||
# Admin Panel
|
||||
|
||||
FileCodeBox provides a fully-featured admin panel that allows administrators to conveniently manage files, view system status, and modify configurations. This document introduces the various features and usage of the admin panel.
|
||||
|
||||
## Accessing the Admin Panel
|
||||
|
||||
### Login Method
|
||||
|
||||
The admin panel is located at the `/admin` path. Access method:
|
||||
|
||||
1. Visit `http://your-domain.com/admin` in your browser
|
||||
2. Enter the admin password (the value of the `admin_token` configuration)
|
||||
3. Click the login button
|
||||
|
||||
::: tip Tip
|
||||
The default admin password is `FileCodeBox2023`. Be sure to change this password in production environments. See [Security Settings](/en/guide/security) for details.
|
||||
:::
|
||||
|
||||
### Show Admin Entry
|
||||
|
||||
By default, the admin panel entry is not shown on the homepage. You can control whether to show it via configuration:
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `showAdminAddr` | int | `0` | Show admin entry on homepage (1=show, 0=hide) |
|
||||
|
||||
::: warning Security Recommendation
|
||||
For public services, it's recommended to keep `showAdminAddr` at `0` and access the admin panel directly via the `/admin` path to reduce the risk of malicious scanning.
|
||||
:::
|
||||
|
||||
### Authentication Mechanism
|
||||
|
||||
The admin panel uses JWT (JSON Web Token) for authentication:
|
||||
|
||||
1. After successful login, the server returns a Token containing admin identity
|
||||
2. Subsequent requests carry the Token via `Authorization: Bearer <token>` header
|
||||
3. Token is used to verify admin identity, ensuring only authorized users can access admin functions
|
||||
|
||||
## Dashboard
|
||||
|
||||
After logging in, you first see the dashboard page, which displays the overall system status.
|
||||
|
||||
### Statistics
|
||||
|
||||
The dashboard displays the following key metrics:
|
||||
|
||||
| Metric | Description |
|
||||
|--------|-------------|
|
||||
| **Total Files** (`totalFiles`) | Total number of files stored in the system |
|
||||
| **Storage Used** (`storageUsed`) | Total storage space occupied by all files (bytes) |
|
||||
| **System Uptime** (`sysUptime`) | Time when the system was first started |
|
||||
| **Yesterday's Uploads** (`yesterdayCount`) | Number of files uploaded yesterday |
|
||||
| **Yesterday's Upload Size** (`yesterdaySize`) | Total size of files uploaded yesterday (bytes) |
|
||||
| **Today's Uploads** (`todayCount`) | Number of files uploaded today so far |
|
||||
| **Today's Upload Size** (`todaySize`) | Total size of files uploaded today (bytes) |
|
||||
|
||||
### Metric Notes
|
||||
|
||||
- **Total Files**: Includes all unexpired files and text shares
|
||||
- **Storage Used**: Shows actual storage space occupied by files, excluding database and other system files
|
||||
- **Yesterday/Today Statistics**: Calculated based on file creation time, useful for understanding system usage trends
|
||||
|
||||
::: tip Tip
|
||||
Storage usage is displayed in bytes. For example, `10485760` represents approximately 10MB.
|
||||
:::
|
||||
|
||||
## File Management
|
||||
|
||||
### File List
|
||||
|
||||
The file management page displays all shared files in the system, supporting pagination and search.
|
||||
|
||||
**List information includes:**
|
||||
- File ID
|
||||
- Extraction code (code)
|
||||
- Filename prefix (prefix)
|
||||
- File extension (suffix)
|
||||
- File size
|
||||
- Creation time
|
||||
- Expiration time
|
||||
- Remaining download count
|
||||
|
||||
### Search Files
|
||||
|
||||
Use the search function to quickly find specific files:
|
||||
|
||||
1. Enter keywords in the search box
|
||||
2. System performs fuzzy matching based on filename prefix (prefix)
|
||||
3. Search results update in real-time
|
||||
|
||||
**Search examples:**
|
||||
- Enter `report` to find all files with "report" in the filename
|
||||
- Enter `.pdf` to find all PDF files (if the filename contains this string)
|
||||
|
||||
### Pagination
|
||||
|
||||
The file list supports paginated display:
|
||||
|
||||
| Parameter | Default | Description |
|
||||
|-----------|---------|-------------|
|
||||
| `page` | `1` | Current page number |
|
||||
| `size` | `10` | Items per page |
|
||||
|
||||
|
||||
### Delete Files
|
||||
|
||||
Administrators can delete any file:
|
||||
|
||||
1. Find the file to delete in the file list
|
||||
2. Click the delete button
|
||||
3. Confirm the delete operation
|
||||
|
||||
::: danger Warning
|
||||
Delete operations are irreversible! Files will be permanently deleted from the storage backend, and database records will also be removed.
|
||||
:::
|
||||
|
||||
**Delete process:**
|
||||
1. System first deletes the actual file from the storage backend (local/S3/OneDrive, etc.)
|
||||
2. Then deletes the file record from the database
|
||||
3. After deletion, the corresponding extraction code becomes invalid
|
||||
|
||||
### Download Files
|
||||
|
||||
Administrators can directly download any file:
|
||||
|
||||
1. Find the target file in the file list
|
||||
2. Click the download button
|
||||
3. File will be downloaded via browser
|
||||
|
||||
For text shares, the system returns text content directly instead of downloading a file.
|
||||
|
||||
### Modify File Information
|
||||
|
||||
Administrators can modify some information of shared files:
|
||||
|
||||
| Modifiable Field | Description |
|
||||
|------------------|-------------|
|
||||
| `code` | Extraction code (must be unique, cannot duplicate other files) |
|
||||
| `prefix` | Filename prefix |
|
||||
| `suffix` | File extension |
|
||||
| `expired_at` | Expiration time |
|
||||
| `expired_count` | Remaining download count |
|
||||
|
||||
**Modify extraction code:**
|
||||
```
|
||||
Original code: abc123
|
||||
New code: myfile2024
|
||||
```
|
||||
|
||||
::: warning Note
|
||||
When modifying extraction codes, the system checks if the new code is already in use. If an identical extraction code exists, the modification will fail.
|
||||
:::
|
||||
|
||||
## Local File Management
|
||||
|
||||
In addition to managing shared files, the admin panel also provides local file management functionality for managing files in the `data/local` directory.
|
||||
|
||||
### View Local Files
|
||||
|
||||
The local file list displays all files in the `data/local` directory:
|
||||
|
||||
| Information | Description |
|
||||
|-------------|-------------|
|
||||
| Filename | Complete filename |
|
||||
| Creation Time | File creation time |
|
||||
| File Size | File size (bytes) |
|
||||
|
||||
### Share Local Files
|
||||
|
||||
You can quickly share local files:
|
||||
|
||||
1. Select the file to share in the local file list
|
||||
2. Set expiration method and value
|
||||
3. Click the share button
|
||||
4. System generates extraction code
|
||||
|
||||
**Share parameters:**
|
||||
|
||||
| Parameter | Description |
|
||||
|-----------|-------------|
|
||||
| `filename` | Filename to share |
|
||||
| `expire_style` | Expiration method (day/hour/minute/forever/count) |
|
||||
| `expire_value` | Expiration value (days/hours/minutes/download count) |
|
||||
|
||||
### Delete Local Files
|
||||
|
||||
You can delete files in the `data/local` directory:
|
||||
|
||||
1. Find the file to delete in the local file list
|
||||
2. Click the delete button
|
||||
3. Confirm deletion
|
||||
|
||||
::: tip Use Cases
|
||||
Local file management is useful for:
|
||||
- Sharing files after batch uploading to the server
|
||||
- Managing files uploaded to the server through other means
|
||||
- Cleaning up unnecessary local files
|
||||
:::
|
||||
|
||||
## System Settings
|
||||
|
||||
### View Configuration
|
||||
|
||||
On the system settings page, you can view the current values of all configuration items. Configuration items are grouped by category:
|
||||
|
||||
- Basic settings (site name, description, etc.)
|
||||
- Upload settings (file size limits, rate limits, etc.)
|
||||
- Storage settings (storage type, path, etc.)
|
||||
- Theme settings (theme selection, opacity, etc.)
|
||||
- Security settings (admin password, error limits, etc.)
|
||||
|
||||
### Modify Configuration
|
||||
|
||||
Administrators can modify most configurations through the admin panel:
|
||||
|
||||
1. Go to the system settings page
|
||||
2. Find the configuration item to modify
|
||||
3. Enter the new value
|
||||
4. Click the save button
|
||||
|
||||
**Modifiable configuration items:**
|
||||
|
||||
| Category | Example Settings |
|
||||
|----------|------------------|
|
||||
| Basic Settings | `name`, `description`, `keywords`, `notify_title`, `notify_content` |
|
||||
| Upload Settings | `uploadSize`, `uploadMinute`, `uploadCount`, `openUpload`, `enableChunk` |
|
||||
| Expiration Settings | `expireStyle`, `max_save_seconds` |
|
||||
| Theme Settings | `themesSelect`, `opacity`, `background` |
|
||||
| Security Settings | `admin_token`, `showAdminAddr`, `errorMinute`, `errorCount` |
|
||||
| Storage Settings | `file_storage`, `storage_path` and storage backend-specific configurations |
|
||||
|
||||
::: warning Note
|
||||
- `admin_token` (admin password) cannot be set to empty
|
||||
- `themesChoices` (theme list) cannot be modified through the admin panel
|
||||
- After modifying storage settings, existing files will not be automatically migrated
|
||||
:::
|
||||
|
||||
### Configuration Effect
|
||||
|
||||
Configuration changes take effect immediately without restarting the service. Configurations are saved in the database and persist after restart.
|
||||
|
||||
**Configuration storage location:**
|
||||
- Database: `data/filecodebox.db`
|
||||
- Table name: `keyvalue`
|
||||
- Key name: `settings`
|
||||
|
||||
## API Endpoints
|
||||
|
||||
All admin panel functions are implemented through REST APIs. Here are the main endpoints:
|
||||
|
||||
### Authentication Endpoint
|
||||
|
||||
**Login**
|
||||
```
|
||||
POST /admin/login
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"password": "your-admin-password"
|
||||
}
|
||||
```
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"token": "eyJhbGciOiJIUzI1NiIs...",
|
||||
"token_type": "Bearer"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Dashboard Endpoint
|
||||
|
||||
**Get Statistics**
|
||||
```
|
||||
GET /admin/dashboard
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### File Management Endpoints
|
||||
|
||||
**Get File List**
|
||||
```
|
||||
GET /admin/file/list?page=1&size=10&keyword=
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**Delete File**
|
||||
```
|
||||
DELETE /admin/file/delete
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"id": 123
|
||||
}
|
||||
```
|
||||
|
||||
**Download File**
|
||||
```
|
||||
GET /admin/file/download?id=123
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**Modify File Information**
|
||||
```
|
||||
PATCH /admin/file/update
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"id": 123,
|
||||
"code": "newcode",
|
||||
"expired_at": "2024-12-31T23:59:59"
|
||||
}
|
||||
```
|
||||
|
||||
### Local File Endpoints
|
||||
|
||||
**Get Local File List**
|
||||
```
|
||||
GET /admin/local/lists
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**Delete Local File**
|
||||
```
|
||||
DELETE /admin/local/delete
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"filename": "example.txt"
|
||||
}
|
||||
```
|
||||
|
||||
**Share Local File**
|
||||
```
|
||||
POST /admin/local/share
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"filename": "example.txt",
|
||||
"expire_style": "day",
|
||||
"expire_value": 7
|
||||
}
|
||||
```
|
||||
|
||||
### Configuration Endpoints
|
||||
|
||||
**Get Configuration**
|
||||
```
|
||||
GET /admin/config/get
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**Update Configuration**
|
||||
```
|
||||
PATCH /admin/config/update
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"admin_token": "new-password",
|
||||
"uploadSize": 52428800
|
||||
}
|
||||
```
|
||||
|
||||
## Common Issues
|
||||
|
||||
### Forgot Admin Password
|
||||
|
||||
If you forgot the admin password, you can reset it through the following methods:
|
||||
|
||||
1. Stop the FileCodeBox service
|
||||
2. Open `data/filecodebox.db` using an SQLite tool
|
||||
3. Query the record with `key='settings'` in the `keyvalue` table
|
||||
4. Modify the `admin_token` value in the JSON
|
||||
5. Restart the service
|
||||
|
||||
```sql
|
||||
-- View current configuration
|
||||
SELECT * FROM keyvalue WHERE key = 'settings';
|
||||
|
||||
-- Or delete configuration to restore default password
|
||||
DELETE FROM keyvalue WHERE key = 'settings';
|
||||
```
|
||||
|
||||
### File Deletion Failed
|
||||
|
||||
If an error occurs when deleting files, possible reasons:
|
||||
|
||||
1. **Storage backend connection failed**: Check if storage configuration is correct
|
||||
2. **File no longer exists**: File may have been manually deleted
|
||||
3. **Insufficient permissions**: Check write permissions for storage directory
|
||||
|
||||
### Configuration Changes Not Taking Effect
|
||||
|
||||
If configuration changes don't take effect:
|
||||
|
||||
1. Check if you clicked the save button
|
||||
2. Refresh the page to see if configuration was saved
|
||||
3. Check browser console for error messages
|
||||
4. Confirm configuration value format is correct (e.g., don't enter strings for numeric types)
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Configuration Guide](/en/guide/configuration) - Learn detailed descriptions of all configuration options
|
||||
- [Security Settings](/en/guide/security) - Learn how to enhance system security
|
||||
- [Storage Configuration](/en/guide/storage) - Configure different storage backends
|
||||
@@ -0,0 +1,325 @@
|
||||
# Security Settings
|
||||
|
||||
FileCodeBox provides multiple layers of security mechanisms to protect your file sharing service. This document explains how to properly configure security options to ensure secure system operation.
|
||||
|
||||
## Admin Password
|
||||
|
||||
### Change Default Password
|
||||
|
||||
::: danger Important Security Warning
|
||||
FileCodeBox's default admin password is `FileCodeBox2023`. **You must change this password immediately in production environments!** Using the default password allows anyone to access your admin panel.
|
||||
:::
|
||||
|
||||
There are two ways to change the admin password:
|
||||
|
||||
**Method 1: Via Admin Panel (Recommended)**
|
||||
|
||||
1. Access `/admin` to enter the admin panel
|
||||
2. Log in with the current password
|
||||
3. Go to the "System Settings" page
|
||||
4. Find the `admin_token` configuration item
|
||||
5. Enter a new secure password and save
|
||||
|
||||
**Method 2: Via Database**
|
||||
|
||||
Configuration is stored in the `keyvalue` table of the `data/filecodebox.db` database. You can directly modify the `admin_token` value.
|
||||
|
||||
### Password Security Recommendations
|
||||
|
||||
- Use a strong password with at least 16 characters
|
||||
- Include uppercase and lowercase letters, numbers, and special characters
|
||||
- Avoid common words or personal information
|
||||
- Change password regularly
|
||||
|
||||
```python
|
||||
# Recommended password format example
|
||||
"admin_token": "Xk9#mP2$vL5@nQ8&wR3"
|
||||
```
|
||||
|
||||
### Hide Admin Entry
|
||||
|
||||
By default, the admin panel entry is hidden. You can control whether to show the admin entry on the homepage via the `showAdminAddr` configuration:
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `showAdminAddr` | int | `0` | Show admin entry (1=show, 0=hide) |
|
||||
|
||||
::: tip Recommendation
|
||||
For public services, it's recommended to keep `showAdminAddr` at `0` and access the admin panel directly via the `/admin` path.
|
||||
:::
|
||||
|
||||
## IP Rate Limiting
|
||||
|
||||
FileCodeBox has built-in IP-based rate limiting mechanisms to effectively prevent abuse and attacks.
|
||||
|
||||
### Upload Rate Limiting
|
||||
|
||||
Limit the number of uploads from a single IP within a specified time:
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `uploadMinute` | int | `1` | Upload limit time window (minutes) |
|
||||
| `uploadCount` | int | `10` | Maximum uploads allowed within the time window |
|
||||
|
||||
**How it works:**
|
||||
- System records upload requests from each IP
|
||||
- When an IP's upload count reaches `uploadCount` within `uploadMinute` minutes
|
||||
- Subsequent upload requests from that IP will be rejected with HTTP 423 error
|
||||
- Counter resets after the time window expires
|
||||
|
||||
**Configuration examples:**
|
||||
|
||||
```python
|
||||
# Relaxed configuration: Max 20 uploads in 5 minutes
|
||||
{
|
||||
"uploadMinute": 5,
|
||||
"uploadCount": 20
|
||||
}
|
||||
|
||||
# Strict configuration: Max 3 uploads in 1 minute
|
||||
{
|
||||
"uploadMinute": 1,
|
||||
"uploadCount": 3
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Error Rate Limiting
|
||||
|
||||
Limit the number of error attempts from a single IP to prevent brute-force attacks on extraction codes:
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `errorMinute` | int | `1` | Error limit time window (minutes) |
|
||||
| `errorCount` | int | `1` | Maximum errors allowed within the time window |
|
||||
|
||||
**How it works:**
|
||||
- When a user enters an incorrect extraction code, the system records the error count for that IP
|
||||
- When error count reaches `errorCount`, that IP will be temporarily locked
|
||||
- Lock duration is `errorMinute` minutes
|
||||
- During lockout, all extraction requests from that IP will be rejected
|
||||
|
||||
**Configuration example:**
|
||||
|
||||
```python
|
||||
# Anti-brute-force configuration: Max 3 errors in 5 minutes
|
||||
{
|
||||
"errorMinute": 5,
|
||||
"errorCount": 3
|
||||
}
|
||||
```
|
||||
|
||||
::: warning Note
|
||||
The default configuration `errorMinute=1, errorCount=1` is very strict, meaning you need to wait 1 minute after entering one incorrect extraction code before retrying. Adjust this configuration based on actual needs.
|
||||
:::
|
||||
|
||||
## Upload Restrictions
|
||||
|
||||
### File Size Limit
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `uploadSize` | int | `10485760` | Maximum single file upload size (bytes), default 10MB |
|
||||
| `openUpload` | int | `1` | Enable upload functionality (1=enabled, 0=disabled) |
|
||||
|
||||
**Common size conversions:**
|
||||
- 10MB = 10 * 1024 * 1024 = `10485760`
|
||||
- 50MB = 50 * 1024 * 1024 = `52428800`
|
||||
- 100MB = 100 * 1024 * 1024 = `104857600`
|
||||
- 1GB = 1024 * 1024 * 1024 = `1073741824`
|
||||
|
||||
### File Expiration Settings
|
||||
|
||||
Through file expiration mechanisms, you can automatically clean up expired files, reducing storage usage and security risks:
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `expireStyle` | list | `["day","hour","minute","forever","count"]` | Available expiration methods |
|
||||
| `max_save_seconds` | int | `0` | Maximum file retention time (seconds), 0 means no limit |
|
||||
|
||||
**Expiration methods explained:**
|
||||
- `day` - Expire by days
|
||||
- `hour` - Expire by hours
|
||||
- `minute` - Expire by minutes
|
||||
- `forever` - Never expire (requires alphanumeric extraction code)
|
||||
- `count` - Expire by download count
|
||||
|
||||
**Security recommendations:**
|
||||
|
||||
For public services, it's recommended to:
|
||||
1. Remove the `forever` option to avoid permanent file storage
|
||||
2. Set `max_save_seconds` to limit maximum retention time
|
||||
3. Prefer using `count` method for automatic deletion after download
|
||||
|
||||
```python
|
||||
# Recommended configuration for public services
|
||||
{
|
||||
"expireStyle": ["hour", "minute", "count"],
|
||||
"max_save_seconds": 86400 # Max retention 1 day
|
||||
}
|
||||
```
|
||||
|
||||
### Disable Upload Functionality
|
||||
|
||||
In some cases, you may need to temporarily disable upload functionality:
|
||||
|
||||
```python
|
||||
{
|
||||
"openUpload": 0 # Disable upload functionality
|
||||
}
|
||||
```
|
||||
|
||||
## Reverse Proxy Security Configuration
|
||||
|
||||
In production environments, Nginx or other reverse proxy servers are typically used. Here are security configuration recommendations:
|
||||
|
||||
### Nginx Configuration Example
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name your-domain.com;
|
||||
|
||||
# Force HTTPS redirect
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name your-domain.com;
|
||||
|
||||
# SSL certificate configuration
|
||||
ssl_certificate /path/to/cert.pem;
|
||||
ssl_certificate_key /path/to/key.pem;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
# Security headers
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
|
||||
# Limit request body size (match uploadSize configuration)
|
||||
client_max_body_size 100M;
|
||||
|
||||
# Pass real IP
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:12345;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Static resource caching
|
||||
location /assets {
|
||||
proxy_pass http://127.0.0.1:12345;
|
||||
proxy_cache_valid 200 7d;
|
||||
add_header Cache-Control "public, max-age=604800";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Key Security Configuration Notes
|
||||
|
||||
**1. Pass Real IP**
|
||||
|
||||
FileCodeBox's IP limiting functionality depends on obtaining the client's real IP. The system obtains IP in the following order:
|
||||
1. `X-Real-IP` request header
|
||||
2. `X-Forwarded-For` request header
|
||||
3. Direct client connection IP
|
||||
|
||||
Ensure the reverse proxy correctly sets these headers:
|
||||
|
||||
```nginx
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
```
|
||||
|
||||
**2. Request Body Size Limit**
|
||||
|
||||
Nginx's `client_max_body_size` should match or be slightly larger than FileCodeBox's `uploadSize` configuration:
|
||||
|
||||
```nginx
|
||||
client_max_body_size 100M; # Allow max 100MB uploads
|
||||
```
|
||||
|
||||
**3. HTTPS Encryption**
|
||||
|
||||
It's strongly recommended to enable HTTPS in production environments:
|
||||
- Protect uploaded file content
|
||||
- Protect admin login credentials
|
||||
- Prevent man-in-the-middle attacks
|
||||
|
||||
### Caddy Configuration Example
|
||||
|
||||
```nginx
|
||||
your-domain.com {
|
||||
reverse_proxy localhost:12345
|
||||
|
||||
header {
|
||||
X-Frame-Options "SAMEORIGIN"
|
||||
X-Content-Type-Options "nosniff"
|
||||
X-XSS-Protection "1; mode=block"
|
||||
Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Security Checklist
|
||||
|
||||
Before deploying FileCodeBox, confirm the following security configurations:
|
||||
|
||||
- [ ] Changed default admin password `admin_token`
|
||||
- [ ] Hidden admin entry `showAdminAddr: 0`
|
||||
- [ ] Configured appropriate upload rate limiting
|
||||
- [ ] Configured error rate limiting to prevent brute-force attacks
|
||||
- [ ] Set reasonable file size limits
|
||||
- [ ] Configured file expiration policy
|
||||
- [ ] Enabled HTTPS encryption
|
||||
- [ ] Reverse proxy correctly passes real IP
|
||||
- [ ] Set security response headers
|
||||
|
||||
## Recommended Security Configurations
|
||||
|
||||
### Public Service Configuration
|
||||
|
||||
```python
|
||||
{
|
||||
"admin_token": "your-very-secure-password",
|
||||
"showAdminAddr": 0,
|
||||
"uploadSize": 10485760, # 10MB
|
||||
"uploadMinute": 1,
|
||||
"uploadCount": 5,
|
||||
"errorMinute": 5,
|
||||
"errorCount": 3,
|
||||
"expireStyle": ["hour", "minute", "count"],
|
||||
"max_save_seconds": 86400, # Max 1 day
|
||||
"openUpload": 1
|
||||
}
|
||||
```
|
||||
|
||||
### Internal Service Configuration
|
||||
|
||||
```python
|
||||
{
|
||||
"admin_token": "internal-secure-password",
|
||||
"showAdminAddr": 1,
|
||||
"uploadSize": 104857600, # 100MB
|
||||
"uploadMinute": 5,
|
||||
"uploadCount": 50,
|
||||
"errorMinute": 1,
|
||||
"errorCount": 5,
|
||||
"expireStyle": ["day", "hour", "forever"],
|
||||
"max_save_seconds": 0, # No limit
|
||||
"openUpload": 1
|
||||
}
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Configuration Guide](/en/guide/configuration) - Learn about all configuration options
|
||||
- [Storage Configuration](/en/guide/storage) - Configure secure storage backends
|
||||
- [File Sharing](/en/guide/share) - Learn about file sharing features
|
||||
@@ -0,0 +1,342 @@
|
||||
# File Sharing
|
||||
|
||||
FileCodeBox provides simple and easy-to-use file and text sharing functionality. Users can securely share and retrieve files using extraction codes.
|
||||
|
||||
## Sharing Methods
|
||||
|
||||
FileCodeBox supports two sharing methods:
|
||||
|
||||
1. **Text Sharing** - Share text content directly, suitable for code snippets, configuration files, etc.
|
||||
2. **File Sharing** - Upload files for sharing, supports various file formats
|
||||
|
||||
## Text Sharing
|
||||
|
||||
### How to Use
|
||||
|
||||
1. Select the "Text Share" tab on the homepage
|
||||
2. Enter or paste the content to share in the text box
|
||||
3. Select expiration method and time
|
||||
4. Click the "Share" button
|
||||
5. Get the extraction code
|
||||
|
||||
### Text Size Limit
|
||||
|
||||
::: warning Note
|
||||
The maximum content size for text sharing is **222KB** (227,328 bytes). If content exceeds this limit, it's recommended to use file sharing instead.
|
||||
:::
|
||||
|
||||
Text content size is calculated using UTF-8 encoding. Chinese characters typically occupy 3 bytes.
|
||||
|
||||
### API Endpoint
|
||||
|
||||
**POST** `/share/text/`
|
||||
|
||||
Request parameters:
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `text` | string | Yes | Text content to share |
|
||||
| `expire_value` | int | No | Expiration value, default 1 |
|
||||
| `expire_style` | string | No | Expiration method, default `day` |
|
||||
|
||||
Response example:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "123456"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## File Sharing
|
||||
|
||||
### How to Use
|
||||
|
||||
1. Select the "File Share" tab on the homepage
|
||||
2. Click the upload area or drag files to the upload area
|
||||
3. Select expiration method and time
|
||||
4. Click the "Upload" button
|
||||
5. Get the extraction code
|
||||
|
||||
### File Size Limit
|
||||
|
||||
The default maximum single file upload size is **10MB**. Administrators can modify this limit via the `uploadSize` configuration.
|
||||
|
||||
::: tip Tip
|
||||
If you need to upload large files, contact the administrator to enable chunked upload functionality or adjust the `uploadSize` configuration.
|
||||
:::
|
||||
|
||||
### Supported Upload Methods
|
||||
|
||||
- **Click Upload** - Click the upload area to select files
|
||||
- **Drag Upload** - Drag files to the upload area
|
||||
- **Paste Upload** - Paste images from clipboard (supported by some themes)
|
||||
|
||||
### API Endpoint
|
||||
|
||||
**POST** `/share/file/`
|
||||
|
||||
Request parameters (multipart/form-data):
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `file` | file | Yes | File to upload |
|
||||
| `expire_value` | int | No | Expiration value, default 1 |
|
||||
| `expire_style` | string | No | Expiration method, default `day` |
|
||||
|
||||
Response example:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "654321",
|
||||
"name": "example.pdf"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Expiration Settings
|
||||
|
||||
FileCodeBox supports multiple flexible expiration methods:
|
||||
|
||||
| Expiration Method | Parameter Value | Description |
|
||||
|-------------------|-----------------|-------------|
|
||||
| By Days | `day` | File expires after specified days |
|
||||
| By Hours | `hour` | File expires after specified hours |
|
||||
| By Minutes | `minute` | File expires after specified minutes |
|
||||
| Never Expire | `forever` | File is permanently valid |
|
||||
| By Count | `count` | File expires after specified download count |
|
||||
|
||||
::: info Note
|
||||
- Administrators can control available expiration methods via the `expireStyle` configuration
|
||||
- Administrators can limit maximum file retention time via the `max_save_seconds` configuration
|
||||
:::
|
||||
|
||||
### Expiration Method Examples
|
||||
|
||||
```bash
|
||||
# File expires after 3 days
|
||||
expire_value=3, expire_style=day
|
||||
|
||||
# File expires after 12 hours
|
||||
expire_value=12, expire_style=hour
|
||||
|
||||
# File expires after 30 minutes
|
||||
expire_value=30, expire_style=minute
|
||||
|
||||
# File never expires
|
||||
expire_value=1, expire_style=forever
|
||||
|
||||
# File expires after 5 downloads
|
||||
expire_value=5, expire_style=count
|
||||
```
|
||||
|
||||
## Retrieving Files
|
||||
|
||||
### How to Use
|
||||
|
||||
1. Enter the extraction code in the "Retrieve File" area on the homepage
|
||||
2. Click the "Retrieve" button
|
||||
3. System displays file information (filename, size, etc.)
|
||||
4. Click the "Download" button to download the file, or view text content directly
|
||||
|
||||
### Extraction Code Notes
|
||||
|
||||
- Extraction codes are typically **6-digit numbers**
|
||||
- Files that never expire use **alphanumeric** extraction codes
|
||||
- Extraction codes are case-sensitive (for alphanumeric codes)
|
||||
|
||||
### API Endpoints
|
||||
|
||||
**Query File Information**
|
||||
|
||||
**POST** `/share/select/`
|
||||
|
||||
Request parameters:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": "123456"
|
||||
}
|
||||
```
|
||||
|
||||
Response example (file):
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "123456",
|
||||
"name": "example.pdf",
|
||||
"size": 1048576,
|
||||
"text": "https://example.com/download/..."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Response example (text):
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "123456",
|
||||
"name": "Text",
|
||||
"size": 1024,
|
||||
"text": "This is the shared text content..."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Direct File Download**
|
||||
|
||||
**GET** `/share/select/?code=123456`
|
||||
|
||||
This endpoint returns file content directly, suitable for direct browser access.
|
||||
|
||||
## Chunked Upload (Large Files)
|
||||
|
||||
For large file uploads, FileCodeBox supports chunked upload functionality. This feature requires administrator enablement (`enableChunk=1`).
|
||||
|
||||
### Chunked Upload Flow
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant C as Client
|
||||
participant S as Server
|
||||
|
||||
C->>S: 1. Initialize upload (POST /chunk/upload/init/)
|
||||
S-->>C: Return upload_id and chunk info
|
||||
|
||||
loop Each chunk
|
||||
C->>S: 2. Upload chunk (POST /chunk/upload/chunk/{upload_id}/{chunk_index})
|
||||
S-->>C: Return chunk hash
|
||||
end
|
||||
|
||||
C->>S: 3. Complete upload (POST /chunk/upload/complete/{upload_id})
|
||||
S-->>C: Return extraction code
|
||||
```
|
||||
|
||||
### 1. Initialize Upload
|
||||
|
||||
**POST** `/chunk/upload/init/`
|
||||
|
||||
Request parameters:
|
||||
|
||||
```json
|
||||
{
|
||||
"file_name": "large_file.zip",
|
||||
"file_size": 104857600,
|
||||
"chunk_size": 5242880,
|
||||
"file_hash": "sha256_hash_of_file"
|
||||
}
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `file_name` | string | Yes | Filename |
|
||||
| `file_size` | int | Yes | Total file size (bytes) |
|
||||
| `chunk_size` | int | No | Chunk size, default 5MB |
|
||||
| `file_hash` | string | Yes | SHA256 hash of the file |
|
||||
|
||||
Response example:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"existed": false,
|
||||
"upload_id": "abc123def456",
|
||||
"chunk_size": 5242880,
|
||||
"total_chunks": 20,
|
||||
"uploaded_chunks": []
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2. Upload Chunk
|
||||
|
||||
**POST** `/chunk/upload/chunk/{upload_id}/{chunk_index}`
|
||||
|
||||
- `upload_id` - Upload session ID returned during initialization
|
||||
- `chunk_index` - Chunk index, starting from 0
|
||||
|
||||
Request body: Chunk file data (multipart/form-data)
|
||||
|
||||
Response example:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"chunk_hash": "sha256_hash_of_chunk"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3. Complete Upload
|
||||
|
||||
**POST** `/chunk/upload/complete/{upload_id}`
|
||||
|
||||
Request parameters:
|
||||
|
||||
```json
|
||||
{
|
||||
"expire_value": 1,
|
||||
"expire_style": "day"
|
||||
}
|
||||
```
|
||||
|
||||
Response example:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "789012",
|
||||
"name": "large_file.zip"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Resume Upload
|
||||
|
||||
Chunked upload supports resume functionality. If upload is interrupted:
|
||||
|
||||
1. Call the initialization endpoint again with the same `file_hash`
|
||||
2. Server returns `uploaded_chunks` list containing already uploaded chunk indices
|
||||
3. Client only needs to upload chunks not in the list
|
||||
|
||||
## Error Handling
|
||||
|
||||
### Common Error Codes
|
||||
|
||||
| Error Code | Description | Solution |
|
||||
|------------|-------------|----------|
|
||||
| 403 | File size exceeds limit | Reduce file size or contact administrator to adjust limit |
|
||||
| 403 | Content too large | Text exceeds 222KB, use file sharing instead |
|
||||
| 403 | Upload rate limit | Wait a while before retrying |
|
||||
| 404 | File not found | Check if extraction code is correct |
|
||||
| 404 | File expired | File has expired or download count exhausted |
|
||||
|
||||
### Rate Limiting
|
||||
|
||||
To prevent abuse, the system has rate limits on upload and retrieval operations:
|
||||
|
||||
- **Upload limit**: Default max 10 uploads per minute
|
||||
- **Error limit**: Default max 1 error attempt per minute
|
||||
|
||||
::: tip Tip
|
||||
If you encounter rate limiting, wait for the limit time window to pass before retrying.
|
||||
:::
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Configuration Guide](/en/guide/configuration) - Learn how to configure sharing-related settings
|
||||
- [Storage Configuration](/en/guide/storage) - Learn about file storage methods
|
||||
- [Security Settings](/en/guide/security) - Learn about security-related configurations
|
||||
- [Admin Panel](/en/guide/management) - Learn how to manage shared files
|
||||
@@ -0,0 +1,395 @@
|
||||
# Storage Configuration
|
||||
|
||||
FileCodeBox supports multiple storage backends. You can choose the appropriate storage method based on your needs. This document details the configuration methods for various storage backends.
|
||||
|
||||
## Storage Types Overview
|
||||
|
||||
| Storage Type | Config Value | Description |
|
||||
|--------------|--------------|-------------|
|
||||
| Local Storage | `local` | Default storage method, files saved on local server |
|
||||
| S3-Compatible Storage | `s3` | Supports AWS S3, Aliyun OSS, MinIO, etc. |
|
||||
| OneDrive | `onedrive` | Microsoft OneDrive cloud storage (work/school accounts only) |
|
||||
| WebDAV | `webdav` | Storage services supporting WebDAV protocol |
|
||||
| OpenDAL | `opendal` | Integrate more storage services via OpenDAL |
|
||||
|
||||
## Local Storage
|
||||
|
||||
Local storage is the default storage method. Files are saved in the server's `data/` directory.
|
||||
|
||||
### Configuration Parameters
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `file_storage` | string | `local` | Storage type |
|
||||
| `storage_path` | string | `""` | Custom storage path (optional) |
|
||||
|
||||
### Configuration Example
|
||||
|
||||
```bash
|
||||
file_storage=local
|
||||
storage_path=
|
||||
```
|
||||
|
||||
### Notes
|
||||
|
||||
- Files are stored by default in `data/share/data/` directory
|
||||
- Subdirectories are automatically created by date: `year/month/day/fileID/`
|
||||
- In production, it's recommended to mount the `data/` directory to persistent storage
|
||||
|
||||
## S3-Compatible Storage
|
||||
|
||||
Supports all S3-compatible object storage services, including AWS S3, Aliyun OSS, MinIO, Tencent Cloud COS, etc.
|
||||
|
||||
### Configuration Parameters
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `file_storage` | string | - | Set to `s3` |
|
||||
| `s3_access_key_id` | string | `""` | Access Key ID |
|
||||
| `s3_secret_access_key` | string | `""` | Secret Access Key |
|
||||
| `s3_bucket_name` | string | `""` | Bucket name |
|
||||
| `s3_endpoint_url` | string | `""` | S3 endpoint URL |
|
||||
| `s3_region_name` | string | `auto` | Region name |
|
||||
| `s3_signature_version` | string | `s3v2` | Signature version (`s3v2` or `s3v4`) |
|
||||
| `s3_hostname` | string | `""` | S3 hostname (alternative) |
|
||||
| `s3_proxy` | int | `0` | Download through server proxy (1=yes, 0=no) |
|
||||
| `aws_session_token` | string | `""` | AWS session token (optional) |
|
||||
|
||||
|
||||
### AWS S3 Configuration Example
|
||||
|
||||
```bash
|
||||
file_storage=s3
|
||||
s3_access_key_id=AKIAIOSFODNN7EXAMPLE
|
||||
s3_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
|
||||
s3_bucket_name=my-filecodebox-bucket
|
||||
s3_endpoint_url=https://s3.amazonaws.com
|
||||
s3_region_name=us-east-1
|
||||
s3_signature_version=s3v4
|
||||
```
|
||||
|
||||
### Aliyun OSS Configuration Example
|
||||
|
||||
```bash
|
||||
file_storage=s3
|
||||
s3_access_key_id=YourAccessKeyId
|
||||
s3_secret_access_key=YourSecretAccessKey
|
||||
s3_bucket_name=bucket-name
|
||||
s3_endpoint_url=https://bucket-name.oss-cn-hangzhou.aliyuncs.com
|
||||
s3_region_name=oss-cn-hangzhou
|
||||
s3_signature_version=s3v4
|
||||
```
|
||||
|
||||
::: tip Aliyun OSS Endpoint Format
|
||||
Endpoint URL format: `https://<bucket-name>.<region>.aliyuncs.com`
|
||||
|
||||
Common regions:
|
||||
- Hangzhou: `oss-cn-hangzhou`
|
||||
- Shanghai: `oss-cn-shanghai`
|
||||
- Beijing: `oss-cn-beijing`
|
||||
- Shenzhen: `oss-cn-shenzhen`
|
||||
:::
|
||||
|
||||
### MinIO Configuration Example
|
||||
|
||||
```bash
|
||||
file_storage=s3
|
||||
s3_access_key_id=minioadmin
|
||||
s3_secret_access_key=minioadmin
|
||||
s3_bucket_name=filecodebox
|
||||
s3_endpoint_url=http://localhost:9000
|
||||
s3_region_name=us-east-1
|
||||
s3_signature_version=s3v4
|
||||
```
|
||||
|
||||
::: warning MinIO Notes
|
||||
- `s3_endpoint_url` should be the MinIO API interface address
|
||||
- `s3_region_name` should match the `Server Location` in MinIO configuration
|
||||
- Ensure the bucket is created and has correct access permissions
|
||||
:::
|
||||
|
||||
### Tencent Cloud COS Configuration Example
|
||||
|
||||
```bash
|
||||
file_storage=s3
|
||||
s3_access_key_id=YourSecretId
|
||||
s3_secret_access_key=YourSecretKey
|
||||
s3_bucket_name=bucket-name-1250000000
|
||||
s3_endpoint_url=https://cos.ap-guangzhou.myqcloud.com
|
||||
s3_region_name=ap-guangzhou
|
||||
s3_signature_version=s3v4
|
||||
```
|
||||
|
||||
### Proxy Download
|
||||
|
||||
When `s3_proxy=1`, file downloads are proxied through the server instead of directly from S3. This is useful when:
|
||||
|
||||
- S3 bucket doesn't allow public access
|
||||
- Need to hide the actual storage address
|
||||
- Network environment restricts direct S3 access
|
||||
|
||||
## OneDrive Storage
|
||||
|
||||
OneDrive storage supports saving files to Microsoft OneDrive cloud storage.
|
||||
|
||||
::: warning Important Limitation
|
||||
OneDrive storage **only supports work or school accounts** and requires admin permissions to authorize the API. Personal accounts cannot use this feature.
|
||||
:::
|
||||
|
||||
### Configuration Parameters
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `file_storage` | string | - | Set to `onedrive` |
|
||||
| `onedrive_domain` | string | `""` | Azure AD domain |
|
||||
| `onedrive_client_id` | string | `""` | Application (client) ID |
|
||||
| `onedrive_username` | string | `""` | Account email |
|
||||
| `onedrive_password` | string | `""` | Account password |
|
||||
| `onedrive_root_path` | string | `filebox_storage` | Storage root directory in OneDrive |
|
||||
| `onedrive_proxy` | int | `0` | Download through server proxy |
|
||||
|
||||
### Configuration Example
|
||||
|
||||
```bash
|
||||
file_storage=onedrive
|
||||
onedrive_domain=contoso.onmicrosoft.com
|
||||
onedrive_client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
onedrive_username=user@contoso.onmicrosoft.com
|
||||
onedrive_password=your_password
|
||||
onedrive_root_path=filebox_storage
|
||||
```
|
||||
|
||||
### Azure App Registration Steps
|
||||
|
||||
To use OneDrive storage, you need to register an application in the Azure portal:
|
||||
|
||||
#### 1. Get Domain
|
||||
|
||||
Log in to [Azure Portal](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade), hover over your account in the top right corner, and the **Domain** shown in the popup is the `onedrive_domain` value.
|
||||
|
||||
#### 2. Register Application
|
||||
|
||||
1. Click **+ New registration** in the top left
|
||||
2. Enter application name (e.g., FileCodeBox)
|
||||
3. **Supported account types**: Select "Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts"
|
||||
4. **Redirect URI**: Select `Web`, enter `http://localhost`
|
||||
5. Click **Register**
|
||||
|
||||
#### 3. Get Client ID
|
||||
|
||||
After registration, find the **Application (client) ID** in the **Essentials** section on the app overview page. This is the `onedrive_client_id` value.
|
||||
|
||||
#### 4. Configure Authentication
|
||||
|
||||
1. Select **Authentication** in the left menu
|
||||
2. Find **Allow public client flows**, select **Yes**
|
||||
3. Click **Save**
|
||||
|
||||
#### 5. Configure API Permissions
|
||||
|
||||
1. Select **API permissions** in the left menu
|
||||
2. Click **+ Add a permission**
|
||||
3. Select **Microsoft Graph** → **Delegated permissions**
|
||||
4. Check the following permissions:
|
||||
- `openid`
|
||||
- `Files.Read`
|
||||
- `Files.Read.All`
|
||||
- `Files.ReadWrite`
|
||||
- `Files.ReadWrite.All`
|
||||
- `User.Read`
|
||||
5. Click **Add permissions**
|
||||
6. Click **Grant admin consent for xxx**
|
||||
7. After confirmation, permission status should show **Granted**
|
||||
|
||||
### Install Dependencies
|
||||
|
||||
Using OneDrive storage requires additional Python dependencies:
|
||||
|
||||
```bash
|
||||
pip install msal Office365-REST-Python-Client
|
||||
```
|
||||
|
||||
### Verify Configuration
|
||||
|
||||
You can use the following code to test if the configuration is correct:
|
||||
|
||||
```python
|
||||
import msal
|
||||
from office365.graph_client import GraphClient
|
||||
|
||||
domain = 'your_domain'
|
||||
client_id = 'your_client_id'
|
||||
username = 'your_username'
|
||||
password = 'your_password'
|
||||
|
||||
def acquire_token_pwd():
|
||||
authority_url = f'https://login.microsoftonline.com/{domain}'
|
||||
app = msal.PublicClientApplication(
|
||||
authority=authority_url,
|
||||
client_id=client_id
|
||||
)
|
||||
result = app.acquire_token_by_username_password(
|
||||
username=username,
|
||||
password=password,
|
||||
scopes=['https://graph.microsoft.com/.default']
|
||||
)
|
||||
return result
|
||||
|
||||
# Test connection
|
||||
client = GraphClient(acquire_token_pwd)
|
||||
me = client.me.get().execute_query()
|
||||
print(f"Login successful: {me.user_principal_name}")
|
||||
```
|
||||
|
||||
|
||||
## WebDAV Storage
|
||||
|
||||
WebDAV storage supports saving files to any service that supports the WebDAV protocol, such as Nextcloud, ownCloud, Nutstore, etc.
|
||||
|
||||
### Configuration Parameters
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `file_storage` | string | - | Set to `webdav` |
|
||||
| `webdav_url` | string | `""` | WebDAV server URL |
|
||||
| `webdav_username` | string | `""` | WebDAV username |
|
||||
| `webdav_password` | string | `""` | WebDAV password |
|
||||
| `webdav_root_path` | string | `filebox_storage` | Storage root directory in WebDAV |
|
||||
| `webdav_proxy` | int | `0` | Download through server proxy |
|
||||
|
||||
### Configuration Example
|
||||
|
||||
```bash
|
||||
file_storage=webdav
|
||||
webdav_url=https://dav.example.com/remote.php/dav/files/username/
|
||||
webdav_username=your_username
|
||||
webdav_password=your_password
|
||||
webdav_root_path=filebox_storage
|
||||
```
|
||||
|
||||
### Nextcloud Configuration Example
|
||||
|
||||
```bash
|
||||
file_storage=webdav
|
||||
webdav_url=https://your-nextcloud.com/remote.php/dav/files/username/
|
||||
webdav_username=your_username
|
||||
webdav_password=your_app_password
|
||||
webdav_root_path=FileCodeBox
|
||||
```
|
||||
|
||||
::: tip Nextcloud App Password
|
||||
It's recommended to create an app password in Nextcloud instead of using your main password:
|
||||
1. Log in to Nextcloud
|
||||
2. Go to **Settings** → **Security**
|
||||
3. Create a new app password in **Devices & sessions**
|
||||
:::
|
||||
|
||||
### Nutstore Configuration Example
|
||||
|
||||
```bash
|
||||
file_storage=webdav
|
||||
webdav_url=https://dav.jianguoyun.com/dav/
|
||||
webdav_username=your_email@example.com
|
||||
webdav_password=your_app_password
|
||||
webdav_root_path=FileCodeBox
|
||||
```
|
||||
|
||||
::: tip Nutstore App Password
|
||||
Nutstore requires an app password:
|
||||
1. Log in to Nutstore web version
|
||||
2. Go to **Account Info** → **Security Options**
|
||||
3. Add an app password
|
||||
:::
|
||||
|
||||
## OpenDAL Storage
|
||||
|
||||
OpenDAL is a unified data access layer that supports multiple storage services. Through OpenDAL, you can use Google Cloud Storage, Azure Blob Storage, and more.
|
||||
|
||||
### Configuration Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| `file_storage` | string | Set to `opendal` |
|
||||
| `opendal_scheme` | string | Storage service type (e.g., `gcs`, `azblob`) |
|
||||
| `opendal_<scheme>_<setting>` | string | Service-specific configuration parameters |
|
||||
|
||||
### Install Dependencies
|
||||
|
||||
```bash
|
||||
pip install opendal
|
||||
```
|
||||
|
||||
### Google Cloud Storage Configuration Example
|
||||
|
||||
```bash
|
||||
file_storage=opendal
|
||||
opendal_scheme=gcs
|
||||
opendal_gcs_root=/filecodebox
|
||||
opendal_gcs_bucket=your-bucket-name
|
||||
opendal_gcs_credential=base64_encoded_credential
|
||||
```
|
||||
|
||||
### Azure Blob Storage Configuration Example
|
||||
|
||||
```bash
|
||||
file_storage=opendal
|
||||
opendal_scheme=azblob
|
||||
opendal_azblob_root=/filecodebox
|
||||
opendal_azblob_container=your-container
|
||||
opendal_azblob_account_name=your_account
|
||||
opendal_azblob_account_key=your_key
|
||||
```
|
||||
|
||||
### Supported Services
|
||||
|
||||
OpenDAL supports numerous storage services. For the complete list, see the [OpenDAL Official Documentation](https://opendal.apache.org/docs/rust/opendal/services/index.html).
|
||||
|
||||
Common services include:
|
||||
- `gcs` - Google Cloud Storage
|
||||
- `azblob` - Azure Blob Storage
|
||||
- `obs` - Huawei Cloud OBS
|
||||
- `oss` - Aliyun OSS (via OpenDAL)
|
||||
- `cos` - Tencent Cloud COS (via OpenDAL)
|
||||
- `hdfs` - Hadoop HDFS
|
||||
- `ftp` - FTP server
|
||||
- `sftp` - SFTP server
|
||||
|
||||
::: warning OpenDAL Notes
|
||||
1. Services integrated via OpenDAL download through server proxy, consuming both storage service and server bandwidth
|
||||
2. Compared to native S3/OneDrive support, OpenDAL may lack some debugging information
|
||||
3. OpenDAL is written in Rust with good performance
|
||||
:::
|
||||
|
||||
## Storage Selection Recommendations
|
||||
|
||||
| Scenario | Recommended Storage | Reason |
|
||||
|----------|---------------------|--------|
|
||||
| Personal/Small deployment | Local storage | Simple and easy, no extra configuration needed |
|
||||
| Enterprise intranet | MinIO + S3 | Self-hosted object storage, data control |
|
||||
| Public cloud deployment | Corresponding cloud provider S3 | Fast same-region access, low cost |
|
||||
| Existing OneDrive | OneDrive | Utilize existing resources |
|
||||
| Existing WebDAV | WebDAV | Good compatibility |
|
||||
| Special storage needs | OpenDAL | Supports more storage services |
|
||||
|
||||
## Common Issues
|
||||
|
||||
### S3 Upload Failure
|
||||
|
||||
1. Check if Access Key and Secret Key are correct
|
||||
2. Confirm bucket name and region configuration are correct
|
||||
3. Check bucket access permission settings
|
||||
4. Confirm signature version (`s3v2` or `s3v4`) matches service provider requirements
|
||||
|
||||
### OneDrive Authentication Failure
|
||||
|
||||
1. Confirm using a work/school account, not a personal account
|
||||
2. Check if Azure app has been granted admin consent
|
||||
3. Confirm API permissions are fully configured
|
||||
4. Verify username and password are correct
|
||||
|
||||
### WebDAV Connection Failure
|
||||
|
||||
1. Check if WebDAV URL format is correct
|
||||
2. Confirm username and password (or app password) are correct
|
||||
3. Check if server supports WebDAV protocol
|
||||
4. Confirm network connection is normal
|
||||
Whitespace-only changes.
@@ -0,0 +1,380 @@
|
||||
# File Upload
|
||||
|
||||
FileCodeBox provides multiple flexible file upload methods, supporting both regular upload and chunked upload to meet different scenario requirements.
|
||||
|
||||
## Upload Methods
|
||||
|
||||
FileCodeBox supports the following upload methods:
|
||||
|
||||
### Drag and Drop Upload
|
||||
|
||||
Drag files directly to the upload area to start uploading. This is the most convenient upload method.
|
||||
|
||||
1. Open the FileCodeBox homepage
|
||||
2. Drag files from your file manager to the upload area
|
||||
3. Release the mouse, file upload begins
|
||||
4. Get the extraction code after upload completes
|
||||
|
||||
::: tip Tip
|
||||
Drag and drop upload supports dragging multiple files simultaneously (depending on theme support).
|
||||
:::
|
||||
|
||||
### Click Upload
|
||||
|
||||
Click the upload area to select files through the system file picker.
|
||||
|
||||
1. Click the "Select File" button in the upload area
|
||||
2. Select the file to upload in the popup file picker
|
||||
3. File upload begins after confirming selection
|
||||
4. Get the extraction code after upload completes
|
||||
|
||||
### Paste Upload
|
||||
|
||||
Supports pasting images directly from clipboard for upload (supported by some themes).
|
||||
|
||||
1. Copy an image to clipboard (screenshot or copy image)
|
||||
2. Use `Ctrl+V` (Windows/Linux) or `Cmd+V` (macOS) to paste in the upload area
|
||||
3. Image upload starts automatically
|
||||
4. Get the extraction code after upload completes
|
||||
|
||||
::: warning Note
|
||||
Paste upload only supports image formats, not other file types. Specific support depends on the theme being used.
|
||||
:::
|
||||
|
||||
## File Size Limits
|
||||
|
||||
### Default Limits
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---------|---------|-------------|
|
||||
| `uploadSize` | 10MB | Maximum single file upload size |
|
||||
|
||||
### Modify Upload Limits
|
||||
|
||||
Administrators can modify upload size limits through the admin panel or configuration file:
|
||||
|
||||
```python
|
||||
# Set maximum upload size to 100MB
|
||||
uploadSize = 104857600 # 100 * 1024 * 1024
|
||||
```
|
||||
|
||||
::: info Note
|
||||
`uploadSize` is in bytes. Common conversions:
|
||||
- 10MB = 10485760
|
||||
- 50MB = 52428800
|
||||
- 100MB = 104857600
|
||||
- 500MB = 524288000
|
||||
- 1GB = 1073741824
|
||||
:::
|
||||
|
||||
### Exceeding Limit Handling
|
||||
|
||||
When an uploaded file exceeds the size limit, the system returns a 403 error:
|
||||
|
||||
```json
|
||||
{
|
||||
"detail": "Size exceeds limit, maximum is 10.00 MB"
|
||||
}
|
||||
```
|
||||
|
||||
## Regular Upload API
|
||||
|
||||
### File Upload Endpoint
|
||||
|
||||
**POST** `/share/file/`
|
||||
|
||||
Content-Type: `multipart/form-data`
|
||||
|
||||
**Request parameters:**
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `file` | file | Yes | File to upload |
|
||||
| `expire_value` | int | No | Expiration value, default 1 |
|
||||
| `expire_style` | string | No | Expiration method, default `day` |
|
||||
|
||||
**Expiration method options:**
|
||||
|
||||
| Value | Description |
|
||||
|-------|-------------|
|
||||
| `day` | Expire by days |
|
||||
| `hour` | Expire by hours |
|
||||
| `minute` | Expire by minutes |
|
||||
| `forever` | Never expire |
|
||||
| `count` | Expire by download count |
|
||||
|
||||
**Response example:**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "654321",
|
||||
"name": "example.pdf"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**cURL example:**
|
||||
|
||||
```bash
|
||||
curl -X POST "http://localhost:12345/share/file/" \
|
||||
-F "file=@/path/to/file.pdf" \
|
||||
-F "expire_value=7" \
|
||||
-F "expire_style=day"
|
||||
```
|
||||
|
||||
|
||||
## Chunked Upload API
|
||||
|
||||
For large files, FileCodeBox supports chunked upload functionality. Chunked upload splits large files into multiple small chunks for separate uploading, supporting resume capability.
|
||||
|
||||
::: warning Prerequisite
|
||||
Chunked upload functionality requires administrator enablement: `enableChunk=1`
|
||||
:::
|
||||
|
||||
### Chunked Upload Flow
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
||||
│ Initialize │ ──▶ │Upload Chunks│ ──▶ │ Complete │
|
||||
│ /init/ │ │ /chunk/ │ │ /complete/ │
|
||||
└─────────────┘ └─────────────┘ └─────────────┘
|
||||
│
|
||||
▼
|
||||
┌───────────┐
|
||||
│ Loop │
|
||||
│each chunk │
|
||||
└───────────┘
|
||||
```
|
||||
|
||||
### 1. Initialize Upload
|
||||
|
||||
**POST** `/chunk/upload/init/`
|
||||
|
||||
**Request parameters:**
|
||||
|
||||
```json
|
||||
{
|
||||
"file_name": "large_file.zip",
|
||||
"file_size": 104857600,
|
||||
"chunk_size": 5242880,
|
||||
"file_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
}
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `file_name` | string | Yes | - | Filename |
|
||||
| `file_size` | int | Yes | - | Total file size (bytes) |
|
||||
| `chunk_size` | int | No | 5MB | Chunk size (bytes) |
|
||||
| `file_hash` | string | Yes | - | SHA256 hash of the file |
|
||||
|
||||
**Response example:**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"existed": false,
|
||||
"upload_id": "abc123def456789",
|
||||
"chunk_size": 5242880,
|
||||
"total_chunks": 20,
|
||||
"uploaded_chunks": []
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| `existed` | Whether file already exists (instant upload) |
|
||||
| `upload_id` | Upload session ID |
|
||||
| `chunk_size` | Chunk size |
|
||||
| `total_chunks` | Total number of chunks |
|
||||
| `uploaded_chunks` | List of already uploaded chunk indices |
|
||||
|
||||
### 2. Upload Chunk
|
||||
|
||||
**POST** `/chunk/upload/chunk/{upload_id}/{chunk_index}`
|
||||
|
||||
**Path parameters:**
|
||||
|
||||
| Parameter | Description |
|
||||
|-----------|-------------|
|
||||
| `upload_id` | Upload session ID returned during initialization |
|
||||
| `chunk_index` | Chunk index, starting from 0 |
|
||||
|
||||
**Request body:**
|
||||
|
||||
Content-Type: `multipart/form-data`
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| `chunk` | file | Chunk data |
|
||||
|
||||
**Response example:**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"chunk_hash": "a1b2c3d4e5f6..."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**cURL example:**
|
||||
|
||||
```bash
|
||||
# Upload first chunk (index 0)
|
||||
curl -X POST "http://localhost:12345/chunk/upload/chunk/abc123def456789/0" \
|
||||
-F "chunk=@/path/to/chunk_0"
|
||||
```
|
||||
|
||||
### 3. Complete Upload
|
||||
|
||||
**POST** `/chunk/upload/complete/{upload_id}`
|
||||
|
||||
**Path parameters:**
|
||||
|
||||
| Parameter | Description |
|
||||
|-----------|-------------|
|
||||
| `upload_id` | Upload session ID |
|
||||
|
||||
**Request parameters:**
|
||||
|
||||
```json
|
||||
{
|
||||
"expire_value": 7,
|
||||
"expire_style": "day"
|
||||
}
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `expire_value` | int | Yes | Expiration value |
|
||||
| `expire_style` | string | Yes | Expiration method |
|
||||
|
||||
**Response example:**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "789012",
|
||||
"name": "large_file.zip"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Resume Upload
|
||||
|
||||
Chunked upload supports resume functionality. When upload is interrupted:
|
||||
|
||||
1. Call the initialization endpoint again with the same `file_hash`
|
||||
2. Server returns `uploaded_chunks` list containing already uploaded chunk indices
|
||||
3. Client only needs to upload chunks not in the list
|
||||
4. Call the complete endpoint after all chunks are uploaded
|
||||
|
||||
**Example flow:**
|
||||
|
||||
```javascript
|
||||
// 1. Initialize upload
|
||||
const initResponse = await fetch('/chunk/upload/init/', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
file_name: 'large_file.zip',
|
||||
file_size: fileSize,
|
||||
chunk_size: 5 * 1024 * 1024,
|
||||
file_hash: fileHash
|
||||
})
|
||||
});
|
||||
const { upload_id, uploaded_chunks, total_chunks } = await initResponse.json();
|
||||
|
||||
// 2. Upload incomplete chunks
|
||||
for (let i = 0; i < total_chunks; i++) {
|
||||
if (!uploaded_chunks.includes(i)) {
|
||||
const chunk = file.slice(i * chunkSize, (i + 1) * chunkSize);
|
||||
await fetch(`/chunk/upload/chunk/${upload_id}/${i}`, {
|
||||
method: 'POST',
|
||||
body: chunk
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Complete upload
|
||||
await fetch(`/chunk/upload/complete/${upload_id}`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
expire_value: 7,
|
||||
expire_style: 'day'
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
### Common Errors
|
||||
|
||||
| HTTP Status | Error Message | Cause | Solution |
|
||||
|-------------|---------------|-------|----------|
|
||||
| 403 | Size exceeds limit | File exceeds `uploadSize` limit | Reduce file size or contact administrator to adjust limit |
|
||||
| 403 | Upload rate limit | Exceeded IP upload rate limit | Wait for limit time window before retrying |
|
||||
| 400 | Invalid expiration type | `expire_style` value not in allowed list | Use a valid expiration method |
|
||||
| 404 | Upload session not found | `upload_id` invalid or expired | Re-initialize upload |
|
||||
| 400 | Invalid chunk index | `chunk_index` out of range | Check if chunk index is correct |
|
||||
| 400 | Incomplete chunks | Chunk count insufficient when completing upload | Ensure all chunks are uploaded |
|
||||
|
||||
### Rate Limiting
|
||||
|
||||
The system has rate limits on upload operations to prevent abuse:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---------|---------|-------------|
|
||||
| `uploadMinute` | 1 | Limit time window (minutes) |
|
||||
| `uploadCount` | 10 | Maximum uploads within time window |
|
||||
|
||||
When rate limit is exceeded, you need to wait for the time window to pass before continuing uploads.
|
||||
|
||||
### Error Response Format
|
||||
|
||||
```json
|
||||
{
|
||||
"detail": "Error message description"
|
||||
}
|
||||
```
|
||||
|
||||
## Upload Configuration
|
||||
|
||||
### Related Settings
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `openUpload` | int | 1 | Enable upload (1=enabled, 0=disabled) |
|
||||
| `uploadSize` | int | 10485760 | Maximum upload size (bytes) |
|
||||
| `enableChunk` | int | 0 | Enable chunked upload (1=enabled, 0=disabled) |
|
||||
| `uploadMinute` | int | 1 | Upload rate limit time window (minutes) |
|
||||
| `uploadCount` | int | 10 | Maximum uploads within time window |
|
||||
| `expireStyle` | list | ["day","hour","minute","forever","count"] | Allowed expiration methods |
|
||||
|
||||
### Configuration Example
|
||||
|
||||
```python
|
||||
# Allow 100MB file uploads, enable chunked upload
|
||||
uploadSize = 104857600
|
||||
enableChunk = 1
|
||||
|
||||
# Relax upload rate limit: max 50 uploads per 5 minutes
|
||||
uploadMinute = 5
|
||||
uploadCount = 50
|
||||
|
||||
# Only allow expiration by days and count
|
||||
expireStyle = ["day", "count"]
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [File Sharing](/en/guide/share) - Learn the complete sharing process
|
||||
- [Configuration Guide](/en/guide/configuration) - Learn about all configuration options
|
||||
- [Storage Configuration](/en/guide/storage) - Learn about file storage methods
|
||||
- [Security Settings](/en/guide/security) - Learn about security-related configurations
|
||||
@@ -0,0 +1,127 @@
|
||||
# Showcase
|
||||
|
||||
Here are some excellent sites built with FileCodeBox. If you've deployed FileCodeBox, feel free to submit a PR to add your site here!
|
||||
|
||||
## Official Demo
|
||||
|
||||
<div class="showcase-grid">
|
||||
|
||||
<div class="showcase-item">
|
||||
|
||||
### 🌟 FileCodeBox Demo
|
||||
|
||||
- **URL**: [share.lanol.cn](https://share.lanol.cn)
|
||||
- **Description**: Official demo site with the latest features
|
||||
- **Highlights**: Stable, full-featured
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
## Community Sites
|
||||
|
||||
::: tip Submit Your Site
|
||||
If you've built your own file sharing service using FileCodeBox, you can submit it through:
|
||||
|
||||
1. Submit a PR on [GitHub](https://github.com/vastsa/FileCodeBox) to edit this page
|
||||
2. Open an [Issue](https://github.com/vastsa/FileCodeBox/issues) with your site info
|
||||
3. Join QQ Group 739673698 to contact the admin
|
||||
:::
|
||||
|
||||
<!--
|
||||
Submission format example:
|
||||
|
||||
<div class="showcase-item">
|
||||
|
||||
### Site Name
|
||||
|
||||
- **URL**: [example.com](https://example.com)
|
||||
- **Description**: Brief description of your site
|
||||
- **Highlights**: List your site's features
|
||||
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="showcase-grid">
|
||||
|
||||
<div class="showcase-item">
|
||||
|
||||
### QuWenJian
|
||||
|
||||
- **URL**: [www.quwenjian.cn/fby.html](https://www.quwenjian.cn/fby.html)
|
||||
- **Description**: QuWenJian - Unlimited storage, portable and limitless
|
||||
- **Highlights**: Free file transfer station
|
||||
- **Operator**: QuWenJian
|
||||
|
||||
</div>
|
||||
|
||||
<div class="showcase-item">
|
||||
|
||||
### Pandora Box
|
||||
|
||||
- **URL**: [pan.duo.la](https://pan.duo.la)
|
||||
- **Description**: Pandora Box
|
||||
- **Highlights**: Classic v1.6 version
|
||||
- **Operator**: WuXingQueXinYan
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
## Submission Requirements
|
||||
|
||||
To ensure quality, please make sure your site meets the following criteria:
|
||||
|
||||
1. **Stable**: Your site should be stable and accessible
|
||||
2. **Legal**: Content must be legal and compliant
|
||||
3. **Attribution**: We recommend keeping FileCodeBox attribution
|
||||
4. **HTTPS**: We recommend enabling HTTPS
|
||||
|
||||
## Submission Template
|
||||
|
||||
If you want to submit your site, please use the following format:
|
||||
|
||||
```markdown
|
||||
### Site Name
|
||||
|
||||
- **URL**: [domain](https://domain)
|
||||
- **Description**: One-line description of your site
|
||||
- **Highlights**: Special features or highlights
|
||||
- **Operator**: Optional, your name or organization
|
||||
```
|
||||
|
||||
<style>
|
||||
.showcase-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 20px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.showcase-item {
|
||||
border: 1px solid var(--vp-c-divider);
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.showcase-item:hover {
|
||||
border-color: var(--vp-c-brand);
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.showcase-item h3 {
|
||||
margin-top: 0;
|
||||
color: var(--vp-c-brand);
|
||||
}
|
||||
|
||||
.showcase-item ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.showcase-item li {
|
||||
margin: 8px 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,206 @@
|
||||
# 配置说明
|
||||
|
||||
FileCodeBox 提供了丰富的配置选项,可以通过管理面板或直接修改配置来自定义系统行为。本文档详细介绍所有可用的配置项。
|
||||
|
||||
## 配置方式
|
||||
|
||||
FileCodeBox 支持两种配置方式:
|
||||
|
||||
1. **管理面板配置**(推荐):访问 `/admin` 进入管理面板,在设置页面修改配置
|
||||
2. **数据库配置**:配置存储在 `data/filecodebox.db` 数据库中
|
||||
|
||||
::: tip 提示
|
||||
首次启动时,系统会使用 `core/settings.py` 中的默认配置。修改后的配置会保存到数据库中。
|
||||
:::
|
||||
|
||||
## 基础设置
|
||||
|
||||
### 站点信息
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `name` | string | `文件快递柜 - FileCodeBox` | 站点名称,显示在页面标题和导航栏 |
|
||||
| `description` | string | `开箱即用的文件快传系统` | 站点描述,用于 SEO |
|
||||
| `keywords` | string | `FileCodeBox, 文件快递柜...` | 站点关键词,用于 SEO |
|
||||
| `port` | int | `12345` | 服务监听端口 |
|
||||
|
||||
### 通知设置
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `notify_title` | string | `系统通知` | 通知标题 |
|
||||
| `notify_content` | string | 欢迎信息 | 通知内容,支持 HTML |
|
||||
| `page_explain` | string | 法律声明 | 页面底部说明文字 |
|
||||
| `robotsText` | string | `User-agent: *\nDisallow: /` | robots.txt 内容 |
|
||||
|
||||
## 上传设置
|
||||
|
||||
### 文件上传限制
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `openUpload` | int | `1` | 是否开启上传功能(1=开启,0=关闭) |
|
||||
| `uploadSize` | int | `10485760` | 单文件最大上传大小(字节),默认 10MB |
|
||||
| `enableChunk` | int | `0` | 是否启用分片上传(1=启用,0=禁用) |
|
||||
|
||||
::: warning 注意
|
||||
`uploadSize` 的单位是字节。10MB = 10 * 1024 * 1024 = 10485760 字节
|
||||
:::
|
||||
|
||||
### 上传频率限制
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `uploadMinute` | int | `1` | 上传限制的时间窗口(分钟) |
|
||||
| `uploadCount` | int | `10` | 在时间窗口内允许的最大上传次数 |
|
||||
|
||||
例如:默认配置表示每 1 分钟内最多允许上传 10 次。
|
||||
|
||||
### 文件过期设置
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `expireStyle` | list | `["day","hour","minute","forever","count"]` | 可选的过期方式 |
|
||||
| `max_save_seconds` | int | `0` | 文件最大保存时间(秒),0 表示不限制 |
|
||||
|
||||
过期方式说明:
|
||||
- `day` - 按天过期
|
||||
- `hour` - 按小时过期
|
||||
- `minute` - 按分钟过期
|
||||
- `forever` - 永不过期
|
||||
- `count` - 按下载次数过期
|
||||
|
||||
## 主题设置
|
||||
|
||||
### 主题选择
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `themesSelect` | string | `themes/2024` | 当前使用的主题 |
|
||||
| `themesChoices` | list | 见下方 | 可用主题列表 |
|
||||
|
||||
默认可用主题:
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "2023",
|
||||
"key": "themes/2023",
|
||||
"author": "Lan",
|
||||
"version": "1.0"
|
||||
},
|
||||
{
|
||||
"name": "2024",
|
||||
"key": "themes/2024",
|
||||
"author": "Lan",
|
||||
"version": "1.0"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### 界面样式
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `opacity` | float | `0.9` | 界面透明度(0-1) |
|
||||
| `background` | string | `""` | 自定义背景图片 URL,为空则使用默认背景 |
|
||||
|
||||
## 管理员设置
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `admin_token` | string | `FileCodeBox2023` | 管理员登录密码 |
|
||||
| `showAdminAddr` | int | `0` | 是否在首页显示管理入口(1=显示,0=隐藏) |
|
||||
|
||||
::: danger 安全警告
|
||||
请务必在生产环境中修改默认的 `admin_token`!使用默认密码会导致严重的安全风险。
|
||||
:::
|
||||
|
||||
## 安全设置
|
||||
|
||||
### 错误次数限制
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `errorMinute` | int | `1` | 错误限制的时间窗口(分钟) |
|
||||
| `errorCount` | int | `1` | 在时间窗口内允许的最大错误次数 |
|
||||
|
||||
此设置用于防止暴力破解提取码。
|
||||
|
||||
## 存储设置
|
||||
|
||||
### 存储类型
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `file_storage` | string | `local` | 存储后端类型 |
|
||||
| `storage_path` | string | `""` | 自定义存储路径 |
|
||||
|
||||
支持的存储类型:
|
||||
- `local` - 本地存储
|
||||
- `s3` - S3 兼容存储(AWS S3、阿里云 OSS、MinIO 等)
|
||||
- `onedrive` - OneDrive 存储
|
||||
- `webdav` - WebDAV 存储
|
||||
- `opendal` - OpenDAL 存储
|
||||
|
||||
详细的存储配置请参考 [存储配置](/guide/storage)。
|
||||
|
||||
## 配置示例
|
||||
|
||||
### 示例 1:小型个人使用
|
||||
|
||||
适合个人或小团队使用,限制较宽松:
|
||||
|
||||
```python
|
||||
{
|
||||
"name": "我的文件分享",
|
||||
"uploadSize": 52428800, # 50MB
|
||||
"uploadMinute": 5, # 5分钟
|
||||
"uploadCount": 20, # 最多20次
|
||||
"expireStyle": ["day", "hour", "forever"],
|
||||
"admin_token": "your-secure-password",
|
||||
"showAdminAddr": 1
|
||||
}
|
||||
```
|
||||
|
||||
### 示例 2:公开服务
|
||||
|
||||
适合公开服务,需要更严格的限制:
|
||||
|
||||
```python
|
||||
{
|
||||
"name": "公共文件快递柜",
|
||||
"uploadSize": 10485760, # 10MB
|
||||
"uploadMinute": 1, # 1分钟
|
||||
"uploadCount": 5, # 最多5次
|
||||
"errorMinute": 5, # 5分钟
|
||||
"errorCount": 3, # 最多3次错误
|
||||
"expireStyle": ["hour", "minute", "count"],
|
||||
"max_save_seconds": 86400, # 最长保存1天
|
||||
"admin_token": "very-secure-password-123",
|
||||
"showAdminAddr": 0
|
||||
}
|
||||
```
|
||||
|
||||
### 示例 3:企业内部使用
|
||||
|
||||
适合企业内部使用,支持大文件和分片上传:
|
||||
|
||||
```python
|
||||
{
|
||||
"name": "企业文件中转站",
|
||||
"uploadSize": 1073741824, # 1GB
|
||||
"enableChunk": 1, # 启用分片上传
|
||||
"uploadMinute": 10, # 10分钟
|
||||
"uploadCount": 100, # 最多100次
|
||||
"expireStyle": ["day", "forever"],
|
||||
"file_storage": "s3", # 使用S3存储
|
||||
"admin_token": "enterprise-secure-token",
|
||||
"showAdminAddr": 1
|
||||
}
|
||||
```
|
||||
|
||||
## 下一步
|
||||
|
||||
- [存储配置](/guide/storage) - 了解如何配置不同的存储后端
|
||||
- [安全设置](/guide/security) - 了解如何增强系统安全性
|
||||
- [文件分享](/guide/share) - 了解文件分享功能
|
||||
@@ -0,0 +1,412 @@
|
||||
# 管理面板
|
||||
|
||||
FileCodeBox 提供了功能完善的管理面板,让管理员可以方便地管理文件、查看系统状态和修改配置。本文档介绍管理面板的各项功能和使用方法。
|
||||
|
||||
## 访问管理面板
|
||||
|
||||
### 登录方式
|
||||
|
||||
管理面板位于 `/admin` 路径。访问方式:
|
||||
|
||||
1. 在浏览器中访问 `http://your-domain.com/admin`
|
||||
2. 输入管理员密码(`admin_token` 配置项的值)
|
||||
3. 点击登录按钮
|
||||
|
||||
::: tip 提示
|
||||
默认管理员密码是 `FileCodeBox2023`。请务必在生产环境中修改此密码,详见 [安全设置](/guide/security)。
|
||||
:::
|
||||
|
||||
### 显示管理入口
|
||||
|
||||
默认情况下,首页不显示管理面板入口。您可以通过配置控制是否显示:
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `showAdminAddr` | int | `0` | 是否在首页显示管理入口(1=显示,0=隐藏) |
|
||||
|
||||
::: warning 安全建议
|
||||
在公开服务中,建议保持 `showAdminAddr` 为 `0`,通过直接访问 `/admin` 路径进入管理面板,减少被恶意扫描的风险。
|
||||
:::
|
||||
|
||||
### 认证机制
|
||||
|
||||
管理面板使用 JWT(JSON Web Token)进行身份认证:
|
||||
|
||||
1. 登录成功后,服务器返回一个包含管理员身份的 Token
|
||||
2. 后续请求通过 `Authorization: Bearer <token>` 头部携带 Token
|
||||
3. Token 用于验证管理员身份,确保只有授权用户可以访问管理功能
|
||||
|
||||
## 仪表盘
|
||||
|
||||
登录后首先看到的是仪表盘页面,展示系统的整体运行状态。
|
||||
|
||||
### 统计指标
|
||||
|
||||
仪表盘显示以下关键指标:
|
||||
|
||||
| 指标 | 说明 |
|
||||
|------|------|
|
||||
| **文件总数** (`totalFiles`) | 系统中存储的文件总数量 |
|
||||
| **存储使用量** (`storageUsed`) | 所有文件占用的总存储空间(字节) |
|
||||
| **系统运行时间** (`sysUptime`) | 系统首次启动的时间 |
|
||||
| **昨日上传数** (`yesterdayCount`) | 昨天一整天上传的文件数量 |
|
||||
| **昨日上传量** (`yesterdaySize`) | 昨天上传文件的总大小(字节) |
|
||||
| **今日上传数** (`todayCount`) | 今天到目前为止上传的文件数量 |
|
||||
| **今日上传量** (`todaySize`) | 今天上传文件的总大小(字节) |
|
||||
|
||||
### 指标说明
|
||||
|
||||
- **文件总数**:包括所有未过期的文件和文本分享
|
||||
- **存储使用量**:显示实际文件占用的存储空间,不包括数据库等系统文件
|
||||
- **昨日/今日统计**:基于文件创建时间计算,用于了解系统使用趋势
|
||||
|
||||
::: tip 提示
|
||||
存储使用量显示的是字节数。例如 `10485760` 表示约 10MB。
|
||||
:::
|
||||
|
||||
## 文件管理
|
||||
|
||||
### 文件列表
|
||||
|
||||
文件管理页面展示系统中所有已分享的文件,支持分页浏览和搜索。
|
||||
|
||||
**列表信息包括:**
|
||||
- 文件 ID
|
||||
- 提取码(code)
|
||||
- 文件名前缀(prefix)
|
||||
- 文件后缀(suffix)
|
||||
- 文件大小
|
||||
- 创建时间
|
||||
- 过期时间
|
||||
- 剩余下载次数
|
||||
|
||||
### 搜索文件
|
||||
|
||||
使用搜索功能可以快速找到特定文件:
|
||||
|
||||
1. 在搜索框中输入关键词
|
||||
2. 系统会根据文件名前缀(prefix)进行模糊匹配
|
||||
3. 搜索结果实时更新
|
||||
|
||||
**搜索示例:**
|
||||
- 输入 `report` 可以找到所有文件名包含 "report" 的文件
|
||||
- 输入 `.pdf` 可以找到所有 PDF 文件(如果文件名包含此字符串)
|
||||
|
||||
### 分页浏览
|
||||
|
||||
文件列表支持分页显示:
|
||||
|
||||
| 参数 | 默认值 | 说明 |
|
||||
|------|--------|------|
|
||||
| `page` | `1` | 当前页码 |
|
||||
| `size` | `10` | 每页显示数量 |
|
||||
|
||||
### 删除文件
|
||||
|
||||
管理员可以删除任意文件:
|
||||
|
||||
1. 在文件列表中找到要删除的文件
|
||||
2. 点击删除按钮
|
||||
3. 确认删除操作
|
||||
|
||||
::: danger 警告
|
||||
删除操作不可恢复!文件将从存储后端永久删除,同时删除数据库中的记录。
|
||||
:::
|
||||
|
||||
**删除流程:**
|
||||
1. 系统首先从存储后端(本地/S3/OneDrive 等)删除实际文件
|
||||
2. 然后从数据库中删除文件记录
|
||||
3. 删除后,对应的提取码将失效
|
||||
|
||||
### 下载文件
|
||||
|
||||
管理员可以直接下载任意文件:
|
||||
|
||||
1. 在文件列表中找到目标文件
|
||||
2. 点击下载按钮
|
||||
3. 文件将通过浏览器下载
|
||||
|
||||
对于文本分享,系统会直接返回文本内容而不是下载文件。
|
||||
|
||||
### 修改文件信息
|
||||
|
||||
管理员可以修改已分享文件的部分信息:
|
||||
|
||||
| 可修改字段 | 说明 |
|
||||
|------------|------|
|
||||
| `code` | 提取码(必须唯一,不能与其他文件重复) |
|
||||
| `prefix` | 文件名前缀 |
|
||||
| `suffix` | 文件后缀名 |
|
||||
| `expired_at` | 过期时间 |
|
||||
| `expired_count` | 剩余下载次数 |
|
||||
|
||||
**修改提取码:**
|
||||
```
|
||||
原提取码:abc123
|
||||
新提取码:myfile2024
|
||||
```
|
||||
|
||||
::: warning 注意
|
||||
修改提取码时,系统会检查新提取码是否已被使用。如果已存在相同的提取码,修改将失败。
|
||||
:::
|
||||
|
||||
## 本地文件管理
|
||||
|
||||
除了管理已分享的文件,管理面板还提供了本地文件管理功能,用于管理 `data/local` 目录中的文件。
|
||||
|
||||
### 查看本地文件
|
||||
|
||||
本地文件列表显示 `data/local` 目录中的所有文件:
|
||||
|
||||
| 信息 | 说明 |
|
||||
|------|------|
|
||||
| 文件名 | 文件的完整名称 |
|
||||
| 创建时间 | 文件的创建时间 |
|
||||
| 文件大小 | 文件大小(字节) |
|
||||
|
||||
### 分享本地文件
|
||||
|
||||
可以将本地文件快速分享:
|
||||
|
||||
1. 在本地文件列表中选择要分享的文件
|
||||
2. 设置过期方式和过期值
|
||||
3. 点击分享按钮
|
||||
4. 系统生成提取码
|
||||
|
||||
**分享参数:**
|
||||
|
||||
| 参数 | 说明 |
|
||||
|------|------|
|
||||
| `filename` | 要分享的文件名 |
|
||||
| `expire_style` | 过期方式(day/hour/minute/forever/count) |
|
||||
| `expire_value` | 过期值(天数/小时数/分钟数/下载次数) |
|
||||
|
||||
### 删除本地文件
|
||||
|
||||
可以删除 `data/local` 目录中的文件:
|
||||
|
||||
1. 在本地文件列表中找到要删除的文件
|
||||
2. 点击删除按钮
|
||||
3. 确认删除
|
||||
|
||||
::: tip 使用场景
|
||||
本地文件管理功能适用于:
|
||||
- 批量上传文件到服务器后进行分享
|
||||
- 管理通过其他方式上传到服务器的文件
|
||||
- 清理不需要的本地文件
|
||||
:::
|
||||
|
||||
## 系统设置
|
||||
|
||||
### 查看配置
|
||||
|
||||
在系统设置页面可以查看当前所有配置项的值。配置项按类别分组显示:
|
||||
|
||||
- 基础设置(站点名称、描述等)
|
||||
- 上传设置(文件大小限制、频率限制等)
|
||||
- 存储设置(存储类型、路径等)
|
||||
- 主题设置(主题选择、透明度等)
|
||||
- 安全设置(管理员密码、错误限制等)
|
||||
|
||||
### 修改配置
|
||||
|
||||
管理员可以通过管理面板修改大部分配置:
|
||||
|
||||
1. 进入系统设置页面
|
||||
2. 找到要修改的配置项
|
||||
3. 输入新的值
|
||||
4. 点击保存按钮
|
||||
|
||||
**可修改的配置项:**
|
||||
|
||||
| 类别 | 配置项示例 |
|
||||
|------|------------|
|
||||
| 基础设置 | `name`, `description`, `keywords`, `notify_title`, `notify_content` |
|
||||
| 上传设置 | `uploadSize`, `uploadMinute`, `uploadCount`, `openUpload`, `enableChunk` |
|
||||
| 过期设置 | `expireStyle`, `max_save_seconds` |
|
||||
| 主题设置 | `themesSelect`, `opacity`, `background` |
|
||||
| 安全设置 | `admin_token`, `showAdminAddr`, `errorMinute`, `errorCount` |
|
||||
| 存储设置 | `file_storage`, `storage_path` 及各存储后端的配置 |
|
||||
|
||||
::: warning 注意
|
||||
- `admin_token`(管理员密码)不能设置为空
|
||||
- `themesChoices`(主题列表)不可通过管理面板修改
|
||||
- 修改存储设置后,已有文件不会自动迁移
|
||||
:::
|
||||
|
||||
### 配置生效
|
||||
|
||||
配置修改后立即生效,无需重启服务。配置保存在数据库中,重启后仍然有效。
|
||||
|
||||
**配置存储位置:**
|
||||
- 数据库:`data/filecodebox.db`
|
||||
- 表名:`keyvalue`
|
||||
- 键名:`settings`
|
||||
|
||||
## API 接口
|
||||
|
||||
管理面板的所有功能都通过 REST API 实现,以下是主要接口:
|
||||
|
||||
### 认证接口
|
||||
|
||||
**登录**
|
||||
```
|
||||
POST /admin/login
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"password": "your-admin-password"
|
||||
}
|
||||
```
|
||||
|
||||
响应:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"token": "eyJhbGciOiJIUzI1NiIs...",
|
||||
"token_type": "Bearer"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 仪表盘接口
|
||||
|
||||
**获取统计数据**
|
||||
```
|
||||
GET /admin/dashboard
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 文件管理接口
|
||||
|
||||
**获取文件列表**
|
||||
```
|
||||
GET /admin/file/list?page=1&size=10&keyword=
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**删除文件**
|
||||
```
|
||||
DELETE /admin/file/delete
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"id": 123
|
||||
}
|
||||
```
|
||||
|
||||
**下载文件**
|
||||
```
|
||||
GET /admin/file/download?id=123
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**修改文件信息**
|
||||
```
|
||||
PATCH /admin/file/update
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"id": 123,
|
||||
"code": "newcode",
|
||||
"expired_at": "2024-12-31T23:59:59"
|
||||
}
|
||||
```
|
||||
|
||||
### 本地文件接口
|
||||
|
||||
**获取本地文件列表**
|
||||
```
|
||||
GET /admin/local/lists
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**删除本地文件**
|
||||
```
|
||||
DELETE /admin/local/delete
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"filename": "example.txt"
|
||||
}
|
||||
```
|
||||
|
||||
**分享本地文件**
|
||||
```
|
||||
POST /admin/local/share
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"filename": "example.txt",
|
||||
"expire_style": "day",
|
||||
"expire_value": 7
|
||||
}
|
||||
```
|
||||
|
||||
### 配置接口
|
||||
|
||||
**获取配置**
|
||||
```
|
||||
GET /admin/config/get
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**更新配置**
|
||||
```
|
||||
PATCH /admin/config/update
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"admin_token": "new-password",
|
||||
"uploadSize": 52428800
|
||||
}
|
||||
```
|
||||
|
||||
## 常见问题
|
||||
|
||||
### 忘记管理员密码
|
||||
|
||||
如果忘记了管理员密码,可以通过以下方式重置:
|
||||
|
||||
1. 停止 FileCodeBox 服务
|
||||
2. 使用 SQLite 工具打开 `data/filecodebox.db`
|
||||
3. 查询 `keyvalue` 表中 `key='settings'` 的记录
|
||||
4. 修改 JSON 中的 `admin_token` 值
|
||||
5. 重启服务
|
||||
|
||||
```sql
|
||||
-- 查看当前配置
|
||||
SELECT * FROM keyvalue WHERE key = 'settings';
|
||||
|
||||
-- 或者删除配置,恢复默认密码
|
||||
DELETE FROM keyvalue WHERE key = 'settings';
|
||||
```
|
||||
|
||||
### 文件删除失败
|
||||
|
||||
如果删除文件时出现错误,可能的原因:
|
||||
|
||||
1. **存储后端连接失败**:检查存储配置是否正确
|
||||
2. **文件已不存在**:文件可能已被手动删除
|
||||
3. **权限不足**:检查存储目录的写入权限
|
||||
|
||||
### 配置修改不生效
|
||||
|
||||
如果修改配置后没有生效:
|
||||
|
||||
1. 检查是否点击了保存按钮
|
||||
2. 刷新页面查看配置是否已保存
|
||||
3. 检查浏览器控制台是否有错误信息
|
||||
4. 确认配置值的格式是否正确(如数字类型不要输入字符串)
|
||||
|
||||
## 下一步
|
||||
|
||||
- [配置说明](/guide/configuration) - 了解所有配置选项的详细说明
|
||||
- [安全设置](/guide/security) - 了解如何增强系统安全性
|
||||
- [存储配置](/guide/storage) - 配置不同的存储后端
|
||||
@@ -0,0 +1,324 @@
|
||||
# 安全设置
|
||||
|
||||
FileCodeBox 提供了多层安全机制来保护您的文件分享服务。本文档介绍如何正确配置安全选项,确保系统安全运行。
|
||||
|
||||
## 管理员密码
|
||||
|
||||
### 修改默认密码
|
||||
|
||||
::: danger 重要安全警告
|
||||
FileCodeBox 的默认管理员密码是 `FileCodeBox2023`。**在生产环境中必须立即修改此密码!**使用默认密码会导致任何人都可以访问您的管理面板。
|
||||
:::
|
||||
|
||||
修改管理员密码有两种方式:
|
||||
|
||||
**方式一:通过管理面板修改(推荐)**
|
||||
|
||||
1. 访问 `/admin` 进入管理面板
|
||||
2. 使用当前密码登录
|
||||
3. 进入「系统设置」页面
|
||||
4. 找到 `admin_token` 配置项
|
||||
5. 输入新的安全密码并保存
|
||||
|
||||
**方式二:通过数据库修改**
|
||||
|
||||
配置存储在 `data/filecodebox.db` 数据库的 `keyvalue` 表中,可以直接修改 `admin_token` 的值。
|
||||
|
||||
### 密码安全建议
|
||||
|
||||
- 使用至少 16 个字符的强密码
|
||||
- 包含大小写字母、数字和特殊字符
|
||||
- 避免使用常见词汇或个人信息
|
||||
- 定期更换密码
|
||||
|
||||
```python
|
||||
# 推荐的密码格式示例
|
||||
"admin_token": "Xk9#mP2$vL5@nQ8&wR3"
|
||||
```
|
||||
|
||||
### 隐藏管理入口
|
||||
|
||||
默认情况下,管理面板入口是隐藏的。您可以通过 `showAdminAddr` 配置控制是否在首页显示管理入口:
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `showAdminAddr` | int | `0` | 是否显示管理入口(1=显示,0=隐藏) |
|
||||
|
||||
::: tip 建议
|
||||
在公开服务中,建议保持 `showAdminAddr` 为 `0`,通过直接访问 `/admin` 路径进入管理面板。
|
||||
:::
|
||||
|
||||
## IP 速率限制
|
||||
|
||||
FileCodeBox 内置了基于 IP 的速率限制机制,可以有效防止滥用和攻击。
|
||||
|
||||
### 上传频率限制
|
||||
|
||||
限制单个 IP 在指定时间内的上传次数:
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `uploadMinute` | int | `1` | 上传限制的时间窗口(分钟) |
|
||||
| `uploadCount` | int | `10` | 在时间窗口内允许的最大上传次数 |
|
||||
|
||||
**工作原理:**
|
||||
- 系统记录每个 IP 的上传请求
|
||||
- 当某 IP 在 `uploadMinute` 分钟内的上传次数达到 `uploadCount` 时
|
||||
- 该 IP 的后续上传请求将被拒绝,返回 HTTP 423 错误
|
||||
- 等待时间窗口过期后,计数器重置
|
||||
|
||||
**配置示例:**
|
||||
|
||||
```python
|
||||
# 宽松配置:5分钟内最多上传20次
|
||||
{
|
||||
"uploadMinute": 5,
|
||||
"uploadCount": 20
|
||||
}
|
||||
|
||||
# 严格配置:1分钟内最多上传3次
|
||||
{
|
||||
"uploadMinute": 1,
|
||||
"uploadCount": 3
|
||||
}
|
||||
```
|
||||
|
||||
### 错误次数限制
|
||||
|
||||
限制单个 IP 的错误尝试次数,防止暴力破解提取码:
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `errorMinute` | int | `1` | 错误限制的时间窗口(分钟) |
|
||||
| `errorCount` | int | `1` | 在时间窗口内允许的最大错误次数 |
|
||||
|
||||
**工作原理:**
|
||||
- 当用户输入错误的提取码时,系统记录该 IP 的错误次数
|
||||
- 当错误次数达到 `errorCount` 时,该 IP 将被暂时锁定
|
||||
- 锁定时间为 `errorMinute` 分钟
|
||||
- 锁定期间,该 IP 的所有提取请求都将被拒绝
|
||||
|
||||
**配置示例:**
|
||||
|
||||
```python
|
||||
# 防暴力破解配置:5分钟内最多允许3次错误
|
||||
{
|
||||
"errorMinute": 5,
|
||||
"errorCount": 3
|
||||
}
|
||||
```
|
||||
|
||||
::: warning 注意
|
||||
默认配置 `errorMinute=1, errorCount=1` 非常严格,意味着输入一次错误的提取码后需要等待1分钟才能重试。根据实际需求调整此配置。
|
||||
:::
|
||||
|
||||
## 上传限制
|
||||
|
||||
### 文件大小限制
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `uploadSize` | int | `10485760` | 单文件最大上传大小(字节),默认 10MB |
|
||||
| `openUpload` | int | `1` | 是否开启上传功能(1=开启,0=关闭) |
|
||||
|
||||
**常用大小换算:**
|
||||
- 10MB = 10 * 1024 * 1024 = `10485760`
|
||||
- 50MB = 50 * 1024 * 1024 = `52428800`
|
||||
- 100MB = 100 * 1024 * 1024 = `104857600`
|
||||
- 1GB = 1024 * 1024 * 1024 = `1073741824`
|
||||
|
||||
### 文件过期设置
|
||||
|
||||
通过文件过期机制,可以自动清理过期文件,减少存储占用和安全风险:
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `expireStyle` | list | `["day","hour","minute","forever","count"]` | 可选的过期方式 |
|
||||
| `max_save_seconds` | int | `0` | 文件最大保存时间(秒),0 表示不限制 |
|
||||
|
||||
**过期方式说明:**
|
||||
- `day` - 按天数过期
|
||||
- `hour` - 按小时过期
|
||||
- `minute` - 按分钟过期
|
||||
- `forever` - 永不过期(需要字符串提取码)
|
||||
- `count` - 按下载次数过期
|
||||
|
||||
**安全建议:**
|
||||
|
||||
对于公开服务,建议:
|
||||
1. 移除 `forever` 选项,避免文件永久存储
|
||||
2. 设置 `max_save_seconds` 限制最长保存时间
|
||||
3. 优先使用 `count` 方式,下载后自动删除
|
||||
|
||||
```python
|
||||
# 公开服务推荐配置
|
||||
{
|
||||
"expireStyle": ["hour", "minute", "count"],
|
||||
"max_save_seconds": 86400 # 最长保存1天
|
||||
}
|
||||
```
|
||||
|
||||
### 关闭上传功能
|
||||
|
||||
在某些情况下,您可能需要临时关闭上传功能:
|
||||
|
||||
```python
|
||||
{
|
||||
"openUpload": 0 # 关闭上传功能
|
||||
}
|
||||
```
|
||||
|
||||
## 反向代理安全配置
|
||||
|
||||
在生产环境中,通常会使用 Nginx 或其他反向代理服务器。以下是安全配置建议:
|
||||
|
||||
### Nginx 配置示例
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name your-domain.com;
|
||||
|
||||
# 强制 HTTPS 重定向
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name your-domain.com;
|
||||
|
||||
# SSL 证书配置
|
||||
ssl_certificate /path/to/cert.pem;
|
||||
ssl_certificate_key /path/to/key.pem;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
# 安全头部
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
|
||||
# 限制请求体大小(与 uploadSize 配置一致)
|
||||
client_max_body_size 100M;
|
||||
|
||||
# 传递真实 IP
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:12345;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# 静态资源缓存
|
||||
location /assets {
|
||||
proxy_pass http://127.0.0.1:12345;
|
||||
proxy_cache_valid 200 7d;
|
||||
add_header Cache-Control "public, max-age=604800";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 关键安全配置说明
|
||||
|
||||
**1. 传递真实 IP**
|
||||
|
||||
FileCodeBox 的 IP 限制功能依赖于获取客户端真实 IP。系统会按以下顺序获取 IP:
|
||||
1. `X-Real-IP` 请求头
|
||||
2. `X-Forwarded-For` 请求头
|
||||
3. 直接连接的客户端 IP
|
||||
|
||||
确保反向代理正确设置这些头部:
|
||||
|
||||
```nginx
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
```
|
||||
|
||||
**2. 请求体大小限制**
|
||||
|
||||
Nginx 的 `client_max_body_size` 应该与 FileCodeBox 的 `uploadSize` 配置一致或略大:
|
||||
|
||||
```nginx
|
||||
client_max_body_size 100M; # 允许上传最大 100MB
|
||||
```
|
||||
|
||||
**3. HTTPS 加密**
|
||||
|
||||
强烈建议在生产环境中启用 HTTPS:
|
||||
- 保护用户上传的文件内容
|
||||
- 保护管理员登录凭据
|
||||
- 防止中间人攻击
|
||||
|
||||
### Caddy 配置示例
|
||||
|
||||
```nginx
|
||||
your-domain.com {
|
||||
reverse_proxy localhost:12345
|
||||
|
||||
header {
|
||||
X-Frame-Options "SAMEORIGIN"
|
||||
X-Content-Type-Options "nosniff"
|
||||
X-XSS-Protection "1; mode=block"
|
||||
Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 安全检查清单
|
||||
|
||||
部署 FileCodeBox 前,请确认以下安全配置:
|
||||
|
||||
- [ ] 已修改默认管理员密码 `admin_token`
|
||||
- [ ] 已隐藏管理入口 `showAdminAddr: 0`
|
||||
- [ ] 已配置合适的上传频率限制
|
||||
- [ ] 已配置错误次数限制防止暴力破解
|
||||
- [ ] 已设置合理的文件大小限制
|
||||
- [ ] 已配置文件过期策略
|
||||
- [ ] 已启用 HTTPS 加密
|
||||
- [ ] 反向代理已正确传递真实 IP
|
||||
- [ ] 已设置安全响应头部
|
||||
|
||||
## 推荐安全配置
|
||||
|
||||
### 公开服务配置
|
||||
|
||||
```python
|
||||
{
|
||||
"admin_token": "your-very-secure-password",
|
||||
"showAdminAddr": 0,
|
||||
"uploadSize": 10485760, # 10MB
|
||||
"uploadMinute": 1,
|
||||
"uploadCount": 5,
|
||||
"errorMinute": 5,
|
||||
"errorCount": 3,
|
||||
"expireStyle": ["hour", "minute", "count"],
|
||||
"max_save_seconds": 86400, # 最长1天
|
||||
"openUpload": 1
|
||||
}
|
||||
```
|
||||
|
||||
### 内部服务配置
|
||||
|
||||
```python
|
||||
{
|
||||
"admin_token": "internal-secure-password",
|
||||
"showAdminAddr": 1,
|
||||
"uploadSize": 104857600, # 100MB
|
||||
"uploadMinute": 5,
|
||||
"uploadCount": 50,
|
||||
"errorMinute": 1,
|
||||
"errorCount": 5,
|
||||
"expireStyle": ["day", "hour", "forever"],
|
||||
"max_save_seconds": 0, # 不限制
|
||||
"openUpload": 1
|
||||
}
|
||||
```
|
||||
|
||||
## 下一步
|
||||
|
||||
- [配置说明](/guide/configuration) - 了解所有配置选项
|
||||
- [存储配置](/guide/storage) - 配置安全的存储后端
|
||||
- [文件分享](/guide/share) - 了解文件分享功能
|
||||
@@ -0,0 +1,341 @@
|
||||
# 文件分享
|
||||
|
||||
FileCodeBox 提供了简单易用的文件和文本分享功能。用户可以通过提取码安全地分享和获取文件。
|
||||
|
||||
## 分享方式
|
||||
|
||||
FileCodeBox 支持两种分享方式:
|
||||
|
||||
1. **文本分享** - 直接分享文本内容,适合代码片段、配置文件等
|
||||
2. **文件分享** - 上传文件进行分享,支持各种文件格式
|
||||
|
||||
## 文本分享
|
||||
|
||||
### 使用方法
|
||||
|
||||
1. 在首页选择「文本分享」标签
|
||||
2. 在文本框中输入或粘贴要分享的内容
|
||||
3. 选择过期方式和时间
|
||||
4. 点击「分享」按钮
|
||||
5. 获取提取码
|
||||
|
||||
### 文本大小限制
|
||||
|
||||
::: warning 注意
|
||||
文本分享的最大内容大小为 **222KB**(227,328 字节)。如果内容超过此限制,建议使用文件分享方式。
|
||||
:::
|
||||
|
||||
文本内容大小按 UTF-8 编码计算,中文字符通常占用 3 个字节。
|
||||
|
||||
### API 接口
|
||||
|
||||
**POST** `/share/text/`
|
||||
|
||||
请求参数:
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| `text` | string | 是 | 要分享的文本内容 |
|
||||
| `expire_value` | int | 否 | 过期数值,默认 1 |
|
||||
| `expire_style` | string | 否 | 过期方式,默认 `day` |
|
||||
|
||||
响应示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "123456"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 文件分享
|
||||
|
||||
### 使用方法
|
||||
|
||||
1. 在首页选择「文件分享」标签
|
||||
2. 点击上传区域或拖拽文件到上传区域
|
||||
3. 选择过期方式和时间
|
||||
4. 点击「上传」按钮
|
||||
5. 获取提取码
|
||||
|
||||
### 文件大小限制
|
||||
|
||||
默认单文件最大上传大小为 **10MB**。管理员可以通过 `uploadSize` 配置项修改此限制。
|
||||
|
||||
::: tip 提示
|
||||
如果需要上传大文件,请联系管理员启用分片上传功能,或调整 `uploadSize` 配置。
|
||||
:::
|
||||
|
||||
### 支持的上传方式
|
||||
|
||||
- **点击上传** - 点击上传区域选择文件
|
||||
- **拖拽上传** - 将文件拖拽到上传区域
|
||||
- **粘贴上传** - 从剪贴板粘贴图片(部分主题支持)
|
||||
|
||||
### API 接口
|
||||
|
||||
**POST** `/share/file/`
|
||||
|
||||
请求参数(multipart/form-data):
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| `file` | file | 是 | 要上传的文件 |
|
||||
| `expire_value` | int | 否 | 过期数值,默认 1 |
|
||||
| `expire_style` | string | 否 | 过期方式,默认 `day` |
|
||||
|
||||
响应示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "654321",
|
||||
"name": "example.pdf"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 过期设置
|
||||
|
||||
FileCodeBox 支持多种灵活的过期方式:
|
||||
|
||||
| 过期方式 | 参数值 | 说明 |
|
||||
|----------|--------|------|
|
||||
| 按天过期 | `day` | 文件在指定天数后过期 |
|
||||
| 按小时过期 | `hour` | 文件在指定小时后过期 |
|
||||
| 按分钟过期 | `minute` | 文件在指定分钟后过期 |
|
||||
| 永不过期 | `forever` | 文件永久有效 |
|
||||
| 按次数过期 | `count` | 文件在被下载指定次数后过期 |
|
||||
|
||||
::: info 说明
|
||||
- 管理员可以通过 `expireStyle` 配置项控制用户可选的过期方式
|
||||
- 管理员可以通过 `max_save_seconds` 配置项限制文件的最长保存时间
|
||||
:::
|
||||
|
||||
### 过期方式示例
|
||||
|
||||
```bash
|
||||
# 文件 3 天后过期
|
||||
expire_value=3, expire_style=day
|
||||
|
||||
# 文件 12 小时后过期
|
||||
expire_value=12, expire_style=hour
|
||||
|
||||
# 文件 30 分钟后过期
|
||||
expire_value=30, expire_style=minute
|
||||
|
||||
# 文件永不过期
|
||||
expire_value=1, expire_style=forever
|
||||
|
||||
# 文件被下载 5 次后过期
|
||||
expire_value=5, expire_style=count
|
||||
```
|
||||
|
||||
## 提取文件
|
||||
|
||||
### 使用方法
|
||||
|
||||
1. 在首页的「提取文件」区域输入提取码
|
||||
2. 点击「提取」按钮
|
||||
3. 系统会显示文件信息(文件名、大小等)
|
||||
4. 点击「下载」按钮下载文件,或直接查看文本内容
|
||||
|
||||
### 提取码说明
|
||||
|
||||
- 提取码通常为 **6 位数字**
|
||||
- 永不过期的文件使用 **字母数字混合** 的提取码
|
||||
- 提取码区分大小写(针对字母数字混合的情况)
|
||||
|
||||
### API 接口
|
||||
|
||||
**查询文件信息**
|
||||
|
||||
**POST** `/share/select/`
|
||||
|
||||
请求参数:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": "123456"
|
||||
}
|
||||
```
|
||||
|
||||
响应示例(文件):
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "123456",
|
||||
"name": "example.pdf",
|
||||
"size": 1048576,
|
||||
"text": "https://example.com/download/..."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
响应示例(文本):
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "123456",
|
||||
"name": "Text",
|
||||
"size": 1024,
|
||||
"text": "这是分享的文本内容..."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**直接下载文件**
|
||||
|
||||
**GET** `/share/select/?code=123456`
|
||||
|
||||
此接口会直接返回文件内容,适合在浏览器中直接访问。
|
||||
|
||||
## 分片上传(大文件)
|
||||
|
||||
对于大文件上传,FileCodeBox 支持分片上传功能。此功能需要管理员启用(`enableChunk=1`)。
|
||||
|
||||
### 分片上传流程
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant C as 客户端
|
||||
participant S as 服务器
|
||||
|
||||
C->>S: 1. 初始化上传 (POST /chunk/upload/init/)
|
||||
S-->>C: 返回 upload_id 和分片信息
|
||||
|
||||
loop 每个分片
|
||||
C->>S: 2. 上传分片 (POST /chunk/upload/chunk/{upload_id}/{chunk_index})
|
||||
S-->>C: 返回分片哈希
|
||||
end
|
||||
|
||||
C->>S: 3. 完成上传 (POST /chunk/upload/complete/{upload_id})
|
||||
S-->>C: 返回提取码
|
||||
```
|
||||
|
||||
### 1. 初始化上传
|
||||
|
||||
**POST** `/chunk/upload/init/`
|
||||
|
||||
请求参数:
|
||||
|
||||
```json
|
||||
{
|
||||
"file_name": "large_file.zip",
|
||||
"file_size": 104857600,
|
||||
"chunk_size": 5242880,
|
||||
"file_hash": "sha256_hash_of_file"
|
||||
}
|
||||
```
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| `file_name` | string | 是 | 文件名 |
|
||||
| `file_size` | int | 是 | 文件总大小(字节) |
|
||||
| `chunk_size` | int | 否 | 分片大小,默认 5MB |
|
||||
| `file_hash` | string | 是 | 文件的 SHA256 哈希值 |
|
||||
|
||||
响应示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"existed": false,
|
||||
"upload_id": "abc123def456",
|
||||
"chunk_size": 5242880,
|
||||
"total_chunks": 20,
|
||||
"uploaded_chunks": []
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2. 上传分片
|
||||
|
||||
**POST** `/chunk/upload/chunk/{upload_id}/{chunk_index}`
|
||||
|
||||
- `upload_id` - 初始化时返回的上传会话 ID
|
||||
- `chunk_index` - 分片索引,从 0 开始
|
||||
|
||||
请求体:分片文件数据(multipart/form-data)
|
||||
|
||||
响应示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"chunk_hash": "sha256_hash_of_chunk"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3. 完成上传
|
||||
|
||||
**POST** `/chunk/upload/complete/{upload_id}`
|
||||
|
||||
请求参数:
|
||||
|
||||
```json
|
||||
{
|
||||
"expire_value": 1,
|
||||
"expire_style": "day"
|
||||
}
|
||||
```
|
||||
|
||||
响应示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "789012",
|
||||
"name": "large_file.zip"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 断点续传
|
||||
|
||||
分片上传支持断点续传。如果上传中断,可以:
|
||||
|
||||
1. 重新调用初始化接口,使用相同的 `file_hash`
|
||||
2. 服务器会返回已上传的分片列表 `uploaded_chunks`
|
||||
3. 客户端只需上传未完成的分片
|
||||
|
||||
## 错误处理
|
||||
|
||||
### 常见错误码
|
||||
|
||||
| 错误码 | 说明 | 解决方案 |
|
||||
|--------|------|----------|
|
||||
| 403 | 文件大小超过限制 | 减小文件大小或联系管理员调整限制 |
|
||||
| 403 | 内容过多 | 文本超过 222KB,请使用文件分享 |
|
||||
| 403 | 上传频率限制 | 等待一段时间后重试 |
|
||||
| 404 | 文件不存在 | 检查提取码是否正确 |
|
||||
| 404 | 文件已过期 | 文件已过期或下载次数已用完 |
|
||||
|
||||
### 频率限制
|
||||
|
||||
为防止滥用,系统对上传和提取操作有频率限制:
|
||||
|
||||
- **上传限制**:默认每分钟最多 10 次上传
|
||||
- **错误限制**:默认每分钟最多 1 次错误尝试
|
||||
|
||||
::: tip 提示
|
||||
如果遇到频率限制,请等待限制时间窗口过后再重试。
|
||||
:::
|
||||
|
||||
## 下一步
|
||||
|
||||
- [配置说明](/guide/configuration) - 了解如何配置分享相关设置
|
||||
- [存储配置](/guide/storage) - 了解文件存储方式
|
||||
- [安全设置](/guide/security) - 了解安全相关配置
|
||||
- [管理面板](/guide/management) - 了解如何管理分享的文件
|
||||
+383
-14
@@ -1,26 +1,395 @@
|
||||
# 阿里云设置
|
||||
S3 AccessKeyId: `AccessKeyId`
|
||||
# 存储配置
|
||||
|
||||
S3 SecretAccessKey: `SecretAccessKey`
|
||||
FileCodeBox 支持多种存储后端,您可以根据需求选择合适的存储方式。本文档将详细介绍各种存储后端的配置方法。
|
||||
|
||||
S3 BucketName: `bucket-name`
|
||||
## 存储类型概览
|
||||
|
||||
S3 EndpointUrl: `https://<bucket-name>.<region>.aliyuncs.com`
|
||||
| 存储类型 | 配置值 | 说明 |
|
||||
|---------|--------|------|
|
||||
| 本地存储 | `local` | 默认存储方式,文件保存在服务器本地 |
|
||||
| S3 兼容存储 | `s3` | 支持 AWS S3、阿里云 OSS、MinIO 等 |
|
||||
| OneDrive | `onedrive` | 微软 OneDrive 云存储(仅支持工作/学校账户) |
|
||||
| WebDAV | `webdav` | 支持 WebDAV 协议的存储服务 |
|
||||
| OpenDAL | `opendal` | 通过 OpenDAL 集成更多存储服务 |
|
||||
|
||||
S3 Signature Version: `s3v4`
|
||||
## 本地存储
|
||||
|
||||
S3 Region Name:`region`
|
||||
本地存储是默认的存储方式,文件将保存在服务器的 `data/` 目录下。
|
||||
|
||||
# Minio设置
|
||||
### 配置参数
|
||||
|
||||
S3 AccessKeyId: `AccessKeyId`
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `file_storage` | string | `local` | 存储类型 |
|
||||
| `storage_path` | string | `""` | 自定义存储路径(可选) |
|
||||
|
||||
S3 SecretAccessKey: `SecretAccessKey`
|
||||
### 配置示例
|
||||
|
||||
S3 BucketName: `bucket-name`
|
||||
```bash
|
||||
file_storage=local
|
||||
storage_path=
|
||||
```
|
||||
|
||||
S3 EndpointUrl: api接口地址
|
||||
### 说明
|
||||
|
||||
S3 Signature Version: `s3v4`
|
||||
- 文件默认存储在 `data/share/data/` 目录下
|
||||
- 按日期自动创建子目录:`年/月/日/文件ID/`
|
||||
- 建议在生产环境中将 `data/` 目录挂载到持久化存储
|
||||
|
||||
S3 Region Name:根据`configurations`里面设置的 `Server Location`
|
||||
## S3 兼容存储
|
||||
|
||||
支持所有 S3 兼容的对象存储服务,包括 AWS S3、阿里云 OSS、MinIO、腾讯云 COS 等。
|
||||
|
||||
### 配置参数
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `file_storage` | string | - | 设置为 `s3` |
|
||||
| `s3_access_key_id` | string | `""` | Access Key ID |
|
||||
| `s3_secret_access_key` | string | `""` | Secret Access Key |
|
||||
| `s3_bucket_name` | string | `""` | 存储桶名称 |
|
||||
| `s3_endpoint_url` | string | `""` | S3 端点 URL |
|
||||
| `s3_region_name` | string | `auto` | 区域名称 |
|
||||
| `s3_signature_version` | string | `s3v2` | 签名版本(`s3v2` 或 `s3v4`) |
|
||||
| `s3_hostname` | string | `""` | S3 主机名(备用) |
|
||||
| `s3_proxy` | int | `0` | 是否通过服务器代理下载(1=是,0=否) |
|
||||
| `aws_session_token` | string | `""` | AWS 会话令牌(可选) |
|
||||
|
||||
### AWS S3 配置示例
|
||||
|
||||
```bash
|
||||
file_storage=s3
|
||||
s3_access_key_id=AKIAIOSFODNN7EXAMPLE
|
||||
s3_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
|
||||
s3_bucket_name=my-filecodebox-bucket
|
||||
s3_endpoint_url=https://s3.amazonaws.com
|
||||
s3_region_name=us-east-1
|
||||
s3_signature_version=s3v4
|
||||
```
|
||||
|
||||
### 阿里云 OSS 配置示例
|
||||
|
||||
```bash
|
||||
file_storage=s3
|
||||
s3_access_key_id=您的AccessKeyId
|
||||
s3_secret_access_key=您的SecretAccessKey
|
||||
s3_bucket_name=bucket-name
|
||||
s3_endpoint_url=https://bucket-name.oss-cn-hangzhou.aliyuncs.com
|
||||
s3_region_name=oss-cn-hangzhou
|
||||
s3_signature_version=s3v4
|
||||
```
|
||||
|
||||
::: tip 阿里云 OSS 端点格式
|
||||
端点 URL 格式为:`https://<bucket-name>.<region>.aliyuncs.com`
|
||||
|
||||
常用区域:
|
||||
- 杭州:`oss-cn-hangzhou`
|
||||
- 上海:`oss-cn-shanghai`
|
||||
- 北京:`oss-cn-beijing`
|
||||
- 深圳:`oss-cn-shenzhen`
|
||||
:::
|
||||
|
||||
### MinIO 配置示例
|
||||
|
||||
```bash
|
||||
file_storage=s3
|
||||
s3_access_key_id=minioadmin
|
||||
s3_secret_access_key=minioadmin
|
||||
s3_bucket_name=filecodebox
|
||||
s3_endpoint_url=http://localhost:9000
|
||||
s3_region_name=us-east-1
|
||||
s3_signature_version=s3v4
|
||||
```
|
||||
|
||||
::: warning MinIO 注意事项
|
||||
- `s3_endpoint_url` 填写 MinIO 的 API 接口地址
|
||||
- `s3_region_name` 根据 MinIO 配置中的 `Server Location` 设置
|
||||
- 确保存储桶已创建且有正确的访问权限
|
||||
:::
|
||||
|
||||
### 腾讯云 COS 配置示例
|
||||
|
||||
```bash
|
||||
file_storage=s3
|
||||
s3_access_key_id=您的SecretId
|
||||
s3_secret_access_key=您的SecretKey
|
||||
s3_bucket_name=bucket-name-1250000000
|
||||
s3_endpoint_url=https://cos.ap-guangzhou.myqcloud.com
|
||||
s3_region_name=ap-guangzhou
|
||||
s3_signature_version=s3v4
|
||||
```
|
||||
|
||||
### 代理下载
|
||||
|
||||
当 `s3_proxy=1` 时,文件下载将通过服务器中转,而不是直接从 S3 下载。这在以下情况下有用:
|
||||
|
||||
- S3 存储桶不允许公开访问
|
||||
- 需要隐藏实际的存储地址
|
||||
- 网络环境限制直接访问 S3
|
||||
|
||||
|
||||
|
||||
## OneDrive 存储
|
||||
|
||||
OneDrive 存储支持将文件保存到微软 OneDrive 云存储。
|
||||
|
||||
::: warning 重要限制
|
||||
OneDrive 存储**仅支持工作或学校账户**,并且需要有管理员权限以授权 API。个人账户无法使用此功能。
|
||||
:::
|
||||
|
||||
### 配置参数
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `file_storage` | string | - | 设置为 `onedrive` |
|
||||
| `onedrive_domain` | string | `""` | Azure AD 域名 |
|
||||
| `onedrive_client_id` | string | `""` | 应用程序(客户端)ID |
|
||||
| `onedrive_username` | string | `""` | 账户邮箱 |
|
||||
| `onedrive_password` | string | `""` | 账户密码 |
|
||||
| `onedrive_root_path` | string | `filebox_storage` | OneDrive 中的存储根目录 |
|
||||
| `onedrive_proxy` | int | `0` | 是否通过服务器代理下载 |
|
||||
|
||||
### 配置示例
|
||||
|
||||
```bash
|
||||
file_storage=onedrive
|
||||
onedrive_domain=contoso.onmicrosoft.com
|
||||
onedrive_client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
onedrive_username=user@contoso.onmicrosoft.com
|
||||
onedrive_password=your_password
|
||||
onedrive_root_path=filebox_storage
|
||||
```
|
||||
|
||||
### Azure 应用注册步骤
|
||||
|
||||
要使用 OneDrive 存储,您需要在 Azure 门户中注册应用程序:
|
||||
|
||||
#### 1. 获取域名
|
||||
|
||||
登录 [Azure 门户](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade),将鼠标置于右上角账号处,浮窗显示的**域**即为 `onedrive_domain` 的值。
|
||||
|
||||
#### 2. 注册应用
|
||||
|
||||
1. 点击左上角的 **+ 新注册**
|
||||
2. 输入应用名称(如:FileCodeBox)
|
||||
3. **受支持的帐户类型**:选择"任何组织目录(任何 Azure AD 目录 - 多租户)中的帐户和个人 Microsoft 帐户"
|
||||
4. **重定向 URI**:选择 `Web`,输入 `http://localhost`
|
||||
5. 点击**注册**
|
||||
|
||||
#### 3. 获取客户端 ID
|
||||
|
||||
注册完成后,在应用概述页面的**概要**中找到**应用程序(客户端)ID**,即为 `onedrive_client_id` 的值。
|
||||
|
||||
#### 4. 配置身份验证
|
||||
|
||||
1. 在左侧菜单选择**身份验证**
|
||||
2. 找到**允许公共客户端流**,选择**是**
|
||||
3. 点击**保存**
|
||||
|
||||
#### 5. 配置 API 权限
|
||||
|
||||
1. 在左侧菜单选择 **API 权限**
|
||||
2. 点击 **+ 添加权限**
|
||||
3. 选择 **Microsoft Graph** → **委托的权限**
|
||||
4. 勾选以下权限:
|
||||
- `openid`
|
||||
- `Files.Read`
|
||||
- `Files.Read.All`
|
||||
- `Files.ReadWrite`
|
||||
- `Files.ReadWrite.All`
|
||||
- `User.Read`
|
||||
5. 点击**添加权限**
|
||||
6. 点击**代表 xxx 授予管理员同意**
|
||||
7. 确认后,权限状态应显示为**已授予**
|
||||
|
||||
### 安装依赖
|
||||
|
||||
使用 OneDrive 存储需要安装额外的 Python 依赖:
|
||||
|
||||
```bash
|
||||
pip install msal Office365-REST-Python-Client
|
||||
```
|
||||
|
||||
### 验证配置
|
||||
|
||||
您可以使用以下代码测试配置是否正确:
|
||||
|
||||
```python
|
||||
import msal
|
||||
from office365.graph_client import GraphClient
|
||||
|
||||
domain = 'your_domain'
|
||||
client_id = 'your_client_id'
|
||||
username = 'your_username'
|
||||
password = 'your_password'
|
||||
|
||||
def acquire_token_pwd():
|
||||
authority_url = f'https://login.microsoftonline.com/{domain}'
|
||||
app = msal.PublicClientApplication(
|
||||
authority=authority_url,
|
||||
client_id=client_id
|
||||
)
|
||||
result = app.acquire_token_by_username_password(
|
||||
username=username,
|
||||
password=password,
|
||||
scopes=['https://graph.microsoft.com/.default']
|
||||
)
|
||||
return result
|
||||
|
||||
# 测试连接
|
||||
client = GraphClient(acquire_token_pwd)
|
||||
me = client.me.get().execute_query()
|
||||
print(f"登录成功:{me.user_principal_name}")
|
||||
```
|
||||
|
||||
## WebDAV 存储
|
||||
|
||||
WebDAV 存储支持将文件保存到任何支持 WebDAV 协议的服务,如 Nextcloud、ownCloud、坚果云等。
|
||||
|
||||
### 配置参数
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `file_storage` | string | - | 设置为 `webdav` |
|
||||
| `webdav_url` | string | `""` | WebDAV 服务器 URL |
|
||||
| `webdav_username` | string | `""` | WebDAV 用户名 |
|
||||
| `webdav_password` | string | `""` | WebDAV 密码 |
|
||||
| `webdav_root_path` | string | `filebox_storage` | WebDAV 中的存储根目录 |
|
||||
| `webdav_proxy` | int | `0` | 是否通过服务器代理下载 |
|
||||
|
||||
### 配置示例
|
||||
|
||||
```bash
|
||||
file_storage=webdav
|
||||
webdav_url=https://dav.example.com/remote.php/dav/files/username/
|
||||
webdav_username=your_username
|
||||
webdav_password=your_password
|
||||
webdav_root_path=filebox_storage
|
||||
```
|
||||
|
||||
### Nextcloud 配置示例
|
||||
|
||||
```bash
|
||||
file_storage=webdav
|
||||
webdav_url=https://your-nextcloud.com/remote.php/dav/files/username/
|
||||
webdav_username=your_username
|
||||
webdav_password=your_app_password
|
||||
webdav_root_path=FileCodeBox
|
||||
```
|
||||
|
||||
::: tip Nextcloud 应用密码
|
||||
建议在 Nextcloud 中创建应用密码,而不是使用主密码:
|
||||
1. 登录 Nextcloud
|
||||
2. 进入**设置** → **安全**
|
||||
3. 在**设备与会话**中创建新的应用密码
|
||||
:::
|
||||
|
||||
### 坚果云配置示例
|
||||
|
||||
```bash
|
||||
file_storage=webdav
|
||||
webdav_url=https://dav.jianguoyun.com/dav/
|
||||
webdav_username=your_email@example.com
|
||||
webdav_password=your_app_password
|
||||
webdav_root_path=FileCodeBox
|
||||
```
|
||||
|
||||
::: tip 坚果云应用密码
|
||||
坚果云需要使用应用密码:
|
||||
1. 登录坚果云网页版
|
||||
2. 进入**账户信息** → **安全选项**
|
||||
3. 添加应用密码
|
||||
:::
|
||||
|
||||
## OpenDAL 存储
|
||||
|
||||
OpenDAL 是一个统一的数据访问层,支持多种存储服务。通过 OpenDAL,您可以使用 Google Cloud Storage、Azure Blob Storage 等更多存储服务。
|
||||
|
||||
### 配置参数
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `file_storage` | string | 设置为 `opendal` |
|
||||
| `opendal_scheme` | string | 存储服务类型(如 `gcs`、`azblob`) |
|
||||
| `opendal_<scheme>_<setting>` | string | 服务特定的配置参数 |
|
||||
|
||||
### 安装依赖
|
||||
|
||||
```bash
|
||||
pip install opendal
|
||||
```
|
||||
|
||||
### Google Cloud Storage 配置示例
|
||||
|
||||
```bash
|
||||
file_storage=opendal
|
||||
opendal_scheme=gcs
|
||||
opendal_gcs_root=/filecodebox
|
||||
opendal_gcs_bucket=your-bucket-name
|
||||
opendal_gcs_credential=base64_encoded_credential
|
||||
```
|
||||
|
||||
### Azure Blob Storage 配置示例
|
||||
|
||||
```bash
|
||||
file_storage=opendal
|
||||
opendal_scheme=azblob
|
||||
opendal_azblob_root=/filecodebox
|
||||
opendal_azblob_container=your-container
|
||||
opendal_azblob_account_name=your_account
|
||||
opendal_azblob_account_key=your_key
|
||||
```
|
||||
|
||||
### 支持的服务
|
||||
|
||||
OpenDAL 支持众多存储服务,完整列表请参考 [OpenDAL 官方文档](https://opendal.apache.org/docs/rust/opendal/services/index.html)。
|
||||
|
||||
常用服务包括:
|
||||
- `gcs` - Google Cloud Storage
|
||||
- `azblob` - Azure Blob Storage
|
||||
- `obs` - 华为云 OBS
|
||||
- `oss` - 阿里云 OSS(通过 OpenDAL)
|
||||
- `cos` - 腾讯云 COS(通过 OpenDAL)
|
||||
- `hdfs` - Hadoop HDFS
|
||||
- `ftp` - FTP 服务器
|
||||
- `sftp` - SFTP 服务器
|
||||
|
||||
::: warning OpenDAL 注意事项
|
||||
1. 通过 OpenDAL 集成的服务均通过服务器中转下载,会同时消耗存储服务和服务器的流量
|
||||
2. 相比原生 S3/OneDrive 支持,OpenDAL 方式可能缺少一些调试信息
|
||||
3. OpenDAL 采用 Rust 编写,性能较好
|
||||
:::
|
||||
|
||||
## 存储选择建议
|
||||
|
||||
| 场景 | 推荐存储 | 原因 |
|
||||
|------|----------|------|
|
||||
| 个人/小型部署 | 本地存储 | 简单易用,无需额外配置 |
|
||||
| 企业内网 | MinIO + S3 | 自建对象存储,数据可控 |
|
||||
| 公有云部署 | 对应云厂商 S3 | 同区域访问快,成本低 |
|
||||
| 已有 OneDrive | OneDrive | 利用现有资源 |
|
||||
| 已有 WebDAV | WebDAV | 兼容性好 |
|
||||
| 特殊存储需求 | OpenDAL | 支持更多存储服务 |
|
||||
|
||||
## 常见问题
|
||||
|
||||
### S3 上传失败
|
||||
|
||||
1. 检查 Access Key 和 Secret Key 是否正确
|
||||
2. 确认存储桶名称和区域配置正确
|
||||
3. 检查存储桶的访问权限设置
|
||||
4. 确认签名版本(`s3v2` 或 `s3v4`)与服务商要求一致
|
||||
|
||||
### OneDrive 认证失败
|
||||
|
||||
1. 确认使用的是工作/学校账户,而非个人账户
|
||||
2. 检查 Azure 应用是否已授予管理员同意
|
||||
3. 确认 API 权限配置完整
|
||||
4. 验证用户名和密码是否正确
|
||||
|
||||
### WebDAV 连接失败
|
||||
|
||||
1. 检查 WebDAV URL 格式是否正确
|
||||
2. 确认用户名和密码(或应用密码)正确
|
||||
3. 检查服务器是否支持 WebDAV 协议
|
||||
4. 确认网络连接正常
|
||||
@@ -0,0 +1,379 @@
|
||||
# 文件上传
|
||||
|
||||
FileCodeBox 提供了多种灵活的文件上传方式,支持普通上传和分片上传,满足不同场景的需求。
|
||||
|
||||
## 上传方式
|
||||
|
||||
FileCodeBox 支持以下几种上传方式:
|
||||
|
||||
### 拖拽上传
|
||||
|
||||
将文件直接拖拽到上传区域即可开始上传。这是最便捷的上传方式。
|
||||
|
||||
1. 打开 FileCodeBox 首页
|
||||
2. 将文件从文件管理器拖拽到上传区域
|
||||
3. 松开鼠标,文件开始上传
|
||||
4. 上传完成后获取提取码
|
||||
|
||||
::: tip 提示
|
||||
拖拽上传支持同时拖拽多个文件(取决于主题支持)。
|
||||
:::
|
||||
|
||||
### 点击上传
|
||||
|
||||
点击上传区域,通过系统文件选择器选择文件。
|
||||
|
||||
1. 点击上传区域的「选择文件」按钮
|
||||
2. 在弹出的文件选择器中选择要上传的文件
|
||||
3. 确认选择后文件开始上传
|
||||
4. 上传完成后获取提取码
|
||||
|
||||
### 粘贴上传
|
||||
|
||||
支持从剪贴板直接粘贴图片进行上传(部分主题支持)。
|
||||
|
||||
1. 复制图片到剪贴板(截图或复制图片)
|
||||
2. 在上传区域使用 `Ctrl+V`(Windows/Linux)或 `Cmd+V`(macOS)粘贴
|
||||
3. 图片自动开始上传
|
||||
4. 上传完成后获取提取码
|
||||
|
||||
::: warning 注意
|
||||
粘贴上传仅支持图片格式,不支持其他文件类型。具体支持情况取决于所使用的主题。
|
||||
:::
|
||||
|
||||
## 文件大小限制
|
||||
|
||||
### 默认限制
|
||||
|
||||
| 配置项 | 默认值 | 说明 |
|
||||
|--------|--------|------|
|
||||
| `uploadSize` | 10MB | 单文件最大上传大小 |
|
||||
|
||||
### 修改上传限制
|
||||
|
||||
管理员可以通过管理面板或配置文件修改上传大小限制:
|
||||
|
||||
```python
|
||||
# 设置最大上传大小为 100MB
|
||||
uploadSize = 104857600 # 100 * 1024 * 1024
|
||||
```
|
||||
|
||||
::: info 说明
|
||||
`uploadSize` 的单位是字节。常用换算:
|
||||
- 10MB = 10485760
|
||||
- 50MB = 52428800
|
||||
- 100MB = 104857600
|
||||
- 500MB = 524288000
|
||||
- 1GB = 1073741824
|
||||
:::
|
||||
|
||||
### 超出限制的处理
|
||||
|
||||
当上传文件超过大小限制时,系统会返回 403 错误:
|
||||
|
||||
```json
|
||||
{
|
||||
"detail": "大小超过限制,最大为10.00 MB"
|
||||
}
|
||||
```
|
||||
|
||||
## 普通上传 API
|
||||
|
||||
### 文件上传接口
|
||||
|
||||
**POST** `/share/file/`
|
||||
|
||||
Content-Type: `multipart/form-data`
|
||||
|
||||
**请求参数:**
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| `file` | file | 是 | 要上传的文件 |
|
||||
| `expire_value` | int | 否 | 过期数值,默认 1 |
|
||||
| `expire_style` | string | 否 | 过期方式,默认 `day` |
|
||||
|
||||
**过期方式选项:**
|
||||
|
||||
| 值 | 说明 |
|
||||
|----|------|
|
||||
| `day` | 按天过期 |
|
||||
| `hour` | 按小时过期 |
|
||||
| `minute` | 按分钟过期 |
|
||||
| `forever` | 永不过期 |
|
||||
| `count` | 按下载次数过期 |
|
||||
|
||||
**响应示例:**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "654321",
|
||||
"name": "example.pdf"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**cURL 示例:**
|
||||
|
||||
```bash
|
||||
curl -X POST "http://localhost:12345/share/file/" \
|
||||
-F "file=@/path/to/file.pdf" \
|
||||
-F "expire_value=7" \
|
||||
-F "expire_style=day"
|
||||
```
|
||||
|
||||
## 分片上传 API
|
||||
|
||||
对于大文件,FileCodeBox 支持分片上传功能。分片上传将大文件分割成多个小块分别上传,支持断点续传。
|
||||
|
||||
::: warning 前提条件
|
||||
分片上传功能需要管理员启用:`enableChunk=1`
|
||||
:::
|
||||
|
||||
### 分片上传流程
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
||||
│ 初始化上传 │ ──▶ │ 上传分片 │ ──▶ │ 完成上传 │
|
||||
│ /init/ │ │ /chunk/ │ │ /complete/ │
|
||||
└─────────────┘ └─────────────┘ └─────────────┘
|
||||
│
|
||||
▼
|
||||
┌───────────┐
|
||||
│ 循环上传 │
|
||||
│ 每个分片 │
|
||||
└───────────┘
|
||||
```
|
||||
|
||||
### 1. 初始化上传
|
||||
|
||||
**POST** `/chunk/upload/init/`
|
||||
|
||||
**请求参数:**
|
||||
|
||||
```json
|
||||
{
|
||||
"file_name": "large_file.zip",
|
||||
"file_size": 104857600,
|
||||
"chunk_size": 5242880,
|
||||
"file_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
}
|
||||
```
|
||||
|
||||
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
||||
|------|------|------|--------|------|
|
||||
| `file_name` | string | 是 | - | 文件名 |
|
||||
| `file_size` | int | 是 | - | 文件总大小(字节) |
|
||||
| `chunk_size` | int | 否 | 5MB | 分片大小(字节) |
|
||||
| `file_hash` | string | 是 | - | 文件的 SHA256 哈希值 |
|
||||
|
||||
**响应示例:**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"existed": false,
|
||||
"upload_id": "abc123def456789",
|
||||
"chunk_size": 5242880,
|
||||
"total_chunks": 20,
|
||||
"uploaded_chunks": []
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 说明 |
|
||||
|------|------|
|
||||
| `existed` | 文件是否已存在(秒传) |
|
||||
| `upload_id` | 上传会话 ID |
|
||||
| `chunk_size` | 分片大小 |
|
||||
| `total_chunks` | 总分片数 |
|
||||
| `uploaded_chunks` | 已上传的分片索引列表 |
|
||||
|
||||
### 2. 上传分片
|
||||
|
||||
**POST** `/chunk/upload/chunk/{upload_id}/{chunk_index}`
|
||||
|
||||
**路径参数:**
|
||||
|
||||
| 参数 | 说明 |
|
||||
|------|------|
|
||||
| `upload_id` | 初始化时返回的上传会话 ID |
|
||||
| `chunk_index` | 分片索引,从 0 开始 |
|
||||
|
||||
**请求体:**
|
||||
|
||||
Content-Type: `multipart/form-data`
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `chunk` | file | 分片数据 |
|
||||
|
||||
**响应示例:**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"chunk_hash": "a1b2c3d4e5f6..."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**cURL 示例:**
|
||||
|
||||
```bash
|
||||
# 上传第一个分片(索引为 0)
|
||||
curl -X POST "http://localhost:12345/chunk/upload/chunk/abc123def456789/0" \
|
||||
-F "chunk=@/path/to/chunk_0"
|
||||
```
|
||||
|
||||
### 3. 完成上传
|
||||
|
||||
**POST** `/chunk/upload/complete/{upload_id}`
|
||||
|
||||
**路径参数:**
|
||||
|
||||
| 参数 | 说明 |
|
||||
|------|------|
|
||||
| `upload_id` | 上传会话 ID |
|
||||
|
||||
**请求参数:**
|
||||
|
||||
```json
|
||||
{
|
||||
"expire_value": 7,
|
||||
"expire_style": "day"
|
||||
}
|
||||
```
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| `expire_value` | int | 是 | 过期数值 |
|
||||
| `expire_style` | string | 是 | 过期方式 |
|
||||
|
||||
**响应示例:**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"detail": {
|
||||
"code": "789012",
|
||||
"name": "large_file.zip"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 断点续传
|
||||
|
||||
分片上传支持断点续传。当上传中断后:
|
||||
|
||||
1. 使用相同的 `file_hash` 重新调用初始化接口
|
||||
2. 服务器返回 `uploaded_chunks` 列表,包含已上传的分片索引
|
||||
3. 客户端只需上传不在列表中的分片
|
||||
4. 所有分片上传完成后调用完成接口
|
||||
|
||||
**示例流程:**
|
||||
|
||||
```javascript
|
||||
// 1. 初始化上传
|
||||
const initResponse = await fetch('/chunk/upload/init/', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
file_name: 'large_file.zip',
|
||||
file_size: fileSize,
|
||||
chunk_size: 5 * 1024 * 1024,
|
||||
file_hash: fileHash
|
||||
})
|
||||
});
|
||||
const { upload_id, uploaded_chunks, total_chunks } = await initResponse.json();
|
||||
|
||||
// 2. 上传未完成的分片
|
||||
for (let i = 0; i < total_chunks; i++) {
|
||||
if (!uploaded_chunks.includes(i)) {
|
||||
const chunk = file.slice(i * chunkSize, (i + 1) * chunkSize);
|
||||
await fetch(`/chunk/upload/chunk/${upload_id}/${i}`, {
|
||||
method: 'POST',
|
||||
body: chunk
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 完成上传
|
||||
await fetch(`/chunk/upload/complete/${upload_id}`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
expire_value: 7,
|
||||
expire_style: 'day'
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
## 错误处理
|
||||
|
||||
### 常见错误
|
||||
|
||||
| HTTP 状态码 | 错误信息 | 原因 | 解决方案 |
|
||||
|-------------|----------|------|----------|
|
||||
| 403 | 大小超过限制 | 文件超过 `uploadSize` 限制 | 减小文件大小或联系管理员调整限制 |
|
||||
| 403 | 上传频率限制 | 超过 IP 上传频率限制 | 等待限制时间窗口后重试 |
|
||||
| 400 | 过期时间类型错误 | `expire_style` 值不在允许列表中 | 使用有效的过期方式 |
|
||||
| 404 | 上传会话不存在 | `upload_id` 无效或已过期 | 重新初始化上传 |
|
||||
| 400 | 无效的分片索引 | `chunk_index` 超出范围 | 检查分片索引是否正确 |
|
||||
| 400 | 分片不完整 | 完成上传时分片数量不足 | 确保所有分片都已上传 |
|
||||
|
||||
### 频率限制
|
||||
|
||||
系统对上传操作有频率限制,防止滥用:
|
||||
|
||||
| 配置项 | 默认值 | 说明 |
|
||||
|--------|--------|------|
|
||||
| `uploadMinute` | 1 | 限制时间窗口(分钟) |
|
||||
| `uploadCount` | 10 | 时间窗口内最大上传次数 |
|
||||
|
||||
当超过频率限制时,需要等待时间窗口过后才能继续上传。
|
||||
|
||||
### 错误响应格式
|
||||
|
||||
```json
|
||||
{
|
||||
"detail": "错误信息描述"
|
||||
}
|
||||
```
|
||||
|
||||
## 上传配置
|
||||
|
||||
### 相关配置项
|
||||
|
||||
| 配置项 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `openUpload` | int | 1 | 是否开放上传(1=开放,0=关闭) |
|
||||
| `uploadSize` | int | 10485760 | 最大上传大小(字节) |
|
||||
| `enableChunk` | int | 0 | 是否启用分片上传(1=启用,0=禁用) |
|
||||
| `uploadMinute` | int | 1 | 上传频率限制时间窗口(分钟) |
|
||||
| `uploadCount` | int | 10 | 时间窗口内最大上传次数 |
|
||||
| `expireStyle` | list | ["day","hour","minute","forever","count"] | 允许的过期方式 |
|
||||
|
||||
### 配置示例
|
||||
|
||||
```python
|
||||
# 允许上传 100MB 文件,启用分片上传
|
||||
uploadSize = 104857600
|
||||
enableChunk = 1
|
||||
|
||||
# 放宽上传频率限制:每 5 分钟最多 50 次
|
||||
uploadMinute = 5
|
||||
uploadCount = 50
|
||||
|
||||
# 只允许按天和按次数过期
|
||||
expireStyle = ["day", "count"]
|
||||
```
|
||||
|
||||
## 下一步
|
||||
|
||||
- [文件分享](/guide/share) - 了解完整的分享流程
|
||||
- [配置说明](/guide/configuration) - 了解所有配置选项
|
||||
- [存储配置](/guide/storage) - 了解文件存储方式
|
||||
- [安全设置](/guide/security) - 了解安全相关配置
|
||||
@@ -0,0 +1,127 @@
|
||||
# 优秀案例
|
||||
|
||||
这里收录了一些使用 FileCodeBox 搭建的优秀站点。如果你也部署了 FileCodeBox,欢迎提交 PR 将你的站点添加到这里!
|
||||
|
||||
## 官方演示站
|
||||
|
||||
<div class="showcase-grid">
|
||||
|
||||
<div class="showcase-item">
|
||||
|
||||
### 🌟 FileCodeBox Demo
|
||||
|
||||
- **网址**:[share.lanol.cn](https://share.lanol.cn)
|
||||
- **简介**:官方演示站点,体验最新功能
|
||||
- **特点**:稳定运行,功能完整
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
## 社区站点
|
||||
|
||||
::: tip 提交你的站点
|
||||
如果你使用 FileCodeBox 搭建了自己的文件分享服务,欢迎通过以下方式提交:
|
||||
|
||||
1. 在 [GitHub](https://github.com/vastsa/FileCodeBox) 提交 PR,编辑此页面
|
||||
2. 在 [Issues](https://github.com/vastsa/FileCodeBox/issues) 中提交你的站点信息
|
||||
3. 加入 QQ 群 739673698 联系管理员
|
||||
:::
|
||||
|
||||
<!--
|
||||
提交格式示例:
|
||||
|
||||
<div class="showcase-item">
|
||||
|
||||
### 站点名称
|
||||
|
||||
- **网址**:[example.com](https://example.com)
|
||||
- **简介**:简短描述你的站点
|
||||
- **特点**:列出站点特色
|
||||
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="showcase-grid">
|
||||
|
||||
<div class="showcase-item">
|
||||
|
||||
### 取文件
|
||||
|
||||
- **网址**:[www.quwenjian.cn/fby.html](https://www.quwenjian.cn/fby.html)
|
||||
- **简介**:取文件 - 存储无界,便携无限
|
||||
- **特点**:永久免费的文件中转站
|
||||
- **运营者**:取文件&取文件网盘
|
||||
|
||||
</div>
|
||||
|
||||
<div class="showcase-item">
|
||||
|
||||
### 潘多拉盒子
|
||||
|
||||
- **网址**:[pan.duo.la](https://pan.duo.la)
|
||||
- **简介**:潘多拉盒子
|
||||
- **特点**:经典1.6版本
|
||||
- **运营者**:五行缺心眼
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
## 提交要求
|
||||
|
||||
为了保证收录站点的质量,请确保你的站点满足以下条件:
|
||||
|
||||
1. **稳定运行**:站点需要稳定运行,能够正常访问
|
||||
2. **合法合规**:站点内容需要合法合规,不得包含违法违规内容
|
||||
3. **保留版权**:建议保留 FileCodeBox 的版权信息
|
||||
4. **HTTPS 支持**:建议启用 HTTPS 加密访问
|
||||
|
||||
## 案例展示模板
|
||||
|
||||
如果你想提交站点,请按照以下格式:
|
||||
|
||||
```markdown
|
||||
### 站点名称
|
||||
|
||||
- **网址**:[域名](https://域名)
|
||||
- **简介**:一句话描述站点用途
|
||||
- **特点**:站点的特色功能或亮点
|
||||
- **运营者**:可选,你的名字或组织
|
||||
```
|
||||
|
||||
<style>
|
||||
.showcase-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 20px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.showcase-item {
|
||||
border: 1px solid var(--vp-c-divider);
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.showcase-item:hover {
|
||||
border-color: var(--vp-c-brand);
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.showcase-item h3 {
|
||||
margin-top: 0;
|
||||
color: var(--vp-c-brand);
|
||||
}
|
||||
|
||||
.showcase-item ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.showcase-item li {
|
||||
margin: 8px 0;
|
||||
}
|
||||
</style>
|
||||
@@ -4,26 +4,24 @@
|
||||
# @Software: PyCharm
|
||||
import asyncio
|
||||
import time
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import HTMLResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from tortoise import Tortoise
|
||||
from tortoise.contrib.fastapi import register_tortoise
|
||||
|
||||
from apps.admin.views import admin_api
|
||||
from apps.base.models import KeyValue
|
||||
from apps.base.utils import ip_limit
|
||||
from apps.base.views import share_api, chunk_api
|
||||
from apps.admin.views import admin_api
|
||||
from apps.base.views import share_api, chunk_api, presign_api
|
||||
from core.database import init_db
|
||||
from core.logger import logger
|
||||
from core.response import APIResponse
|
||||
from core.settings import data_root, settings, BASE_DIR, DEFAULT_CONFIG
|
||||
from core.tasks import delete_expire_files
|
||||
from core.logger import logger
|
||||
|
||||
from contextlib import asynccontextmanager
|
||||
from tortoise import Tortoise
|
||||
from core.tasks import delete_expire_files, clean_incomplete_uploads
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
@@ -42,6 +40,7 @@ async def lifespan(app: FastAPI):
|
||||
|
||||
# 启动后台任务
|
||||
task = asyncio.create_task(delete_expire_files())
|
||||
chunk_cleanup_task = asyncio.create_task(clean_incomplete_uploads())
|
||||
logger.info("应用初始化完成")
|
||||
|
||||
try:
|
||||
@@ -50,7 +49,8 @@ async def lifespan(app: FastAPI):
|
||||
# 清理操作
|
||||
logger.info("正在关闭应用...")
|
||||
task.cancel()
|
||||
await asyncio.gather(task, return_exceptions=True)
|
||||
chunk_cleanup_task.cancel()
|
||||
await asyncio.gather(task, chunk_cleanup_task, return_exceptions=True)
|
||||
await Tortoise.close_connections()
|
||||
logger.info("应用已关闭")
|
||||
|
||||
@@ -98,6 +98,7 @@ register_tortoise(
|
||||
|
||||
app.include_router(share_api)
|
||||
app.include_router(chunk_api)
|
||||
app.include_router(presign_api)
|
||||
app.include_router(admin_api)
|
||||
|
||||
|
||||
@@ -134,7 +135,7 @@ async def get_config():
|
||||
"explain": settings.page_explain,
|
||||
"uploadSize": settings.uploadSize,
|
||||
"expireStyle": settings.expireStyle,
|
||||
"enableChunk": settings.enableChunk if settings.file_storage == "local" and settings.enableChunk else 0,
|
||||
"enableChunk": settings.enableChunk,
|
||||
"openUpload": settings.openUpload,
|
||||
"notify_title": settings.notify_title,
|
||||
"notify_content": settings.notify_content,
|
||||
@@ -148,5 +149,5 @@ if __name__ == "__main__":
|
||||
import uvicorn
|
||||
|
||||
uvicorn.run(
|
||||
app="main:app", host="0.0.0.0", port=settings.port, reload=False, workers=1
|
||||
app="main:app", host=settings.serverHost, port=settings.serverPort, reload=False, workers=settings.serverWorkers
|
||||
)
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
## 🚀 更新计划
|
||||
|
||||
- [ ] 切片上传,同文件秒传,断点续传
|
||||
- [ ] 2025年皮肤
|
||||
- [ ] 文件收集功能
|
||||
|
||||
## 📝 项目简介
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import{c as i,d as k,r as y,o as u,I as v,a as p,b as t,n as o,h as e,i as w,g as n,X as _,F as M,q as C,x as z,z as B,J as L,s as D,K as F,t as j,e as l}from"./index-CL9mnhPI.js";import{B as S}from"./box-rSyVX8Lw.js";/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const V=i("cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const q=i("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const E=i("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const I=i("menu",[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]]),N={class:"flex items-center"},R={class:"rounded-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 p-1 animate-spin-slow"},Z={class:"flex-1 overflow-y-auto"},A={class:"p-4 space-y-2"},H=["onClick"],J={class:"flex-1 flex flex-col min-h-screen"},K={class:"flex items-center justify-between h-16 px-4"},$=k({__name:"AdminLayout",setup(O){const c=B(),a=w("isDarkMode"),m=[{id:"Dashboard",name:"仪表盘",icon:E,redirect:"/admin/dashboard"},{id:"FileManage",name:"文件管理",icon:q,redirect:"/admin/files"},{id:"Settings",name:"系统设置",icon:V,redirect:"/admin/settings"}],s=y(!0),h=()=>{s.value=!s.value},d=()=>{window.innerWidth>=1024?s.value=!0:s.value=!1};u(()=>{d(),window.addEventListener("resize",d)}),v(()=>{window.removeEventListener("resize",d)});const x=y({page:1,size:10,total:0}),b=async()=>{try{x.value.total=85}catch(g){console.error("加载文件列表失败:",g)}};return u(()=>{b()}),(g,T)=>{const f=z("router-view");return l(),p("div",{class:o(["min-h-screen flex flex-col lg:flex-row transition-colors duration-300",[e(a)?"bg-gray-900":"bg-gray-50"]])},[t("aside",{class:o(["fixed inset-y-0 left-0 z-50 w-64 transform transition-all duration-300 ease-in-out lg:relative lg:translate-x-0 border-r",[e(a)?"bg-gray-800 bg-opacity-90 backdrop-filter backdrop-blur-xl border-gray-700":"bg-white border-gray-200",{"-translate-x-full":!s.value}]])},[t("div",{class:o(["flex items-center justify-between h-16 px-4 border-b",[e(a)?"border-gray-700":"border-gray-200"]])},[t("div",N,[t("div",R,[t("div",{class:o(["rounded-full p-1",[e(a)?"bg-gray-800":"bg-white"]])},[n(e(S),{class:o(["w-6 h-6",[e(a)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2)]),t("h1",{class:o(["ml-2 text-xl font-semibold",[e(a)?"text-white":"text-gray-800"]])}," FileCodeBox ",2)]),t("button",{onClick:h,class:"lg:hidden"},[n(e(_),{class:o(["w-6 h-6",[e(a)?"text-gray-400":"text-gray-600"]])},null,8,["class"])])],2),t("nav",Z,[t("ul",A,[(l(),p(M,null,C(m,r=>t("li",{key:r.id},[t("a",{onClick:U=>e(c).push(r.redirect),class:o(["flex items-center p-2 rounded-lg transition-colors duration-200",[e(c).currentRoute.value.name===r.id?e(a)?"bg-indigo-900 text-indigo-400":"bg-indigo-100 text-indigo-600":e(a)?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-100"]])},[(l(),L(F(r.icon),{class:"w-5 h-5 mr-3"})),D(" "+j(r.name),1)],10,H)])),64))])])],2),t("div",J,[t("header",{class:o(["shadow-md border-b transition-colors duration-300",[e(a)?"bg-gray-800 border-gray-700":"bg-white border-gray-200"]])},[t("div",K,[t("button",{onClick:h,class:"lg:hidden"},[n(e(I),{class:o(["w-6 h-6",[e(a)?"text-gray-400":"text-gray-600"]])},null,8,["class"])])])],2),t("main",{class:o(["flex-1 p-6 overflow-y-auto transition-colors duration-300",[e(a)?"bg-gray-900":"bg-gray-50"]])},[n(f)],2)])],2)}}});export{$ as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
.switch{position:relative;display:inline-block;width:60px;height:34px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#e5e7eb;transition:.4s}.dark .slider{background-color:#4b5563}input:checked+.slider{background-color:#4f46e5}.dark input:checked+.slider{background-color:#4f46e5}.slider:before{position:absolute;content:"";height:26px;width:26px;left:4px;bottom:4px;background-color:#fff;transition:.4s}.dark .slider:before{background-color:#e5e7eb}.slider.round{border-radius:34px}.slider.round:before{border-radius:50%}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin-slow{animation:spin 8s linear infinite}.transition-colors{transition-property:background-color,border-color,color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.custom-scrollbar::-webkit-scrollbar{width:8px}.custom-scrollbar::-webkit-scrollbar-track{background:transparent}.custom-scrollbar::-webkit-scrollbar-thumb{background-color:#cbd5e0;border-radius:4px}:is():hover{background-color:#a0aec0}.custom-scrollbar :deep(.dark &::-webkit-scrollbar-thumb){background-color:#4a5568}.custom-scrollbar :deep(.dark &::-webkit-scrollbar-thumb):hover{background-color:#2d3748}.space-y-6{margin-bottom:5rem}
|
||||
.switch{position:relative;display:inline-block;width:60px;height:34px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#e5e7eb;transition:.4s}.dark .slider{background-color:#4b5563}input:checked+.slider{background-color:#4f46e5}.dark input:checked+.slider{background-color:#4f46e5}.slider:before{position:absolute;content:"";height:26px;width:26px;left:4px;bottom:4px;background-color:#fff;transition:.4s}.dark .slider:before{background-color:#e5e7eb}.slider.round{border-radius:34px}.slider.round:before{border-radius:50%}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin-slow{animation:spin 8s linear infinite}.transition-colors{transition-property:background-color,border-color,color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.custom-scrollbar::-webkit-scrollbar{width:6px}.custom-scrollbar::-webkit-scrollbar-track{background:transparent}.custom-scrollbar::-webkit-scrollbar-thumb{background-color:#cbd5e0;border-radius:3px}:global(.dark) .custom-scrollbar::-webkit-scrollbar-thumb{background-color:#4a5568}
|
||||
@@ -0,0 +1 @@
|
||||
import{c as l,d as _,u as M,r as m,f as p,R as C,a as b,o as h,b as t,n as o,e,i as z,l as i,I as D,t as f,X as L,y as B,D as j,G as E,k as F,E as I,m as N}from"./index-DaP6hnmm.js";import{B as R}from"./box-C2OkK29z.js";const S=l("cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);const V=l("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const Z=l("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);const q=l("menu",[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]]),A={class:"flex items-center"},$={class:"rounded-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 p-1 animate-spin-slow"},G={class:"flex-1 overflow-y-auto custom-scrollbar"},H={class:"p-4 space-y-2"},O=["onClick"],T={class:"flex-1 flex flex-col h-full"},U={class:"flex items-center justify-between h-16 px-4"},P=_({__name:"AdminLayout",setup(W){const d=D(),{t:n}=M(),a=z("isDarkMode"),x=[{id:"Dashboard",name:n("admin.dashboard.title"),icon:Z,redirect:"/admin/dashboard"},{id:"FileManage",name:n("admin.fileManage.title"),icon:V,redirect:"/admin/files"},{id:"Settings",name:n("admin.settings.title"),icon:S,redirect:"/admin/settings"}],r=m(!0),g=()=>{r.value=!r.value},c=()=>{window.innerWidth>=1024?r.value=!0:r.value=!1};p(()=>{c(),window.addEventListener("resize",c)}),C(()=>{window.removeEventListener("resize",c)});const k=m({page:1,size:10,total:0}),v=async()=>{try{k.value.total=85}catch(u){console.error("加载文件列表失败:",u)}};return p(()=>{v()}),(u,y)=>{const w=E("router-view");return h(),b("div",{class:o(["h-screen flex flex-col lg:flex-row transition-colors duration-300",[e(a)?"bg-gray-900":"bg-gray-50"]])},[t("aside",{class:o(["fixed inset-y-0 border-transparent left-0 z-50 w-64 transform transition-all duration-300 ease-in-out lg:relative lg:translate-x-0 border-r flex flex-col h-full lg:h-screen",[e(a)?"bg-gray-800 bg-opacity-90 backdrop-filter backdrop-blur-xl ":"bg-white ",{"-translate-x-full":!r.value}]])},[t("div",{class:o(["flex items-center justify-between h-16 px-4 border-b",[e(a)?"border-gray-700":"border-gray-200"]])},[t("div",A,[t("div",$,[t("div",{class:o(["rounded-full p-1",[e(a)?"bg-gray-800":"bg-white"]])},[i(e(R),{class:o(["w-6 h-6",[e(a)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2)]),t("h1",{onClick:y[0]||(y[0]=s=>e(d).push("/")),class:o(["ml-2 text-xl font-semibold cursor-pointer",[e(a)?"text-white":"text-gray-800"]])},f(e(n)("common.appName")),3)]),t("button",{onClick:g,class:"lg:hidden"},[i(e(L),{class:o(["w-6 h-6",[e(a)?"text-gray-400":"text-gray-600"]])},null,8,["class"])])],2),t("nav",G,[t("ul",H,[(h(),b(B,null,j(x,s=>t("li",{key:s.id},[t("a",{onClick:X=>e(d).push(s.redirect),class:o(["flex items-center p-2 rounded-lg transition-colors duration-200",[e(d).currentRoute.value.name===s.id?e(a)?"bg-indigo-900 text-indigo-400":"bg-indigo-100 text-indigo-600":e(a)?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-100"]])},[(h(),F(N(s.icon),{class:"w-5 h-5 mr-3"})),I(" "+f(s.name),1)],10,O)])),64))])])],2),t("div",T,[t("header",{class:o(["shadow-md border-b transition-colors duration-300 h-16",[e(a)?"bg-gray-800 border-gray-700":"bg-white border-gray-200"]])},[t("div",U,[t("button",{onClick:g,class:"lg:hidden"},[i(e(q),{class:o(["w-6 h-6",[e(a)?"text-gray-400":"text-gray-600"]])},null,8,["class"])])])],2),t("main",{class:o(["overflow-y-auto transition-colors duration-300 custom-scrollbar",[e(a)?"bg-gray-900":"bg-gray-50"]])},[i(w)],2)])],2)}}});export{P as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{c as _,d as S,g as x,a as M,o as v,n as d,e as t,i as k,b as s,t as r,k as w,m as D,K as F,u as U,S as B,f as z,l as g,v as m,E as C,V as $}from"./index-DaP6hnmm.js";import{F as T}from"./file-C928Lhos.js";import{H as V}from"./hard-drive-B6XHFjlY.js";const H=_("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const N=_("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),j={class:"flex items-center justify-between"},b=S({__name:"StatCard",props:{title:{},value:{},icon:{},iconColor:{},descriptionType:{default:"neutral"}},setup(f){const l=f,e=k("isDarkMode"),a=x(()=>({indigo:e?"bg-indigo-900":"bg-indigo-100",purple:e?"bg-purple-900":"bg-purple-100",green:e?"bg-green-900":"bg-green-100",blue:e?"bg-blue-900":"bg-blue-100"})[l.iconColor]),h=x(()=>({indigo:e?"text-indigo-400":"text-indigo-600",purple:e?"text-purple-400":"text-purple-600",green:e?"text-green-400":"text-green-600",blue:e?"text-blue-400":"text-blue-600"})[l.iconColor]),p=x(()=>({success:e?"text-green-400":"text-green-600",error:e?"text-red-400":"text-red-600",neutral:e?"text-gray-400":"text-gray-600"})[l.descriptionType]);return(i,o)=>(v(),M("div",{class:d(["p-6 rounded-lg shadow-md transition-colors duration-300",[t(e)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[s("div",j,[s("div",null,[s("p",{class:d(["text-sm",[t(e)?"text-gray-400":"text-gray-600"]])},r(i.title),3),s("h3",{class:d(["text-2xl font-bold mt-1",[t(e)?"text-white":"text-gray-800"]])},r(i.value),3)]),s("div",{class:d(["p-3 rounded-full",a.value])},[(v(),w(D(i.icon),{class:d(["w-6 h-6",h.value])},null,8,["class"]))],2)]),s("p",{class:d(["text-sm mt-2",p.value])},[F(i.$slots,"description")],2)],2))}}),I={class:"p-6 overflow-y-auto custom-scrollbar"},L={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8"},A={class:"ml-2"},E={class:"ml-2"},K={class:"text-sm mt-1"},J=S({__name:"DashboardView",setup(f){const l=k("isDarkMode"),{t:e}=U(),a=B({totalFiles:0,storageUsed:0,yesterdayCount:0,todayCount:0,yesterdaySize:0,todaySize:0,sysUptime:0}),h=o=>{const c=new Date().getTime()-o,u=Math.floor(c/(1440*60*1e3)),y=Math.floor(c%(1440*60*1e3)/(3600*1e3));return`${u}天${y}小时`},p=o=>{const n=parseInt(o)/1024,c=n/1024,u=c/1024,y=u/1024;return y>1?`${y.toFixed(2)}TB`:u>1?`${u.toFixed(2)}GB`:c>1?`${c.toFixed(2)}MB`:n>1?`${n.toFixed(2)}KB`:`${o}B`},i=async()=>{const o=await $.getDashboard();o.detail&&(a.totalFiles=o.detail.totalFiles,a.storageUsed=p(o.detail.storageUsed.toString()),a.yesterdaySize=p(o.detail.yesterdaySize.toString()),a.todaySize=p(o.detail.todaySize.toString()),a.yesterdayCount=o.detail.yesterdayCount,a.todayCount=o.detail.todayCount,a.sysUptime=h(Number(o.detail.sysUptime)))};return z(()=>{i()}),(o,n)=>(v(),M("div",I,[s("h2",{class:d(["text-2xl font-bold mb-6",[t(l)?"text-white":"text-gray-800"]])},r(t(e)("admin.dashboard.title")),3),s("div",L,[g(b,{title:t(e)("admin.dashboard.totalFiles"),value:a.totalFiles,icon:t(T),"icon-color":"indigo","description-type":"success"},{description:m(()=>[s("span",null,r(t(e)("admin.dashboard.yesterday"))+":"+r(a.yesterdayCount),1),s("span",A,r(t(e)("admin.dashboard.today"))+":"+r(a.todayCount),1)]),_:1},8,["title","value","icon"]),g(b,{title:t(e)("admin.dashboard.storageSpace"),value:a.storageUsed,icon:t(V),"icon-color":"purple","description-type":"success"},{description:m(()=>[s("span",null,r(t(e)("admin.dashboard.yesterday"))+":"+r(a.yesterdaySize),1),s("span",E,r(t(e)("admin.dashboard.today"))+":"+r(a.todaySize),1)]),_:1},8,["title","value","icon"]),g(b,{title:t(e)("admin.dashboard.activeUsers"),value:"25",icon:t(N),"icon-color":"green","description-type":"error"},{description:m(()=>[s("span",null,r(t(e)("admin.dashboard.weeklyChange")),1)]),_:1},8,["title","icon"]),g(b,{title:t(e)("admin.dashboard.systemStatus"),value:t(e)("admin.dashboard.normal"),icon:t(H),"icon-color":"blue","description-type":"neutral"},{description:m(()=>[C(r(t(e)("admin.dashboard.serverUptime"))+": "+r(a.sysUptime),1)]),_:1},8,["title","value","icon"])]),s("div",{class:d(["mt-auto text-center py-4",[t(l)?"text-gray-400":"text-gray-600"]])},[n[1]||(n[1]=s("p",{class:"text-sm"}," 版本 v2.2.1 更新时间:2025-09-04 ",-1)),s("p",K,[C(" © "+r(new Date().getFullYear())+" ",1),n[0]||(n[0]=s("a",{href:"https://github.com/vastsa/FileCodeBox"},"FileCodeBox",-1))])],2)]))}});export{J as default};
|
||||
@@ -1,11 +0,0 @@
|
||||
import{c as x,d as m,H as b,o as h,a as f,b as t,n as a,h as e,i as v,t as i,g,s as w,A as _,e as F}from"./index-CL9mnhPI.js";import{F as k}from"./file-CeiRRIJG.js";import{H as C}from"./hard-drive-D-zf5eAT.js";/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const z=x("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const D=x("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),M={class:"p-6 h-screen overflow-y-auto custom-scrollbar"},S={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8"},U={class:"flex items-center justify-between"},B={class:"flex items-center justify-between"},$={class:"flex items-center justify-between"},j={class:"flex items-center justify-between"},H={class:"text-sm mt-1"},T=m({__name:"DashboardView",setup(V){const s=v("isDarkMode"),o=b({totalFiles:0,storageUsed:0,yesterdayCount:0,todayCount:0,yesterdaySize:0,todaySize:0,sysUptime:0}),u=l=>{const n=new Date().getTime()-l,d=Math.floor(n/(1440*60*1e3)),c=Math.floor(n%(1440*60*1e3)/(3600*1e3));return`${d}天${c}小时`},y=l=>{const r=parseInt(l)/1024,n=r/1024,d=n/1024,c=d/1024;return c>1?`${c.toFixed(2)}TB`:d>1?`${d.toFixed(2)}GB`:n>1?`${n.toFixed(2)}MB`:r>1?`${r.toFixed(2)}KB`:`${l}B`},p=async()=>{const l=await _.get("admin/dashboard");o.totalFiles=l.detail.totalFiles,o.storageUsed=y(l.detail.storageUsed),o.yesterdaySize=y(l.detail.yesterdaySize),o.todaySize=y(l.detail.todaySize),o.yesterdayCount=l.detail.yesterdayCount,o.todayCount=l.detail.todayCount,o.sysUptime=u(l.detail.sysUptime)};return h(()=>{p()}),(l,r)=>(F(),f("div",M,[t("h2",{class:a(["text-2xl font-bold mb-6",[e(s)?"text-white":"text-gray-800"]])}," 仪表盘 ",2),t("div",S,[t("div",{class:a(["p-6 rounded-lg shadow-md transition-colors duration-300",[e(s)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[t("div",U,[t("div",null,[t("p",{class:a(["text-sm",[e(s)?"text-gray-400":"text-gray-600"]])}," 总文件数 ",2),t("h3",{class:a(["text-2xl font-bold mt-1",[e(s)?"text-white":"text-gray-800"]])},i(o.totalFiles),3)]),t("div",{class:a(["p-3 rounded-full",[e(s)?"bg-indigo-900":"bg-indigo-100"]])},[g(e(k),{class:a(["w-6 h-6",[e(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2)]),t("p",{class:a(["text-sm mt-2",[e(s)?"text-green-400":"text-green-600"]])},[t("span",{class:a([e(s)?"text-gray-400":"text-gray-600"])},"昨天:",2),t("span",null,i(o.yesterdayCount),1),t("span",{class:a(["ml-2",[e(s)?"text-gray-400":"text-gray-600"]])},"今天:",2),t("span",null,i(o.todayCount),1)],2)],2),t("div",{class:a(["p-6 rounded-lg shadow-md transition-colors duration-300",[e(s)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[t("div",B,[t("div",null,[t("p",{class:a(["text-sm",[e(s)?"text-gray-400":"text-gray-600"]])}," 存储空间 ",2),t("h3",{class:a(["text-2xl font-bold mt-1",[e(s)?"text-white":"text-gray-800"]])},i(o.storageUsed),3)]),t("div",{class:a(["p-3 rounded-full",[e(s)?"bg-purple-900":"bg-purple-100"]])},[g(e(C),{class:a(["w-6 h-6",[e(s)?"text-purple-400":"text-purple-600"]])},null,8,["class"])],2)]),t("p",{class:a(["text-sm mt-2",[e(s)?"text-green-400":"text-green-600"]])},[t("span",{class:a([e(s)?"text-gray-400":"text-gray-600"])},"昨天:",2),t("span",null,i(o.yesterdaySize),1),t("span",{class:a(["ml-2",[e(s)?"text-gray-400":"text-gray-600"]])},"今天:",2),t("span",null,i(o.todaySize),1)],2)],2),t("div",{class:a(["p-6 rounded-lg shadow-md transition-colors duration-300",[e(s)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[t("div",$,[t("div",null,[t("p",{class:a(["text-sm",[e(s)?"text-gray-400":"text-gray-600"]])}," 活跃用户 ",2),t("h3",{class:a(["text-2xl font-bold mt-1",[e(s)?"text-white":"text-gray-800"]])}," 25 ",2)]),t("div",{class:a(["p-3 rounded-full",[e(s)?"bg-green-900":"bg-green-100"]])},[g(e(D),{class:a(["w-6 h-6",[e(s)?"text-green-400":"text-green-600"]])},null,8,["class"])],2)]),t("p",{class:a(["text-sm mt-2",[e(s)?"text-red-400":"text-red-600"]])},[r[0]||(r[0]=t("span",null,"↓ 5% ",-1)),t("span",{class:a([e(s)?"text-gray-400":"text-gray-600"])},"较上周",2)],2)],2),t("div",{class:a(["p-6 rounded-lg shadow-md transition-colors duration-300",[e(s)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[t("div",j,[t("div",null,[t("p",{class:a(["text-sm",[e(s)?"text-gray-400":"text-gray-600"]])}," 系统状态 ",2),t("h3",{class:a(["text-2xl font-bold mt-1",[e(s)?"text-white":"text-gray-800"]])}," 正常 ",2)]),t("div",{class:a(["p-3 rounded-full",[e(s)?"bg-blue-900":"bg-blue-100"]])},[g(e(z),{class:a(["w-6 h-6",[e(s)?"text-blue-400":"text-blue-600"]])},null,8,["class"])],2)]),t("p",{class:a(["text-sm mt-2",[e(s)?"text-gray-400":"text-gray-600"]])}," 服务器运行时间: "+i(o.sysUptime),3)],2)]),t("div",{class:a(["mt-auto text-center py-4",[e(s)?"text-gray-400":"text-gray-600"]])},[r[2]||(r[2]=t("p",{class:"text-sm"}," 版本 v2.0.3 更新时间:2025-03-03 ",-1)),t("p",H,[w(" © "+i(new Date().getFullYear())+" ",1),r[1]||(r[1]=t("a",{href:"https://github.com/vastsa/FileCodeBox"},"FileCodeBox",-1))])],2)]))}});export{T as default};
|
||||
@@ -1,26 +0,0 @@
|
||||
import{c as w,d as R,r as M,u as Y,f as U,a as u,b as t,l as G,n as i,h as e,i as J,m as x,g as l,v as y,L as N,s as h,F as S,q as V,t as g,A as $,e as p}from"./index-CL9mnhPI.js";import{F as O}from"./file-CeiRRIJG.js";import{T as Q}from"./trash-Cr3Lyvdp.js";/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const f=w("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const W=w("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const X=w("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const L=w("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const T=w("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Z={class:"p-6 h-screen overflow-y-auto custom-scrollbar"},tt={class:"mb-8"},et={class:"flex flex-1 gap-4 w-full sm:w-auto"},ot={class:"relative flex-1"},st={class:"overflow-x-auto"},it={class:"px-6 py-4 whitespace-nowrap"},at={class:"flex items-center"},rt={class:"px-6 py-4"},nt={class:"flex items-center group relative"},lt=["title"],dt={class:"absolute left-0 -top-2 -translate-y-full opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none"},gt={class:"bg-gray-900 text-white text-sm rounded px-2 py-1 max-w-xs break-all"},ct={class:"px-6 py-4 whitespace-nowrap"},ut={class:"px-6 py-4"},pt={class:"group relative"},xt={class:"absolute left-0 -top-2 -translate-y-full opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-10"},yt={class:"bg-gray-900 text-white text-sm rounded px-2 py-1 max-w-xs break-all"},ht={class:"px-6 py-4 whitespace-nowrap"},ft={class:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium"},bt={class:"flex items-center space-x-2"},mt=["onClick"],vt=["onClick"],wt={class:"flex items-center space-x-2"},_t=["disabled"],kt={class:"flex items-center space-x-1"},Ct=["onClick"],Mt=["disabled"],St={key:0,class:"fixed inset-0 z-50","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true"},jt={class:"fixed inset-0 z-10 overflow-y-auto"},zt={class:"flex min-h-full items-center justify-center p-4 text-center sm:p-0"},Vt={class:"flex items-center justify-between"},$t={class:"flex items-center space-x-3"},Ft={class:"px-6 py-5"},Dt={class:"grid gap-6"},Ut={class:"space-y-2 group"},Lt={class:"relative rounded-lg shadow-sm"},Tt={class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-opacity duration-200 opacity-0 group-focus-within:opacity-100"},Bt={class:"space-y-2 group"},Et={class:"relative rounded-lg shadow-sm"},Pt={class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-opacity duration-200 opacity-0 group-focus-within:opacity-100"},At={class:"space-y-2 group"},qt={class:"relative rounded-lg shadow-sm"},Ht={class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-opacity duration-200 opacity-0 group-focus-within:opacity-100"},Kt={class:"space-y-2 group"},It={class:"relative rounded-lg shadow-sm"},Rt={class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-opacity duration-200 opacity-0 group-focus-within:opacity-100"},Yt={class:"space-y-2 group"},Gt={class:"relative rounded-lg shadow-sm"},Jt={class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-opacity duration-200 opacity-0 group-focus-within:opacity-100"},Xt=R({__name:"FileManageView",setup(Nt){function B(r){const s=new Date(r),a=s.getFullYear(),c=(s.getMonth()+1).toString().padStart(2,"0"),k=s.getDate().toString().padStart(2,"0"),C=s.getHours().toString().padStart(2,"0"),v=s.getMinutes().toString().padStart(2,"0"),I=s.getSeconds().toString().padStart(2,"0");return`${a}-${c}-${k} ${C}:${v}:${I}`}const o=J("isDarkMode"),F=M([]),E=Y(),P=["取件码","名称","大小","描述","过期时间","操作"],n=M({page:1,size:10,total:0,keyword:""}),j=M(!1),d=M({id:null,code:"",prefix:"",suffix:"",expired_at:"",expired_count:null}),A=r=>{d.value={id:r.id,code:r.code,prefix:r.prefix,suffix:r.suffix,expired_at:r.expired_at?r.expired_at.slice(0,16):"",expired_count:r.expired_count},j.value=!0},_=()=>{j.value=!1,d.value={id:null,code:"",prefix:"",suffix:"",expired_at:"",expired_count:null}},q=async()=>{try{await $({url:"admin/file/update",method:"patch",data:d.value}),await b(),_()}catch(r){E.showAlert(r.response.data.detail,"error")}},H=async r=>{try{await $({url:"admin/file/delete",method:"delete",data:{id:r}}),await b()}catch(s){console.error("删除失败:",s)}},b=async()=>{try{const r=await $({url:"/admin/file/list",method:"get",params:n.value});F.value=r.detail.data,n.value.total=r.detail.total}catch(r){console.error("加载文件列表失败:",r)}},z=async r=>{r<1||r>m.value||(n.value.page=r,await b())};b();const m=U(()=>Math.ceil(n.value.total/n.value.size)),K=U(()=>{const r=n.value.page,s=m.value,a=2,c=[];c.push(1);const k=Math.max(2,r-a),C=Math.min(s-1,r+a);k>2&&c.push("...");for(let v=k;v<=C;v++)c.push(v);return C<s-1&&c.push("..."),s>1&&c.push(s),c}),D=async()=>{n.value.page=1,await b()};return(r,s)=>(p(),u("div",Z,[t("div",tt,[t("h2",{class:i(["text-2xl font-bold mb-4",[e(o)?"text-white":"text-gray-800"]])}," 文件管理 ",2)]),t("div",{class:i(["mb-6 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between bg-opacity-70 p-4 rounded-lg shadow-sm",[e(o)?"bg-gray-800":"bg-white"]])},[t("div",et,[t("div",ot,[x(t("input",{type:"text","onUpdate:modelValue":s[0]||(s[0]=a=>n.value.keyword=a),onKeyup:N(D,["enter"]),class:i([e(o)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400"Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{c as P,d as E,a as x,o as y,n as o,e as t,i as U,b as e,K as H,t as s,y as F,D as A,g as j,l as c,E as b,u as te,r as _,p as oe,j as V,x as k,z as M,W as ae,v as q,Y as L}from"./index-DaP6hnmm.js";import{C as ie}from"./copy-bjFRgEY8.js";import{F as se}from"./file-C928Lhos.js";import{E as re,T as ne}from"./trash-JuhqIjo3.js";const C=P("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const le=P("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const de=P("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const ge=P("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const I=P("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const K=P("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),ce={class:"overflow-x-auto"},ue=E({__name:"DataTable",props:{title:{},headers:{}},setup(T){const h=U("isDarkMode");return(i,a)=>(y(),x("div",{class:o(["rounded-lg shadow-sm overflow-hidden transition-all duration-300",[t(h)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[e("div",{class:o(["px-6 py-4 border-b",[t(h)?"border-gray-700":"border-gray-200"]])},[e("h3",{class:o(["text-lg font-medium",[t(h)?"text-white":"text-gray-800"]])},s(i.title),3)],2),e("div",ce,[e("table",{class:o(["min-w-full divide-y",[t(h)?"divide-gray-700":"divide-gray-200"]])},[e("thead",{class:o([t(h)?"bg-gray-900/50":"bg-gray-50"])},[e("tr",null,[(y(!0),x(F,null,A(i.headers,v=>(y(),x("th",{key:v,class:o(["px-6 py-3.5 text-left text-xs font-medium uppercase tracking-wider",[t(h)?"text-gray-400":"text-gray-500"]])},s(v),3))),128))])],2),e("tbody",{class:o([t(h)?"bg-gray-800/50 divide-y divide-gray-700":"bg-white divide-y divide-gray-200"])},[H(i.$slots,"body")],2)],2)]),H(i.$slots,"footer")],2))}}),pe={class:"flex items-center space-x-2"},xe=["disabled"],ye={class:"flex items-center space-x-1"},he=["onClick"],fe=["disabled"],me=E({__name:"DataPagination",props:{currentPage:{},pageSize:{},total:{}},emits:["page-change"],setup(T){const h=T,i=U("isDarkMode"),a=j(()=>Math.ceil(h.total/h.pageSize)),v=j(()=>{const d=h.currentPage,p=a.value,g=2,f=[];f.push(1);const u=Math.max(2,d-g),w=Math.min(p-1,d+g);u>2&&f.push("...");for(let m=u;m<=w;m++)f.push(m);return w<p-1&&f.push("..."),p>1&&f.push(p),f});return(d,p)=>(y(),x("div",{class:o(["mt-4 flex items-center justify-between px-6 py-4 border-t",[t(i)?"border-gray-700":"border-gray-200"]])},[e("div",{class:o(["flex items-center text-sm",[t(i)?"text-gray-400":"text-gray-500"]])}," 显示第 "+s((d.currentPage-1)*d.pageSize+1)+" 到 "+s(Math.min(d.currentPage*d.pageSize,d.total))+" 条,共 "+s(d.total)+" 条 ",3),e("div",pe,[e("button",{onClick:p[0]||(p[0]=g=>d.$emit("page-change",d.currentPage-1)),disabled:d.currentPage===1,class:o(["inline-flex items-center px-3 py-1.5 rounded-md transition-colors duration-200",[t(i)?d.currentPage===1?"bg-gray-800 text-gray-600 cursor-not-allowed":"bg-gray-800 text-gray-300 hover:bg-gray-700":d.currentPage===1?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-100 text-gray-700 hover:bg-gray-200"]])},[c(t(de),{class:"w-4 h-4"}),p[2]||(p[2]=b(" 上一页 ",-1))],10,xe),e("div",ye,[(y(!0),x(F,null,A(v.value,g=>(y(),x(F,{key:g},[g!=="..."?(y(),x("button",{key:0,onClick:f=>d.$emit("page-change",g),class:o(["inline-flex items-center px-3 py-1.5 rounded-md transition-colors duration-200",[d.currentPage===g?"bg-indigo-600 text-white":t(i)?"bg-gray-800 text-gray-300 hover:bg-gray-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"]])},s(g),11,he)):(y(),x("span",{key:1,class:o(["px-2",[t(i)?"text-gray-400":"text-gray-500"]])}," ... ",2))],64))),128))]),e("button",{onClick:p[1]||(p[1]=g=>d.$emit("page-change",d.currentPage+1)),disabled:d.currentPage>=a.value,class:o(["inline-flex items-center px-3 py-1.5 rounded-md transition-colors duration-200",[t(i)?d.currentPage>=a.value?"bg-gray-800 text-gray-600 cursor-not-allowed":"bg-gray-800 text-gray-300 hover:bg-gray-700":d.currentPage>=a.value?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-100 text-gray-700 hover:bg-gray-200"]])},[p[3]||(p[3]=b(" 下一页 ",-1)),c(t(le),{class:"w-4 h-4"})],10,fe)])],2))}}),be={class:"p-6 overflow-y-auto custom-scrollbar"},ve={class:"mb-8"},we={class:"flex flex-1 gap-4 w-full sm:w-auto"},_e={class:"relative flex-1"},ke=["placeholder"],Me={class:"px-6 py-4 whitespace-nowrap"},Ce={class:"flex items-center"},Pe={class:"px-6 py-4"},$e={class:"flex items-center group relative"},Se=["title"],ze={class:"absolute left-0 -top-2 -translate-y-full opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none"},Fe={class:"bg-gray-900 text-white Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{Q as y,r as c,a0 as u,g as b,d as w,p as x,a as h,o as S,b as e,n as d,e as i,i as A,l as k,h as I,x as D,z as N,E as T,t as _,a1 as E,I as M,_ as O}from"./index-DaP6hnmm.js";import{B as V}from"./box-C2OkK29z.js";const j=y("admin",()=>{const p=c(localStorage.getItem(u.ADMIN_PASSWORD)||""),s=c(localStorage.getItem(u.TOKEN)||""),a=c(!1),l=c(null),n=b(()=>a.value&&!!s.value),f=o=>{p.value=o,localStorage.setItem(u.ADMIN_PASSWORD,o)},g=o=>{s.value=o,localStorage.setItem(u.TOKEN,o)},m=o=>{l.value=o,a.value=!0,g(o.token)};return{adminPassword:p,token:s,isLoggedIn:a,userInfo:l,isAuthenticated:n,updateAdminPassword:f,setToken:g,setUserInfo:m,login:o=>{m(o)},logout:()=>{p.value="",s.value="",a.value=!1,l.value=null,localStorage.removeItem(u.ADMIN_PASSWORD),localStorage.removeItem(u.TOKEN)},initAuth:()=>{const o=localStorage.getItem(u.TOKEN);o&&(s.value=o,a.value=!0)}}}),B=j,K={class:"mx-auto h-16 w-16 relative"},P={class:"rounded-md shadow-sm -space-y-px"},R=["disabled"],z=w({__name:"LoginView",setup(p){const s=x(),a=c(""),l=c(!1),n=A("isDarkMode"),f=B(),g=()=>{let r=!0;return a.value?a.value.length<6&&(s.showAlert("密码长度至少为6位","error"),r=!1):(s.showAlert("无效的密码","error"),r=!1),r},m=M(),v=async()=>{if(g()){l.value=!0;try{const r=await E.login(a.value);r.detail?.token?(f.setToken(r.detail.token),m.push("/admin")):s.showAlert("登录失败:未获取到有效令牌","error")}catch(r){const t=r&&typeof r=="object"&&"response"in r&&r.response?.data?.detail||"登录失败";s.showAlert(t,"error")}finally{l.value=!1}}};return(r,t)=>(S(),h("div",{class:d(["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",i(n)?"bg-gray-900":"bg-gray-50"])},[t[6]||(t[6]=e("div",{class:"absolute inset-0 z-0"},[e("div",{class:"cyber-grid"}),e("div",{class:"floating-particles"})],-1)),e("div",{class:d(["max-w-md w-full space-y-8 backdrop-blur-lg bg-opacity-20 p-8 rounded-xl border border-opacity-20",[i(n)?"bg-gray-800 border-gray-600":"bg-white/70 border-gray-200"]])},[e("div",null,[e("div",K,[t[1]||(t[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)),t[2]||(t[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:d(["absolute inset-1 rounded-full flex items-center justify-center",i(n)?"bg-gray-800":"bg-white"])},[k(i(V),{class:d(["h-8 w-8",i(n)?"text-cyan-400":"text-cyan-600"])},null,8,["class"])],2)]),e("h2",{class:d(["mt-6 text-center text-3xl font-extrabold",i(n)?"text-white":"text-gray-900"])}," 登录 ",2)]),e("form",{class:"mt-8 space-y-6",onSubmit:I(v,["prevent"])},[t[5]||(t[5]=e("input",{type:"hidden",name:"remember",value:"true"},null,-1)),e("div",P,[e("div",null,[t[3]||(t[3]=e("label",{for:"password",class:"sr-only"},"密码",-1)),D(e("input",{id:"password",name:"password",type:"password",autocomplete:"current-password",required:"","onUpdate:modelValue":t[0]||(t[0]=o=>a.value=o),class:d(["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",i(n)?"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),[[N,a.value]])])]),e("div",null,[e("button",{type:"submit",class:d(["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",i(n)?"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",l.value?"opacity-75 cursor-not-allowed":""]),disabled:l.value},[t[4]||(t[4]=e("span",{class:"absolute left-0 inset-y-0 flex items-center pl-3"},null,-1)),T(" "+_(l.value?"登录中...":"登录"),1)],10,R)])],32)],2)],2))}}),C=O(z,[["__scopeId","data-v-894571a2"]]);export{C as default};
|
||||
@@ -1 +0,0 @@
|
||||
@keyframes spin-66eb7914{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin-slow[data-v-66eb7914]{animation:spin-66eb7914 8s linear infinite}.fade-enter-active[data-v-66eb7914],.fade-leave-active[data-v-66eb7914]{transition:opacity .3s ease}.fade-enter-from[data-v-66eb7914],.fade-leave-to[data-v-66eb7914]{opacity:0}input[data-v-66eb7914]:focus{box-shadow:0 0 15px #6366f14d}button[data-v-66eb7914]:active:not(:disabled){transform:scale(.98)}.cyber-grid[data-v-66eb7914]{background-image:linear-gradient(transparent 95%,#6366f11a 50%),linear-gradient(90deg,transparent 95%,rgba(99,102,241,.1) 50%);background-size:30px 30px;width:100%;height:100%;position:absolute;opacity:.5}.floating-particles[data-v-66eb7914]{position:absolute;width:100%;height:100%;background:radial-gradient(circle at center,transparent 0%,transparent 100%);filter:url(#gooey)}.floating-particles[data-v-66eb7914]:before,.floating-particles[data-v-66eb7914]:after{content:"";position:absolute;width:100%;height:100%;background-image:radial-gradient(circle at center,rgba(99,102,241,.1) 0%,transparent 50%);animation:float-66eb7914 20s infinite linear}.floating-particles[data-v-66eb7914]:after{animation-delay:-10s;opacity:.5}@keyframes float-66eb7914{0%{transform:translate(0) scale(1)}50%{transform:translate(50px,50px) scale(1.5)}to{transform:translate(0) scale(1)}}button[data-v-66eb7914]:hover:not(:disabled){box-shadow:0 0 25px #6366f180}.fade-enter-active[data-v-66eb7914],.fade-leave-active[data-v-66eb7914]{transition:all .5s cubic-bezier(.4,0,.2,1)}
|
||||
@@ -0,0 +1 @@
|
||||
@keyframes spin-894571a2{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin-slow[data-v-894571a2]{animation:spin-894571a2 8s linear infinite}.fade-enter-active[data-v-894571a2],.fade-leave-active[data-v-894571a2]{transition:opacity .3s ease}.fade-enter-from[data-v-894571a2],.fade-leave-to[data-v-894571a2]{opacity:0}input[data-v-894571a2]:focus{box-shadow:0 0 15px #6366f14d}button[data-v-894571a2]:active:not(:disabled){transform:scale(.98)}.cyber-grid[data-v-894571a2]{background-image:linear-gradient(transparent 95%,#6366f11a 50%),linear-gradient(90deg,transparent 95%,rgba(99,102,241,.1) 50%);background-size:30px 30px;width:100%;height:100%;position:absolute;opacity:.5}.floating-particles[data-v-894571a2]{position:absolute;width:100%;height:100%;background:radial-gradient(circle at center,transparent 0%,transparent 100%);filter:url(#gooey)}.floating-particles[data-v-894571a2]:before,.floating-particles[data-v-894571a2]:after{content:"";position:absolute;width:100%;height:100%;background-image:radial-gradient(circle at center,rgba(99,102,241,.1) 0%,transparent 50%);animation:float-894571a2 20s infinite linear}.floating-particles[data-v-894571a2]:after{animation-delay:-10s;opacity:.5}@keyframes float-894571a2{0%{transform:translate(0) scale(1)}50%{transform:translate(50px,50px) scale(1.5)}to{transform:translate(0) scale(1)}}button[data-v-894571a2]:hover:not(:disabled){box-shadow:0 0 25px #6366f180}.fade-enter-active[data-v-894571a2],.fade-leave-active[data-v-894571a2]{transition:all .5s cubic-bezier(.4,0,.2,1)}
|
||||
@@ -1 +0,0 @@
|
||||
import{G as y,r as u,d as b,u as v,a as w,b as e,n as l,h as o,i as x,g as h,j as k,m as S,v as A,s as V,t as D,A as j,z as B,e as P,_}from"./index-CL9mnhPI.js";import{B as z}from"./box-rSyVX8Lw.js";const M=y("adminData",()=>{const d=u(localStorage.getItem("adminPassword")||"");function n(a){d.value=a,localStorage.setItem("token",a)}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=b({__name:"LoginView",setup(d){const n=v(),a=u(""),i=u(!1),s=x("isDarkMode"),c=M(),p=()=>{let r=!0;return a.value?a.value.length<6&&(n.showAlert("密码长度至少为6位","error"),r=!1):(n.showAlert("无效的密码","error"),r=!1),r},m=B(),f=async()=>{if(p()){j.post("/admin/login",{password:a.value}).then(r=>{c.updateAdminPwd(r.detail.token),m.push("/admin")}).catch(r=>{n.showAlert(r.response.data.detail,"error")}),i.value=!0;try{await new Promise(r=>setTimeout(r,2e3))}catch{}finally{i.value=!1}}};return(r,t)=>(P(),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"])},[t[6]||(t[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,[t[1]||(t[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)),t[2]||(t[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"])},[t[5]||(t[5]=e("input",{type:"hidden",name:"remember",value:"true"},null,-1)),e("div",L,[e("div",null,[t[3]||(t[3]=e("label",{for:"password",class:"sr-only"},"密码",-1)),S(e("input",{id:"password",name:"password",type:"password",autocomplete:"current-password",required:"","onUpdate:modelValue":t[0]||(t[0]=g=>a.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,a.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},[t[4]||(t[4]=e("span",{class:"absolute left-0 inset-y-0 flex items-center pl-3"},null,-1)),V(" "+D(i.value?"登录中...":"登录"),1)],10,N)])],32)],2)],2))}}),E=_(T,[["__scopeId","data-v-66eb7914"]]);export{E as default};
|
||||
@@ -0,0 +1 @@
|
||||
@keyframes spin-slow-2a18d8c8{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin-slow[data-v-2a18d8c8]{animation:spin-slow-2a18d8c8 3s linear infinite}
|
||||
@@ -0,0 +1 @@
|
||||
import{c as J,d as G,N,r as R,O as Z,f as ne,y as oe,Q as ie,g as B,U as x,p as se,a as le,o as ue,b as H,l as ce,e as X,n as de,i as fe,t as he,_ as ve}from"./index-DaP6hnmm.js";import{B as ge}from"./box-C2OkK29z.js";const xe=J("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const He=J("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var D=function(){return D=Object.assign||function(c){for(var u,l=1,f=arguments.length;l<f;l++){u=arguments[l];for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(c[v]=u[v])}return c},D.apply(this,arguments)};var F;(function(o){var c=(function(){function a(e,t,r,n){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],e<a.MIN_VERSION||e>a.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=e*4+17;for(var s=[],i=0;i<this.size;i++)s.push(!1);for(var i=0;i<this.size;i++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();var h=this.addEccAndInterleave(r);if(this.drawCodewords(h),n==-1)for(var p=1e9,i=0;i<8;i++){this.applyMask(i),this.drawFormatBits(i);var M=this.getPenaltyScore();M<p&&(n=i,p=M),this.applyMask(i)}f(0<=n&&n<=7),this.mask=n,this.applyMask(n),this.drawFormatBits(n),this.isFunction=[]}return a.encodeText=function(e,t){var r=o.QrSegment.makeSegments(e);return a.encodeSegments(r,t)},a.encodeBinary=function(e,t){var r=o.QrSegment.makeBytes(e);return a.encodeSegments([r],t)},a.encodeSegments=function(e,t,r,n,s,i){if(r===void 0&&(r=1),n===void 0&&(n=40),s===void 0&&(s=-1),i===void 0&&(i=!0),!(a.MIN_VERSION<=r&&r<=n&&n<=a.MAX_VERSION)||s<-1||s>7)throw new RangeError("Invalid value");var h,p;for(h=r;;h++){var M=a.getNumDataCodewords(h,t)*8,w=v.getTotalBits(e,h);if(w<=M){p=w;break}if(h>=n)throw new RangeError("Data too long")}for(var C=0,S=[a.Ecc.MEDIUM,a.Ecc.QUARTILE,a.Ecc.HIGH];C<S.length;C++){var m=S[C];i&&p<=a.getNumDataCodewords(h,m)*8&&(t=m)}for(var g=[],E=0,P=e;E<P.length;E++){var y=P[E];u(y.mode.modeBits,4,g),u(y.numChars,y.mode.numCharCountBits(h),g);for(var b=0,A=y.getData();b<A.length;b++){var O=A[b];g.push(O)}}f(g.length==p);var L=a.getNumDataCodewords(h,t)*8;f(g.length<=L),u(0,Math.min(4,L-g.length),g),u(0,(8-g.length%8)%8,g),f(g.length%8==0);for(var I=236;g.length<L;I^=253)u(I,8,g);for(var T=[];T.length*8<g.length;)T.push(0);return g.forEach(function(k,Q){return T[Q>>>3]|=k<<7-(Q&7)}),new a(h,t,T,s)},a.prototype.getModule=function(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]},a.prototype.getModules=function(){return this.modules},a.prototype.drawFunctionPatterns=function(){for(var e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);for(var t=this.getAlignmentPatternPositions(),r=t.length,e=0;e<r;e++)for(var n=0;n<r;n++)e==0&&n==0||e==0&&n==r-1||e==r-1&&n==0||this.drawAlignmentPattern(t[e],t[n]);this.drawFormatBits(0),this.drawVersion()},a.prototype.drawFormatBits=function(e){for(var t=this.errorCorrectionLevel.formatBits<<3|e,r=t,n=0;n<10;n++)r=r<<1^(r>>>9)*1335;var s=(t<<10|r)^21522;f(s>>>15==0);for(var n=0;n<=5;n++)this.setFunctionModule(8,n,l(s,n));this.setFunctionModule(8,7,l(s,6)),this.setFunctionModule(8,8,l(s,7)),this.setFunctionModule(7,8,l(s,8));for(var n=9;n<15;n++)this.setFunctionModule(14-n,8,l(s,n));for(var n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,l(s,n));for(var n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,l(s,n));this.setFunctionModule(8,this.size-8,!0)},a.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^(e>>>11)*7973;var r=this.version<<12|e;f(r>>>18==0);for(var t=0;t<18;t++){var n=l(r,t),s=this.size-11+t%3,i=Math.floor(t/3);this.setFunctionModule(s,i,n),this.setFunctionModule(i,s,n)}}},a.prototype.drawFinderPattern=function(e,t){for(var r=-4;r<=4;r++)for(var n=-4;n<=4;n++){var s=Math.max(Math.abs(n),Math.abs(r)),i=e+n,h=t+r;0<=i&&i<this.size&&0<=h&&h<this.size&&this.setFunctionModule(i,h,s!=2&&s!=4)}},a.prototype.drawAlignmentPattern=function(e,t){for(var r=-2;r<=2;r++)for(var n=-2;n<=2;n++)this.setFunctionModule(e+n,t+r,Math.max(Math.abs(n),Math.abs(r))!=1)},a.prototype.setFunctionModule=function(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0},a.prototype.addEccAndInterleave=function(e){var t=this.version,r=this.errorCorrectionLevel;if(e.length!=a.getNumDataCodewords(t,r))tLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
.w-97-100[data-v-8f0be1b0]{width:calc(100% - 1rem)}.drawer-enter-active[data-v-9c6698ec],.drawer-leave-active[data-v-9c6698ec]{transition:transform .3s ease}.drawer-enter-from[data-v-9c6698ec],.drawer-leave-to[data-v-9c6698ec]{transform:translate(100%)}@media(min-width:640px){.sm\:w-120[data-v-9c6698ec]{width:30rem}}.fade-enter-active[data-v-5c3436d6],.fade-leave-active[data-v-5c3436d6]{transition:opacity .3s ease}.fade-enter-from[data-v-5c3436d6],.fade-leave-to[data-v-5c3436d6]{opacity:0}.list-enter-active[data-v-31facf40],.list-leave-active[data-v-31facf40]{transition:all .3s ease}.list-enter-from[data-v-31facf40],.list-leave-to[data-v-31facf40]{opacity:0;transform:translate(30px)}.list-move[data-v-31facf40]{transition:transform .3s ease}.fade-enter-active[data-v-eb3f9cc8],.fade-leave-active[data-v-eb3f9cc8]{transition:opacity .3s ease}.fade-enter-from[data-v-eb3f9cc8],.fade-leave-to[data-v-eb3f9cc8]{opacity:0}.custom-scrollbar[data-v-eb3f9cc8]{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.3) rgba(243,244,246,.5)}.custom-scrollbar[data-v-eb3f9cc8]::-webkit-scrollbar{width:6px;height:6px}.custom-scrollbar[data-v-eb3f9cc8]::-webkit-scrollbar-track{background:#f3f4f680;border-radius:3px}.custom-scrollbar[data-v-eb3f9cc8]::-webkit-scrollbar-thumb{background-color:#9ca3af80;border-radius:3px;-webkit-transition:background-color .3s;transition:background-color .3s}.custom-scrollbar[data-v-eb3f9cc8]::-webkit-scrollbar-thumb:hover{background-color:#9ca3afb3}[data-v-eb3f9cc8] [class*=dark] .custom-scrollbar{scrollbar-color:rgba(75,85,99,.5) rgba(31,41,55,.5)}[data-v-eb3f9cc8] [class*=dark] .custom-scrollbar::-webkit-scrollbar-track{background:#1f293780}[data-v-eb3f9cc8] [class*=dark] .custom-scrollbar::-webkit-scrollbar-thumb{background-color:#4b556380}[data-v-eb3f9cc8] [class*=dark] .custom-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#4b5563b3}.custom-scrollbar[data-v-eb3f9cc8]{background:inherit}.break-words[data-v-eb3f9cc8]{word-wrap:break-word;overflow-wrap:break-word;word-break:break-word}.overflow-wrap-anywhere[data-v-eb3f9cc8]{overflow-wrap:anywhere}[data-v-eb3f9cc8] .prose{text-align:left;word-wrap:break-word;overflow-wrap:break-word;word-break:break-word}[data-v-eb3f9cc8] .prose h1,[data-v-eb3f9cc8] .prose h2,[data-v-eb3f9cc8] .prose h3,[data-v-eb3f9cc8] .prose h4,[data-v-eb3f9cc8] .prose h5,[data-v-eb3f9cc8] .prose h6{color:#4f46e5;word-wrap:break-word;overflow-wrap:break-word}[data-v-eb3f9cc8] .prose p,[data-v-eb3f9cc8] .prose div,[data-v-eb3f9cc8] .prose span,[data-v-eb3f9cc8] .prose code,[data-v-eb3f9cc8] .prose pre{word-wrap:break-word;overflow-wrap:break-word;word-break:break-word}[data-v-eb3f9cc8] .prose pre{white-space:pre-wrap;overflow-x:auto}[data-v-eb3f9cc8] .prose code{white-space:pre-wrap}@media(prefers-color-scheme:dark){[data-v-eb3f9cc8] .prose h1,[data-v-eb3f9cc8] .prose h2,[data-v-eb3f9cc8] .prose h3,[data-v-eb3f9cc8] .prose h4,[data-v-eb3f9cc8] .prose h5,[data-v-eb3f9cc8] .prose h6{color:#818cf8}}@keyframes blob-a89ba9bf{0%,to{transform:translate(0) scale(1)}25%{transform:translate(20px,-50px) scale(1.1)}50%{transform:translate(-20px,20px) scale(.9)}75%{transform:translate(50px,50px) scale(1.05)}}.animate-spin-slow[data-v-a89ba9bf]{animation:spin-a89ba9bf 8s linear infinite}@keyframes spin-a89ba9bf{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.w-97-100[data-v-a89ba9bf]{width:97%}[data-v-a89ba9bf] .prose{text-align:left;word-wrap:break-word;overflow-wrap:break-word;word-break:break-word}[data-v-a89ba9bf] .prose h1,[data-v-a89ba9bf] .prose h2,[data-v-a89ba9bf] .prose h3,[data-v-a89ba9bf] .prose h4,[data-v-a89ba9bf] .prose h5,[data-v-a89ba9bf] .prose h6{color:#4f46e5;word-wrap:break-word;overflow-wrap:break-word}[data-v-a89ba9bf] .prose p,[data-v-a89ba9bf] .prose div,[data-v-a89ba9bf] .prose span,[data-v-a89ba9bf] .prose code,[data-v-a89ba9bf] .prose pre{word-wrap:break-word;overflow-wrap:break-word;word-break:break-word}[data-v-a89ba9bf] .prose pre{white-space:pre-wrap;overflow-x:auto}[data-v-a89ba9bf] .prose code{white-space:pre-wrap}@media(prefers-color-scheme:dark){[data-v-a89ba9bf] .prose h1,[data-v-a89ba9bf] .prose h2,[data-v-a89ba9bf] .prose h3,[data-v-a89ba9bf] .prose h4,[data-v-a89ba9bf] .prose h5,[data-v-a89ba9bf] .prose h6{color:#818cf8}}@media(min-width:640px){.sm\:w-120[data-v-a89ba9bf]{width:30rem}}.custom-scrollbar[data-v-a89ba9bf]{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.3) rgba(243,244,246,.5)}.custom-scrollbar[data-v-a89ba9bf]::-webkit-scrollbar{width:6px;height:6px}.custom-scrollbar[data-v-a89ba9bf]::-webkit-scrollbar-track{background:#f3f4f680;border-radius:3px}.custom-scrollbar[data-v-a89ba9bf]::-webkit-scrollbar-thumb{background-color:#9ca3af80;border-radius:3px;-webkit-transition:background-color .3s;transition:background-color .3s}.custom-scrollbar[data-v-a89ba9bf]::-webkit-scrollbar-thumb:hover{background-color:#9ca3afb3}[data-v-a89ba9bf] [class*=dark] .custom-scrollbar{scrollbar-color:rgba(75,85,99,.5) rgba(31,41,55,.5)}[Line truncated
|
||||
@@ -0,0 +1,61 @@
|
||||
import{c as Pt,d as be,u as We,r as K,w as Dt,a as W,o as P,h as zt,b,n as T,e as d,i as xe,t as R,x as cr,j as ge,z as ur,l as L,_ as Re,G as pr,v as Le,E as me,k as Ut,T as Ft,K as hr,X as Nn,H as dr,y as fr,D as gr,p as mr,L as kr,f as br,M as xr,I as wr,J as yr}from"./index-DaP6hnmm.js";import{S as _r,C as Tr,Q as vr,u as Ar,P as Er,d as Sr}from"./PageHeader-Dda1k_N5.js";import{F as Pn}from"./file-C928Lhos.js";import{H as Rr}from"./hard-drive-B6XHFjlY.js";import{E as Lr,T as Cr}from"./trash-JuhqIjo3.js";import{C as Dr}from"./copy-bjFRgEY8.js";import"./box-C2OkK29z.js";const Ir=Pt("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const $r=Pt("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const zn=Pt("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),Mr={class:"mb-6 relative"},Or={class:"relative"},Nr=["placeholder","readonly"],Pr={key:0,class:"absolute inset-y-0 right-0 flex items-center pr-3"},zr=["disabled"],Ur={class:"flex items-center justify-center relative z-10"},Fr=be({__name:"RetrieveForm",props:{inputStatus:{},error:{type:Boolean}},emits:["submit","update:code"],setup(r,{expose:e,emit:t}){const{t:s}=We(),n=t,l=xe("isDarkMode"),i=K(""),a=K(!1),u=K();return Dt(i,c=>{n("update:code",c)}),e({focus:()=>u.value?.focus()}),(c,h)=>(P(),W("form",{onSubmit:h[3]||(h[3]=zt(m=>c.$emit("submit"),["prevent"]))},[b("div",Mr,[b("label",{for:"code",class:T(["block text-sm font-medium mb-2",[d(l)?"text-gray-300":"text-gray-800"]])},R(d(s)("retrieve.codeInput.label")),3),b("div",Or,[cr(b("input",{id:"code","onUpdate:modelValue":h[0]||(h[0]=m=>i.value=m),type:"text",ref_key:"codeInput",ref:u,class:T(["w-full px-4 py-3 rounded-lg placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 pr-10",[d(l)?"bg-gray-700 bg-opacity-50":"bg-gray-100",{"ring-2 ring-red-500":c.error},d(l)?"text-gray-300":"text-gray-800"]]),placeholder:d(s)("retrieve.codeInput.placeholder"),required:"",readonly:c.inputStatus.readonly,maxlength:"5",onFocus:h[1]||(h[1]=m=>a.value=!0),onBlur:h[2]||(h[2]=m=>a.value=!1)},null,42,Nr),[[ur,i.value]]),c.inputStatus.loading?(P(),W("div",Pr,[...h[4]||(h[4]=[b("span",{class:"animate-spin rounded-full h-5 w-5 border-b-2 border-indigo-500"},null,-1)])])):ge("",!0)]),b("div",{class:T(["absolute -bottom-0.5 left-2 h-0.5 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 transition-all duration-300 ease-in-out",{"w-97-100":a.value,"w-0":!a.value}])},null,2)]),b("button",{type:"submit",class:"w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold py-3 px-4 rounded-lg hover:from-indigo-600 hover:via-purple-600 hover:to-pink-600 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-300 transform hover:scale-105 hover:shadow-lg relative overflow-hidden group",disabled:c.inputStatus.loading},[b("span",Ur,[b("span",null,R(c.inputStatus.loading?d(s)("common.loading"):d(s)("retrieve.submit")),1),L(d(Ir),{class:"w-5 h-5 ml-2 transition-transform duration-300 transform group-hover:translate-x-1"})]),h[5]||(h[5]=b("span",{class:"absolute top-0 left-0 w-full h-full bg-gradient-to-r from-pink-500 via-purple-500 to-indigo-500 opacity-0 group-hover:opacity-100 transition-opacity duration-300"},null,-1))],8,zr)],32))}}),Br=Re(Fr,[["__scopeId","data-v-8f0be1b0"]]),Hr={key:0,class:"mb-6 text-center"},Gr=be({__name:"PageFooter",props:{linkText:{},linkTo:{},drawerText:{}},emits:["toggle-drawer"],setup(r){const{t:e}=We(),t=xe("isDarkMode");return(s,n)=>{const l=pr("router-link");return P(),W("div",null,[s.linkText&&s.linkTo?(P(),W("div",Hr,[L(l,{to:s.linkTo,class:"text-indigo-400 hover:text-indigo-300 transition duration-300"},{default:Le(()=>[me(R(s.linkText),1)]),_:1},8,["to"])])):ge("",!0),b("div",{class:T(["px-8 py-4 bg-opacity-50 flex justify-between items-center",[d(t)?"bg-gray-800":"bg-gray-100"]])},[b("span",{class:T(["text-sm flex items-center",[d(t)?"text-gray-300":"text-gray-800"]])},[L(d(_r),{class:"w-4 h-4 mr-1 text-green-400"}),me(" "+R(d(e)("send.secureEncryption")),1)],2),b("button",{onClick:n[0]||(n[0]=i=>s.$emit("toggle-drawer")),class:T(["text-sm hover:text-indigo-300 transition duration-300 flex items-center",[d(t)?"text-indigo-400":"text-indigo-600"]])},[me(R(s.drawerText)+" ",1),L(d(Tr),{class:"w-4 h-4 ml-1"})],2)],2)])}}}),Wr=be({__name:"SideDrawer",props:{visible:{type:Boolean},title:{}},emits:["close"],setup(r){const e=xe("isDarkMode");return(t,s)=>(P(),Ut(Ft,{name:"drawer"},{default:Le(()=>[t.visible?(P(),W("div",{key:0,class:T(["fixed inset-y-0 right-0 w-full sm:w-120 bg-opacity-70 backdrop-filter backdrop-blur-xl shadow-2xl z-50 overflow-hidden flex flex-col",[d(e)?"bg-gray-900":"bg-whiteLine truncated
|
||||
]`).replace("lheading",Bn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Us=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gn=/^( {2,}|\\)\n(?!\s*$)/,Fs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ut=/[\p{P}\p{S}]/u,Zt=/[\s\p{P}\p{S}]/u,Wn=/[^\s\p{P}\p{S}]/u,Bs=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zt).getRegex(),qn=/(?!~)[\p{P}\p{S}]/u,Hs=/(?!~)[\s\p{P}\p{S}]/u,Gs=/(?:[^\s\p{P}\p{S}]|~)/u,Ws=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,jn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,qs=A(jn,"u").replace(/punct/g,ut).getRegex(),js=A(jn,"u").replace(/punct/g,qn).getRegex(),Zn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Zs=A(Zn,"gu").replace(/notPunctSpace/g,Wn).replace(/punctSpace/g,Zt).replace(/punct/g,ut).getRegex(),Xs=A(Zn,"gu").replace(/notPunctSpace/g,Gs).replace(/punctSpace/g,Hs).replace(/punct/g,qn).getRegex(),Ys=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Wn).replace(/punctSpace/g,Zt).replace(/punct/g,ut).getRegex(),Vs=A(/\\(punct)/,"gu").replace(/punct/g,ut).getRegex(),Qs=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ks=A(qt).replace("(?:-->|$)","-->").getRegex(),Js=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ks).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ot=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,ei=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ot).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xn=A(/^!?\[(label)\]\[(ref)\]/).replace("label",ot).replace("ref",Wt).getRegex(),Yn=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wt).getRegex(),ti=A("reflink|nolink(?!\\()","g").replace("reflink",Xn).replace("nolink",Yn).getRegex(),Xt={_backpedal:Ge,anyPunctuation:Vs,autolink:Qs,blockSkip:Ws,br:Gn,code:Us,del:Ge,emStrongLDelim:qs,emStrongRDelimAst:Zs,emStrongRDelimUnd:Ys,escape:zs,link:ei,nolink:Yn,punctuation:Bs,reflink:Xn,reflinkSearch:ti,tag:Js,text:Fs,url:Ge},ni={...Xt,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",ot).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ot).getRegex()},It={...Xt,emStrongRDelimAst:Xs,emStrongLDelim:js,url:A(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ri={...It,br:A(Gn).replace("{2,}","*").getRegex(),text:A(It.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},et={normal:jt,gfm:Ns,pedantic:Ps},Ne={normal:Xt,gfm:It,breaks:ri,pedantic:ni},si={"&":"&","<":"<",">":">",'"':""","'":"'"},Tn=r=>si[r];function re(r,e){if(e){if(q.escapeTest.test(r))return r.replace(q.escapeReplace,Tn)}else if(q.escapeTestNoEncode.test(r))return r.replace(q.escapeReplaceNoEncode,Tn);return r}function vn(r){try{r=encodeURI(r).replace(q.percentDecode,"%")}catch{return null}return r}function An(r,e){let t=r.replace(q.findPipe,(l,i,a)=>{let u=!1,c=i;for(;--c>=0&&a[c]==="\\";)u=!u;return u?"|":" |"}),s=t.split(q.splitPipe),n=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(q.slashPipe,"|");return s}function Pe(r,e,t){let s=r.length;if(s===0)return"";let n=0;for(;n<s&&r.charAt(s-n-1)===e;)n++;return r.slice(0,s-n)}function ii(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return Line truncated
|
||||
`).map(l=>{let i=l.match(t.other.beginningSpace);if(i===null)return l;let[a]=i;return a.length>=n.length?l.slice(n.length):l}).join(`
|
||||
`)}var lt=class{options;rules;lexer;constructor(r){this.options=r||we}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Pe(t,`
|
||||
`)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=oi(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=Pe(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:Pe(e[0],`
|
||||
`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=Pe(e[0],`
|
||||
`).split(`
|
||||
`),s="",n="",l=[];for(;t.length>0;){let i=!1,a=[],u;for(u=0;u<t.length;u++)if(this.rules.other.blockquoteStart.test(t[u]))a.push(t[u]),i=!0;else if(!i)a.push(t[u]);else break;t=t.slice(u);let c=a.join(`
|
||||
`),h=c.replace(this.rules.other.blockquoteSetextReplace,`
|
||||
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
||||
${c}`:c,n=n?`${n}
|
||||
${h}`:h;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,l,!0),this.lexer.state.top=m,t.length===0)break;let f=l.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let y=f,v=y.raw+`
|
||||
`+t.join(`
|
||||
`),$=this.blockquote(v);l[l.length-1]=$,s=s.substring(0,s.length-y.raw.length)+$.raw,n=n.substring(0,n.length-y.text.length)+$.text;break}else if(f?.type==="list"){let y=f,v=y.raw+`
|
||||
`+t.join(`
|
||||
`),$=this.list(v);l[l.length-1]=$,s=s.substring(0,s.length-f.raw.length)+$.raw,n=n.substring(0,n.length-y.raw.length)+$.raw,t=v.substring(l.at(-1).raw.length).split(`
|
||||
`);continue}}return{type:"blockquote",raw:s,tokens:l,text:n}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=e[1].trim(),s=t.length>1,n={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let l=this.rules.other.listItemRegex(t),i=!1;for(;r;){let u=!1,c="",h="";if(!(e=l.exec(r))||this.rules.block.hr.test(r))break;c=e[0],r=r.substring(c.length);let m=e[2].split(`
|
||||
`,1)[0].replace(this.rules.other.listReplaceTabs,J=>" ".repeat(3*J.length)),f=r.split(`
|
||||
`,1)[0],y=!m.trim(),v=0;if(this.options.pedantic?(v=2,h=m.trimStart()):y?v=e[1].length+1:(v=e[2].search(this.rules.other.nonSpaceChar),v=v>4?1:v,h=m.slice(v),v+=e[1].length),y&&this.rules.other.blankLine.test(f)&&(c+=f+`
|
||||
`,r=r.substring(f.length+1),u=!0),!u){let J=this.rules.other.nextBulletRegex(v),ee=this.rules.other.hrRegex(v),U=this.rules.other.fencesBeginRegex(v),D=this.rules.other.headingBeginRegex(v),se=this.rules.other.htmlBeginRegex(v);for(;r;){let ie=r.split(`
|
||||
`,1)[0],te;if(f=ie,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),te=f):te=f.replace(this.rules.other.tabCharGlobal," "),U.test(f)||D.test(f)||se.test(f)||J.test(f)||ee.test(f))break;if(te.search(this.rules.other.nonSpaceChar)>=v||!f.trim())h+=`
|
||||
`+te.slice(v);else{if(y||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||U.test(m)||D.test(m)||ee.test(m))break;h+=`
|
||||
`+f}!y&&!f.trim()&&(y=!0),c+=ie+`
|
||||
`,r=r.substring(ie.length+1),m=te.slice(v)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let $=null,V;this.options.gfm&&($=this.rules.other.listIsTask.exec(h),$&&(V=$[0]!=="[ ] ",h=h.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:c,task:!!$,checked:V,loose:!1,text:h,tokens:[]}),n.raw+=c}let a=n.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let u=0;u<n.items.length;u++)if(this.lexer.state.top=!1,n.items[u].tokens=this.lexer.blockTokens(n.items[u].text,[]),!n.loose){let c=n.items[u].tokens.filter(m=>m.type==="space"),h=c.length>0&&c.some(m=>this.rules.other.anyLine.test(m.raw));n.loose=h}if(n.loose)for(let u=0;u<n.items.length;u++)n.items[u].loose=!0;return n}}html(r){let e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(r){let e=this.rules.block.def.exec(r);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:n}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=An(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
||||
`):[],l={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let i of s)this.rules.other.tableAlignRight.test(i)?l.align.push("right"):this.rules.other.tableAlignCenter.test(i)?l.align.push("center"):this.rules.other.tableAlignLeft.test(i)?l.align.push("left"):l.align.push(null);for(let i=0;i<t.length;i++)l.header.push({text:t[i],tokens:this.lexer.inline(t[i]),header:!0,align:l.align[i]});for(let i of n)l.rows.push(An(i,l.header.length).map((a,u)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:l.align[u]})));return l}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let t=e[1].charAt(e[1].length-1)===`
|
||||
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let l=Pe(t.slice(0,-1),"\\");if((t.length-l.length)%2===0)return}else{let l=ii(e[2],"()");if(l===-2)return;if(l>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let s=e[2],n="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(s);l&&(s=l[1],n=l[3])}else n=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),En(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[s.toLowerCase()];if(!n){let l=t[0].charAt(0);return{type:"text",raw:l,text:l}}return En(t,n,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,l,i,a=n,u=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*r.length+n);(s=c.exec(e))!=null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(i=[...l].length,s[3]||s[4]){a+=i;continue}else if((s[5]||s[6])&&n%3&&!((n+i)%3)){u+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+u);let h=[...s[0]][0].length,m=r.slice(0,n+s.index+h+i);if(Math.min(n,i)%2){let y=m.slice(1,-1);return{type:"em",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}let f=m.slice(2,-2);return{type:"strong",raw:m,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r){let e=this.rules.inline.del.exec(r);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},pe=class $t{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||we,this.options.tokenizer=this.options.tokenizer||new lt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:q,block:et.normal,inline:Ne.normal};this.options.pedantic?(t.block=et.pedantic,t.inline=Ne.pedantic):this.options.gfm&&(t.block=et.gfm,this.options.breaks?t.inline=Ne.breaks:t.inline=Ne.gfm),this.tokenizer.rules=t}static get rules(){return{block:et,inline:Ne}}static lex(e,t){return new $t(t).lex(e)}static lexInline(e,t){return new $t(t).inlineTokens(e)}lex(e){e=e.replace(q.carriageReturn,`
|
||||
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){for(this.options.pedantic&&(e=e.replace(q.tabCharGlobal," ").replace(q.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(i=>(n=i.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let i=t.at(-1);n.raw.length===1&&i!==void 0?i.raw+=`
|
||||
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
||||
`)?"":`
|
||||
`)+n.raw,i.text+=`
|
||||
`+n.text,this.inlineQueue.at(-1).src=i.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
||||
`)?"":`
|
||||
`)+n.raw,i.text+=`
|
||||
`+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let l=e;if(this.options.extensions?.startBlock){let i=1/0,a=e.slice(1),u;this.options.extensions.startBlock.forEach(c=>{u=c.call({lexer:this},a),typeof u=="number"&&u>=0&&(i=Math.min(i,u))}),i<1/0&&i>=0&&(l=e.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(l))){let i=t.at(-1);s&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
|
||||
`)?"":`
|
||||
`)+n.raw,i.text+=`
|
||||
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(n),s=l.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
||||
`)?"":`
|
||||
`)+n.raw,i.text+=`
|
||||
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(n);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s=e,n=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,n.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(n=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let l=!1,i="";for(;e;){l||(i=""),l=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=t.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,i)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let u=e;if(this.options.extensions?.startInline){let c=1/0,h=e.slice(1),m;this.options.extensions.startInline.forEach(f=>{m=f.call({lexer:this},h),typeof m=="number"&&m>=0&&(c=Math.min(c,m))}),c<1/0&&c>=0&&(u=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(u)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(i=a.raw.slice(-1)),l=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},at=class{options;parser;constructor(r){this.options=r||we}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(q.notSpaceStart)?.[0],n=r.replace(q.endingNewline,"")+`
|
||||
`;return s?'<pre><code class="language-'+re(s)+'">'+(t?n:re(n,!0))+`</code></pre>
|
||||
`:"<pre><code>"+(t?n:re(n,!0))+`</code></pre>
|
||||
`}blockquote({tokens:r}){return`<blockquote>
|
||||
${this.parser.parse(r)}</blockquote>
|
||||
`}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
|
||||
`}hr(r){return`<hr>
|
||||
`}list(r){let e=r.ordered,t=r.start,s="";for(let i=0;i<r.items.length;i++){let a=r.items[i];s+=this.listitem(a)}let n=e?"ol":"ul",l=e&&t!==1?' start="'+t+'"':"";return"<"+n+l+`>
|
||||
`+s+"</"+n+`>
|
||||
`}listitem(r){let e="";if(r.task){let t=this.checkbox({checked:!!r.checked});r.loose?r.tokens[0]?.type==="paragraph"?(r.tokens[0].text=t+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&r.tokens[0].tokens[0].type==="text"&&(r.tokens[0].tokens[0].text=t+" "+re(r.tokens[0].tokens[0].text),r.tokens[0].tokens[0].escaped=!0)):r.tokens.unshift({type:"text",raw:t+" ",text:t+" ",escaped:!0}):e+=t+" "}return e+=this.parser.parse(r.tokens,!!r.loose),`<li>${e}</li>
|
||||
`}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
|
||||
`}table(r){let e="",t="";for(let n=0;n<r.header.length;n++)t+=this.tablecell(r.header[n]);e+=this.tablerow({text:t});let s="";for(let n=0;n<r.rows.length;n++){let l=r.rows[n];t="";for(let i=0;i<l.length;i++)t+=this.tablecell(l[i]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
||||
<thead>
|
||||
`+e+`</thead>
|
||||
`+s+`</table>
|
||||
`}tablerow({text:r}){return`<tr>
|
||||
${r}</tr>
|
||||
`}tablecell(r){let e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>
|
||||
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${re(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t),n=vn(r);if(n===null)return s;r=n;let l='<a href="'+r+'"';return e&&(l+=' title="'+re(e)+'"'),l+=">"+s+"</a>",l}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let n=vn(r);if(n===null)return re(t);r=n;let l=`<img src="${r}" alt="${t}"`;return e&&(l+=` title="${re(e)}"`),l+=">",l}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:re(r.text)}},Yt=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}},he=class Mt{options;renderer;textRenderer;constructor(e){this.options=e||we,this.options.renderer=this.options.renderer||new at,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Yt}static parse(e,t){return new Mt(t).parse(e)}static parseInline(e,t){return new Mt(t).parseInline(e)}parse(e,t=!0){let s="";for(let n=0;n<e.length;n++){let l=e[n];if(this.options.extensions?.renderers?.[l.type]){let a=l,u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){s+=u||"";continue}}let i=l;switch(i.type){case"space":{s+=this.renderer.space(i);continue}case"hr":{s+=this.renderer.hr(i);continue}case"heading":{s+=this.renderer.heading(i);continue}case"code":{s+=this.renderer.code(i);continue}case"table":{s+=this.renderer.table(i);continue}case"blockquote":{s+=this.renderer.blockquote(i);continue}case"list":{s+=this.renderer.list(i);continue}case"html":{s+=this.renderer.html(i);continue}case"def":{s+=this.renderer.def(i);continue}case"paragraph":{s+=this.renderer.paragraph(i);continue}case"text":{let a=i,u=this.renderer.text(a);for(;n+1<e.length&&e[n+1].type==="text";)a=e[++n],u+=`
|
||||
`+this.renderer.text(a);t?s+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):s+=u;continue}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,t=this.renderer){let s="";for(let n=0;n<e.length;n++){let l=e[n];if(this.options.extensions?.renderers?.[l.type]){let a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=a||"";continue}}let i=l;switch(i.type){case"escape":{s+=t.text(i);break}case"html":{s+=t.html(i);break}case"link":{s+=t.link(i);break}case"image":{s+=t.image(i);break}case"strong":{s+=t.strong(i);break}case"em":{s+=t.em(i);break}case"codespan":{s+=t.codespan(i);break}case"br":{s+=t.br(i);break}case"del":{s+=t.del(i);break}case"text":{s+=t.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},st=class{options;block;constructor(r){this.options=r||we}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}provideLexer(){return this.block?pe.lex:pe.lexInline}provideParser(){return this.block?he.parse:he.parseInline}},li=class{defaults=Bt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=he;Renderer=at;TextRenderer=Yt;Lexer=pe;Tokenizer=lt;Hooks=st;constructor(...r){this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let n=s;for(let l of n.header)t=t.concat(this.walkTokens(l.tokens,e));for(let l of n.rows)for(let i of l)t=t.concat(this.walkTokens(i.tokens,e));break}case"list":{let n=s;t=t.concat(this.walkTokens(n.items,e));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(l=>{let i=n[l].flat(1/0);t=t.concat(this.walkTokens(i,e))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,e)))}}return t}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let l=e.renderers[n.name];l?e.renderers[n.name]=function(...i){let a=n.renderer.apply(this,i);return a===!1&&(a=l.apply(this,i)),a}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[n.level];l?l.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),t.renderer){let n=this.defaults.renderer||new at(this.defaults);for(let l in t.renderer){if(!(l in n))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let i=l,a=t.renderer[i],u=n[i];n[i]=(...c)=>{let h=a.apply(n,c);return h===!1&&(h=u.apply(n,c)),h||""}}s.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new lt(this.defaults);for(let l in t.tokenizer){if(!(l in n))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let i=l,a=t.tokenizer[i],u=n[i];n[i]=(...c)=>{let h=a.apply(n,c);return h===!1&&(h=u.apply(n,c)),h}}s.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new st;for(let l in t.hooks){if(!(l in n))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let i=l,a=t.hooks[i],u=n[i];st.passThroughHooks.has(l)?n[i]=c=>{if(this.defaults.async)return Promise.resolve(a.call(n,c)).then(m=>u.call(n,m));let h=a.call(n,c);return u.call(n,h)}:n[i]=(...c)=>{let h=a.apply(n,c);return h===!1&&(h=u.apply(n,c)),h}}s.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,l=t.walkTokens;s.walkTokens=function(i){let a=[];return a.push(l.call(this,i)),n&&(a=a.concat(n.call(this,i))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return pe.lex(r,e??this.defaults)}parser(r,e){return he.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},n={...this.defaults,...s},l=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return l(new Error("marked(): input parameter is of type "+ObjecLine truncated
|
||||
Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+re(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},ke=new li;function E(r,e){return ke.parse(r,e)}E.options=E.setOptions=function(r){return ke.setOptions(r),E.defaults=ke.defaults,Un(E.defaults),E};E.getDefaults=Bt;E.defaults=we;E.use=function(...r){return ke.use(...r),E.defaults=ke.defaults,Un(E.defaults),E};E.walkTokens=function(r,e){return ke.walkTokens(r,e)};E.parseInline=ke.parseInline;E.Parser=he;E.parser=he.parse;E.Renderer=at;E.TextRenderer=Yt;E.Lexer=pe;E.lexer=pe.lex;E.Tokenizer=lt;E.Hooks=st;E.parse=E;E.options;E.setOptions;E.use;E.walkTokens;E.parseInline;he.parse;pe.lex;const{entries:Vn,setPrototypeOf:Sn,isFrozen:ai,getPrototypeOf:ci,getOwnPropertyDescriptor:ui}=Object;let{freeze:j,seal:Y,create:Qn}=Object,{apply:Ot,construct:Nt}=typeof Reflect<"u"&&Reflect;j||(j=function(e){return e});Y||(Y=function(e){return e});Ot||(Ot=function(e,t,s){return e.apply(t,s)});Nt||(Nt=function(e,t){return new e(...t)});const tt=Z(Array.prototype.forEach),pi=Z(Array.prototype.lastIndexOf),Rn=Z(Array.prototype.pop),ze=Z(Array.prototype.push),hi=Z(Array.prototype.splice),it=Z(String.prototype.toLowerCase),Et=Z(String.prototype.toString),Ln=Z(String.prototype.match),Ue=Z(String.prototype.replace),di=Z(String.prototype.indexOf),fi=Z(String.prototype.trim),Q=Z(Object.prototype.hasOwnProperty),G=Z(RegExp.prototype.test),Fe=gi(TypeError);function Z(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return Ot(r,e,s)}}function gi(r){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return Nt(r,t)}}function w(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:it;Sn&&Sn(r,null);let s=e.length;for(;s--;){let n=e[s];if(typeof n=="string"){const l=t(n);l!==n&&(ai(e)||(e[s]=l),n=l)}r[n]=!0}return r}function mi(r){for(let e=0;e<r.length;e++)Q(r,e)||(r[e]=null);return r}function ue(r){const e=Qn(null);for(const[t,s]of Vn(r))Q(r,t)&&(Array.isArray(s)?e[t]=mi(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=ue(s):e[t]=s);return e}function Be(r,e){for(;r!==null;){const s=ui(r,e);if(s){if(s.get)return Z(s.get);if(typeof s.value=="function")return Z(s.value)}r=ci(r)}function t(){return null}return t}const Cn=j(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),St=j(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Rt=j(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ki=j(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Lt=j(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),bi=j(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Dn=j(["#text"]),In=j(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","cLine truncated
|
||||
`+X),ye&&tt([de,Ce,x],ce=>{X=Ue(X,ce," ")}),D&&Xe?D.createHTML(X):X},e.setConfig=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tt(k),kt=!0},e.clearConfig=function(){Ee=null,kt=!1},e.isValidAttribute=function(k,o,p){Ee||Tt({});const g=N(k),S=N(o);return mn(g,S,p)},e.addHook=function(k,o){typeof o=="function"&&ze(I[k],o)},e.removeHook=function(k,o){if(o!==void 0){const p=pi(I[k],o);return p===-1?void 0:hi(I[k],p,1)[0]}return Rn(I[k])},e.removeHooks=function(k){I[k]=[]},e.removeAllHooks=function(){I=On()},e}var Li=er();const Ci={class:"min-h-screen flex items-center justify-center p-4 overflow-hidden transition-colors duration-300"},Di={class:"w-full max-w-md relative z-10"},Ii={class:"p-8"},$i=be({__name:"RetrievewFileView",setup(r){const{t:e}=We(),t=mr(),s=window.location.origin,n=wr(),l=xe("isDarkMode"),i=Ar(),{receiveData:a}=kr(i),u=K(""),c=K({readonly:!1,loading:!1}),h=K(""),m=K(null),f=K(!1),y=xr(),v=a,$=JSON.parse(localStorage.getItem("config")||"{}"),V=K(null);br(()=>{V.value&&V.value.focus();const x=y.query.code;x&&typeof x=="string"&&(u.value=x)}),Dt(u,x=>{x.length===5&&U()});const J=x=>x.downloadUrl?x.downloadUrl.startsWith("http")?x.downloadUrl:`${s}${x.downloadUrl}`:"",ee=async()=>{m.value&&m.value.content&&await Sr(m.value.content,{successMsg:e("fileRecord.contentCopied"),errorMsg:e("fileRecord.copyFailed")})},U=async()=>{if(u.value.length!==5){t.showAlert(e("retrieve.messages.invalidCode"),"error");return}c.value.readonly=!0,c.value.loading=!0;try{const x=await yr.post("/share/select/",{code:u.value}),_=x.data||x;if(_&&_.code===200)if(_.detail){const H=_.detail.text.startsWith("/share/download")||_.detail.name!=="Text",oe={id:Date.now(),code:_.detail.code,filename:_.detail.name,size:D(_.detail.size),downloadUrl:H?_.detail.text:null,content:H?null:_.detail.text,date:new Date().toLocaleString()};let De=!0;i.receiveData.forEach(ft=>{ft.code===oe.code&&(De=!1)}),De&&i.addReceiveData(oe),H?m.value=oe:(m.value=oe,I.value=!0),t.showAlert(e("retrieve.messages.retrieveSuccess"),"success")}else t.showAlert(e("retrieve.messages.invalidCodeError"),"error");else t.showAlert(e("retrieve.messages.retrieveFailure")+_.detail,"error")}catch(x){console.error("Retrieve failed:",x);const _=x,H=_?.response?.data?.detail||_?.message||e("retrieve.messages.unknownError");t.showAlert(e("retrieve.messages.networkError")+H,"error")}finally{c.value.readonly=!1,c.value.loading=!1,u.value=""}},D=x=>{if(x===0)return"0 "+e("fileSize.bytes");const _=1024,H=[e("fileSize.bytes"),e("fileSize.kb"),e("fileSize.mb"),e("fileSize.gb"),e("fileSize.tb")],oe=Math.floor(Math.log(x)/Math.log(_));return parseFloat((x/Math.pow(_,oe)).toFixed(2))+" "+H[oe]},se=x=>{m.value=x},ie=x=>{const _=v.value.findIndex(H=>H.id===x);_!==-1&&i.deleteReceiveData(_)},te=()=>{f.value=!f.value},pt=()=>{n.push("/send")},ht=x=>x.downloadUrl?`${s}${x.downloadUrl}`:`${s}?code=${x.code}`,dt=x=>{if(x.downloadUrl)window.open(`${x.downloadUrl.startsWith("http")?"":s}${x.downloadUrl}`,"_blank");else if(x.content){const _=new Blob([x.content],{type:"text/plain;charset=utf-8"});As.saveAs(_,`${x.filename}.txt`)}},I=K(!1),de=K("");Dt(()=>m.value?.content,async x=>{if(x)try{const _=await E(x);de.value=Li.sanitize(_,{ALLOWED_TAGS:["p","br","strong","em","u","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","code","pre","a","img"],ALLOWED_ATTR:["href","src","alt","title","class"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|xxx):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i})}catch(_){console.error("Markdown 渲染失败:",_),de.value=x}else de.value=""},{immediate:!0});const Ce=()=>{I.value=!0};return(x,_)=>(P(),W("div",Ci,[b("div",Di,[b("div",{class:T(["rounded-3xl shadow-2xl overflow-hidden border transform transition-all duration-300",[d(l)?"bg-gray-800 bg-opacity-50 backdrop-filter backdrop-blur-xl border-gray-700":"bg-white border-gray-200"]])},[b("div",Ii,[L(Er,{title:d($).name,onTitleClick:pt},null,8,["title"]),L(Br,{"input-status":c.value,error:!!h.value,onSubmit:U,"onUpdate:code":_[0]||(_[0]=H=>u.value=H),ref:"retrieveFormRef"},null,8,["input-status","error"])]),L(Gr,{"link-text":x.$t("retrieve.needSendFile"),"link-to":"/send","drawer-text":x.$t("retrieve.recordsDrawer"),onToggleDrawer:te},null,8,["link-text","drawer-text"])],2)]),L(qr,{visible:f.value,title:x.$t("retrieve.recordsDrawer"),onClose:te},{default:Le(()=>[L(ms,{records:d(v),onViewDetails:se,onDownloadRecord:dt,onDeleteRecord:ie},null,8,["records"])]),_:1},8,["visible","title"]),L(ls,{visible:!!m.value,record:m.value,onClose:_[1]||(_[1]=H=>m.value=null),onShowContentPreview:Ce,"get-download-url":J,"get-qr-code-value":ht},null,8,["visible","record"]),L(_s,{visible:I.value,"rendered-content":de.value,onClose:_[2]||(_[2]=H=>I.value=!1),onCopyContent:ee},null,8,["visible","rendered-content"])]))}}),Bi=Re($i,[["__scopeId","data-v-a89ba9bf"]]);export{Bi as default};
|
||||
@@ -1 +0,0 @@
|
||||
@keyframes blob-750ecd33{0%,to{transform:translate(0) scale(1)}25%{transform:translate(20px,-50px) scale(1.1)}50%{transform:translate(-20px,20px) scale(.9)}75%{transform:translate(50px,50px) scale(1.05)}}.animate-spin-slow[data-v-750ecd33]{animation:spin-750ecd33 8s linear infinite}@keyframes spin-750ecd33{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.w-97-100[data-v-750ecd33]{width:97%}[data-v-750ecd33] .prose{text-align:left}[data-v-750ecd33] .prose h1,[data-v-750ecd33] .prose h2,[data-v-750ecd33] .prose h3,[data-v-750ecd33] .prose h4,[data-v-750ecd33] .prose h5,[data-v-750ecd33] .prose h6{color:#4f46e5}@media (prefers-color-scheme: dark){[data-v-750ecd33] .prose h1,[data-v-750ecd33] .prose h2,[data-v-750ecd33] .prose h3,[data-v-750ecd33] .prose h4,[data-v-750ecd33] .prose h5,[data-v-750ecd33] .prose h6{color:#818cf8}}@media (min-width: 640px){.sm\:w-120[data-v-750ecd33]{width:30rem}}.custom-scrollbar[data-v-750ecd33]{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.3) transparent}.custom-scrollbar[data-v-750ecd33]::-webkit-scrollbar{width:6px;height:6px}.custom-scrollbar[data-v-750ecd33]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-750ecd33]::-webkit-scrollbar-thumb{background-color:#9ca3af4d;border-radius:3px;-webkit-transition:background-color .3s;transition:background-color .3s}.custom-scrollbar[data-v-750ecd33]::-webkit-scrollbar-thumb:hover{background-color:#9ca3af80}[data-v-750ecd33] [class*=dark] .custom-scrollbar{scrollbar-color:rgba(75,85,99,.3) transparent}[data-v-750ecd33] [class*=dark] .custom-scrollbar::-webkit-scrollbar-thumb{background-color:#4b55634d}[data-v-750ecd33] [class*=dark] .custom-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#4b556380}
|
||||
@@ -1,77 +0,0 @@
|
||||
import{c as it,d as rr,u as sr,B as ir,r as oe,o as or,C as lr,w as dn,a as le,b as f,g as C,n as T,h as b,i as ar,t as de,j as cr,m as ur,l as Xe,v as pr,k as Ie,x as hr,s as me,T as Tt,z as fr,X as gn,y as dr,F as gr,q as mr,e as ae,A as xr,_ as kr}from"./index-CL9mnhPI.js";import{u as br,S as wr,C as yr,Q as _r,d as Tr,E as vr}from"./clipboard-DyBaoW_S.js";import{B as Ar}from"./box-rSyVX8Lw.js";import{F as mn}from"./file-CeiRRIJG.js";import{H as Er}from"./hard-drive-D-zf5eAT.js";import{T as Sr}from"./trash-Cr3Lyvdp.js";/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Rr=it("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Lr=it("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Cr=it("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const xn=it("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Je={exports:{}},Ir=Je.exports,kn;function Dr(){return kn||(kn=1,function(r,e){(function(n,s){s()})(Ir,function(){function n(c,h){return typeof h>"u"?h={autoBom:!1}:typeof h!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),h={autoBom:!h}),h.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function s(c,h,x){var d=new XMLHttpRequest;d.open("GET",c),d.responseType="blob",d.onload=function(){u(d.response,h,x)},d.onerror=function(){console.error("could not download file")},d.send()}function t(c){var h=new XMLHttpRequest;h.open("HEAD",c,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function l(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(h)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ye=="object"&&Ye.global===Ye?Ye:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,h,x){var d=o.URL||o.webkitURL,_=document.createElement("a");h=h||c.name||"download",_.download=h,_.rel="noopener",typeof c=="string"?(_.href=c,_.origin===location.origin?l(_):t(_.href)?s(c,h,x):l(_,_.target="_blank")):(_.href=d.createObjectURL(c),setTimeout(function(){d.revokeObjectURL(_.href)},4e4),setTimeout(function(){l(_)},0))}:"msSaveOrOpenBlob"in navigator?function(c,h,x){if(h=h||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,x),h);else if(t(c))s(c,h,x);else{var d=document.createElement("a");d.href=c,d.target="_blank",setTimeout(function(){l(d)})}}:function(c,h,x,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof c=="string")return s(c,h,x);var _=c.type==="application/octet-stream",v=/constructor/i.test(o.HTMLElement)||o.safari,O=/CriOS\/[\d]+/.test(navigator.userAgent);if((O||_&&v||a)&&typeof FileReader<"u"){var j=new FileReader;j.onloadend=function(){var $=j.result;$=O?$:$.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=$:location=$,d=null},j.readAsDataURL(c)}else{var V=o.URL||o.webkitURL,Q=V.createObjectURL(c);d?d.location=Q:location.href=Q,d=null,setTimeout(function(){V.revokeObjectURL(Q)},4e4)}});o.saveAs=u.saveAs=u,r.exports=u})}(Je)),Je.exports}var Or=Dr();function Mt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ke=Mt();function On(r){ke=r}var Ue={exec:()=>null};function A(r,e=""){let n=typeof r=="string"?r:r.source,s={replace:(t,l)=>{let o=typeof l=="string"?l:l.source;return o=o.replace(H.caret,"$1"),n=n.replace(t,o),s},getRegex:()=>new RegExp(n,e)};return s}var H={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${MathLine truncated
|
||||
]`).replace("lheading",Nn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,zn=/^( {2,}|\\)\n(?!\s*$)/,Xr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,lt=/[\p{P}\p{S}]/u,Ft=/[\s\p{P}\p{S}]/u,$n=/[^\s\p{P}\p{S}]/u,Yr=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ft).getRegex(),Un=/(?!~)[\p{P}\p{S}]/u,Vr=/(?!~)[\s\p{P}\p{S}]/u,Qr=/(?:[^\s\p{P}\p{S}]|~)/u,Kr=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,Fn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Jr=A(Fn,"u").replace(/punct/g,lt).getRegex(),es=A(Fn,"u").replace(/punct/g,Un).getRegex(),Bn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ts=A(Bn,"gu").replace(/notPunctSpace/g,$n).replace(/punctSpace/g,Ft).replace(/punct/g,lt).getRegex(),ns=A(Bn,"gu").replace(/notPunctSpace/g,Qr).replace(/punctSpace/g,Vr).replace(/punct/g,Un).getRegex(),rs=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$n).replace(/punctSpace/g,Ft).replace(/punct/g,lt).getRegex(),ss=A(/\\(punct)/,"gu").replace(/punct/g,lt).getRegex(),is=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),os=A($t).replace("(?:-->|$)","-->").getRegex(),ls=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",os).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),nt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,as=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",nt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Hn=A(/^!?\[(label)\]\[(ref)\]/).replace("label",nt).replace("ref",zt).getRegex(),Gn=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",zt).getRegex(),cs=A("reflink|nolink(?!\\()","g").replace("reflink",Hn).replace("nolink",Gn).getRegex(),Bt={_backpedal:Ue,anyPunctuation:ss,autolink:is,blockSkip:Kr,br:zn,code:Zr,del:Ue,emStrongLDelim:Jr,emStrongRDelimAst:ts,emStrongRDelimUnd:rs,escape:jr,link:as,nolink:Gn,punctuation:Yr,reflink:Hn,reflinkSearch:cs,tag:ls,text:Xr,url:Ue},us={...Bt,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",nt).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",nt).getRegex()},Lt={...Bt,emStrongRDelimAst:ns,emStrongLDelim:es,url:A(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ps={...Lt,br:A(zn).replace("{2,}","*").getRegex(),text:A(Lt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ve={normal:Ut,gfm:qr,pedantic:Wr},De={normal:Bt,gfm:Lt,breaks:ps,pedantic:us},hs={"&":"&","<":"<",">":">",'"':""","'":"'"},wn=r=>hs[r];function ee(r,e){if(e){if(H.escapeTest.test(r))return r.replace(H.escapeReplace,wn)}else if(H.escapeTestNoEncode.test(r))return r.replace(H.escapeReplaceNoEncode,wn);return r}function yn(r){try{r=encodeURI(r).replace(H.percentDecode,"%")}catch{return null}return r}function _n(r,e){let n=r.replace(H.findPipe,(l,o,a)=>{let u=!1,c=o;for(;--c>=0&&a[c]==="\\";)u=!u;return u?"|":" |"}),s=n.split(H.splitPipe),t=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;t<s.length;t++)s[t]=s[t].trim().replace(H.slashPipe,"|");return s}function Oe(r,e,n){let s=r.length;if(s===0)return"";let t=0;for(;t<s&&r.charAt(s-t-1)===e;)t++;return r.slice(0,s-t)}function fs(r,e){if(r.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])n++;else if(r[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function Tn(Line truncated
|
||||
`).map(l=>{let o=l.match(n.other.beginningSpace);if(o===null)return l;let[a]=o;return a.length>=t.length?l.slice(t.length):l}).join(`
|
||||
`)}var rt=class{options;rules;lexer;constructor(r){this.options=r||ke}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Oe(n,`
|
||||
`)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let n=e[0],s=ds(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=Oe(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:Oe(e[0],`
|
||||
`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let n=Oe(e[0],`
|
||||
`).split(`
|
||||
`),s="",t="",l=[];for(;n.length>0;){let o=!1,a=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))a.push(n[u]),o=!0;else if(!o)a.push(n[u]);else break;n=n.slice(u);let c=a.join(`
|
||||
`),h=c.replace(this.rules.other.blockquoteSetextReplace,`
|
||||
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
||||
${c}`:c,t=t?`${t}
|
||||
${h}`:h;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,l,!0),this.lexer.state.top=x,n.length===0)break;let d=l.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let _=d,v=_.raw+`
|
||||
`+n.join(`
|
||||
`),O=this.blockquote(v);l[l.length-1]=O,s=s.substring(0,s.length-_.raw.length)+O.raw,t=t.substring(0,t.length-_.text.length)+O.text;break}else if(d?.type==="list"){let _=d,v=_.raw+`
|
||||
`+n.join(`
|
||||
`),O=this.list(v);l[l.length-1]=O,s=s.substring(0,s.length-d.raw.length)+O.raw,t=t.substring(0,t.length-_.raw.length)+O.raw,n=v.substring(l.at(-1).raw.length).split(`
|
||||
`);continue}}return{type:"blockquote",raw:s,tokens:l,text:t}}}list(r){let e=this.rules.block.list.exec(r);if(e){let n=e[1].trim(),s=n.length>1,t={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let l=this.rules.other.listItemRegex(n),o=!1;for(;r;){let u=!1,c="",h="";if(!(e=l.exec(r))||this.rules.block.hr.test(r))break;c=e[0],r=r.substring(c.length);let x=e[2].split(`
|
||||
`,1)[0].replace(this.rules.other.listReplaceTabs,V=>" ".repeat(3*V.length)),d=r.split(`
|
||||
`,1)[0],_=!x.trim(),v=0;if(this.options.pedantic?(v=2,h=x.trimStart()):_?v=e[1].length+1:(v=e[2].search(this.rules.other.nonSpaceChar),v=v>4?1:v,h=x.slice(v),v+=e[1].length),_&&this.rules.other.blankLine.test(d)&&(c+=d+`
|
||||
`,r=r.substring(d.length+1),u=!0),!u){let V=this.rules.other.nextBulletRegex(v),Q=this.rules.other.hrRegex(v),$=this.rules.other.fencesBeginRegex(v),I=this.rules.other.headingBeginRegex(v),te=this.rules.other.htmlBeginRegex(v);for(;r;){let ne=r.split(`
|
||||
`,1)[0],K;if(d=ne,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),K=d):K=d.replace(this.rules.other.tabCharGlobal," "),$.test(d)||I.test(d)||te.test(d)||V.test(d)||Q.test(d))break;if(K.search(this.rules.other.nonSpaceChar)>=v||!d.trim())h+=`
|
||||
`+K.slice(v);else{if(_||x.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||$.test(x)||I.test(x)||Q.test(x))break;h+=`
|
||||
`+d}!_&&!d.trim()&&(_=!0),c+=ne+`
|
||||
`,r=r.substring(ne.length+1),x=K.slice(v)}}t.loose||(o?t.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0));let O=null,j;this.options.gfm&&(O=this.rules.other.listIsTask.exec(h),O&&(j=O[0]!=="[ ] ",h=h.replace(this.rules.other.listReplaceTask,""))),t.items.push({type:"list_item",raw:c,task:!!O,checked:j,loose:!1,text:h,tokens:[]}),t.raw+=c}let a=t.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let u=0;u<t.items.length;u++)if(this.lexer.state.top=!1,t.items[u].tokens=this.lexer.blockTokens(t.items[u].text,[]),!t.loose){let c=t.items[u].tokens.filter(x=>x.type==="space"),h=c.length>0&&c.some(x=>this.rules.other.anyLine.test(x.raw));t.loose=h}if(t.loose)for(let u=0;u<t.items.length;u++)t.items[u].loose=!0;return t}}html(r){let e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(r){let e=this.rules.block.def.exec(r);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:s,title:t}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=_n(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
||||
`):[],l={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?l.align.push("right"):this.rules.other.tableAlignCenter.test(o)?l.align.push("center"):this.rules.other.tableAlignLeft.test(o)?l.align.push("left"):l.align.push(null);for(let o=0;o<n.length;o++)l.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:l.align[o]});for(let o of t)l.rows.push(_n(o,l.header.length).map((a,u)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:l.align[u]})));return l}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let n=e[1].charAt(e[1].length-1)===`
|
||||
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=Oe(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=fs(e[2],"()");if(l===-2)return;if(l>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(s);l&&(s=l[1],t=l[3])}else t=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),Tn(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let n;if((n=this.rules.inline.reflink.exec(r))||(n=this.rules.inline.nolink.exec(r))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return Tn(n,t,n[0],this.lexer,this.rules)}}emStrong(r,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!n||this.rules.inline.punctuation.exec(n))){let t=[...s[0]].length-1,l,o,a=t,u=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*r.length+t);(s=c.exec(e))!=null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(o=[...l].length,s[3]||s[4]){a+=o;continue}else if((s[5]||s[6])&&t%3&&!((t+o)%3)){u+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+u);let h=[...s[0]][0].length,x=r.slice(0,t+s.index+h+o);if(Math.min(t,o)%2){let _=x.slice(1,-1);return{type:"em",raw:x,text:_,tokens:this.lexer.inlineTokens(_)}}let d=x.slice(2,-2);return{type:"strong",raw:x,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),t=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&t&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r){let e=this.rules.inline.del.exec(r);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},ue=class Ct{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ke,this.options.tokenizer=this.options.tokenizer||new rt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:H,block:Ve.normal,inline:De.normal};this.options.pedantic?(n.block=Ve.pedantic,n.inline=De.pedantic):this.options.gfm&&(n.block=Ve.gfm,this.options.breaks?n.inline=De.breaks:n.inline=De.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ve,inline:De}}static lex(e,n){return new Ct(n).lex(e)}static lexInline(e,n){return new Ct(n).inlineTokens(e)}lex(e){e=e.replace(H.carriageReturn,`
|
||||
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){for(this.options.pedantic&&(e=e.replace(H.tabCharGlobal," ").replace(H.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(o=>(t=o.call({lexer:this},e,n))?(e=e.substring(t.raw.length),n.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let o=n.at(-1);t.raw.length===1&&o!==void 0?o.raw+=`
|
||||
`:n.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
||||
`+t.raw,o.text+=`
|
||||
`+t.text,this.inlineQueue.at(-1).src=o.text):n.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
||||
`+t.raw,o.text+=`
|
||||
`+t.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title});continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),n.push(t);continue}let l=e;if(this.options.extensions?.startBlock){let o=1/0,a=e.slice(1),u;this.options.extensions.startBlock.forEach(c=>{u=c.call({lexer:this},a),typeof u=="number"&&u>=0&&(o=Math.min(o,u))}),o<1/0&&o>=0&&(l=e.substring(0,o+1))}if(this.state.top&&(t=this.tokenizer.paragraph(l))){let o=n.at(-1);s&&o?.type==="paragraph"?(o.raw+=`
|
||||
`+t.raw,o.text+=`
|
||||
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(t),s=l.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=`
|
||||
`+t.raw,o.text+=`
|
||||
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(t);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let s=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let l=!1,o="";for(;e;){l||(o=""),l=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=n.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,o)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let u=e;if(this.options.extensions?.startInline){let c=1/0,h=e.slice(1),x;this.options.extensions.startInline.forEach(d=>{x=d.call({lexer:this},h),typeof x=="number"&&x>=0&&(c=Math.min(c,x))}),c<1/0&&c>=0&&(u=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(u)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),l=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}},st=class{options;parser;constructor(r){this.options=r||ke}space(r){return""}code({text:r,lang:e,escaped:n}){let s=(e||"").match(H.notSpaceStart)?.[0],t=r.replace(H.endingNewline,"")+`
|
||||
`;return s?'<pre><code class="language-'+ee(s)+'">'+(n?t:ee(t,!0))+`</code></pre>
|
||||
`:"<pre><code>"+(n?t:ee(t,!0))+`</code></pre>
|
||||
`}blockquote({tokens:r}){return`<blockquote>
|
||||
${this.parser.parse(r)}</blockquote>
|
||||
`}html({text:r}){return r}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
|
||||
`}hr(r){return`<hr>
|
||||
`}list(r){let e=r.ordered,n=r.start,s="";for(let o=0;o<r.items.length;o++){let a=r.items[o];s+=this.listitem(a)}let t=e?"ol":"ul",l=e&&n!==1?' start="'+n+'"':"";return"<"+t+l+`>
|
||||
`+s+"</"+t+`>
|
||||
`}listitem(r){let e="";if(r.task){let n=this.checkbox({checked:!!r.checked});r.loose?r.tokens[0]?.type==="paragraph"?(r.tokens[0].text=n+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&r.tokens[0].tokens[0].type==="text"&&(r.tokens[0].tokens[0].text=n+" "+ee(r.tokens[0].tokens[0].text),r.tokens[0].tokens[0].escaped=!0)):r.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(r.tokens,!!r.loose),`<li>${e}</li>
|
||||
`}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
|
||||
`}table(r){let e="",n="";for(let t=0;t<r.header.length;t++)n+=this.tablecell(r.header[t]);e+=this.tablerow({text:n});let s="";for(let t=0;t<r.rows.length;t++){let l=r.rows[t];n="";for(let o=0;o<l.length;o++)n+=this.tablecell(l[o]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
||||
<thead>
|
||||
`+e+`</thead>
|
||||
`+s+`</table>
|
||||
`}tablerow({text:r}){return`<tr>
|
||||
${r}</tr>
|
||||
`}tablecell(r){let e=this.parser.parseInline(r.tokens),n=r.header?"th":"td";return(r.align?`<${n} align="${r.align}">`:`<${n}>`)+e+`</${n}>
|
||||
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${ee(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:n}){let s=this.parser.parseInline(n),t=yn(r);if(t===null)return s;r=t;let l='<a href="'+r+'"';return e&&(l+=' title="'+ee(e)+'"'),l+=">"+s+"</a>",l}image({href:r,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let t=yn(r);if(t===null)return ee(n);r=t;let l=`<img src="${r}" alt="${n}"`;return e&&(l+=` title="${ee(e)}"`),l+=">",l}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:ee(r.text)}},Ht=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}},pe=class It{options;renderer;textRenderer;constructor(e){this.options=e||ke,this.options.renderer=this.options.renderer||new st,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ht}static parse(e,n){return new It(n).parse(e)}static parseInline(e,n){return new It(n).parseInline(e)}parse(e,n=!0){let s="";for(let t=0;t<e.length;t++){let l=e[t];if(this.options.extensions?.renderers?.[l.type]){let a=l,u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){s+=u||"";continue}}let o=l;switch(o.type){case"space":{s+=this.renderer.space(o);continue}case"hr":{s+=this.renderer.hr(o);continue}case"heading":{s+=this.renderer.heading(o);continue}case"code":{s+=this.renderer.code(o);continue}case"table":{s+=this.renderer.table(o);continue}case"blockquote":{s+=this.renderer.blockquote(o);continue}case"list":{s+=this.renderer.list(o);continue}case"html":{s+=this.renderer.html(o);continue}case"paragraph":{s+=this.renderer.paragraph(o);continue}case"text":{let a=o,u=this.renderer.text(a);for(;t+1<e.length&&e[t+1].type==="text";)a=e[++t],u+=`
|
||||
`+this.renderer.text(a);n?s+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):s+=u;continue}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,n=this.renderer){let s="";for(let t=0;t<e.length;t++){let l=e[t];if(this.options.extensions?.renderers?.[l.type]){let a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=a||"";continue}}let o=l;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},et=class{options;block;constructor(r){this.options=r||ke}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}provideLexer(){return this.block?ue.lex:ue.lexInline}provideParser(){return this.block?pe.parse:pe.parseInline}},gs=class{defaults=Mt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=pe;Renderer=st;TextRenderer=Ht;Lexer=ue;Tokenizer=rt;Hooks=et;constructor(...r){this.use(...r)}walkTokens(r,e){let n=[];for(let s of r)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let t=s;for(let l of t.header)n=n.concat(this.walkTokens(l.tokens,e));for(let l of t.rows)for(let o of l)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let t=s;n=n.concat(this.walkTokens(t.items,e));break}default:{let t=s;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(l=>{let o=t[l].flat(1/0);n=n.concat(this.walkTokens(o,e))}):t.tokens&&(n=n.concat(this.walkTokens(t.tokens,e)))}}return n}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let l=e.renderers[t.name];l?e.renderers[t.name]=function(...o){let a=t.renderer.apply(this,o);return a===!1&&(a=l.apply(this,o)),a}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[t.level];l?l.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),n.renderer){let t=this.defaults.renderer||new st(this.defaults);for(let l in n.renderer){if(!(l in t))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let o=l,a=n.renderer[o],u=t[o];t[o]=(...c)=>{let h=a.apply(t,c);return h===!1&&(h=u.apply(t,c)),h||""}}s.renderer=t}if(n.tokenizer){let t=this.defaults.tokenizer||new rt(this.defaults);for(let l in n.tokenizer){if(!(l in t))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let o=l,a=n.tokenizer[o],u=t[o];t[o]=(...c)=>{let h=a.apply(t,c);return h===!1&&(h=u.apply(t,c)),h}}s.tokenizer=t}if(n.hooks){let t=this.defaults.hooks||new et;for(let l in n.hooks){if(!(l in t))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let o=l,a=n.hooks[o],u=t[o];et.passThroughHooks.has(l)?t[o]=c=>{if(this.defaults.async)return Promise.resolve(a.call(t,c)).then(x=>u.call(t,x));let h=a.call(t,c);return u.call(t,h)}:t[o]=(...c)=>{let h=a.apply(t,c);return h===!1&&(h=u.apply(t,c)),h}}s.hooks=t}if(n.walkTokens){let t=this.defaults.walkTokens,l=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(l.call(this,o)),t&&(a=a.concat(t.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return ue.lex(r,e??this.defaults)}parser(r,e){return pe.parse(r,e??this.defaults)}parseMarkdown(r){return(e,n)=>{let s={...n},t={...this.defaults,...s},l=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return l(new Error("marked(): input parameter is of type "+ObjecLine truncated
|
||||
Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+ee(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},xe=new gs;function E(r,e){return xe.parse(r,e)}E.options=E.setOptions=function(r){return xe.setOptions(r),E.defaults=xe.defaults,On(E.defaults),E};E.getDefaults=Mt;E.defaults=ke;E.use=function(...r){return xe.use(...r),E.defaults=xe.defaults,On(E.defaults),E};E.walkTokens=function(r,e){return xe.walkTokens(r,e)};E.parseInline=xe.parseInline;E.Parser=pe;E.parser=pe.parse;E.Renderer=st;E.TextRenderer=Ht;E.Lexer=ue;E.lexer=ue.lex;E.Tokenizer=rt;E.Hooks=et;E.parse=E;E.options;E.setOptions;E.use;E.walkTokens;E.parseInline;pe.parse;ue.lex;/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:qn,setPrototypeOf:vn,isFrozen:ms,getPrototypeOf:xs,getOwnPropertyDescriptor:ks}=Object;let{freeze:G,seal:Z,create:Wn}=Object,{apply:Dt,construct:Ot}=typeof Reflect<"u"&&Reflect;G||(G=function(e){return e});Z||(Z=function(e){return e});Dt||(Dt=function(e,n,s){return e.apply(n,s)});Ot||(Ot=function(e,n){return new e(...n)});const Qe=q(Array.prototype.forEach),bs=q(Array.prototype.lastIndexOf),An=q(Array.prototype.pop),Me=q(Array.prototype.push),ws=q(Array.prototype.splice),tt=q(String.prototype.toLowerCase),vt=q(String.prototype.toString),En=q(String.prototype.match),Ne=q(String.prototype.replace),ys=q(String.prototype.indexOf),_s=q(String.prototype.trim),Y=q(Object.prototype.hasOwnProperty),B=q(RegExp.prototype.test),Pe=Ts(TypeError);function q(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),t=1;t<n;t++)s[t-1]=arguments[t];return Dt(r,e,s)}}function Ts(r){return function(){for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return Ot(r,n)}}function y(r,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:tt;vn&&vn(r,null);let s=e.length;for(;s--;){let t=e[s];if(typeof t=="string"){const l=n(t);l!==t&&(ms(e)||(e[s]=l),t=l)}r[t]=!0}return r}function vs(r){for(let e=0;e<r.length;e++)Y(r,e)||(r[e]=null);return r}function ce(r){const e=Wn(null);for(const[n,s]of qn(r))Y(r,n)&&(Array.isArray(s)?e[n]=vs(s):s&&typeof s=="object"&&s.constructor===Object?e[n]=ce(s):e[n]=s);return e}function ze(r,e){for(;r!==null;){const s=ks(r,e);if(s){if(s.get)return q(s.get);if(typeof s.value=="function")return q(s.value)}r=xs(r)}function n(){return null}return n}const Sn=G(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),At=G(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Et=G(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),As=G(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),St=G(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Es=G(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Rn=G(["#text"]),Ln=G([Line truncated
|
||||
`+W),be&&Qe([he,Ee,w],ie=>{W=Ne(W,ie," ")}),I&&Ge?I.createHTML(W):W},e.setConfig=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wt(k),dt=!0},e.clearConfig=function(){ve=null,dt=!1},e.isValidAttribute=function(k,i,p){ve||wt({});const g=P(k),S=P(i);return cn(g,S,p)},e.addHook=function(k,i){typeof i=="function"&&Me(D[k],i)},e.removeHook=function(k,i){if(i!==void 0){const p=bs(D[k],i);return p===-1?void 0:ws(D[k],p,1)[0]}return An(D[k])},e.removeHooks=function(k){D[k]=[]},e.removeAllHooks=function(){D=Dn()},e}var zs=Xn();const $s={class:"min-h-screen flex items-center justify-center p-4 overflow-hidden transition-colors duration-300"},Us={class:"w-full max-w-md relative z-10"},Fs={class:"p-8"},Bs={class:"flex justify-center mb-8"},Hs={class:"rounded-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 p-1 animate-spin-slow"},Gs={class:"rounded-full bg-gray-900 p-2"},qs={class:"mb-6 relative"},Ws={class:"relative"},js=["readonly"],Zs={key:0,class:"absolute inset-y-0 right-0 flex items-center pr-3"},Xs=["disabled"],Ys={class:"flex items-center justify-center relative z-10"},Vs={class:"mt-6 text-center"},Qs={class:"flex-grow overflow-y-auto p-6"},Ks={class:"flex-shrink-0 mr-4"},Js={class:"flex-grow min-w-0 mr-4"},ei={class:"flex-shrink-0 flex space-x-2"},ti=["onClick"],ni=["onClick"],ri=["onClick"],si={key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},ii={class:"space-y-4"},oi={class:"flex items-center"},li={class:"flex items-center"},ai={class:"flex items-center"},ci={class:"flex items-center"},ui={key:0,class:"ml-2"},pi={key:1},hi=["href"],fi={class:"mt-6 flex flex-col items-center"},di={class:"bg-white p-2 rounded-lg shadow-md"},gi={key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},mi={class:"flex justify-between items-center mb-4 flex-shrink-0"},xi={class:"flex items-center gap-3"},ki={class:"flex-1 overflow-y-auto custom-scrollbar"},bi=["innerHTML"],wi=rr({__name:"RetrievewFileView",setup(r){const e=sr(),n=window.location.origin,s=fr(),t=ar("isDarkMode"),l=br(),{receiveData:o}=ir(l),a=oe(""),u=oe({readonly:!1,loading:!1}),c=oe(!1),h=oe(""),x=oe(null),d=oe(!1),_=lr(),v=o,O=JSON.parse(localStorage.getItem("config")||"{}"),j=oe(null);or(()=>{j.value&&j.value.focus();const w=_.query.code;w&&typeof w=="string"&&(a.value=w)}),dn(a,w=>{w.length===5&&$()});const V=w=>w.downloadUrl?w.downloadUrl.startsWith("http")?w.downloadUrl:`${n}${w.downloadUrl}`:"",Q=async()=>{x.value&&x.value.content&&await Tr(x.value.content,{successMsg:"内容已复制到剪贴板",errorMsg:"复制失败,请重试"})},$=async()=>{if(a.value.length!==5){e.showAlert("请输入5位取件码","error");return}u.value.readonly=!0,u.value.loading=!0;try{const w=await xr.post("/share/select/",{code:a.value}),m=w.data||w;if(m&&m.code===200)if(m.detail){const X=m.detail.text.startsWith("/share/download")||m.detail.name!=="Text",R={id:Date.now(),code:m.detail.code,filename:m.detail.name,size:I(m.detail.size),downloadUrl:X?m.detail.text:null,content:X?null:m.detail.text,date:new Date().toLocaleString()};let fe=!0;l.receiveData.forEach(pt=>{pt.code===R.code&&(fe=!1)}),fe&&l.addReceiveData(R),X?x.value=R:(x.value=R,D.value=!0),e.showAlert("文件获取成功","success")}else e.showAlert("无效的取件码","error");else e.showAlert("获取文件失败","error"),console.log(m)}catch(w){console.error("取件失败:",w),e.showAlert("取件失败,请稍后重试","error")}finally{u.value.readonly=!1,u.value.loading=!1,a.value=""}},I=w=>{if(w===0)return"0 Bytes";const m=1024,X=["Bytes","KB","MB","GB","TB"],R=Math.floor(Math.log(w)/Math.log(m));return parseFloat((w/Math.pow(m,R)).toFixed(2))+" "+X[R]},te=w=>{x.value=w},ne=w=>{const m=v.value.findIndex(X=>X.id===w);m!==-1&&l.deleteReceiveData(m)},K=()=>{d.value=!d.value},at=()=>{s.push("/send")},ct=w=>w.downloadUrl?`${n}${w.downloadUrl}`:`${n}?code=${w.code}`,ut=w=>{if(console.log(w),w.downloadUrl)window.open(`${w.downloadUrl.startsWith("http")?"":n}${w.downloadUrl}`,"_blank");else if(w.content){const m=new Blob([w.content],{type:"text/plain;charset=utf-8"});Or.saveAs(m,`${w.filename}.txt`)}},D=oe(!1),he=oe("");dn(()=>x.value?.content,async w=>{if(w)try{const m=await E(w);he.value=zs.sanitize(m,{ALLOWED_TAGS:["p","br","strong","em","u","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","code","pre","a","img"],ALLOWED_ATTR:["href","src","alt","title","class"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|xxx):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i})}catch(m){console.error("Markdown 渲染失败:",m),he.value=w}else he.value=""},{immediate:!0});const Ee=()=>{D.value=!0};return(w,m)=>{const X=hr("router-link");return ae(),le("div",$s,[f("div",Us,[f("div",{class:T(["rounded-3xl shadow-2xl overflow-hidden border transform transition-all duration-300",[b(t)?"bg-gray-800 bg-opacity-50 backdrop-filter backdrop-blur-xl border-gray-700":"bg-white border-gray-200"]])},[f("divLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
.border-progress-container[data-v-2fbf5085]{position:relative;width:100%;height:100%}.border-progress-canvas[data-v-2fbf5085]{position:absolute;top:0;left:0;width:100%;height:100%;transition:all .3s ease}.custom-scrollbar[data-v-bebdfe92]{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.3) rgba(243,244,246,.5)}.custom-scrollbar[data-v-bebdfe92]::-webkit-scrollbar{width:6px;height:6px}.custom-scrollbar[data-v-bebdfe92]::-webkit-scrollbar-track{background:#f3f4f680;border-radius:3px}.custom-scrollbar[data-v-bebdfe92]::-webkit-scrollbar-thumb{background-color:#9ca3af80;border-radius:3px;-webkit-transition:background-color .3s;transition:background-color .3s}.custom-scrollbar[data-v-bebdfe92]::-webkit-scrollbar-thumb:hover{background-color:#9ca3afb3}[data-v-bebdfe92] [class*=dark] .custom-scrollbar{scrollbar-color:rgba(75,85,99,.5) rgba(31,41,55,.5)}[data-v-bebdfe92] [class*=dark] .custom-scrollbar::-webkit-scrollbar-track{background:#1f293780}[data-v-bebdfe92] [class*=dark] .custom-scrollbar::-webkit-scrollbar-thumb{background-color:#4b556380}[data-v-bebdfe92] [class*=dark] .custom-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#4b5563b3}.fade-enter-active[data-v-832d304e],.fade-leave-active[data-v-832d304e]{transition:opacity .3s ease,transform .3s ease}.fade-enter-from[data-v-832d304e],.fade-leave-to[data-v-832d304e]{opacity:0;transform:translateY(10px)}@media(min-width:640px){.sm\:w-120[data-v-832d304e]{width:30rem}}.fade-enter-to[data-v-832d304e],.fade-leave-from[data-v-832d304e]{opacity:1;transform:translateY(0)}.drawer-enter-active[data-v-832d304e],.drawer-leave-active[data-v-832d304e]{transition:transform .3s ease}.drawer-enter-from[data-v-832d304e],.drawer-leave-to[data-v-832d304e]{transform:translate(100%)}.list-enter-active[data-v-832d304e],.list-leave-active[data-v-832d304e]{transition:all .5s ease}.list-enter-from[data-v-832d304e],.list-leave-to[data-v-832d304e]{opacity:0;transform:translate(30px)}select option[data-v-832d304e]{padding:8px;margin:4px;border-radius:6px}select option[data-v-832d304e]:checked{background:linear-gradient(to right,#6366f180,#a855f780)!important;color:#fff!important}.dark select option[data-v-832d304e]:checked{background:linear-gradient(to right,#6366f1b3,#a855f7b3)!important}select option[data-v-832d304e]:hover{background-color:#6366f11a}.dark select option[data-v-832d304e]:hover{background-color:#6366f133}.custom-scrollbar[data-v-832d304e]{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.4) rgba(243,244,246,.3)}.custom-scrollbar[data-v-832d304e]::-webkit-scrollbar{width:8px;height:8px}.custom-scrollbar[data-v-832d304e]::-webkit-scrollbar-track{background:#f3f4f64d;border-radius:6px;margin:4px}.custom-scrollbar[data-v-832d304e]::-webkit-scrollbar-thumb{background:linear-gradient(135deg,#6366f199,#a855f799);border-radius:6px;border:1px solid rgba(255,255,255,.2);-webkit-transition:all .3s ease;transition:all .3s ease}.custom-scrollbar[data-v-832d304e]::-webkit-scrollbar-thumb:hover{background:linear-gradient(135deg,#6366f1cc,#a855f7cc);transform:scale(1.1)}.custom-scrollbar[data-v-832d304e]::-webkit-scrollbar-corner{background:transparent}.dark .custom-scrollbar[data-v-832d304e]{scrollbar-color:rgba(75,85,99,.6) rgba(31,41,55,.4)}.dark .custom-scrollbar[data-v-832d304e]::-webkit-scrollbar-track{background:#1f293766}.dark .custom-scrollbar[data-v-832d304e]::-webkit-scrollbar-thumb{background:linear-gradient(135deg,#6366f1b3,#a855f7b3);border:1px solid rgba(255,255,255,.1)}.dark .custom-scrollbar[data-v-832d304e]::-webkit-scrollbar-thumb:hover{background:linear-gradient(135deg,#6366f1e6,#a855f7e6)}
|
||||
@@ -1 +0,0 @@
|
||||
.border-progress-container[data-v-2fbf5085]{position:relative;width:100%;height:100%}.border-progress-canvas[data-v-2fbf5085]{position:absolute;top:0;left:0;width:100%;height:100%;transition:all .3s ease}.fade-enter-active[data-v-afcdcb37],.fade-leave-active[data-v-afcdcb37]{transition:opacity .3s ease,transform .3s ease}.fade-enter-from[data-v-afcdcb37],.fade-leave-to[data-v-afcdcb37]{opacity:0;transform:translateY(10px)}@media (min-width: 640px){.sm\:w-120[data-v-afcdcb37]{width:30rem}}.fade-enter-to[data-v-afcdcb37],.fade-leave-from[data-v-afcdcb37]{opacity:1;transform:translateY(0)}.drawer-enter-active[data-v-afcdcb37],.drawer-leave-active[data-v-afcdcb37]{transition:transform .3s ease}.drawer-enter-from[data-v-afcdcb37],.drawer-leave-to[data-v-afcdcb37]{transform:translate(100%)}.list-enter-active[data-v-afcdcb37],.list-leave-active[data-v-afcdcb37]{transition:all .5s ease}.list-enter-from[data-v-afcdcb37],.list-leave-to[data-v-afcdcb37]{opacity:0;transform:translate(30px)}select option[data-v-afcdcb37]{padding:8px;margin:4px;border-radius:6px}select option[data-v-afcdcb37]:checked{background:linear-gradient(to right,#6366f180,#a855f780)!important;color:#fff!important}.dark select option[data-v-afcdcb37]:checked{background:linear-gradient(to right,#6366f1b3,#a855f7b3)!important}select option[data-v-afcdcb37]:hover{background-color:#6366f11a}.dark select option[data-v-afcdcb37]:hover{background-color:#6366f133}
|
||||
@@ -1,26 +0,0 @@
|
||||
import{c as H,d as de,r as T,o as ue,w as ze,a as _,b as t,e as C,_ as ge,u as Te,f as Ae,g as f,n,h as r,i as $e,t as z,j as E,k as U,l as V,m as G,v as se,T as O,F as Q,p as De,q as ae,s as J,x as Ie,X as ne,y as Fe,z as Pe,A as L}from"./index-CL9mnhPI.js";import{u as je,S as le,C as Be,c as Re,a as Ue,Q as Ve,b as K,E as Le}from"./clipboard-DyBaoW_S.js";import{F as ie}from"./file-CeiRRIJG.js";import{T as He}from"./trash-Cr3Lyvdp.js";/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const X=H("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Ee=H("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Ne=H("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const We=H("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const qe=H("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),Ge=de({__name:"BorderProgressBar",props:{progress:{}},setup($){const S=$,F=T(null),s=T(null);let u=null;const w=()=>{if(!u||!s.value||!F.value)return;const g=F.value.clientWidth,h=F.value.clientHeight;s.value.width=g,s.value.height=h;const c=4,l=8;u.lineWidth=c;const x=u.createLinearGradient(0,0,g,h);x.addColorStop(0,"#4f46e5"),x.addColorStop(.5,"#7c3aed"),x.addColorStop(1,"#db2777"),u.strokeStyle="rgba(229, 231, 235, 0.2)",k(u,c/2,c/2,g-c,h-c,l),u.stroke();const y=((g+h)*2-8*l+2*Math.PI*l)*S.progress/100;u.strokeStyle=x,u.lineCap="round",u.lineJoin="round",u.beginPath();let i=y;const m=c/2,M=g-c,D=h-c;if(i>0){const p=Math.min(M-2*l,i);u.moveTo(l+m,m),u.lineTo(p+l+m,m),i-=p}if(i>0){const p=Math.min(Math.PI/2,i/l);u.arc(M-l+m,l+m,l,-Math.PI/2,p-Math.PI/2,!1),i-=p*l}if(i>0){const p=Math.min(D-2*l,i);u.lineTo(M+m,p+l+m),i-=p}if(i>0){const p=Math.min(Math.PI/2,i/l);u.arc(M-l+m,D-l+m,l,0,p,!1),i-=p*l}if(i>0){const p=Math.min(M-2*l,i);u.lineTo(M-p-l+m,D+m),i-=p}if(i>0){const p=Math.min(Math.PI/2,i/l);u.arc(l+m,D-l+m,l,Math.PI/2,Math.PI/2+p,!1),i-=p*l}if(i>0){const p=Math.min(D-2*l,i);u.lineTo(m,D-p-l+m),i-=p}if(i>0){const p=Math.min(Math.PI/2,i/l);u.arc(l+m,l+m,l,Math.PI,Math.PI+p,!1)}u.stroke()};function k(g,h,c,l,x,v){g.beginPath(),g.moveTo(h+v,c),g.lineTo(h+l-v,c),g.arcTo(h+l,c,h+l,c+v,v),g.lineTo(h+l,c+x-v),g.arcTo(h+l,c+x,h+l-v,c+x,v),g.lineTo(h+v,c+x),g.arcTo(h,c+x,h,c+x-v,v),g.lineTo(h,c+v),g.arcTo(h,c,h+v,c,v),g.closePath()}return ue(()=>{s.value&&(u=s.value.getContext("2d"),w())}),ze(()=>S.progress,w),(g,h)=>(C(),_("div",{class:"border-progress-container",ref_key:"container",ref:F},[t("canvas",{ref_key:"canvas",ref:s,class:"border-progress-canvas"},null,512)],512))}}),Oe=ge(Ge,[["__scopeId","data-v-2fbf5085"]]),ce=$=>$>=1024*1024*1024?Math.round($/(1024*1024*1024))+"GB":$>=1024*1024?Math.round($/(1024*1024))+"MB":Math.round($/1024)+"KB",Qe={class:"p-8"},Je={class:"flex justify-center space-x-4 mb-6"},Ke={key:"file",class:"grid grid-cols-1 gap-8"},Xe={key:0,class:"absolute inset-0 w-full h-full"},Ye={class:"block truncate"},Ze={key:"text",class:"grid grid-cols-1 gap-8"},et={key:0,class:"flex flex-col"},tt={class:"flex flex-col space-y-3"},rt={class:"relative flex-grow group"},ot=["placeholder"],st=["value"],at={type:"submit",class:"w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold py-4 px-6 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition-all duration-300 transform hover:scale-105 hover:shadow-lg relative overflow-hidden group"},nt={class:"relative z-10 flex items-center justify-center text-lg"},lt={class:"mt-6 text-center"},it={class:"flex-grow overflow-y-auto p-6"},ct={class:"flex-shrink-0 mr-4"},dt={class:"flex-grow min-w-0 mr-4"},ut={class:"flex-shrink-0 flex space-x-2"},gt=["onClick"],pt=["onClick"],ht=["onClick"],ft={key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-3 sm:p-4 overflow-y-auto"},mt={class:"flex items-center justify-between"},xt={class:"p-4 sm:p-6"},vt={class:"flex items-center mb-3 sm:mb-4"},yt={class:"ml-3 sm:ml-4 min-w-0 flex-1"},bt={class:"grid grid-cols-2 gap-3 sm:gap-4"},wt={class:"flex items-center min-w-0"},kt={class:"flex items-center min-w-0"},_t={class:"grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6"},Ct={class:"space-y-3 sm:space-y-4"},St={class:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl p-4 sm:p-5 text-white"},Mt={class:"flex items-center justify-between mb-3 sm:mb-4"},zt={class:"text-2xl sm:text-3xl font-bold tracking-wider text-center break-all"},Tt={class:"flex items-center justify-between mb-2 sm:mb-3"},At={class:"bg-white p-3 sm:p-4 rounded-lg shadow-sm mb-3 sm:mb-4"},$t=de({__name:"SendFileView",setup($){const S=JSON.parse(localStorage.getItem("config")||"{}"),F=Pe(),s=$e("isDarkMode"),u=je(),w=T("file"),k=T(null),g=T(""),h=T(null),c=T("day"),l=T("1"),x=T(0),v=T(!1),y=T(null),i=Te(),m=Ae(()=>u.shareData),M=T(""),D=()=>{h.value?.click()},p=async o=>{const e=o.target;if(e.files&&e.files.length>0){const d=e.files[0];if(k.value=d,!W())return;M.value=await N(d),console.log(M.value)}},pe=async o=>{if(o.dataTransfer?.files&&o.dataTransfer.files.length>0){const e=o.dataTransfer.files[0];if(k.value=e,!W())return;M.value=await N(e)}},he=async o=>{const e=o.clipboardData?.items;if(e)for(const d of e)if(d.kind==="file"){const a=d.getAsFile();if(a){if(a.size===0){i.showAlert("无法读取空文件","error");return}if(k.value=a,!W())return;try{M.value=await N(a),i.showAlert("已从剪贴板添加文件:"+a.name,"success")}catch(b){i.showAlert("文件处理失败","error"),console.error("File hash calculation failed:",b)}break}}else w.value="text",e[0].getAsString(a=>{g.value+=a})},N=async o=>new Promise(e=>{const a=new FileReader;let b=0;const P=Math.ceil(o.size/2097152);a.onload=async I=>{const B=new Uint8Array(I.target.resulLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{c as X,d as ae,u as oe,a as U,o as F,b as r,n,e as t,i as ne,t as M,r as P,f as Fe,w as Xe,_ as ge,g as E,C as Ze,h as se,j as K,k as We,l as S,m as Je,p as Ee,q as ee,P as J,s as Ke,F as we,v as te,T as ie,x as ke,y as de,z as Qe,A as Ye,B as Se,D as _e,E as ce,G as et,X as Ce,H as tt,I as rt,J as re}from"./index-DaP6hnmm.js";import{u as st,P as at,S as Me,C as ot,c as nt,a as lt,Q as it,b as ue}from"./PageHeader-Dda1k_N5.js";import{F as Ie}from"./file-C928Lhos.js";import{E as dt,T as ct}from"./trash-JuhqIjo3.js";import"./box-C2OkK29z.js";const ut=X("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const pe=X("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]);const pt=X("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const gt=X("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);const ht=X("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);const ft=X("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const vt=X("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),Te=A=>A>=1024*1024*1024?Math.round(A/(1024*1024*1024))+"GB":A>=1024*1024?Math.round(A/(1024*1024))+"MB":Math.round(A/1024)+"KB",mt={class:"flex justify-center space-x-4 mb-6"},yt=ae({__name:"SendTypeSelector",props:{selectedType:{}},emits:["update:selectedType"],setup(A,{emit:y}){const{t:I}=oe(),s=y,f=ne("isDarkMode"),p=_=>{s("update:selectedType",_)};return(_,h)=>(F(),U("div",mt,[r("button",{type:"button",onClick:h[0]||(h[0]=d=>p("file")),class:n(["px-4 py-2 rounded-lg transition-colors duration-300",_.selectedType==="file"?"bg-indigo-600 text-white":t(f)?"bg-gray-700 text-gray-300 hover:bg-gray-600":"bg-gray-200 text-gray-700 hover:bg-gray-300"])},M(t(I)("nav.sendFile")),3),r("button",{type:"button",onClick:h[1]||(h[1]=d=>p("text")),class:n(["px-4 py-2 rounded-lg transition-colors duration-300",_.selectedType==="text"?"bg-indigo-600 text-white":t(f)?"bg-gray-700 text-gray-300 hover:bg-gray-600":"bg-gray-200 text-gray-700 hover:bg-gray-300"])},M(t(I)("send.sendText")),3)]))}}),xt=ae({__name:"BorderProgressBar",props:{progress:{}},setup(A){const y=A,I=P(null),s=P(null);let f=null;const p=()=>{if(!f||!s.value||!I.value)return;const h=I.value.clientWidth,d=I.value.clientHeight;s.value.width=h,s.value.height=d;const c=4,o=8;f.lineWidth=c;const T=f.createLinearGradient(0,0,h,d);T.addColorStop(0,"#4f46e5"),T.addColorStop(.5,"#7c3aed"),T.addColorStop(1,"#db2777"),f.strokeStyle="rgba(229, 231, 235, 0.2)",_(f,c/2,c/2,h-c,d-c,o),f.stroke();const u=((h+d)*2-8*o+2*Math.PI*o)*y.progress/100;f.strokeStyle=T,f.lineCap="round",f.lineJoin="round",f.beginPath();let g=u;const C=c/2,$=h-c,V=d-c;if(g>0){const b=Math.min($-2*o,g);f.moveTo(o+C,C),f.lineTo(b+o+C,C),g-=b}if(g>0){const b=Math.min(Math.PI/2,g/o);f.arc($-o+C,o+C,o,-Math.PI/2,b-Math.PI/2,!1),g-=b*o}if(g>0){const b=Math.min(V-2*o,g);f.lineTo($+C,b+o+C),g-=b}if(g>0){const b=Math.min(Math.PI/2,g/o);f.arc($-o+C,V-o+C,o,0,b,!1),g-=b*o}if(g>0){const b=Math.min($-2*o,g);f.lineTo($-b-o+C,V+C),g-=b}if(g>0){const b=Math.min(Math.PI/2,g/o);f.arc(o+C,V-o+C,o,Math.PI/2,Math.PI/2+b,!1),g-=b*o}if(g>0){const b=Math.min(V-2*o,g);f.lineTo(C,V-b-o+C),g-=b}if(g>0){const b=Math.min(Math.PI/2,g/o);f.arc(o+C,o+C,o,Math.PI,Math.PI+b,!1)}f.stroke()};function _(h,d,c,o,T,x){h.beginPath(),h.moveTo(d+x,c),h.lineTo(d+o-x,c),h.arcTo(d+o,c,d+o,c+x,x),h.lineTo(d+o,c+T-x),h.arcTo(d+o,c+T,d+o-x,c+T,x),h.lineTo(d+x,c+T),h.arcTo(d,c+T,d,c+T-x,x),h.lineTo(d,c+x),h.arcTo(d,c,d+x,c,x),h.closePath()}return Fe(()=>{s.value&&(f=s.value.getContext("2d"),p())}),Xe(()=>y.progress,p),(h,d)=>(F(),U("div",{class:"border-progress-container",ref_key:"container",ref:I},[r("canvas",{ref_key:"canvas",ref:s,class:"border-progress-canvas"},null,512)],512))}}),bt=ge(xt,[["__scopeId","data-v-2fbf5085"]]),wt=["accept","disabled"],kt={key:0,class:"absolute inset-0 w-full h-full"},St={class:"block truncate"},_t={key:1,class:"mt-3 w-full"},Ct=ae({__name:"FileUploadArea",props:{selectedFile:{default:null},progress:{default:0},placeholder:{default:""},Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{d as B,u as F,r as h,p as z,a as m,o as b,b as e,t as l,e as o,n as s,i as A,x as d,z as g,A as x,y as w,D as k,j as _,Z as U,$ as P}from"./index-DaP6hnmm.js";const T={class:"p-6 h-screen overflow-y-auto custom-scrollbar"},E={class:"space-y-4"},N={class:"grid grid-cols-1 gap-6"},L={class:"space-y-2"},I={class:"space-y-2"},$={class:"space-y-2"},j={class:"relative"},K=["placeholder"],G={class:"text-xs"},W={class:"space-y-2"},R={class:"space-y-2"},H=["value"],Z={class:"space-y-2"},q={class:"grid grid-cols-1 gap-6 mt-8"},J={class:"space-y-2"},O={class:"space-y-2"},Q={class:"space-y-4"},X={class:"space-y-2"},Y=["placeholder"],ee={class:"space-y-4"},oe={class:"space-y-2"},te={value:"local"},re={value:"s3"},ae={value:"webdav"},se={key:0,class:"space-y-2"},ne={class:"flex items-center"},ie=["aria-checked"],le={key:1,class:"space-y-4"},de={class:"space-y-2"},ge=["placeholder"],ue={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ce={class:"space-y-2"},ye=["placeholder"],me={class:"space-y-2"},be=["placeholder"],pe={key:2,class:"space-y-4"},ve={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},he={class:"space-y-2"},xe={class:"space-y-2"},fe={class:"space-y-2"},_e={class:"space-y-2"},we={class:"space-y-2"},ke=["placeholder"],Ue={class:"space-y-2"},Ce={value:"s3v2"},Se={value:"s3v4"},Ve={class:"space-y-2"},De={class:"space-y-2"},Me={class:"flex items-center"},Be=["aria-checked"],Fe={class:"space-y-2"},ze={class:"flex items-center"},Ae=["aria-checked"],Pe={class:"mt-8"},Te={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Ee={class:"space-y-2"},Ne={class:"flex items-center space-x-2"},Le={class:"space-y-2"},Ie={class:"flex items-center space-x-2"},$e={class:"space-y-2"},je={class:"flex items-center space-x-2"},Ke={value:"KB"},Ge={value:"MB"},We={value:"GB"},Re={class:"space-y-2"},He={class:"flex flex-wrap gap-3"},Ze=["value"],qe={class:"space-y-2"},Je={class:"flex items-center space-x-2"},Oe={value:"秒"},Qe={value:"分"},Xe={value:"时"},Ye={value:"天"},eo={class:"space-y-2"},oo={class:"flex items-center"},to=["aria-checked"],ro={class:"mt-8"},ao={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},so={class:"space-y-2"},no={class:"flex items-center space-x-2"},io={class:"space-y-2"},lo={class:"flex items-center space-x-2"},go={class:"flex justify-end mt-8"},yo=B({__name:"SystemSettingsView",setup(uo){const n=A("isDarkMode"),{t:i}=F(),t=h({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,enableChunk:0,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:""}),p=h(1),v=h("MB"),c=h(1),y=h("天"),C=(u,a)=>u*{秒:1,分:60,时:3600,天:86400}[a],f=z(),S=async()=>{try{const u=await U.getConfig();if(u.code===200&&u.detail){t.value=u.detail;const a=t.value.uploadSize;a>=1024*1024*1024?(p.value=Math.round(a/(1024*1024*1024)),v.value="GB"):a>=1024*1024?(p.value=Math.round(a/(1024*1024)),v.value="MB"):(p.value=Math.round(a/1024),v.value="KB");const r=t.value.max_save_seconds;r===0?(c.value=7,y.value="天"):r%86400===0&&r>=86400?(c.value=r/86400,y.value="天"):r%3600===0&&r>=3600?(c.value=r/3600,y.value="时"):r%60===0&&r>=60?(c.value=r/60,y.value="分"):(c.value=r,y.value="秒")}}catch(u){const a=u instanceof Error?u.message:i("manage.systemSettings.getConfigFailed");f.showAlert(a,"error"),console.error("Failed to get system config:",u)}},V=(u,a)=>u*{KB:1024,MB:1048576,GB:1073741824}[a],D=()=>{const u={...t.value};u.uploadSize=V(p.value,v.value),c.value===0?u.max_save_seconds=7*86400:u.max_save_seconds=C(c.value,y.value),U.updateConfig(u).then(a=>{a.code==200?f.showAlert(i("manage.systemSettings.saveSuccess"),"success"):f.showAlert(a.message||i("manage.systemSettings.saveFailed"),"error")}).catch(a=>{const r=a instanceof Error?a.message:i("manage.systemSettings.saveFailed");f.showAlert(r,"error")})};return S(),(u,a)=>(b(),m("div",T,[e("h2",{class:s(["text-2xl font-bold mb-6",[o(n)?"text-white":"text-gray-800"]])},l(o(i)("admin.settings.title")),3),e("div",{class:s(["space-y-6 rounded-lg shadow-md p-6",[o(n)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[e("section",E,[e("h3",{class:s(["text-lg font-medium mb-4",[o(n)?"text-white":"text-gray-800"]])},l(o(i)("admin.settings.basicSettings")),3),e("div",N,[e("div",L,[e("label",{class:s(["block text-sm font-medium",[o(n)?"text-gray-300":"text-gray-700"]])},l(o(i)("admin.settings.siteName")),3),d(e("input",{type:"text","onUpdate:modelValue":a[0]||(a[0]=r=>t.value.name=r),class:s(["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",[o(n)?"bgLine truncated
|
||||
@@ -1 +0,0 @@
|
||||
import{d as B,r as m,u as M,a as c,b as e,n as a,h as n,i as F,m as l,v as i,p as x,F as w,q as _,l as h,t as y,A as k,M as A,e as b}from"./index-CL9mnhPI.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"},I={class:"space-y-2"},j={class:"relative"},G={class:"space-y-2"},N={class:"space-y-2"},R=["value"],L={class:"space-y-2"},$={class:"grid grid-cols-1 gap-6 mt-8"},P={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-2"},Y={class:"flex items-center"},Z=["aria-checked"],ee={key:1,class:"space-y-4"},oe={class:"space-y-2"},re={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},te={class:"space-y-2"},ae={class:"space-y-2"},se={key:2,class:"space-y-4"},ne={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},le={class:"space-y-2"},ie={class:"space-y-2"},de={class:"space-y-2"},ue={class:"space-y-2"},ge={class:"space-y-2"},ce={class:"space-y-2"},ye={class:"space-y-2"},be={class:"space-y-2"},pe={class:"flex items-center"},ve=["aria-checked"],me={class:"mt-8"},xe={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},he={class:"space-y-2"},fe={class:"flex items-center space-x-2"},we={class:"space-y-2"},_e={class:"flex items-center space-x-2"},ke={class:"space-y-2"},Ue={class:"flex items-center space-x-2"},Se={class:"space-y-2"},Ve={class:"flex flex-wrap gap-3"},Ce=["value"],De={class:"space-y-2"},Be={class:"flex items-center space-x-2"},Me={class:"space-y-2"},Fe={class:"flex items-center"},Ae=["aria-checked"],ze={class:"mt-8"},Ee={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Te={class:"space-y-2"},We={class:"flex items-center space-x-2"},Ke={class:"space-y-2"},Ie={class:"flex items-center space-x-2"},Ne=B({__name:"SystemSettingsView",setup(je){const s=F("isDarkMode"),t=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,enableChunk:0,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:""}),p=m(1),v=m("MB"),u=m(1),g=m("天"),U=(d,o)=>d*{秒:1,分:60,时:3600,天:86400}[o],S=()=>{k({url:"admin/config/get",method:"get"}).then(d=>{t.value=d.detail;const o=t.value.uploadSize;o>=1024*1024*1024?(p.value=Math.round(o/(1024*1024*1024)),v.value="GB"):o>=1024*1024?(p.value=Math.round(o/(1024*1024)),v.value="MB"):(p.value=Math.round(o/1024),v.value="KB");const r=t.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="秒")})},f=M(),V=(d,o)=>d*{KB:1024,MB:1048576,GB:1073741824}[o],C=()=>{const d={...t.value};d.uploadSize=V(p.value,v.value),u.value===0?d.max_save_seconds=7*86400:d.max_save_seconds=U(u.value,g.value),k({url:"admin/config/update",method:"patch",data:d}).then(o=>{o.code==200?f.showAlert("保存成功","success"):f.showAlert(o.message,"error")})};return S(),(d,o)=>(b(),c("div",z,[e("h2",{class:a(["text-2xl font-bold mb-6",[n(s)?"text-white":"text-gray-800"]])}," 系统设置 ",2),e("div",{class:a(["space-y-6 rounded-lg shadow-md p-6",[n(s)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[e("section",E,[e("h3",{class:a(["text-lg font-medium mb-4",[n(s)?"text-white":"text-gray-800"]])}," 基本设置 ",2),e("div",T,[e("div",W,[e("label",{class:a(["block text-sm font-medium",[n(s)?"text-gray-300":"text-gray-700"]])}," 网站名称 ",2),l(e("input",{type:"text","onUpdate:modelValue":o[0]||(o[0]=r=>t.value.name=r),class:a(["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",[n(s)?"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,t.value.name]])]),e("div",K,[e("label",{class:a(["block text-sm font-medium",[n(s)?"text-gray-300":"text-gray-700"]])}," 网站描述 ",2),l(e("input",{type:"text","onUpdate:modelValue":o[1]||(o[1]=r=>t.value.description=r),class:a(["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",[n(s)?"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,t.value.description]])]),e("div",I,[e("label",{class:a(["block text-sm font-medium",[n(s)?"text-gray-300":"text-gray-70Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{c as a}from"./index-DaP6hnmm.js";const e=a("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);export{e as B};
|
||||
@@ -1,6 +0,0 @@
|
||||
import{c as a}from"./index-CL9mnhPI.js";/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const e=a("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);export{e as B};
|
||||
@@ -1,21 +0,0 @@
|
||||
import{c as F,d as Q,D as R,r as _,E as $,o as X,F as Z,G as j,H as Y,u as ee}from"./index-CL9mnhPI.js";/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const se=F("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const le=F("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const ue=F("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/*!
|
||||
* qrcode.vue v3.6.0
|
||||
* A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3
|
||||
* © 2017-PRESENT @scopewu(https://github.com/scopewu)
|
||||
* MIT License.
|
||||
*/var N=function(){return N=Object.assign||function(c){for(var u,l=1,f=arguments.length;l<f;l++){u=arguments[l];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(c[d]=u[d])}return c},N.apply(this,arguments)};var I;(function(o){var c=function(){function a(e,t,r,n){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],e<a.MIN_VERSION||e>a.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=e*4+17;for(var i=[],s=0;s<this.size;s++)i.push(!1);for(var s=0;s<this.size;s++)this.modules.push(i.slice()),this.isFunction.push(i.slice());this.drawFunctionPatterns();var h=this.addEccAndInterleave(r);if(this.drawCodewords(h),n==-1)for(var g=1e9,s=0;s<8;s++){this.applyMask(s),this.drawFormatBits(s);var p=this.getPenaltyScore();p<g&&(n=s,g=p),this.applyMask(s)}f(0<=n&&n<=7),this.mask=n,this.applyMask(n),this.drawFormatBits(n),this.isFunction=[]}return a.encodeText=function(e,t){var r=o.QrSegment.makeSegments(e);return a.encodeSegments(r,t)},a.encodeBinary=function(e,t){var r=o.QrSegment.makeBytes(e);return a.encodeSegments([r],t)},a.encodeSegments=function(e,t,r,n,i,s){if(r===void 0&&(r=1),n===void 0&&(n=40),i===void 0&&(i=-1),s===void 0&&(s=!0),!(a.MIN_VERSION<=r&&r<=n&&n<=a.MAX_VERSION)||i<-1||i>7)throw new RangeError("Invalid value");var h,g;for(h=r;;h++){var p=a.getNumDataCodewords(h,t)*8,w=d.getTotalBits(e,h);if(w<=p){g=w;break}if(h>=n)throw new RangeError("Data too long")}for(var C=0,M=[a.Ecc.MEDIUM,a.Ecc.QUARTILE,a.Ecc.HIGH];C<M.length;C++){var m=M[C];s&&g<=a.getNumDataCodewords(h,m)*8&&(t=m)}for(var v=[],E=0,S=e;E<S.length;E++){var y=S[E];u(y.mode.modeBits,4,v),u(y.numChars,y.mode.numCharCountBits(h),v);for(var P=0,A=y.getData();P<A.length;P++){var O=A[P];v.push(O)}}f(v.length==g);var T=a.getNumDataCodewords(h,t)*8;f(v.length<=T),u(0,Math.min(4,T-v.length),v),u(0,(8-v.length%8)%8,v),f(v.length%8==0);for(var b=236;v.length<T;b^=253)u(b,8,v);for(var z=[];z.length*8<v.length;)z.push(0);return v.forEach(function(k,L){return z[L>>>3]|=k<<7-(L&7)}),new a(h,t,z,i)},a.prototype.getModule=function(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]},a.prototype.getModules=function(){return this.modules},a.prototype.drawFunctionPatterns=function(){for(var e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);for(var t=this.getAlignmentPatternPositions(),r=t.length,e=0;e<r;e++)for(var n=0;n<r;n++)e==0&&n==0||e==0&&n==r-1||e==r-1&&n==0||this.drawAlignmentPattern(t[e],t[n]);this.drawFormatBits(0),this.drawVersion()},a.prototype.drawFormatBits=function(e){for(var t=this.errorCorrectionLevel.formatBits<<3|e,r=t,n=0;n<10;n++)r=r<<1^(r>>>9)*1335;var i=(t<<10|r)^21522;f(i>>>15==0);for(var n=0;n<=5;n++)this.setFunctionModule(8,n,l(i,n));this.setFunctionModule(8,7,l(i,6)),this.setFunctionModule(8,8,l(i,7)),this.setFunctionModule(7,8,l(i,8));for(var n=9;n<15;n++)this.setFunctionModule(14-n,8,l(i,n));for(var n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,l(i,n));for(var n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,l(i,n));this.setFunctionModule(8,this.size-8,!0)},a.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^(e>>>11)*7973;var r=this.version<<12|e;f(r>>>18==0);for(var t=0;t<18;t++){var n=l(r,t),i=this.size-11+t%3,s=Math.floor(t/3);this.setFunctionModule(i,s,n),this.setFunctionModule(s,i,n)}}},a.prototype.drawFinderPattern=function(e,t){for(var r=-4;r<=4;r++)for(var n=-4;n<=4;n++){var i=Math.max(Math.abs(n),Math.abs(r)),s=e+n,h=t+r;0<=s&&s<this.size&&0<=h&&h<this.size&&this.setFunctionModule(s,h,i!=2&&i!=4)}},a.prototype.drawAlignmentPattern=function(e,t){for(var r=-2;r<=2;r++)for(var n=-2;n<=2;n++)this.setFunctionModule(e+n,t+r,Math.max(Math.abs(n),Math.abs(r))!=1)},a.prototype.setFunctionModule=function(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0},a.prototype.addEccAndInterleave=function(e){var t=this.version,r=this.errorCorrectionLevel;if(e.length!=a.getNumDataCodewords(t,r))throw new RangeError("Invalid argument");for(var n=a.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t],i=a.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t],s=Math.floor(a.getNumRawDataModules(t)/8),h=n-s%n,g=Math.floor(s/n),p=[],w=a.reedSolomonComputeDivisor(i),C=0,M=0;C<n;C++){var m=e.slice(M,M+g-i+(C<h?0:1));M+=m.length;var v=a.reedSolomonComputeRemainder(m,w);C<h&&m.push(0),p.push(m.concat(v))}for(var E=[],S=function(y){p.forEach(function(P,A){(y!=g-i||A>=h)&&E.push(P[y])})},C=0;C<p[0].length;C++)S(C);return f(E.length==s),E},a.prototype.drawCodewords=function(e){if(e.length!=Math.floor(a.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");for(var t=0,r=this.size-1;r>=1;r-=2){r==6&&(r=5);for(var n=0;n<this.size;n++)for(var i=0;i<2;i++){var s=r-i,h=(r+1&2)==0,g=h?this.size-1-n:n;!this.isFunction[g][s]&&t<e.lengLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{c}from"./index-DaP6hnmm.js";const t=c("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);export{t as C};
|
||||
@@ -0,0 +1 @@
|
||||
import{c as a}from"./index-DaP6hnmm.js";const t=a("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);export{t as F};
|
||||
@@ -1,6 +0,0 @@
|
||||
import{c as a}from"./index-CL9mnhPI.js";/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const t=a("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);export{t as F};
|
||||
@@ -0,0 +1 @@
|
||||
import{c as e}from"./index-DaP6hnmm.js";const a=e("hard-drive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);export{a as H};
|
||||
@@ -1,6 +0,0 @@
|
||||
import{c as e}from"./index-CL9mnhPI.js";/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const a=e("hard-drive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);export{a as H};
|
||||
@@ -0,0 +1 @@
|
||||
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768Line truncated
|
||||
@@ -1,86 +0,0 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SendFileView-DMM0PLHF.js","assets/clipboard-DyBaoW_S.js","assets/file-CeiRRIJG.js","assets/trash-Cr3Lyvdp.js","assets/SendFileView-D4zqltAp.css","assets/RetrievewFileView-xI-OMrlb.js","assets/box-rSyVX8Lw.js","assets/hard-drive-D-zf5eAT.js","assets/RetrievewFileView-CVaCMBkW.css","assets/AdminLayout-BU4M1K3d.js","assets/AdminLayout-BTROkEoU.css","assets/DashboardView-IVJO4iyD.js","assets/FileManageView-CFq3Itls.js","assets/FileManageView-DrjnVkAt.css","assets/LoginView-DLf5se-S.js","assets/LoginView-CUDwFSJJ.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.18
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**//*! #__NO_SIDE_EFFECTS__ */function Nr(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ce={},Qt=[],rt=()=>{},$c=()=>!1,vs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Mr=e=>e.startsWith("onUpdate:"),ge=Object.assign,kr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Uc=Object.prototype.hasOwnProperty,se=(e,t)=>Uc.call(e,t),$=Array.isArray,Yt=e=>$n(e)==="[object Map]",cn=e=>$n(e)==="[object Set]",co=e=>$n(e)==="[object Date]",K=e=>typeof e=="function",de=e=>typeof e=="string",ot=e=>typeof e=="symbol",oe=e=>e!==null&&typeof e=="object",Ti=e=>(oe(e)||K(e))&&K(e.then)&&K(e.catch),Oi=Object.prototype.toString,$n=e=>Oi.call(e),Hc=e=>$n(e).slice(8,-1),Pi=e=>$n(e)==="[object Object]",Ir=e=>de(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bn=Nr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Es=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Vc=/-(\w)/g,Ve=Es(e=>e.replace(Vc,(t,n)=>n?n.toUpperCase():"")),qc=/\B([A-Z])/g,Pt=Es(e=>e.replace(qc,"-$1").toLowerCase()),Ss=Es(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ks=Es(e=>e?`on${Ss(e)}`:""),At=(e,t)=>!Object.is(e,t),ns=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ur=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},cs=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Kc=e=>{const t=de(e)?Number(e):NaN;return isNaN(t)?e:t};let ao;const xs=()=>ao||(ao=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Rs(e){if($(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=de(s)?Gc(s):Rs(s);if(r)for(const o in r)t[o]=r[o]}return t}else if(de(e)||oe(e))return e}const Wc=/;(?![^(]*\))/g,zc=/:([^]+)/,Jc=/\/\*[^]*?\*\//g;function Gc(e){const t={};return e.replace(Jc,"").split(Wc).forEach(n=>{if(n){const s=n.split(zc);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function an(e){let t="";if(de(e))t=e;else if($(e))for(let n=0;n<e.length;n++){const s=an(e[n]);s&&(t+=s+" ")}else if(oe(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Xc="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Qc=Nr(Xc);function Li(e){return!!e||e===""}function Yc(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Un(e[s],t[s]);return n}function Un(e,t){if(e===t)return!0;let n=co(e),s=co(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=ot(e),s=ot(t),n||s)return e===t;if(n=$(e),s=$(t),n||s)return n&&s?Yc(e,t):!1;if(n=oe(e),s=oe(t),n||s){if(!n||!s)return!1;const r=Object.keys(e).length,o=Object.keys(t).length;if(r!==o)return!1;for(const i in e){const l=e.hasOwnProperty(i),c=t.hasOwnProperty(i);if(l&&!c||!l&&c||!Un(e[i],t[i]))return!1}}return String(e)===String(t)}function Fr(e,t){return e.findIndex(n=>Un(n,t))}const Ni=e=>!!(e&&e.__v_isRef===!0),Mi=e=>de(e)?e:e==null?"":$(e)||oe(e)&&(e.toString===Oi||!K(e.toString))?Ni(e)?Mi(e.value):JSON.stringify(e,ki,2):String(e),ki=(e,t)=>Ni(t)?ki(e,t.value):Yt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],o)=>(n[Ws(s,o)+" =>"]=r,n),{})}:cn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Ws(n))}:ot(t)?Ws(t):oe(t)&&!$(t)&&!Pi(t)?String(t):t,Ws=(e,t="")=>{var n;return ot(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
||||
* @vue/reactivity v3.5.18
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/let be;class Ii{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=be,!t&&be&&(this.index=(be.scopes||(be.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=be;try{return be=this,t()}finally{be=n}}}on(){++this._on===1&&(this.prevScope=be,be=this)}off(){this._on>0&&--this._on===0&&(be=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Fi(e){return new Ii(e)}function Di(){return be}function Zc(e,t=!1){be&&be.cleanups.push(e)}let ue;const zs=new WeakSet;class ji{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,be&&be.active&&be.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,zs.has(this)&&(zs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||$i(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,uo(this),Ui(this);const t=ue,n=Ke;ue=this,Ke=!0;try{return this.fn()}finally{Hi(this),ue=t,Ke=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Br(t);this.deps=this.depsTail=void 0,uo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?zs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){fr(this)&&this.run()}get dirty(){return fr(this)}}let Bi=0,_n,wn;function $i(e,t=!1){if(e.flags|=8,t){e.next=wn,wn=e;return}e.next=_n,_n=e}function Dr(){Bi++}function jr(){if(--Bi>0)return;if(wn){let t=wn;for(wn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;_n;){let t=_n;for(_n=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Ui(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Hi(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),Br(s),ea(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function fr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Vi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Vi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===On)||(e.globalVersion=On,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!fr(e))))return;e.flags|=2;const t=e.dep,n=ue,s=Ke;ue=e,Ke=!0;try{Ui(e);const r=e.fn(e._value);(t.version===0||At(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{ue=n,Ke=s,Hi(e),e.flags&=-3}}function Br(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)Br(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ea(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ke=!0;const qi=[];function pt(){qi.push(Ke),Ke=!1}function mt(){const e=qi.pop();Ke=e===void 0?!0:e}function uo(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ue;ue=void 0;try{t()}finally{ue=n}}}let On=0;class ta{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class $r{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ue||!Ke||ue===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ue)n=this.activeLink=new ta(ue,this),ue.deps?(n.prevDep=ue.depsTail,ue.depsTail.nextDep=n,ue.depsTail=n):ue.deps=ue.depsTail=n,Ki(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=ue.depsTail,n.nextDep=void 0,ue.depsTail.nextDep=n,ue.depsTail=n,ue.deps===n&&(ue.deps=s)}return n}trigger(t){this.version++,On++,this.notify(t)}notify(t){Dr();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{jr()}}}functiLine truncated
|
||||
* @vue/runtime-core v3.5.18
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/function Vn(e,t,n,s){try{return s?e(...s):e()}catch(r){As(r,t,n)}}function We(e,t,n,s){if(K(e)){const r=Vn(e,t,n,s);return r&&Ti(r)&&r.catch(o=>{As(o,t,n)}),r}if($(e)){const r=[];for(let o=0;o<e.length;o++)r.push(We(e[o],t,n,s));return r}}function As(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||ce;if(t){let l=t.parent;const c=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const a=l.ec;if(a){for(let f=0;f<a.length;f++)if(a[f](e,c,u)===!1)return}l=l.parent}if(o){pt(),Vn(o,null,10,[e,c,u]),mt();return}}Pa(e,n,r,s,i)}function Pa(e,t,n,s=!0,r=!1){if(r)throw e;console.error(e)}const xe=[];let nt=-1;const Zt=[];let Et=null,Gt=0;const sl=Promise.resolve();let ds=null;function Ts(e){const t=ds||sl;return e?t.then(this?e.bind(this):e):t}function La(e){let t=nt+1,n=xe.length;for(;t<n;){const s=t+n>>>1,r=xe[s],o=Ln(r);o<e||o===e&&r.flags&2?t=s+1:n=s}return t}function Kr(e){if(!(e.flags&1)){const t=Ln(e),n=xe[xe.length-1];!n||!(e.flags&2)&&t>=Ln(n)?xe.push(e):xe.splice(La(t),0,e),e.flags|=1,rl()}}function rl(){ds||(ds=sl.then(il))}function Na(e){$(e)?Zt.push(...e):Et&&e.id===-1?Et.splice(Gt+1,0,e):e.flags&1||(Zt.push(e),e.flags|=1),rl()}function ho(e,t,n=nt+1){for(;n<xe.length;n++){const s=xe[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;xe.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function ol(e){if(Zt.length){const t=[...new Set(Zt)].sort((n,s)=>Ln(n)-Ln(s));if(Zt.length=0,Et){Et.push(...t);return}for(Et=t,Gt=0;Gt<Et.length;Gt++){const n=Et[Gt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Et=null,Gt=0}}const Ln=e=>e.id==null?e.flags&2?-1:1/0:e.id;function il(e){try{for(nt=0;nt<xe.length;nt++){const t=xe[nt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Vn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;nt<xe.length;nt++){const t=xe[nt];t&&(t.flags&=-2)}nt=-1,xe.length=0,ol(),ds=null,(xe.length||Zt.length)&&il()}}let De=null,ll=null;function hs(e){const t=De;return De=e,ll=e&&e.type.__scopeId||null,t}function ps(e,t=De,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&xo(-1);const o=hs(t);let i;try{i=e(...r)}finally{hs(o),s._d&&xo(1)}return i};return s._n=!0,s._c=!0,s._d=!0,s}function Up(e,t){if(De===null)return e;const n=Is(De),s=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[o,i,l,c=ce]=t[r];o&&(K(o)&&(o={mounted:o,updated:o}),o.deep&&ft(i),s.push({dir:o,instance:n,value:i,oldValue:void 0,arg:l,modifiers:c}))}return e}function Lt(e,t,n,s){const r=e.dirs,o=t&&t.dirs;for(let i=0;i<r.length;i++){const l=r[i];o&&(l.oldValue=o[i].value);let c=l.dir[s];c&&(pt(),We(c,n,8,[e.el,l,e,t]),mt())}}const Ma=Symbol("_vte"),cl=e=>e.__isTeleport,St=Symbol("_leaveCb"),es=Symbol("_enterCb");function al(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ls(()=>{e.isMounted=!0}),yl(()=>{e.isUnmounting=!0}),e}const $e=[Function,Array],ul={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:$e,onEnter:$e,onAfterEnter:$e,onEnterCancelled:$e,onBeforeLeave:$e,onLeave:$e,onAfterLeave:$e,onLeaveCancelled:$e,onBeforeAppear:$e,onAppear:$e,onAfterAppear:$e,onAppearCancelled:$e},fl=e=>{const t=e.subTree;return t.component?fl(t.component):t},ka={name:"BaseTransition",props:ul,setup(e,{slots:t}){const n=ks(),s=al();return()=>{const r=t.default&&Wr(t.default(),!0);if(!r||!r.length)return;const o=dl(r),i=Q(e),{mode:l}=i;if(s.isLeaving)return Xs(o);const c=po(o);if(!c)return Xs(o);let u=Nn(c,i,s,n,f=>u=f);c.type!==Re&&Ht(c,u);let a=n.subTree&&po(n.subTree);if(a&&a.type!==Re&&!Ft(c,a)&&fl(n).type!==Re){let f=Nn(a,i,s,n);if(Ht(a,f),l==="out-in"&&c.type!==Re)return s.isLeaving=!0,f.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,a=void 0},Xs(o);l==="in-out"&&c.type!==Re?f.delayLeave=(p,m,y)=>{const _=hl(s,a);_[String(a.key)]=a,p[St]=()=>{m(),p[St]=void 0,delete u.delayedLeave,a=void 0},u.delayedLeave=()=>{y(),delete u.delayedLeave,a=void 0}}:a=void 0}else a&&(a=void 0);return o}}};function dl(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Re){t=n;break}}return t}const Ia=ka;function hl(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Nn(e,t,n,s,r){const{appear:o,mode:i,persisted:l=!1,onBeforeEnter:c,onEnter:u,onAfterEnter:a,onEnterCancelled:f,onBeforeLeave:p,onLeave:m,onAfterLeave:y,onLeaveCancelled:_,onBeforeAppear:x,onAppear:T,onAfterAppear:C,onAppearCancelled:P}=t,L=String(e.key),j=hl(n,e),X=(M,W)=>{M&&We(M,s,9,W)},z=(M,W)=>{const ee=W[1];X(M,W),$(M)?M.every(F=>F.length<=1)&&ee():M.length<=1&&ee()},V={mode:i,persisted:l,beforeEnter(M){let W=c;if(!n.isMounted)if(o)W=x||c;else return;M[St]&&M[St](!0);const ee=j[L];ee&&Ft(e,ee)&&ee.el[St]&&ee.el[St](),X(W,[M])},enter(M){let W=u,ee=a,F=f;if(!n.isMounted)if(o)W=T||u,ee=C||a,F=P||f;else return;let Y=!1;const pe=M[es]=Ee=>{Y||(Y=!0,Ee?X(F,[M]):X(ee,[M]),V.delayedLeave&&V.delayedLeave(),M[es]=void 0)};W?z(W,[M,pe]):pe()},leave(M,W){const Line truncated
|
||||
* @vue/runtime-dom v3.5.18
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/let _r;const Ao=typeof window<"u"&&window.trustedTypes;if(Ao)try{_r=Ao.createPolicy("vue",{createHTML:e=>e})}catch{}const Hl=_r?e=>_r.createHTML(e):e=>e,ju="http://www.w3.org/2000/svg",Bu="http://www.w3.org/1998/Math/MathML",at=typeof document<"u"?document:null,To=at&&at.createElement("template"),$u={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?at.createElementNS(ju,e):t==="mathml"?at.createElementNS(Bu,e):n?at.createElement(e,{is:n}):at.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>at.createTextNode(e),createComment:e=>at.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>at.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{To.innerHTML=Hl(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=To.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},bt="transition",pn="animation",sn=Symbol("_vtc"),Vl={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},ql=ge({},ul,Vl),Uu=e=>(e.displayName="Transition",e.props=ql,e),Hu=Uu((e,{slots:t})=>nn(Ia,Kl(e),t)),Mt=(e,t=[])=>{$(e)?e.forEach(n=>n(...t)):e&&e(...t)},Oo=e=>e?$(e)?e.some(t=>t.length>1):e.length>1:!1;function Kl(e){const t={};for(const F in e)F in Vl||(t[F]=e[F]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=o,appearActiveClass:u=i,appearToClass:a=l,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,y=Vu(r),_=y&&y[0],x=y&&y[1],{onBeforeEnter:T,onEnter:C,onEnterCancelled:P,onLeave:L,onLeaveCancelled:j,onBeforeAppear:X=T,onAppear:z=C,onAppearCancelled:V=P}=t,M=(F,Y,pe,Ee)=>{F._enterCancelled=Ee,wt(F,Y?a:l),wt(F,Y?u:i),pe&&pe()},W=(F,Y)=>{F._isLeaving=!1,wt(F,f),wt(F,m),wt(F,p),Y&&Y()},ee=F=>(Y,pe)=>{const Ee=F?z:C,ie=()=>M(Y,F,pe);Mt(Ee,[Y,ie]),Po(()=>{wt(Y,F?c:o),tt(Y,F?a:l),Oo(Ee)||Lo(Y,s,_,ie)})};return ge(t,{onBeforeEnter(F){Mt(T,[F]),tt(F,o),tt(F,i)},onBeforeAppear(F){Mt(X,[F]),tt(F,c),tt(F,u)},onEnter:ee(!1),onAppear:ee(!0),onLeave(F,Y){F._isLeaving=!0;const pe=()=>W(F,Y);tt(F,f),F._enterCancelled?(tt(F,p),wr()):(wr(),tt(F,p)),Po(()=>{F._isLeaving&&(wt(F,f),tt(F,m),Oo(L)||Lo(F,s,x,pe))}),Mt(L,[F,pe])},onEnterCancelled(F){M(F,!1,void 0,!0),Mt(P,[F])},onAppearCancelled(F){M(F,!0,void 0,!0),Mt(V,[F])},onLeaveCancelled(F){W(F),Mt(j,[F])}})}function Vu(e){if(e==null)return null;if(oe(e))return[er(e.enter),er(e.leave)];{const t=er(e);return[t,t]}}function er(e){return Kc(e)}function tt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[sn]||(e[sn]=new Set)).add(t)}function wt(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[sn];n&&(n.delete(t),n.size||(e[sn]=void 0))}function Po(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let qu=0;function Lo(e,t,n,s){const r=e._endId=++qu,o=()=>{r===e._endId&&s()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:l,propCount:c}=Wl(e,t);if(!i)return s();const u=i+"end";let a=0;const f=()=>{e.removeEventListener(u,p),o()},p=m=>{m.target===e&&++a>=c&&f()};setTimeout(()=>{a<c&&f()},l+1),e.addEventListener(u,p)}function Wl(e,t){const n=window.getComputedStyle(e),s=y=>(n[y]||"").split(", "),r=s(`${bt}Delay`),o=s(`${bt}Duration`),i=No(r,o),l=s(`${pn}Delay`),c=s(`${pn}Duration`),u=No(l,c);let a=null,f=0,p=0;t===bt?i>0&&(a=bt,f=i,p=o.length):t===pn?u>0&&(a=pn,f=u,p=c.length):(f=Math.max(i,u),a=f>0?i>u?bt:pn:null,p=a?a===bt?o.length:c.length:0);const m=a===bt&&/\b(transform|all)(,|$)/.test(s(`${bt}Property`).toString());return{type:a,timeout:f,propCount:p,hasTransform:m}}function No(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Mo(n)+Mo(e[s])))}function Mo(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function wr(){return document.body.offsetHeight}function Ku(e,t,n){const s=e[sn];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ko=Symbol("_vod"),Wu=Symbol("_vsh"),zu=Symbol(""),Ju=/(^|;)\s*display\s*:/;function Gu(e,t,n){const s=e.style,r=de(n);let o=!1;if(n&&!r){if(t)if(de(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOLine truncated
|
||||
* pinia v3.0.3
|
||||
* (c) 2025 Eduardo San Martin Morote
|
||||
* @license MIT
|
||||
*/let Xl;const Fs=e=>Xl=e,Ql=Symbol();function vr(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Cn;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Cn||(Cn={}));function Sf(){const e=Fi(!0),t=e.run(()=>en({}));let n=[],s=[];const r=qr({install(o){Fs(r),r._a=o,o.provide(Ql,r),o.config.globalProperties.$pinia=r,s.forEach(i=>n.push(i)),s=[]},use(o){return this._a?n.push(o):s.push(o),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}const Yl=()=>{};function Jo(e,t,n,s=Yl){e.push(t);const r=()=>{const o=e.indexOf(t);o>-1&&(e.splice(o,1),s())};return!n&&Di()&&Zc(r),r}function Jt(e,...t){e.slice().forEach(n=>{n(...t)})}const xf=e=>e(),Go=Symbol(),sr=Symbol();function Er(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,s)=>e.set(s,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],r=e[n];vr(r)&&vr(s)&&e.hasOwnProperty(n)&&!fe(s)&&!dt(s)?e[n]=Er(r,s):e[n]=s}return e}const Rf=Symbol();function Cf(e){return!vr(e)||!Object.prototype.hasOwnProperty.call(e,Rf)}const{assign:vt}=Object;function Af(e){return!!(fe(e)&&e.effect)}function Tf(e,t,n,s){const{state:r,actions:o,getters:i}=t,l=n.state.value[e];let c;function u(){l||(n.state.value[e]=r?r():{});const a=Ea(n.state.value[e]);return vt(a,o,Object.keys(i||{}).reduce((f,p)=>(f[p]=qr(Fe(()=>{Fs(n);const m=n._s.get(e);return i[p].call(m,m)})),f),{}))}return c=Zl(e,u,t,n,s,!0),c}function Zl(e,t,n={},s,r,o){let i;const l=vt({actions:{}},n),c={deep:!0};let u,a,f=[],p=[],m;const y=s.state.value[e];!o&&!y&&(s.state.value[e]={}),en({});let _;function x(V){let M;u=a=!1,typeof V=="function"?(V(s.state.value[e]),M={type:Cn.patchFunction,storeId:e,events:m}):(Er(s.state.value[e],V),M={type:Cn.patchObject,payload:V,storeId:e,events:m});const W=_=Symbol();Ts().then(()=>{_===W&&(u=!0)}),a=!0,Jt(f,M,s.state.value[e])}const T=o?function(){const{state:M}=n,W=M?M():{};this.$patch(ee=>{vt(ee,W)})}:Yl;function C(){i.stop(),f=[],p=[],s._s.delete(e)}const P=(V,M="")=>{if(Go in V)return V[sr]=M,V;const W=function(){Fs(s);const ee=Array.from(arguments),F=[],Y=[];function pe(G){F.push(G)}function Ee(G){Y.push(G)}Jt(p,{args:ee,name:W[sr],store:j,after:pe,onError:Ee});let ie;try{ie=V.apply(this&&this.$id===e?this:j,ee)}catch(G){throw Jt(Y,G),G}return ie instanceof Promise?ie.then(G=>(Jt(F,G),G)).catch(G=>(Jt(Y,G),Promise.reject(G))):(Jt(F,ie),ie)};return W[Go]=!0,W[sr]=M,W},L={_p:s,$id:e,$onAction:Jo.bind(null,p),$patch:x,$reset:T,$subscribe(V,M={}){const W=Jo(f,V,M.detached,()=>ee()),ee=i.run(()=>xn(()=>s.state.value[e],F=>{(M.flush==="sync"?a:u)&&V({storeId:e,type:Cn.direct,events:m},F)},vt({},c,M)));return W},$dispose:C},j=Hn(L);s._s.set(e,j);const z=(s._a&&s._a.runWithContext||xf)(()=>s._e.run(()=>(i=Fi()).run(()=>t({action:P}))));for(const V in z){const M=z[V];if(fe(M)&&!Af(M)||dt(M))o||(y&&Cf(M)&&(fe(M)?M.value=y[V]:Er(M,y[V])),s.state.value[e][V]=M);else if(typeof M=="function"){const W=P(M,V);z[V]=W,l.actions[V]=M}}return vt(j,z),vt(Q(j),z),Object.defineProperty(j,"$state",{get:()=>s.state.value[e],set:V=>{x(M=>{vt(M,V)})}}),s._p.forEach(V=>{vt(j,i.run(()=>V({store:j,app:s._a,pinia:s,options:l})))}),y&&o&&n.hydrate&&n.hydrate(j.$state,y),u=!0,a=!0,j}/*! #__NO_SIDE_EFFECTS__ */function Of(e,t,n){let s;const r=typeof t=="function";s=r?n:t;function o(i,l){const c=eu();return i=i||(c?Pe(Ql,null):null),i&&Fs(i),i=Xl,i._s.has(e)||(r?Zl(e,t,s,i):Tf(e,s,i)),i._s.get(e)}return o.$id=e,o}function Pf(e){const t=Q(e),n={};for(const s in t){const r=t[s];r.effect?n[s]=Fe({get:()=>e[s],set(o){e[s]=o}}):(fe(r)||dt(r))&&(n[s]=Ra(e,s))}return n}/*!
|
||||
* vue-router v4.5.1
|
||||
* (c) 2025 Eduardo San Martin Morote
|
||||
* @license MIT
|
||||
*/const Xt=typeof document<"u";function ec(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Lf(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&ec(e.default)}const ne=Object.assign;function rr(e,t){const n={};for(const s in t){const r=t[s];n[s]=ze(r)?r.map(e):e(r)}return n}const An=()=>{},ze=Array.isArray,tc=/#/g,Nf=/&/g,Mf=/\//g,kf=/=/g,If=/\?/g,nc=/\+/g,Ff=/%5B/g,Df=/%5D/g,sc=/%5E/g,jf=/%60/g,rc=/%7B/g,Bf=/%7C/g,oc=/%7D/g,$f=/%20/g;function Yr(e){return encodeURI(""+e).replace(Bf,"|").replace(Ff,"[").replace(Df,"]")}function Uf(e){return Yr(e).replace(rc,"{").replace(oc,"}").replace(sc,"^")}function Sr(e){return Yr(e).replace(nc,"%2B").replace($f,"+").replace(tc,"%23").replace(Nf,"%26").replace(jf,"`").replace(rc,"{").replace(oc,"}").replace(sc,"^")}function Hf(e){return Sr(e).replace(kf,"%3D")}function Vf(e){return Yr(e).replace(tc,"%23").replace(If,"%3F")}function qf(e){return e==null?"":Vf(e).replace(Mf,"%2F")}function Dn(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const Kf=/\/$/,Wf=e=>e.replace(Kf,"");function or(e,t,n="/"){let s,r={},o="",i="";const l=t.indexOf("#");let c=t.indexOf("?");return l<c&&l>=0&&(c=-1),c>-1&&(s=t.slice(0,c),o=t.slice(c+1,l>-1?l:t.length),r=e(o)),l>-1&&(s=s||t.slice(0,l),i=t.slice(l,t.length)),s=Xf(s??t,n),{fullPath:s+(o&&"?")+o+i,path:s,query:r,hash:Dn(i)}}function zf(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Xo(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Jf(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&on(t.matched[s],n.matched[r])&&ic(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function on(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function ic(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Gf(e[n],t[n]))return!1;return!0}function Gf(e,t){return ze(e)?Qo(e,t):ze(t)?Qo(t,e):e===t}function Qo(e,t){return ze(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Xf(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let o=n.length-1,i,l;for(i=0;i<s.length;i++)if(l=s[i],l!==".")if(l==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+s.slice(i).join("/")}const _t={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var jn;(function(e){e.pop="pop",e.push="push"})(jn||(jn={}));var Tn;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Tn||(Tn={}));function Qf(e){if(!e)if(Xt){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Wf(e)}const Yf=/^[^#]+#/;function Zf(e,t){return e.replace(Yf,"#")+t}function ed(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Ds=()=>({left:window.scrollX,top:window.scrollY});function td(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=ed(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Yo(e,t){return(history.state?history.state.position-t:-1)+e}const xr=new Map;function nd(e,t){xr.set(e,t)}function sd(e){const t=xr.get(e);return xr.delete(e),t}let rd=()=>location.protocol+"//"+location.host;function lc(e,t){const{pathname:n,search:s,hash:r}=t,o=e.indexOf("#");if(o>-1){let l=r.includes(e.slice(o))?e.slice(o).length:1,c=r.slice(l);return c[0]!=="/"&&(c="/"+c),Xo(c,"")}return Xo(n,e)+s+r}function od(e,t,n,s){let r=[],o=[],i=null;const l=({state:p})=>{const m=lc(e,location),y=n.value,_=t.value;let x=0;if(p){if(n.value=m,t.value=p,i&&i===y){i=null;return}x=_?p.position-_.position:0}else s(m);r.forEach(T=>{T(n.value,y,{delta:x,type:jn.pop,direction:x?x>0?Tn.forward:Tn.back:Tn.unknown})})};function c(){i=n.value}function u(p){r.push(p);const m=()=>{const y=r.indexOf(p);y>-1&&r.splice(y,1)};return o.push(m),m}function a(){const{history:p}=window;p.state&&p.replaceState(ne({},p.state,{scroll:Ds()}),"")}function f(){for(const p of o)p();o=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",a)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",a,{passive:!0}),{pauseListeners:c,listen:u,destroy:f}}function Zo(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Ds():null}}function id(e){const{history:t,location:n}=window,s={value:lc(e,n)},r={value:t.state};r.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scLine truncated
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const hi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Id=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase()),Fd=e=>{const t=Id(e);return t.charAt(0).toUpperCase()+t.slice(1)},Dd=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/var ts={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const jd=({size:e,strokeWidth:t=2,absoluteStrokeWidth:n,color:s,iconNode:r,name:o,class:i,...l},{slots:c})=>nn("svg",{...ts,width:e||ts.width,height:e||ts.height,stroke:s||ts.stroke,"stroke-width":n?Number(t)*24/Number(e):t,class:Dd("lucide",...o?[`lucide-${hi(Fd(o))}-icon`,`lucide-${hi(o)}`]:["lucide-icon"]),...l},[...r.map(u=>nn(...u)),...c.default?[c.default()]:[]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const qt=(e,t)=>(n,{slots:s})=>nn(jd,{...n,iconNode:t,name:e},s);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Bd=qt("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const $d=qt("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Ud=qt("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Hd=qt("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Vd=qt("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const qd=qt("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Kd=qt("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Wd=qn({__name:"ThemeToggle",setup(e){const t=Pe("isDarkMode"),n=Pe("setColorMode"),s=()=>{n(!t.value)};return(r,o)=>(qe(),kn("button",{onClick:s,class:an(["fixed top-4 right-4 z-10 p-2 rounded-full transition-all duration-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transform hover:rotate-180",Oe(t)?"bg-gray-800 text-yellow-300":"bg-white text-gray-800"])},[Oe(t)?(qe(),tn(Oe(Hd),{key:1,class:"w-6 h-6"})):(qe(),tn(Oe(Vd),{key:0,class:"w-6 h-6"}))],2))}});function hc(e,t){return function(){return e.apply(t,arguments)}}const{toString:zd}=Object.prototype,{getPrototypeOf:eo}=Object,{iterator:Bs,toStringTag:pc}=Symbol,$s=(e=>t=>{const n=zd.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Je=e=>(e=e.toLowerCase(),t=>$s(t)===e),Us=e=>t=>typeof t===e,{isArray:un}=Array,Bn=Us("undefined");function Wn(e){return e!==null&&!Bn(e)&&e.constructor!==null&&!Bn(e.constructor)&&Le(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const mc=Je("ArrayBuffer");function Jd(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&mc(e.buffer),t}const Gd=Us("string"),Le=Us("function"),gc=Us("number"),zn=e=>e!==null&&typeof e=="object",Xd=e=>e===!0||e===!1,os=e=>{if($s(e)!=="object")return!1;const t=eo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(pc in e)&&!(Bs in e)},Qd=e=>{if(!zn(e)||Wn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Yd=Je("Date"),Zd=Je("File"),eh=Je("Blob"),th=Je("FileList"),nh=e=>zn(e)&&Le(e.pipe),sh=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Le(e.append)&&((t=$s(e))==="formdata"||t==="object"&&Le(e.toString)&&e.toString()==="[object FormData]"))},rh=Je("URLSearchParams"),[oh,ih,lh,ch]=["ReadableStream","Request","Response","Headers"].map(Je),ah=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Jn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),un(e))for(s=0,r=e.length;s<r;s++)t.call(null,e[s],s,e);else{if(Wn(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let l;for(s=0;s<i;s++)l=o[s],t.call(null,e[l],l,e)}}function yc(e,t){if(Wn(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,r;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const Dt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,bc=e=>!Bn(e)&&e!==Dt;function Cr(){const{caseless:e}=bc(this)&&this||{},t={},n=(s,r)=>{const o=e&&yc(t,r)||r;os(t[o])&&os(s)?t[o]=Cr(t[o],s):os(s)?t[o]=Cr({},s):un(s)?t[o]=s.slice():t[o]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Jn(arguments[s],n);return t}const uh=(e,t,n,{allOwnKeys:s}={})=>(Jn(t,(r,o)=>{n&&Le(r)?e[o]=hc(r,n):e[o]=r},{allOwnKeys:s}),e),fh=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),dh=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},hh=(e,t,n,s)=>{let r,o,i;const l={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),o=r.length;o-- >0;)i=r[o],(!s||s(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=n!==!1&&eo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ph=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},mh=e=>{if(!e)return null;if(un(e))return e;let t=e.length;if(!gc(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},gh=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&eo(Uint8Array)),yh=(e,t)=>{const s=(e&&e[Bs]).call(e);let r;for(;(r=s.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},bh=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},_h=Je("HTMLFormElement"),wh=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),pi=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),vh=Je("RegExp"),_c=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Jn(n,(r,o)=>{let i;(i=t(r,o,e))!==!1&&(s[o]=i||r)}),Object.defineProperties(e,s)},Eh=e=>{_c(e,(t,n)=>{if(Le(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(Le(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Sh=(e,t)=>{const n={},s=r=>{r.forEach(o=>{n[o]=!0})};return un(e)?s(e):s(String(e).split(t)),n},xh=()=>{},Rh=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Ch(e){return!!(e&&Le(e.append)&&e[pc]==="FormData"&&e[Bs])}const Ah=e=>{const t=new Array(10),n=(s,r)=>{if(zn(s)){if(t.indexOf(s)>=0)return;if(Wn(s))return s;if(!("toJSON"in s)){t[r]=s;const o=un(s)?[]:{};return Jn(s,(i,l)=>{const c=n(i,r+1);!Bn(c)&&(o[l]=c)}),t[r]=void 0,o}}retLine truncated
|
||||
`).forEach(function(i){r=i.indexOf(":"),n=i.substring(0,r).trim().toLowerCase(),s=i.substring(r+1).trim(),!(!n||t[n]&&Jh[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},bi=Symbol("internals");function gn(e){return e&&String(e).trim().toLowerCase()}function is(e){return e===!1||e==null?e:b.isArray(e)?e.map(is):String(e)}function Xh(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Qh=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lr(e,t,n,s,r){if(b.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!b.isString(t)){if(b.isString(s))return t.indexOf(s)!==-1;if(b.isRegExp(s))return s.test(t)}}function Yh(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function Zh(e,t){const n=b.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,o,i){return this[s].call(this,t,r,o,i)},configurable:!0})})}let Ne=class{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function o(l,c,u){const a=gn(c);if(!a)throw new Error("header name must be a non-empty string");const f=b.findKey(r,a);(!f||r[f]===void 0||u===!0||u===void 0&&r[f]!==!1)&&(r[f||c]=is(l))}const i=(l,c)=>b.forEach(l,(u,a)=>o(u,a,c));if(b.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(b.isString(t)&&(t=t.trim())&&!Qh(t))i(Gh(t),n);else if(b.isObject(t)&&b.isIterable(t)){let l={},c,u;for(const a of t){if(!b.isArray(a))throw TypeError("Object iterator must return a key-value pair");l[u=a[0]]=(c=l[u])?b.isArray(c)?[...c,a[1]]:[c,a[1]]:a[1]}i(l,n)}else t!=null&&o(n,t,s);return this}get(t,n){if(t=gn(t),t){const s=b.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return Xh(r);if(b.isFunction(n))return n.call(this,r,s);if(b.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=gn(t),t){const s=b.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||lr(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function o(i){if(i=gn(i),i){const l=b.findKey(s,i);l&&(!n||lr(s,s[l],l,n))&&(delete s[l],r=!0)}}return b.isArray(t)?t.forEach(o):o(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const o=n[s];(!t||lr(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){const n=this,s={};return b.forEach(this,(r,o)=>{const i=b.findKey(s,o);if(i){n[i]=is(r),delete n[o];return}const l=t?Yh(o):String(o).trim();l!==o&&delete n[o],n[l]=is(r),s[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return b.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&b.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||||
`)}getSetCookie(){return this.get("set-cookie")||[]}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[bi]=this[bi]={accessors:{}}).accessors,r=this.prototype;function o(i){const l=gn(i);s[l]||(Zh(r,i),s[l]=!0)}return b.isArray(t)?t.forEach(o):o(t),this}};Ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);b.reduceDescriptors(Ne.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});b.freezeMethods(Ne);function cr(e,t){const n=this||Gn,s=t||n,r=Ne.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 Tc(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 Oc(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 ep(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function tp(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<t)return;const m=a&&u-a;return m?Math.round(p*1e3/m):void 0}}function np(e,t){let n=0,s=1e3/t,r,o;const i=(u,a=Date.now())=>{n=a,r=null,o&&(clearTimeout(o),o=null),e(...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 _s=(e,t,n=3)=>{let s=0;const r=tp(50,250);return np(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)},_i=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},wi=e=>(...t)=>b.asap(()=>e(...t)),sp=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,rp=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 op(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ip(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Pc(e,t,n){let s=!op(t);return e&&(s||n==!1)?ip(e,t):t}const vi=e=>e instanceof Ne?{...e}:e;function Vt(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(vi(u),vi(a),f,!0)};return b.forEach(Object.keys({...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 Lc=e=>{const t=Vt({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:o,headers:i,auth:l}=t;t.headers=i=Ne.from(i),t.url=Rc(Pc(t.baseURL,t.url,t.allowAbsoluteUrls),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&&sp(t.url))){const u=rLine truncated
|
||||
`+o.map(xi).join(`
|
||||
`):" "+xi(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:Pr};function ar(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new fn(null,e)}function Ri(e){return ar(e),e.headers=Ne.from(e.headers),e.data=cr.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),kc.getAdapter(e.adapter||Gn.adapter)(e).then(function(s){return ar(e),s.data=cr.call(e,e.transformResponse,s),s.headers=Ne.from(s.headers),s},function(s){return Tc(s)||(ar(e),s&&s.response&&(s.response.data=cr.call(e,e.transformResponse,s.response),s.response.headers=Ne.from(s.response.headers))),Promise.reject(s)})}const Ic="1.11.0",qs={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{qs[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ci={};qs.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&&!Ci[i]&&(Ci[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}};qs.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function _p(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 ls={assertOptions:_p,validators:qs},et=ls.validators;let Ut=class{constructor(t){this.defaults=t||{},this.interceptors={request:new yi,response:new yi}}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=Vt(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&ls.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}:ls.assertOptions(r,{encode:et.function,serialize:et.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ls.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=Ne.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=[Ri.bind(this),void 0];for(y.unshift(...l),y.push(...u),p=y.length,a=Promise.resolve(n);f<p;)a=a.then(y[f++],y[f++]);return a}p=l.length;let m=n;for(f=0;f<p;){const y=l[f++],_=l[f++];try{m=y(m)}catch(x){_.call(this,x);break}}try{a=Ri.call(this,m)}catch(y){return Promise.reject(y)}for(f=0,p=u.length;f<p;)a=a.then(u[f++],u[f++]);return a}getUri(t){t=Vt(this.defaults,t);const n=Pc(t.baseURL,t.url,t.allowAbsoluteUrls);return Rc(n,t.params,t.paramsSerializer)}};b.forEach(["delete","get","head","options"],function(t){Ut.prototype[t]=function(n,s){return this.request(Vt(s||{},{method:t,url:n,data:(s||{}).data}))}});b.forEach(["post","put","patch"],function(t){function n(s){return function(o,i,l){return this.request(Vt(l||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}Ut.prototype[t]=n(),Ut.prototype[t+"Form"]=n(!0)});let wp=class Fc{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(r=>{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 Fc(function(r){t=r}),cancel:t}}};function vp(e){return function(n){return e.apply(null,n)}}function Ep(e){return b.isObject(e)&&e.isAxiosError===!0}const Lr={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(Lr).forEach(([e,t])=>{Lr[t]=e});function Dc(e){const t=new Ut(e),n=hc(Ut.prototype.request,t);return b.extend(n,Ut.prototype,t,{allOwnKeys:!0}),b.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Dc(Vt(e,r))},n}const he=Dc(Gn);he.Axios=Ut;he.CanceledError=fn;he.CancelToken=wp;he.isCancel=Tc;he.VERSION=Ic;he.toFormData=Hs;he.AxiosError=J;he.Cancel=he.CanceledError;he.all=function(t){return Promise.all(t)};he.spread=vp;he.isAxiosError=Ep;he.mergeConfig=Vt;he.AxiosHeaders=Ne;he.formToJSON=e=>Ac(b.isHTMLForm(e)?new FormData(e):e);he.getAdapter=kc.getAdapter;he.HttpStatusCode=Lr;he.default=he;const{Line truncated
|
||||
@@ -0,0 +1,9 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SendFileView-DsVuX-HF.js","assets/PageHeader-Dda1k_N5.js","assets/box-C2OkK29z.js","assets/PageHeader-DV4PCTwD.css","assets/file-C928Lhos.js","assets/trash-JuhqIjo3.js","assets/SendFileView-CncKd-lI.css","assets/RetrievewFileView-CSTBscGQ.js","assets/hard-drive-B6XHFjlY.js","assets/copy-bjFRgEY8.js","assets/RetrievewFileView-Bs4l0or-.css","assets/AdminLayout-V4TGAipv.js","assets/AdminLayout-D_KhoR09.css","assets/DashboardView-Bi1R6Lfw.js","assets/FileManageView-Dl2tHKSM.js","assets/FileManageView-DrjnVkAt.css","assets/LoginView-BiEXW3sl.js","assets/LoginView-CbGDZtny.css"])))=>i.map(i=>d[i]);
|
||||
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Ko(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const be={},Wn=[],xt=()=>{},Rl=()=>!1,vs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Go=e=>e.startsWith("onUpdate:"),ke=Object.assign,Yo=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Rf=Object.prototype.hasOwnProperty,me=(e,t)=>Rf.call(e,t),Q=Array.isArray,Bn=e=>Fr(e)==="[object Map]",Zn=e=>Fr(e)==="[object Set]",Li=e=>Fr(e)==="[object Date]",se=e=>typeof e=="function",Re=e=>typeof e=="string",vt=e=>typeof e=="symbol",ye=e=>e!==null&&typeof e=="object",Nl=e=>(ye(e)||se(e))&&se(e.then)&&se(e.catch),Il=Object.prototype.toString,Fr=e=>Il.call(e),Nf=e=>Fr(e).slice(8,-1),xl=e=>Fr(e)==="[object Object]",qo=e=>Re(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,fr=Ko(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ss=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},If=/-\w/g,gt=Ss(e=>e.replace(If,t=>t.slice(1).toUpperCase())),xf=/\B([A-Z])/g,gn=Ss(e=>e.replace(xf,"-$1").toLowerCase()),ws=Ss(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ys=Ss(e=>e?`on${ws(e)}`:""),cn=(e,t)=>!Object.is(e,t),es=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},kl=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},as=e=>{const t=parseFloat(e);return isNaN(t)?e:t},kf=e=>{const t=Re(e)?Number(e):NaN;return isNaN(t)?e:t};let Pi;const Ts=()=>Pi||(Pi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Cs(e){if(Q(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Re(r)?Uf(r):Cs(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Re(e)||ye(e))return e}const Ff=/;(?![^(]*\))/g,Df=/:([^]+)/,Mf=/\/\*[^]*?\*\//g;function Uf(e){const t={};return e.replace(Mf,"").split(Ff).forEach(n=>{if(n){const r=n.split(Df);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function Nt(e){let t="";if(Re(e))t=e;else if(Q(e))for(let n=0;n<e.length;n++){const r=Nt(e[n]);r&&(t+=r+" ")}else if(ye(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const $f="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Vf=Ko($f);function Fl(e){return!!e||e===""}function Hf(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Dr(e[r],t[r]);return n}function Dr(e,t){if(e===t)return!0;let n=Li(e),r=Li(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=vt(e),r=vt(t),n||r)return e===t;if(n=Q(e),r=Q(t),n||r)return n&&r?Hf(e,t):!1;if(n=ye(e),r=ye(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,o=Object.keys(t).length;if(s!==o)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!Dr(e[i],t[i]))return!1}}return String(e)===String(t)}function zo(e,t){return e.findIndex(n=>Dr(n,t))}const Dl=e=>!!(e&&e.__v_isRef===!0),Er=e=>Re(e)?e:e==null?"":Q(e)||ye(e)&&(e.toString===Il||!se(e.toString))?Dl(e)?Er(e.value):JSON.stringify(e,Ml,2):String(e),Ml=(e,t)=>Dl(t)?Ml(e,t.value):Bn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[qs(r,o)+" =>"]=s,n),{})}:Zn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>qs(n))}:vt(t)?qs(t):ye(t)&&!Q(t)&&!xl(t)?String(t):t,qs=(e,t="")=>{var n;return vt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let ze;class Ul{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ze,!t&&ze&&(this.index=(ze.scopes||(ze.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=ze;try{return ze=this,t()}finally{ze=n}}}on(){++this._on===1&&(this.prevScope=ze,ze=this)}off(){this._on>0&&--this._on===0&&(ze=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.Line truncated
|
||||
`,Jm="\u2028",Qm="\u2029";function Zm(e){const t=e;let n=0,r=1,s=1,o=0;const i=x=>t[x]===Xm&&t[x+1]===rt,a=x=>t[x]===rt,l=x=>t[x]===Qm,c=x=>t[x]===Jm,u=x=>i(x)||a(x)||l(x)||c(x),f=()=>n,d=()=>r,m=()=>s,y=()=>o,S=x=>i(x)||l(x)||c(x)?rt:t[x],w=()=>S(n),R=()=>S(n+o);function D(){return o=0,u(n)&&(r++,s=0),i(n)&&n++,n++,s++,t[n]}function E(){return i(n+o)&&o++,o++,t[n+o]}function v(){n=0,r=1,s=1,o=0}function O(x=0){o=x}function N(){const x=n+o;for(;x!==n;)D();o=0}return{index:f,line:d,column:m,peekOffset:y,charAt:S,currentChar:w,currentPeek:R,next:D,peek:E,reset:v,resetPeek:O,skipToPeek:N}}const tn=void 0,eg=".",Fa="'",tg="tokenizer";function ng(e,t={}){const n=t.location!==!1,r=Zm(e),s=()=>r.index(),o=()=>Bm(r.line(),r.column(),r.index()),i=o(),a=s(),l={currentType:14,offset:a,startLoc:i,endLoc:i,lastType:14,lastOffset:a,lastStartLoc:i,lastEndLoc:i,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=t;function f(h,p,C,...I){const K=c();if(p.column+=C,p.offset+=C,u){const H=n?bs(K.startLoc,p):null,T=nr(h,H,{domain:tg,args:I});u(T)}}function d(h,p,C){h.endLoc=o(),h.currentType=p;const I={type:p};return n&&(I.loc=bs(h.startLoc,h.endLoc)),C!=null&&(I.value=C),I}const m=h=>d(h,14);function y(h,p){return h.currentChar()===p?(h.next(),p):(f(ne.EXPECTED_TOKEN,o(),0,p),"")}function S(h){let p="";for(;h.currentPeek()===Mt||h.currentPeek()===rt;)p+=h.currentPeek(),h.peek();return p}function w(h){const p=S(h);return h.skipToPeek(),p}function R(h){if(h===tn)return!1;const p=h.charCodeAt(0);return p>=97&&p<=122||p>=65&&p<=90||p===95}function D(h){if(h===tn)return!1;const p=h.charCodeAt(0);return p>=48&&p<=57}function E(h,p){const{currentType:C}=p;if(C!==2)return!1;S(h);const I=R(h.currentPeek());return h.resetPeek(),I}function v(h,p){const{currentType:C}=p;if(C!==2)return!1;S(h);const I=h.currentPeek()==="-"?h.peek():h.currentPeek(),K=D(I);return h.resetPeek(),K}function O(h,p){const{currentType:C}=p;if(C!==2)return!1;S(h);const I=h.currentPeek()===Fa;return h.resetPeek(),I}function N(h,p){const{currentType:C}=p;if(C!==8)return!1;S(h);const I=h.currentPeek()===".";return h.resetPeek(),I}function x(h,p){const{currentType:C}=p;if(C!==9)return!1;S(h);const I=R(h.currentPeek());return h.resetPeek(),I}function V(h,p){const{currentType:C}=p;if(!(C===8||C===12))return!1;S(h);const I=h.currentPeek()===":";return h.resetPeek(),I}function L(h,p){const{currentType:C}=p;if(C!==10)return!1;const I=()=>{const H=h.currentPeek();return H==="{"?R(h.peek()):H==="@"||H==="%"||H==="|"||H===":"||H==="."||H===Mt||!H?!1:H===rt?(h.peek(),I()):$(h,!1)},K=I();return h.resetPeek(),K}function q(h){S(h);const p=h.currentPeek()==="|";return h.resetPeek(),p}function Z(h){const p=S(h),C=h.currentPeek()==="%"&&h.peek()==="{";return h.resetPeek(),{isModulo:C,hasSpace:p.length>0}}function $(h,p=!0){const C=(K=!1,H="",T=!1)=>{const k=h.currentPeek();return k==="{"?H==="%"?!1:K:k==="@"||!k?H==="%"?!0:K:k==="%"?(h.peek(),C(K,"%",!0)):k==="|"?H==="%"||T?!0:!(H===Mt||H===rt):k===Mt?(h.peek(),C(!0,Mt,T)):k===rt?(h.peek(),C(!0,rt,T)):!0},I=C();return p&&h.resetPeek(),I}function X(h,p){const C=h.currentChar();return C===tn?tn:p(C)?(h.next(),C):null}function ue(h){const p=h.charCodeAt(0);return p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===95||p===36}function Pe(h){return X(h,ue)}function te(h){const p=h.charCodeAt(0);return p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===95||p===36||p===45}function ee(h){return X(h,te)}function re(h){const p=h.charCodeAt(0);return p>=48&&p<=57}function Fe(h){return X(h,re)}function Ye(h){const p=h.charCodeAt(0);return p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102}function he(h){return X(h,Ye)}function ge(h){let p="",C="";for(;p=Fe(h);)C+=p;return C}function qe(h){w(h);const p=h.currentChar();return p!=="%"&&f(ne.EXPECTED_TOKEN,o(),0,p),h.next(),"%"}function De(h){let p="";for(;;){const C=h.currentChar();if(C==="{"||C==="}"||C==="@"||C==="|"||!C)break;if(C==="%")if($(h))p+=C,h.next();else break;else if(C===Mt||C===rt)if($(h))p+=C,h.next();else{if(q(h))break;p+=C,h.next()}else p+=C,h.next()}return p}function ct(h){w(h);let p="",C="";for(;p=ee(h);)C+=p;return h.currentChar()===tn&&f(ne.UNTERMINATED_CLOSING_BRACE,o(),0),C}function Me(h){w(h);let p="";return h.currentChar()==="-"?(h.next(),p+=`-${ge(h)}`):p+=ge(h),h.currentChar()===tn&&f(ne.UNTERMINATED_CLOSING_BRACE,o(),0),p}function M(h){return h!==Fa&&h!==rt}function Y(h){w(h),y(h,"'");let p="",C="";for(;p=X(h,M);)p==="\\"?C+=j(h):C+=p;const I=h.currentChar();return I===rt||I===tn?(f(ne.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),I===rt&&(h.next(),y(h,"'")),C):(y(h,"'"),C)}function j(h){const p=h.currentChar();switch(p){case"\\":case"'":return h.next(),`\\${p}`;case"u":return z(h,p,4);case"U":return z(h,p,6);default:return f(ne.UNKNOWN_ESCAPE_SEQUENCE,o(),0,p),""}}function z(h,p,C){y(h,p);let I="";for(let K=0;K<C;K++){const H=he(h);if(!H){f(ne.INVALID_UNICODE_ESCAPE_SEQUENCE,o(),0,`\\${p}${I}${h.currentChar()}`);break}I+=H}return`\\${p}${I}`}function fe(h){return h!=="{"&&h!=="}"&&hLine truncated
|
||||
`,o=t.needIndent?t.needIndent:n!=="arrow",i=e.helpers||[],a=dg(e,{filename:r,breakLineCode:s,needIndent:o});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(o),i.length>0&&(a.push(`const { ${Cu(i.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),Xn(a,e),a.deindent(o),a.push("}"),delete e.helpers;const{code:l,map:c}=a.context();return{ast:e,code:l,map:c?c.toJSON():void 0}};function yg(e,t={}){const n=Tu({},t),r=!!n.jit,s=!!n.minify,o=n.optimize==null?!0:n.optimize,a=ig(n).parse(e);return r?(o&&cg(a),s&&Vn(a),{ast:a,code:""}):(lg(a,n),_g(a,n))}function bg(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Bt().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(Bt().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Bt().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function kt(e){return de(e)&&mi(e)===0&&(yt(e,"b")||yt(e,"body"))}const Lu=["b","body"];function Eg(e){return yn(e,Lu)}const Pu=["c","cases"];function vg(e){return yn(e,Pu,[])}const Au=["s","static"];function Sg(e){return yn(e,Au)}const Ou=["i","items"];function wg(e){return yn(e,Ou,[])}const Ru=["t","type"];function mi(e){return yn(e,Ru)}const Nu=["v","value"];function Qr(e,t){const n=yn(e,Nu);if(n!=null)return n;throw Ir(t)}const Iu=["m","modifier"];function Tg(e){return yn(e,Iu)}const xu=["k","key"];function Cg(e){const t=yn(e,xu);if(t)return t;throw Ir(6)}function yn(e,t,n){for(let r=0;r<t.length;r++){const s=t[r];if(yt(e,s)&&e[s]!=null)return e[s]}return n}const ku=[...Lu,...Pu,...Au,...Ou,...xu,...Iu,...Nu,...Ru];function Ir(e){return new Error(`unhandled node type: ${e}`)}const bn=[];bn[0]={w:[0],i:[3,0],"[":[4],o:[7]};bn[1]={w:[1],".":[2],"[":[4],o:[7]};bn[2]={w:[2],i:[3,0],0:[3,0]};bn[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};bn[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};bn[5]={"'":[4,0],o:8,l:[5,0]};bn[6]={'"':[4,0],o:8,l:[6,0]};const Lg=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Pg(e){return Lg.test(e)}function Ag(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function Og(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Rg(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:Pg(t)?Ag(t):"*"+t}function Ng(e){const t=[];let n=-1,r=0,s=0,o,i,a,l,c,u,f;const d=[];d[0]=()=>{i===void 0?i=a:i+=a},d[1]=()=>{i!==void 0&&(t.push(i),i=void 0)},d[2]=()=>{d[0](),s++},d[3]=()=>{if(s>0)s--,r=4,d[0]();else{if(s=0,i===void 0||(i=Rg(i),i===!1))return!1;d[1]()}};function m(){const y=e[n+1];if(r===5&&y==="'"||r===6&&y==='"')return n++,a="\\"+y,d[0](),!0}for(;r!==null;)if(n++,o=e[n],!(o==="\\"&&m())){if(l=Og(o),f=bn[r],c=f[l]||f.l||8,c===8||(r=c[0],c[1]!==void 0&&(u=d[c[1]],u&&(a=o,u()===!1))))return;if(r===7)return t}}const Ua=new Map;function Ig(e,t){return de(e)?e[t]:null}function xg(e,t){if(!de(e))return null;let n=Ua.get(t);if(n||(n=Ng(t),n&&Ua.set(t,n)),!n)return null;const r=n.length;let s=e,o=0;for(;o<r;){const i=n[o];if(ku.includes(i)&&kt(s))return null;const a=s[i];if(a===void 0||Se(s))return null;s=a,o++}return s}const kg=e=>e,Fg=e=>"",Dg="text",Mg=e=>e.length===0?"":Wm(e),Ug=Hm;function $a(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function $g(e){const t=Ie(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(Ie(e.named.count)||Ie(e.named.n))?Ie(e.named.count)?e.named.count:Ie(e.named.n)?e.named.n:t:t}function Vg(e,t){t.count||(t.count=e),t.n||(t.n=e)}function Hg(e={}){const t=e.locale,n=$g(e),r=de(e.pluralRules)&&G(t)&&Se(e.pluralRules[t])?e.pluralRules[t]:$a,s=de(e.pluralRules)&&G(t)&&Se(e.pluralRules[t])?$a:void 0,o=R=>R[r(n,R.length,s)],i=e.list||[],a=R=>i[R],l=e.named||_e();Ie(e.pluralIndex)&&Vg(n,l);const c=R=>l[R];function u(R){const D=Se(e.messages)?e.messages(R):de(e.messages)?e.messages[R]:!1;return D||(e.parent?e.parent.message(R):Fg)}const f=R=>e.modifiers?e.modifiers[R]:kg,d=oe(e.processor)&&Se(e.processor.normalize)?e.processor.normalize:Mg,m=oe(e.processor)&&Se(e.processor.interpolate)?e.processor.interpolate:Ug,y=oe(e.processor)&&G(e.processor.type)?e.processor.type:Dg,w={list:a,named:c,plural:o,linked:(R,...D)=>{const[E,v]=D;let O="text",N="";D.length===1?de(E)?(N=E.modifier||N,O=E.type||O):G(E)&&(N=E||N):D.length===2&&(G(E)&&(N=E||N),G(v)&&(O=v||O));const x=u(R)(w),V=O==="vnode"&&Ce(x)&&N?x[0]:x;return N?f(N)(V,O):V},message:u,type:y,interpolate:m,normalize:d,values:Ge(_e(),i,l)};return w}let xr=null;function Wg(e){xr=e}function Bg(e,t,n){xr&&xr.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const jg=Kg("function:translate");function Kg(e){return t=>xr&&xr.emit(e,t)}const Gg=hi.__EXTEND_POINT__,Tn=Ms(Gg),Yg={FALLBACK_TO_TRANSLATE:Tn(),CANNOT_FORMAT_NUMBER:Tn(),FALLBACK_TO_NUMBER_FORMAT:Tn(),CANNOT_FORMAT_DATE:Tn(),FALLBACKLine truncated
|
||||
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&ub[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},_l=Symbol("internals");function cr(e){return e&&String(e).trim().toLowerCase()}function os(e){return e===!1||e==null?e:A.isArray(e)?e.map(os):String(e)}function db(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const hb=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function po(e,t,n,r,s){if(A.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!A.isString(t)){if(A.isString(r))return t.indexOf(r)!==-1;if(A.isRegExp(r))return r.test(t)}}function pb(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function mb(e,t){const n=A.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let lt=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(a,l,c){const u=cr(l);if(!u)throw new Error("header name must be a non-empty string");const f=A.findKey(s,u);(!f||s[f]===void 0||c===!0||c===void 0&&s[f]!==!1)&&(s[f||l]=os(a))}const i=(a,l)=>A.forEach(a,(c,u)=>o(c,u,l));if(A.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(A.isString(t)&&(t=t.trim())&&!hb(t))i(fb(t),n);else if(A.isObject(t)&&A.isIterable(t)){let a={},l,c;for(const u of t){if(!A.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?A.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}i(a,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=cr(t),t){const r=A.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return db(s);if(A.isFunction(n))return n.call(this,s,r);if(A.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=cr(t),t){const r=A.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||po(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=cr(i),i){const a=A.findKey(r,i);a&&(!n||po(r,r[a],a,n))&&(delete r[a],s=!0)}}return A.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||po(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return A.forEach(this,(s,o)=>{const i=A.findKey(r,o);if(i){n[i]=os(s),delete n[o];return}const a=t?pb(o):String(o).trim();a!==o&&delete n[o],n[a]=os(s),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return A.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&A.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||||
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[_l]=this[_l]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=cr(i);r[a]||(mb(s,i),r[a]=!0)}return A.isArray(t)?t.forEach(o):o(t),this}};lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);A.reduceDescriptors(lt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});A.freezeMethods(lt);function mo(e,t){const n=this||Kr,r=t||n,s=lt.from(r.headers);let o=r.data;return A.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Ef(e){return!!(e&&e.__CANCEL__)}function sr(e,t,n){ie.call(this,e??"canceled",ie.ERR_CANCELED,t,n),this.name="CanceledError"}A.inherits(sr,ie,{__CANCEL__:!0});function vf(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ie("Request failed with status code "+n.status,[ie.ERR_BAD_REQUEST,ie.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function gb(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function _b(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[o];i||(i=c),n[s]=l,r[s]=c;let f=o,d=0;for(;f!==s;)d+=n[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-i<t)return;const m=u&&c-u;return m?Math.round(d*1e3/m):void 0}}function yb(e,t){let n=0,r=1e3/t,s,o;const i=(c,u=Date.now())=>{n=u,s=null,o&&(clearTimeout(o),o=null),e(...c)};return[(...c)=>{const u=Date.now(),f=u-n;f>=r?i(c,u):(s=c,o||(o=setTimeout(()=>{o=null,i(s)},r-f)))},()=>s&&i(s)]}const Es=(e,t,n=3)=>{let r=0;const s=_b(50,250);return yb(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,l=i-r,c=s(l),u=i<=a;r=i;const f={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-i)/c:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},n)},yl=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},bl=e=>(...t)=>A.asap(()=>e(...t)),bb=Ze.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ze.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ze.origin),Ze.navigator&&/(msie|trident)/i.test(Ze.navigator.userAgent)):()=>!0,Eb=Ze.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];A.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),A.isString(r)&&a.push(`path=${r}`),A.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),A.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function vb(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Sb(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Sf(e,t,n){let r=!vb(t);return e&&(r||n==!1)?Sb(e,t):t}const El=e=>e instanceof lt?{...e}:e;function Fn(e,t){t=t||{};const n={};function r(c,u,f,d){return A.isPlainObject(c)&&A.isPlainObject(u)?A.merge.call({caseless:d},c,u):A.isPlainObject(u)?A.merge({},u):A.isArray(u)?u.slice():u}function s(c,u,f,d){if(A.isUndefined(u)){if(!A.isUndefined(c))return r(void 0,c,f,d)}else return r(c,u,f,d)}function o(c,u){if(!A.isUndefined(u))return r(void 0,u)}function i(c,u){if(A.isUndefined(u)){if(!A.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in t)return r(c,u);if(f in e)return r(void 0,c)}const l={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:a,headers:(c,u,f)=>s(El(c),El(u),f,!0)};return A.forEach(Object.keys({...e,...t}),function(u){const f=l[u]||s,d=f(e[u],t[u],u);A.isUndefined(d)&&f!==a||(n[u]=d)}),n}const wf=e=>{const t=Fn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=lt.from(i),t.url=_f(Sf(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),A.isFormData(n)){if(Ze.hasStandardBrowserEnv||Ze.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(A.isFunction(n.getHeaders)){const l=n.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,f])=>{c.incluLine truncated
|
||||
`+i.map(Ll).join(`
|
||||
`):" "+Ll(i[0]):"as no adapter specified";throw new ie("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const Cf={getAdapter:xb,adapters:wi};function go(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new sr(null,e)}function Pl(e){return go(e),e.headers=lt.from(e.headers),e.data=mo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Cf.getAdapter(e.adapter||Kr.adapter,e)(e).then(function(r){return go(e),r.data=mo.call(e,e.transformResponse,r),r.headers=lt.from(r.headers),r},function(r){return Ef(r)||(go(e),r&&r.response&&(r.response.data=mo.call(e,e.transformResponse,r.response),r.response.headers=lt.from(r.response.headers))),Promise.reject(r)})}const Lf="1.13.2",js={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{js[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Al={};js.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Lf+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,a)=>{if(t===!1)throw new ie(s(i," has been removed"+(n?" in "+n:"")),ie.ERR_DEPRECATED);return n&&!Al[i]&&(Al[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,a):!0}};js.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function kb(e,t,n){if(typeof e!="object")throw new ie("options must be an object",ie.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const a=e[o],l=a===void 0||i(a,o,e);if(l!==!0)throw new ie("option "+o+" must be "+l,ie.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ie("Unknown option "+o,ie.ERR_BAD_OPTION)}}const is={assertOptions:kb,validators:js},Pt=is.validators;let xn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new gl,response:new gl}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
||||
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Fn(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&is.assertOptions(r,{silentJSONParsing:Pt.transitional(Pt.boolean),forcedJSONParsing:Pt.transitional(Pt.boolean),clarifyTimeoutError:Pt.transitional(Pt.boolean)},!1),s!=null&&(A.isFunction(s)?n.paramsSerializer={serialize:s}:is.assertOptions(s,{encode:Pt.function,serialize:Pt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),is.assertOptions(n,{baseUrl:Pt.spelling("baseURL"),withXsrfToken:Pt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&A.merge(o.common,o[n.method]);o&&A.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),n.headers=lt.concat(i,o);const a=[];let l=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(l=l&&S.synchronous,a.unshift(S.fulfilled,S.rejected))});const c=[];this.interceptors.response.forEach(function(S){c.push(S.fulfilled,S.rejected)});let u,f=0,d;if(!l){const y=[Pl.bind(this),void 0];for(y.unshift(...a),y.push(...c),d=y.length,u=Promise.resolve(n);f<d;)u=u.then(y[f++],y[f++]);return u}d=a.length;let m=n;for(;f<d;){const y=a[f++],S=a[f++];try{m=y(m)}catch(w){S.call(this,w);break}}try{u=Pl.call(this,m)}catch(y){return Promise.reject(y)}for(f=0,d=c.length;f<d;)u=u.then(c[f++],c[f++]);return u}getUri(t){t=Fn(this.defaults,t);const n=Sf(t.baseURL,t.url,t.allowAbsoluteUrls);return _f(n,t.params,t.paramsSerializer)}};A.forEach(["delete","get","head","options"],function(t){xn.prototype[t]=function(n,r){return this.request(Fn(r||{},{method:t,url:n,data:(r||{}).data}))}});A.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,a){return this.request(Fn(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}xn.prototype[t]=n(),xn.prototype[t+"Form"]=n(!0)});let Fb=class Pf{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{r.subscribe(a),o=a}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,a){r.reason||(r.reason=new sr(o,i,a),n(r.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=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Pf(function(s){t=s}),cancel:t}}};function Db(e){return function(n){return e.apply(null,n)}}function Mb(e){return A.isObject(e)&&e.isAxiosError===!0}const jo={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(jo).forEach(([e,t])=>{jo[t]=e});function Af(e){const t=new xn(e),n=sf(xn.prototype.request,t);return A.extend(n,xn.prototype,t,{allOwnKeys:!0}),A.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Af(Fn(e,s))},n}const Ne=Af(Kr);Ne.Axios=xn;Ne.CanceledError=sr;Ne.CancelToken=Fb;Ne.isCancel=Ef;Ne.VERSION=Lf;Ne.toFormData=Bs;Ne.AxiosError=ie;Ne.Cancel=Ne.CanceledError;Ne.all=function(t){return Promise.all(t)};Ne.spread=Db;Ne.isAxiosError=Mb;Ne.mergeConfig=Fn;Ne.AxiosHLine truncated
|
||||
@@ -1 +0,0 @@
|
||||
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\!container{max-width:768px!important}.container{max-widthLine truncated
|
||||
@@ -1,6 +0,0 @@
|
||||
import{c as a}from"./index-CL9mnhPI.js";/**
|
||||
* @license lucide-vue-next v0.535.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const e=a("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);export{e as T};
|
||||
@@ -0,0 +1 @@
|
||||
import{c as a}from"./index-DaP6hnmm.js";const c=a("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const t=a("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);export{c as E,t as T};
|
||||
@@ -13,8 +13,8 @@
|
||||
<link rel="manifest" href="/assets/manifest.json" />
|
||||
<meta name="github" content="https://github.com/vastsa/FileCodeBox" />
|
||||
<title>{{title}}</title>
|
||||
<script type="module" crossorigin src="/assets/index-CL9mnhPI.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-gMRRgN5l.css">
|
||||
<script type="module" crossorigin src="/assets/index-DaP6hnmm.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BXCbdTRh.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
Reference in new issue
Block a user