diff --git a/apps/admin/dependencies.py b/apps/admin/dependencies.py index 04b97f8..a6ead2b 100644 --- a/apps/admin/dependencies.py +++ b/apps/admin/dependencies.py @@ -2,22 +2,88 @@ # @Author : Lan # @File : depends.py # @Software: PyCharm -from fastapi import Header, HTTPException +from fastapi import Header, HTTPException, Depends from fastapi.requests import Request +import base64 +import hmac +import json +import time from core.settings import settings from apps.admin.services import FileService, ConfigService, LocalFileService +def create_token(data: dict, expires_in: int = 3600 * 24) -> str: + """ + 创建JWT token + :param data: 数据负载 + :param expires_in: 过期时间(秒) + """ + header = base64.b64encode(json.dumps({"alg": "HS256", "typ": "JWT"}).encode()).decode() + payload = base64.b64encode(json.dumps({ + **data, + "exp": int(time.time()) + expires_in + }).encode()).decode() + + signature = hmac.new( + settings.jwt_secret_key.encode(), + f"{header}.{payload}".encode(), + 'sha256' + ).digest() + signature = base64.b64encode(signature).decode() + + return f"{header}.{payload}.{signature}" + +def verify_token(token: str) -> dict: + """ + 验证JWT token + :param token: JWT token + :return: 解码后的数据 + """ + try: + header_b64, payload_b64, signature_b64 = token.split('.') + + # 验证签名 + expected_signature = hmac.new( + settings.jwt_secret_key.encode(), + f"{header_b64}.{payload_b64}".encode(), + 'sha256' + ).digest() + expected_signature_b64 = base64.b64encode(expected_signature).decode() + + if signature_b64 != expected_signature_b64: + raise ValueError("无效的签名") + + # 解码payload + payload = json.loads(base64.b64decode(payload_b64)) + + # 检查是否过期 + if payload.get("exp", 0) < time.time(): + raise ValueError("token已过期") + + return payload + except Exception as e: + raise ValueError(f"token验证失败: {str(e)}") async def admin_required(authorization: str = Header(default=None), request: Request = None): - is_admin = (authorization.split(' ')[-1] if authorization else '') == settings.admin_token - if request.url.path.startswith('/share/'): - if not settings.openUpload and not is_admin: - raise HTTPException(status_code=403, detail='本站未开启游客上传,如需上传请先登录后台') - else: - if not is_admin: - raise HTTPException(status_code=401, detail='未授权或授权校验失败') - return is_admin - + """ + 验证管理员权限 + """ + try: + if not authorization or not authorization.startswith('Bearer '): + raise ValueError("缺少Bearer token") + + token = authorization.split(' ')[1] + payload = verify_token(token) + is_admin = payload.get("is_admin", False) + + if request.url.path.startswith('/share/'): + if not settings.openUpload and not is_admin: + raise HTTPException(status_code=403, detail='本站未开启游客上传,如需上传请先登录后台') + else: + if not is_admin: + raise HTTPException(status_code=401, detail='未授权或授权校验失败') + return is_admin + except ValueError as e: + raise HTTPException(status_code=401, detail=str(e)) async def get_file_service(): return FileService() diff --git a/apps/admin/schemas.py b/apps/admin/schemas.py index acd124a..5cc0802 100644 --- a/apps/admin/schemas.py +++ b/apps/admin/schemas.py @@ -13,3 +13,7 @@ class ShareItem(BaseModel): class DeleteItem(BaseModel): filename: str + + +class LoginData(BaseModel): + password: str diff --git a/apps/admin/views.py b/apps/admin/views.py index 5bc0922..5d0aae1 100644 --- a/apps/admin/views.py +++ b/apps/admin/views.py @@ -4,19 +4,30 @@ # @Software: PyCharm import datetime -from fastapi import APIRouter, Depends +from fastapi import APIRouter, Depends, HTTPException from apps.admin.services import FileService, ConfigService, LocalFileService from apps.admin.dependencies import admin_required, get_file_service, get_config_service, get_local_file_service -from apps.admin.schemas import IDData, ShareItem, DeleteItem +from apps.admin.schemas import IDData, ShareItem, DeleteItem, LoginData from core.response import APIResponse from apps.base.models import FileCodes, KeyValue +from apps.admin.dependencies import create_token +from core.settings import settings admin_api = APIRouter(prefix='/admin', tags=['管理']) @admin_api.post('/login') -async def login(admin: bool = Depends(admin_required)): - return APIResponse() +async def login(data: LoginData): + # 验证管理员密码 + if data.password != settings.admin_password: + raise HTTPException(status_code=401, detail="密码错误") + + # 生成包含管理员身份的token + token = create_token({"is_admin": True}) + return APIResponse(detail={ + "token": token, + "token_type": "Bearer" + }) @admin_api.get('/dashboard') diff --git a/core/settings.py b/core/settings.py index a84bbc2..a9353df 100644 --- a/core/settings.py +++ b/core/settings.py @@ -66,6 +66,9 @@ DEFAULT_CONFIG = { 'port': 12345, 'showAdminAddr': 0, 'robotsText': 'User-agent: *\nDisallow: /', + 'jwt_secret_key': "your-secret-key", # 建议使用环境变量 + 'jwt_algorithm': "HS256", + 'admin_password': 'FileCodeBox2023', # 建议使用环境变量存储 } diff --git a/themes/2024/assets/AdminLayout-DGEvILen.js b/themes/2024/assets/AdminLayout-DDemRuZ3.js similarity index 98% rename from themes/2024/assets/AdminLayout-DGEvILen.js rename to themes/2024/assets/AdminLayout-DDemRuZ3.js index b9597e2..3ab9a82 100644 --- a/themes/2024/assets/AdminLayout-DGEvILen.js +++ b/themes/2024/assets/AdminLayout-DDemRuZ3.js @@ -1,4 +1,4 @@ -import{c as i,B as k,r as h,o as u,I as v,d as x,e as t,n as o,g as e,i as w,f as n,X as _,F as M,q as C,p as z,y as B,J as L,m as D,K as F,t as I,z as d}from"./index-CiI2cp0V.js";import{B as j}from"./box-BA8SMkDM.js";/** +import{c as i,B as k,r as h,o as u,I as v,d as x,e as t,n as o,g as e,i as w,f as n,X as _,F as M,q as C,p as z,y as B,J as L,m as D,K as F,t as I,z as d}from"./index-BXFy05WO.js";import{B as j}from"./box-Cg0hrykV.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/DashboardView-6JCRMawe.js b/themes/2024/assets/DashboardView-62OQJn6e.js similarity index 98% rename from themes/2024/assets/DashboardView-6JCRMawe.js rename to themes/2024/assets/DashboardView-62OQJn6e.js index 27670a2..336cdc5 100644 --- a/themes/2024/assets/DashboardView-6JCRMawe.js +++ b/themes/2024/assets/DashboardView-62OQJn6e.js @@ -1,4 +1,4 @@ -import{c as g,B as v,H as w,o as _,d as u,e as t,n as a,g as e,i as k,t as i,f as y,F as U,q as F,A as M,z as p,J as z,K as C}from"./index-CiI2cp0V.js";import{F as m}from"./file-CWusGEpI.js";import{H as D,T as S}from"./trash-dDHutUhM.js";/** +import{c as g,B as v,H as w,o as _,d as u,e as t,n as a,g as e,i as k,t as i,f as y,F as U,q as F,A as M,z as p,J as z,K as C}from"./index-BXFy05WO.js";import{F as m}from"./file-DYxS796P.js";import{H as D,T as S}from"./trash-CUA4S_ac.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/FileManageView-BYyHY3ZZ.js b/themes/2024/assets/FileManageView-pSYIZ4a9.js similarity index 98% rename from themes/2024/assets/FileManageView-BYyHY3ZZ.js rename to themes/2024/assets/FileManageView-pSYIZ4a9.js index 3463d88..f38ce8a 100644 --- a/themes/2024/assets/FileManageView-BYyHY3ZZ.js +++ b/themes/2024/assets/FileManageView-pSYIZ4a9.js @@ -1,4 +1,4 @@ -import{c as V,B as T,u as q,r as _,b as k,d as c,e as t,n as o,g as a,i as A,j as P,f as m,v as H,m as I,F as v,q as w,t as d,A as S,z as g}from"./index-CiI2cp0V.js";import{F as L}from"./file-CWusGEpI.js";/** +import{c as V,B as T,u as q,r as _,b as k,d as c,e as t,n as o,g as a,i as A,j as P,f as m,v as H,m as I,F as v,q as w,t as d,A as S,z as g}from"./index-BXFy05WO.js";import{F as L}from"./file-DYxS796P.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/LoginView-CUuunog8.js b/themes/2024/assets/LoginView-CUuunog8.js new file mode 100644 index 0000000..f10e071 --- /dev/null +++ b/themes/2024/assets/LoginView-CUuunog8.js @@ -0,0 +1 @@ +import{G as y,r as u,B as b,u as v,d as w,e,n as l,g as o,i as x,f as h,h as k,j as S,v as A,m as V,t as B,y as D,z as j,A as P,_}from"./index-BXFy05WO.js";import{B as z}from"./box-Cg0hrykV.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=D(),f=async()=>{if(p()){P.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)=>(j(),w("div",{class:l(["min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 transition-colors duration-200 relative overflow-hidden",o(s)?"bg-gray-900":"bg-gray-50"])},[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(" "+B(i.value?"登录中...":"登录"),1)],10,N)])],32)],2)],2))}}),E=_(T,[["__scopeId","data-v-3d6e2ab2"]]);export{E as default}; diff --git a/themes/2024/assets/LoginView-Cf0iN_2x.css b/themes/2024/assets/LoginView-Cf0iN_2x.css deleted file mode 100644 index 4366653..0000000 --- a/themes/2024/assets/LoginView-Cf0iN_2x.css +++ /dev/null @@ -1 +0,0 @@ -@keyframes spin-2e50c3fa{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin-slow[data-v-2e50c3fa]{animation:spin-2e50c3fa 8s linear infinite}.fade-enter-active[data-v-2e50c3fa],.fade-leave-active[data-v-2e50c3fa]{transition:opacity .3s ease}.fade-enter-from[data-v-2e50c3fa],.fade-leave-to[data-v-2e50c3fa]{opacity:0}input[data-v-2e50c3fa]:focus{box-shadow:0 0 15px #6366f14d}button[data-v-2e50c3fa]:active:not(:disabled){transform:scale(.98)}.cyber-grid[data-v-2e50c3fa]{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-2e50c3fa]{position:absolute;width:100%;height:100%;background:radial-gradient(circle at center,transparent 0%,transparent 100%);filter:url(#gooey)}.floating-particles[data-v-2e50c3fa]:before,.floating-particles[data-v-2e50c3fa]: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-2e50c3fa 20s infinite linear}.floating-particles[data-v-2e50c3fa]:after{animation-delay:-10s;opacity:.5}@keyframes float-2e50c3fa{0%{transform:translate(0) scale(1)}50%{transform:translate(50px,50px) scale(1.5)}to{transform:translate(0) scale(1)}}button[data-v-2e50c3fa]:hover:not(:disabled){box-shadow:0 0 25px #6366f180}.fade-enter-active[data-v-2e50c3fa],.fade-leave-active[data-v-2e50c3fa]{transition:all .5s cubic-bezier(.4,0,.2,1)} diff --git a/themes/2024/assets/LoginView-CvDOmLlY.js b/themes/2024/assets/LoginView-CvDOmLlY.js deleted file mode 100644 index 2e6f1ff..0000000 --- a/themes/2024/assets/LoginView-CvDOmLlY.js +++ /dev/null @@ -1 +0,0 @@ -import{G as y,r as u,B as v,u as b,d as w,e,n as l,g as o,i as x,f as h,h as k,j as S,v as A,m as V,t as B,y as D,z as j,A as P,_}from"./index-CiI2cp0V.js";import{B as z}from"./box-BA8SMkDM.js";const M=y("adminData",()=>{const d=u(localStorage.getItem("adminPassword")||"");function n(t){d.value=t,localStorage.setItem("token",t)}return{adminPassword:d,updateAdminPwd:n}}),I={class:"mx-auto h-16 w-16 relative"},L={class:"rounded-md shadow-sm -space-y-px"},N=["disabled"],T=v({__name:"LoginView",setup(d){const n=b(),t=u(""),i=u(!1),s=x("isDarkMode"),c=M(),p=()=>{let a=!0;return t.value?t.value.length<6&&(n.showAlert("密码长度至少为6位","error"),a=!1):(n.showAlert("无效的密码","error"),a=!1),a},m=D(),f=async()=>{if(p()){c.updateAdminPwd(t.value),P.post("/admin/login",{password:t.value}).then(()=>{m.push("/admin")}).catch(a=>{n.showAlert(a.response.data.detail,"error")}),i.value=!0;try{await new Promise(a=>setTimeout(a,2e3))}catch{}finally{i.value=!1}}};return(a,r)=>(j(),w("div",{class:l(["min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 transition-colors duration-200 relative overflow-hidden",o(s)?"bg-gray-900":"bg-gray-50"])},[r[6]||(r[6]=e("div",{class:"absolute inset-0 z-0"},[e("div",{class:"cyber-grid"}),e("div",{class:"floating-particles"})],-1)),e("div",{class:l(["max-w-md w-full space-y-8 backdrop-blur-lg bg-opacity-20 p-8 rounded-xl border border-opacity-20",[o(s)?"bg-gray-800 border-gray-600":"bg-white/70 border-gray-200"]])},[e("div",null,[e("div",I,[r[1]||(r[1]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-cyan-500 via-purple-500 to-pink-500 rounded-full animate-spin-slow"},null,-1)),r[2]||(r[2]=e("div",{class:"absolute -inset-2 bg-gradient-to-r from-cyan-500 via-purple-500 to-pink-500 rounded-full opacity-50 blur-md animate-pulse"},null,-1)),e("div",{class:l(["absolute inset-1 rounded-full flex items-center justify-center",o(s)?"bg-gray-800":"bg-white"])},[h(o(z),{class:l(["h-8 w-8",o(s)?"text-cyan-400":"text-cyan-600"])},null,8,["class"])],2)]),e("h2",{class:l(["mt-6 text-center text-3xl font-extrabold",o(s)?"text-white":"text-gray-900"])}," 登录 ",2)]),e("form",{class:"mt-8 space-y-6",onSubmit:k(f,["prevent"])},[r[5]||(r[5]=e("input",{type:"hidden",name:"remember",value:"true"},null,-1)),e("div",L,[e("div",null,[r[3]||(r[3]=e("label",{for:"password",class:"sr-only"},"密码",-1)),S(e("input",{id:"password",name:"password",type:"password",autocomplete:"current-password",required:"","onUpdate:modelValue":r[0]||(r[0]=g=>t.value=g),class:l(["appearance-none rounded-t-md relative block w-full px-4 py-3 border transition-all duration-200 placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:border-cyan-500 focus:z-10 sm:text-sm backdrop-blur-sm",o(s)?"bg-gray-800/50 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"bg-white/50 border-gray-300 text-gray-900 hover:border-gray-400"]),placeholder:"密码"},null,2),[[A,t.value]])])]),e("div",null,[e("button",{type:"submit",class:l(["group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-medium rounded-md text-white transition-all duration-300 transform hover:scale-[1.02] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cyan-500 shadow-lg hover:shadow-cyan-500/50",o(s)?"bg-gradient-to-r from-cyan-500 to-purple-500 hover:from-cyan-600 hover:to-purple-600":"bg-gradient-to-r from-cyan-600 to-purple-600 hover:from-cyan-700 hover:to-purple-700",i.value?"opacity-75 cursor-not-allowed":""]),disabled:i.value},[r[4]||(r[4]=e("span",{class:"absolute left-0 inset-y-0 flex items-center pl-3"},null,-1)),V(" "+B(i.value?"登录中...":"登录"),1)],10,N)])],32)],2)],2))}}),E=_(T,[["__scopeId","data-v-2e50c3fa"]]);export{E as default}; diff --git a/themes/2024/assets/LoginView-DO0tOjab.css b/themes/2024/assets/LoginView-DO0tOjab.css new file mode 100644 index 0000000..8407909 --- /dev/null +++ b/themes/2024/assets/LoginView-DO0tOjab.css @@ -0,0 +1 @@ +@keyframes spin-3d6e2ab2{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin-slow[data-v-3d6e2ab2]{animation:spin-3d6e2ab2 8s linear infinite}.fade-enter-active[data-v-3d6e2ab2],.fade-leave-active[data-v-3d6e2ab2]{transition:opacity .3s ease}.fade-enter-from[data-v-3d6e2ab2],.fade-leave-to[data-v-3d6e2ab2]{opacity:0}input[data-v-3d6e2ab2]:focus{box-shadow:0 0 15px #6366f14d}button[data-v-3d6e2ab2]:active:not(:disabled){transform:scale(.98)}.cyber-grid[data-v-3d6e2ab2]{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-3d6e2ab2]{position:absolute;width:100%;height:100%;background:radial-gradient(circle at center,transparent 0%,transparent 100%);filter:url(#gooey)}.floating-particles[data-v-3d6e2ab2]:before,.floating-particles[data-v-3d6e2ab2]: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-3d6e2ab2 20s infinite linear}.floating-particles[data-v-3d6e2ab2]:after{animation-delay:-10s;opacity:.5}@keyframes float-3d6e2ab2{0%{transform:translate(0) scale(1)}50%{transform:translate(50px,50px) scale(1.5)}to{transform:translate(0) scale(1)}}button[data-v-3d6e2ab2]:hover:not(:disabled){box-shadow:0 0 25px #6366f180}.fade-enter-active[data-v-3d6e2ab2],.fade-leave-active[data-v-3d6e2ab2]{transition:all .5s cubic-bezier(.4,0,.2,1)} diff --git a/themes/2024/assets/RetrievewFileView-BckF8ahS.js b/themes/2024/assets/RetrievewFileView--mI6JURl.js similarity index 99% rename from themes/2024/assets/RetrievewFileView-BckF8ahS.js rename to themes/2024/assets/RetrievewFileView--mI6JURl.js index b1ca083..61e5ccb 100644 --- a/themes/2024/assets/RetrievewFileView-BckF8ahS.js +++ b/themes/2024/assets/RetrievewFileView--mI6JURl.js @@ -1,4 +1,4 @@ -var De=Object.defineProperty;var Pe=(d,e,t)=>e in d?De(d,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[e]=t;var v=(d,e,t)=>Pe(d,typeof e!="symbol"?e+"":e,t);import{c as _e,_ as Fe,u as Ze,s as Oe,r as D,o as Ue,a as Qe,w as He,b as Ne,d as I,e as p,f as $,n as w,g as f,i as Ve,t as j,h as Ge,j as We,k as Y,v as Xe,l as Q,m as Z,p as Ke,X as xe,T as Je,F as Ye,q as et,x as le,y as tt,z as L,A as nt}from"./index-CiI2cp0V.js";import{c as H,u as st,S as it,C as rt,a as ot,Q as lt,E as at}from"./_commonjsHelpers-GlvjlJV-.js";import{B as ct}from"./box-BA8SMkDM.js";import{F as ke}from"./file-CWusGEpI.js";import{H as ut,T as pt}from"./trash-dDHutUhM.js";/** +var De=Object.defineProperty;var Pe=(d,e,t)=>e in d?De(d,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[e]=t;var v=(d,e,t)=>Pe(d,typeof e!="symbol"?e+"":e,t);import{c as _e,_ as Fe,u as Ze,s as Oe,r as D,o as Ue,a as Qe,w as He,b as Ne,d as I,e as p,f as $,n as w,g as f,i as Ve,t as j,h as Ge,j as We,k as Y,v as Xe,l as Q,m as Z,p as Ke,X as xe,T as Je,F as Ye,q as et,x as le,y as tt,z as L,A as nt}from"./index-BXFy05WO.js";import{c as H,u as st,S as it,C as rt,a as ot,Q as lt,E as at}from"./_commonjsHelpers-CoPwux66.js";import{B as ct}from"./box-Cg0hrykV.js";import{F as ke}from"./file-DYxS796P.js";import{H as ut,T as pt}from"./trash-CUA4S_ac.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/SendFileView-Ctmzhn2X.js b/themes/2024/assets/SendFileView-BElzCnKe.js similarity index 99% rename from themes/2024/assets/SendFileView-Ctmzhn2X.js rename to themes/2024/assets/SendFileView-BElzCnKe.js index 4e24666..3596218 100644 --- a/themes/2024/assets/SendFileView-Ctmzhn2X.js +++ b/themes/2024/assets/SendFileView-BElzCnKe.js @@ -1,4 +1,4 @@ -import{c as W,B as oe,r as z,o as ne,w as he,d as F,z as D,e as a,_ as se,u as ae,y as ge,i as pe,b as ye,p as ve,f as M,n as f,g as i,t as U,h as Q,l as E,k as N,j as J,v as X,x as K,C as be,F as Y,q as Z,m as V,X as xe,T as me,A as ee}from"./index-CiI2cp0V.js";import{g as we,u as _e,S as Ce,C as Ae,E as Me,a as Se,Q as Be}from"./_commonjsHelpers-GlvjlJV-.js";import{F as te}from"./file-CWusGEpI.js";import{T as Ie,H as Te}from"./trash-dDHutUhM.js";/** +import{c as W,B as oe,r as z,o as ne,w as he,d as F,z as D,e as a,_ as se,u as ae,y as ge,i as pe,b as ye,p as ve,f as M,n as f,g as i,t as U,h as Q,l as E,k as N,j as J,v as X,x as K,C as be,F as Y,q as Z,m as V,X as xe,T as me,A as ee}from"./index-BXFy05WO.js";import{g as we,u as _e,S as Ce,C as Ae,E as Me,a as Se,Q as Be}from"./_commonjsHelpers-CoPwux66.js";import{F as te}from"./file-DYxS796P.js";import{T as Ie,H as Te}from"./trash-CUA4S_ac.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/SystemSettingsView-DMnqdwce.js b/themes/2024/assets/SystemSettingsView-Cnrs3zpT.js similarity index 99% rename from themes/2024/assets/SystemSettingsView-DMnqdwce.js rename to themes/2024/assets/SystemSettingsView-Cnrs3zpT.js index de5952d..55077f4 100644 --- a/themes/2024/assets/SystemSettingsView-DMnqdwce.js +++ b/themes/2024/assets/SystemSettingsView-Cnrs3zpT.js @@ -1 +1 @@ -import{B,r as m,u as M,d as p,e,n as t,g as s,i as F,j as n,v as d,C as x,F as f,q as w,k as _,t as b,A as k,L as A,z as v}from"./index-CiI2cp0V.js";const z={class:"p-6 h-screen overflow-y-auto custom-scrollbar"},E={class:"space-y-4"},T={class:"grid grid-cols-1 gap-6"},W={class:"space-y-2"},K={class:"space-y-2"},j={class:"space-y-2"},I={class:"relative"},G={class:"space-y-2"},L={class:"space-y-2"},N=["value"],R={class:"space-y-2"},P={class:"grid grid-cols-1 gap-6 mt-8"},$={class:"space-y-2"},q={class:"space-y-2"},H={class:"space-y-4"},J={class:"space-y-2"},O={class:"space-y-4"},Q={class:"space-y-2"},X={key:0,class:"space-y-4"},Y={class:"space-y-2"},Z={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ee={class:"space-y-2"},oe={class:"space-y-2"},re={key:1,class:"space-y-4"},te={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ae={class:"space-y-2"},se={class:"space-y-2"},le={class:"space-y-2"},ne={class:"space-y-2"},de={class:"space-y-2"},ie={class:"space-y-2"},ue={class:"space-y-2"},ge={class:"space-y-2"},ce={class:"flex items-center"},ye=["aria-checked"],pe={class:"mt-8"},be={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ve={class:"space-y-2"},me={class:"flex items-center space-x-2"},xe={class:"space-y-2"},he={class:"flex items-center space-x-2"},fe={class:"space-y-2"},we={class:"flex items-center space-x-2"},_e={class:"space-y-2"},ke={class:"flex flex-wrap gap-3"},Ue=["value"],Se={class:"space-y-2"},Ve={class:"flex items-center space-x-2"},De={class:"space-y-2"},Ce={class:"flex items-center"},Be=["aria-checked"],Me={class:"mt-8"},Fe={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Ae={class:"space-y-2"},ze={class:"flex items-center space-x-2"},Ee={class:"space-y-2"},Te={class:"flex items-center space-x-2"},je=B({__name:"SystemSettingsView",setup(We){const a=F("isDarkMode"),l=m({name:"",description:"",file_storage:"",webdav_url:"",webdav_username:"",webdav_password:"",themesChoices:[],expireStyle:[],admin_token:"",robotsText:"",keywords:"",notify_title:"",storage_path:"",notify_content:"",openUpload:1,uploadSize:1,uploadMinute:1,max_save_seconds:0,opacity:.9,s3_access_key_id:"",background:"",showAdminAddr:0,page_explain:"",s3_secret_access_key:"",aws_session_token:"",s3_signature_version:"",s3_region_name:"",s3_bucket_name:"",s3_endpoint_url:"",s3_hostname:"",uploadCount:1,errorMinute:1,errorCount:1,s3_proxy:0,themesSelect:""}),c=m(1),y=m("MB"),u=m(1),g=m("天"),U=(i,o)=>i*{秒:1,分:60,时:3600,天:86400}[o],S=()=>{k({url:"/admin/config/get",method:"get"}).then(i=>{l.value=i.detail;let o=l.value.uploadSize;o>=1024*1024*1024?(c.value=Math.round(o/(1024*1024*1024)),y.value="GB"):o>=1024*1024?(c.value=Math.round(o/(1024*1024)),y.value="MB"):(c.value=Math.round(o/1024),y.value="KB");let r=l.value.max_save_seconds;r===0?(u.value=7,g.value="天"):r%86400===0&&r>=86400?(u.value=r/86400,g.value="天"):r%3600===0&&r>=3600?(u.value=r/3600,g.value="时"):r%60===0&&r>=60?(u.value=r/60,g.value="分"):(u.value=r,g.value="秒")})},h=M(),V=(i,o)=>i*{KB:1024,MB:1048576,GB:1073741824}[o],D=()=>{const i={...l.value};i.uploadSize=V(c.value,y.value),u.value===0?i.max_save_seconds=7*86400:i.max_save_seconds=U(u.value,g.value),k({url:"/admin/config/update",method:"patch",data:i}).then(o=>{o.code==200?h.showAlert("保存成功","success"):h.showAlert(o.message,"error")})};return S(),(i,o)=>(v(),p("div",z,[e("h2",{class:t(["text-2xl font-bold mb-6",[s(a)?"text-white":"text-gray-800"]])}," 系统设置 ",2),e("div",{class:t(["space-y-6 rounded-lg shadow-md p-6",[s(a)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[e("section",E,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 基本设置 ",2),e("div",T,[e("div",W,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 网站名称 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[0]||(o[0]=r=>l.value.name=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.name]])]),e("div",K,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 网站描述 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[1]||(o[1]=r=>l.value.description=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.description]])]),e("div",j,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 管理员密码 ",2),e("div",I,[n(e("input",{type:"password","onUpdate:modelValue":o[2]||(o[2]=r=>l.value.admin_token=r),placeholder:"留空则不修改密码",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.admin_token]]),e("div",{class:t(["absolute inset-y-0 right-0 flex items-center pr-3 text-sm text-gray-400",[s(a)?"text-gray-500":"text-gray-400"]])},o[31]||(o[31]=[e("span",{class:"text-xs"},"留空则不修改",-1)]),2)])]),e("div",G,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 关键词 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[3]||(o[3]=r=>l.value.keywords=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.keywords]])]),e("div",L,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 主题选择 ",2),n(e("select",{"onUpdate:modelValue":o[4]||(o[4]=r=>l.value.themesSelect=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border appearance-none bg-no-repeat bg-right focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none cursor-pointer",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]]),style:{"background-image":"url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M7%208l3%203%203-3%22%20stroke%3D%22%236B7280%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E')"}},[(v(!0),p(f,null,w(l.value.themesChoices,r=>(v(),p("option",{value:r.key,key:r.key},b(r.name)+" (by "+b(r.author)+" V"+b(r.version)+") ",9,N))),128))],2),[[x,l.value.themesSelect]])]),e("div",R,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Robots.txt ",2),n(e("textarea",{"onUpdate:modelValue":o[5]||(o[5]=r=>l.value.robotsText=r),rows:"3",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border resize-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.robotsText]])])]),e("div",P,[e("div",$,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 通知标题 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[6]||(o[6]=r=>l.value.notify_title=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.notify_title]])]),e("div",q,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 通知内容 ",2),n(e("textarea",{"onUpdate:modelValue":o[7]||(o[7]=r=>l.value.notify_content=r),rows:"3",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border resize-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.notify_content]])])]),e("div",H,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 存储设置 ",2),e("div",J,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 存储路径 ",2),n(e("input",{type:"text",placeholder:"留空则使用默认路径,可不填写","onUpdate:modelValue":o[8]||(o[8]=r=>l.value.storage_path=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.storage_path]])]),e("div",O,[e("div",Q,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 存储方式 ",2),n(e("select",{"onUpdate:modelValue":o[9]||(o[9]=r=>l.value.file_storage=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border appearance-none bg-no-repeat bg-right focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none cursor-pointer",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]]),style:{"background-image":"url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M7%208l3%203%203-3%22%20stroke%3D%22%236B7280%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E')"}},o[32]||(o[32]=[e("option",{value:"local"},"本地存储",-1),e("option",{value:"s3"},"S3 存储",-1),e("option",{value:"webdav"},"Webdav 存储",-1)]),2),[[x,l.value.file_storage]])]),l.value.file_storage==="webdav"?(v(),p("div",X,[e("div",Y,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Webdav URL ",2),n(e("input",{type:"text",placeholder:"请输入 Webdav URL","onUpdate:modelValue":o[10]||(o[10]=r=>l.value.webdav_url=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.webdav_url]])]),e("div",Z,[e("div",ee,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Webdav Username ",2),n(e("input",{type:"text",placeholder:"请输入 Webdav Username","onUpdate:modelValue":o[11]||(o[11]=r=>l.value.webdav_username=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.webdav_username]])]),e("div",oe,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Webdav Password ",2),n(e("input",{type:"password",placeholder:"请输入 Webdav Password","onUpdate:modelValue":o[12]||(o[12]=r=>l.value.webdav_password=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.webdav_password]])])])])):_("",!0),l.value.file_storage==="s3"?(v(),p("div",re,[e("div",te,[e("div",ae,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 AccessKeyId ",2),n(e("input",{type:"text","onUpdate:modelValue":o[13]||(o[13]=r=>l.value.s3_access_key_id=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_access_key_id]])]),e("div",se,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 SecretAccessKey ",2),n(e("input",{type:"password","onUpdate:modelValue":o[14]||(o[14]=r=>l.value.s3_secret_access_key=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_secret_access_key]])]),e("div",le,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 BucketName ",2),n(e("input",{type:"text","onUpdate:modelValue":o[15]||(o[15]=r=>l.value.s3_bucket_name=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_bucket_name]])]),e("div",ne,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 EndpointUrl ",2),n(e("input",{type:"text","onUpdate:modelValue":o[16]||(o[16]=r=>l.value.s3_endpoint_url=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_endpoint_url]])]),e("div",de,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Region Name ",2),n(e("input",{type:"text","onUpdate:modelValue":o[17]||(o[17]=r=>l.value.s3_region_name=r),placeholder:"auto",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_region_name]])]),e("div",ie,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Signature Version ",2),n(e("select",{"onUpdate:modelValue":o[18]||(o[18]=r=>l.value.s3_signature_version=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[33]||(o[33]=[e("option",{value:"s3v2"},"S3v2",-1),e("option",{value:"s3v4"},"S3v4",-1)]),2),[[x,l.value.s3_signature_version]])]),e("div",ue,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Hostname ",2),n(e("input",{type:"text","onUpdate:modelValue":o[19]||(o[19]=r=>l.value.s3_hostname=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_hostname]])]),e("div",ge,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 启用代理 ",2),e("div",ce,[e("button",{type:"button",onClick:o[20]||(o[20]=r=>l.value.s3_proxy=l.value.s3_proxy===1?0:1),class:t(["relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",[l.value.s3_proxy===1?"bg-indigo-600":"bg-gray-200"]]),role:"switch","aria-checked":l.value.s3_proxy===1},[e("span",{class:t(["pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",[l.value.s3_proxy===1?"translate-x-5":"translate-x-0",s(a)&&l.value.s3_proxy!==1?"bg-gray-100":"bg-white"]])},null,2)],10,ye),e("span",{class:t(["ml-3 text-sm",[s(a)?"text-gray-300":"text-gray-700"]])},b(l.value.s3_proxy===1?"已开启":"已关闭"),3)])])])])):_("",!0)])]),e("div",pe,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 上传限制 ",2),e("div",be,[e("div",ve,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 每分钟上传限制 ",2),e("div",me,[n(e("input",{type:"number","onUpdate:modelValue":o[21]||(o[21]=r=>l.value.uploadMinute=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.uploadMinute]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"分钟",2)])]),e("div",xe,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 上传数量限制 ",2),e("div",he,[n(e("input",{type:"number","onUpdate:modelValue":o[22]||(o[22]=r=>l.value.uploadCount=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.uploadCount]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"个文件",2)])]),e("div",fe,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 文件大小限制 ",2),e("div",we,[n(e("input",{type:"number","onUpdate:modelValue":o[23]||(o[23]=r=>c.value=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,c.value]]),n(e("select",{"onUpdate:modelValue":o[24]||(o[24]=r=>y.value=r),class:t(["rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[34]||(o[34]=[e("option",{value:"KB"},"KB",-1),e("option",{value:"MB"},"MB",-1),e("option",{value:"GB"},"GB",-1)]),2),[[x,y.value]])])]),e("div",_e,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 过期方式 ",2),e("div",ke,[(v(),p(f,null,w(["day","hour","minute","forever","count"],r=>e("label",{key:r,class:"relative inline-flex items-center group cursor-pointer"},[n(e("input",{type:"checkbox",value:r,"onUpdate:modelValue":o[25]||(o[25]=C=>l.value.expireStyle=C),class:"peer sr-only"},null,8,Ue),[[A,l.value.expireStyle]]),e("div",{class:t(["px-4 py-2 rounded-full border-2 transition-all duration-200 select-none",[l.value.expireStyle.includes(r)?(s(a),"bg-indigo-600 border-indigo-600 text-white"):s(a)?"bg-gray-700 border-gray-600 text-gray-300 hover:border-indigo-500":"bg-white border-gray-300 text-gray-700 hover:border-indigo-500"]])},b({day:"按天",hour:"按小时",minute:"按分钟",forever:"永久",count:"按次数"}[r]),3)])),64))])]),e("div",Se,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 最长保存时间 ",2),e("div",Ve,[n(e("input",{type:"number","onUpdate:modelValue":o[26]||(o[26]=r=>u.value=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,u.value]]),n(e("select",{"onUpdate:modelValue":o[27]||(o[27]=r=>g.value=r),class:t(["rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[35]||(o[35]=[e("option",{value:"秒"},"秒",-1),e("option",{value:"分"},"分",-1),e("option",{value:"时"},"时",-1),e("option",{value:"天"},"天",-1)]),2),[[x,g.value]])])]),e("div",De,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 游客上传 ",2),e("div",Ce,[e("button",{type:"button",onClick:o[28]||(o[28]=r=>l.value.openUpload=l.value.openUpload===1?0:1),class:t(["relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",[l.value.openUpload===1?"bg-indigo-600":"bg-gray-200"]]),role:"switch","aria-checked":l.value.openUpload===1},[e("span",{class:t(["pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",[l.value.openUpload===1?"translate-x-5":"translate-x-0",s(a)&&l.value.openUpload!==1?"bg-gray-100":"bg-white"]])},null,2)],10,Be),e("span",{class:t(["ml-3 text-sm",[s(a)?"text-gray-300":"text-gray-700"]])},b(l.value.openUpload===1?"已开启":"已关闭"),3)])])])]),e("div",Me,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 错误限制 ",2),e("div",Fe,[e("div",Ae,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 每分钟错误限制 ",2),e("div",ze,[n(e("input",{type:"number","onUpdate:modelValue":o[29]||(o[29]=r=>l.value.errorMinute=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.errorMinute]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"分钟",2)])]),e("div",Ee,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 错误次数限制 ",2),e("div",Te,[n(e("input",{type:"number","onUpdate:modelValue":o[30]||(o[30]=r=>l.value.errorCount=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.errorCount]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"次",2)])])])]),e("div",{class:"flex justify-end mt-8"},[e("button",{onClick:D,class:"px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-200"}," 保存设置 ")])])],2)]))}});export{je as default}; +import{B,r as m,u as M,d as p,e,n as t,g as s,i as F,j as n,v as d,C as x,F as f,q as w,k as _,t as b,A as k,L as A,z as v}from"./index-BXFy05WO.js";const z={class:"p-6 h-screen overflow-y-auto custom-scrollbar"},E={class:"space-y-4"},T={class:"grid grid-cols-1 gap-6"},W={class:"space-y-2"},K={class:"space-y-2"},j={class:"space-y-2"},I={class:"relative"},G={class:"space-y-2"},L={class:"space-y-2"},N=["value"],R={class:"space-y-2"},P={class:"grid grid-cols-1 gap-6 mt-8"},$={class:"space-y-2"},q={class:"space-y-2"},H={class:"space-y-4"},J={class:"space-y-2"},O={class:"space-y-4"},Q={class:"space-y-2"},X={key:0,class:"space-y-4"},Y={class:"space-y-2"},Z={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ee={class:"space-y-2"},oe={class:"space-y-2"},re={key:1,class:"space-y-4"},te={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ae={class:"space-y-2"},se={class:"space-y-2"},le={class:"space-y-2"},ne={class:"space-y-2"},de={class:"space-y-2"},ie={class:"space-y-2"},ue={class:"space-y-2"},ge={class:"space-y-2"},ce={class:"flex items-center"},ye=["aria-checked"],pe={class:"mt-8"},be={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ve={class:"space-y-2"},me={class:"flex items-center space-x-2"},xe={class:"space-y-2"},he={class:"flex items-center space-x-2"},fe={class:"space-y-2"},we={class:"flex items-center space-x-2"},_e={class:"space-y-2"},ke={class:"flex flex-wrap gap-3"},Ue=["value"],Se={class:"space-y-2"},Ve={class:"flex items-center space-x-2"},De={class:"space-y-2"},Ce={class:"flex items-center"},Be=["aria-checked"],Me={class:"mt-8"},Fe={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Ae={class:"space-y-2"},ze={class:"flex items-center space-x-2"},Ee={class:"space-y-2"},Te={class:"flex items-center space-x-2"},je=B({__name:"SystemSettingsView",setup(We){const a=F("isDarkMode"),l=m({name:"",description:"",file_storage:"",webdav_url:"",webdav_username:"",webdav_password:"",themesChoices:[],expireStyle:[],admin_token:"",robotsText:"",keywords:"",notify_title:"",storage_path:"",notify_content:"",openUpload:1,uploadSize:1,uploadMinute:1,max_save_seconds:0,opacity:.9,s3_access_key_id:"",background:"",showAdminAddr:0,page_explain:"",s3_secret_access_key:"",aws_session_token:"",s3_signature_version:"",s3_region_name:"",s3_bucket_name:"",s3_endpoint_url:"",s3_hostname:"",uploadCount:1,errorMinute:1,errorCount:1,s3_proxy:0,themesSelect:""}),c=m(1),y=m("MB"),u=m(1),g=m("天"),U=(i,o)=>i*{秒:1,分:60,时:3600,天:86400}[o],S=()=>{k({url:"/admin/config/get",method:"get"}).then(i=>{l.value=i.detail;let o=l.value.uploadSize;o>=1024*1024*1024?(c.value=Math.round(o/(1024*1024*1024)),y.value="GB"):o>=1024*1024?(c.value=Math.round(o/(1024*1024)),y.value="MB"):(c.value=Math.round(o/1024),y.value="KB");let r=l.value.max_save_seconds;r===0?(u.value=7,g.value="天"):r%86400===0&&r>=86400?(u.value=r/86400,g.value="天"):r%3600===0&&r>=3600?(u.value=r/3600,g.value="时"):r%60===0&&r>=60?(u.value=r/60,g.value="分"):(u.value=r,g.value="秒")})},h=M(),V=(i,o)=>i*{KB:1024,MB:1048576,GB:1073741824}[o],D=()=>{const i={...l.value};i.uploadSize=V(c.value,y.value),u.value===0?i.max_save_seconds=7*86400:i.max_save_seconds=U(u.value,g.value),k({url:"/admin/config/update",method:"patch",data:i}).then(o=>{o.code==200?h.showAlert("保存成功","success"):h.showAlert(o.message,"error")})};return S(),(i,o)=>(v(),p("div",z,[e("h2",{class:t(["text-2xl font-bold mb-6",[s(a)?"text-white":"text-gray-800"]])}," 系统设置 ",2),e("div",{class:t(["space-y-6 rounded-lg shadow-md p-6",[s(a)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[e("section",E,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 基本设置 ",2),e("div",T,[e("div",W,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 网站名称 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[0]||(o[0]=r=>l.value.name=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.name]])]),e("div",K,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 网站描述 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[1]||(o[1]=r=>l.value.description=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.description]])]),e("div",j,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 管理员密码 ",2),e("div",I,[n(e("input",{type:"password","onUpdate:modelValue":o[2]||(o[2]=r=>l.value.admin_token=r),placeholder:"留空则不修改密码",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.admin_token]]),e("div",{class:t(["absolute inset-y-0 right-0 flex items-center pr-3 text-sm text-gray-400",[s(a)?"text-gray-500":"text-gray-400"]])},o[31]||(o[31]=[e("span",{class:"text-xs"},"留空则不修改",-1)]),2)])]),e("div",G,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 关键词 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[3]||(o[3]=r=>l.value.keywords=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.keywords]])]),e("div",L,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 主题选择 ",2),n(e("select",{"onUpdate:modelValue":o[4]||(o[4]=r=>l.value.themesSelect=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border appearance-none bg-no-repeat bg-right focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none cursor-pointer",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]]),style:{"background-image":"url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M7%208l3%203%203-3%22%20stroke%3D%22%236B7280%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E')"}},[(v(!0),p(f,null,w(l.value.themesChoices,r=>(v(),p("option",{value:r.key,key:r.key},b(r.name)+" (by "+b(r.author)+" V"+b(r.version)+") ",9,N))),128))],2),[[x,l.value.themesSelect]])]),e("div",R,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Robots.txt ",2),n(e("textarea",{"onUpdate:modelValue":o[5]||(o[5]=r=>l.value.robotsText=r),rows:"3",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border resize-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.robotsText]])])]),e("div",P,[e("div",$,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 通知标题 ",2),n(e("input",{type:"text","onUpdate:modelValue":o[6]||(o[6]=r=>l.value.notify_title=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.notify_title]])]),e("div",q,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 通知内容 ",2),n(e("textarea",{"onUpdate:modelValue":o[7]||(o[7]=r=>l.value.notify_content=r),rows:"3",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border resize-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.notify_content]])])]),e("div",H,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 存储设置 ",2),e("div",J,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 存储路径 ",2),n(e("input",{type:"text",placeholder:"留空则使用默认路径,可不填写","onUpdate:modelValue":o[8]||(o[8]=r=>l.value.storage_path=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.storage_path]])]),e("div",O,[e("div",Q,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 存储方式 ",2),n(e("select",{"onUpdate:modelValue":o[9]||(o[9]=r=>l.value.file_storage=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border appearance-none bg-no-repeat bg-right focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none cursor-pointer",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]]),style:{"background-image":"url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M7%208l3%203%203-3%22%20stroke%3D%22%236B7280%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E')"}},o[32]||(o[32]=[e("option",{value:"local"},"本地存储",-1),e("option",{value:"s3"},"S3 存储",-1),e("option",{value:"webdav"},"Webdav 存储",-1)]),2),[[x,l.value.file_storage]])]),l.value.file_storage==="webdav"?(v(),p("div",X,[e("div",Y,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Webdav URL ",2),n(e("input",{type:"text",placeholder:"请输入 Webdav URL","onUpdate:modelValue":o[10]||(o[10]=r=>l.value.webdav_url=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.webdav_url]])]),e("div",Z,[e("div",ee,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Webdav Username ",2),n(e("input",{type:"text",placeholder:"请输入 Webdav Username","onUpdate:modelValue":o[11]||(o[11]=r=>l.value.webdav_username=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.webdav_username]])]),e("div",oe,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," Webdav Password ",2),n(e("input",{type:"password",placeholder:"请输入 Webdav Password","onUpdate:modelValue":o[12]||(o[12]=r=>l.value.webdav_password=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.webdav_password]])])])])):_("",!0),l.value.file_storage==="s3"?(v(),p("div",re,[e("div",te,[e("div",ae,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 AccessKeyId ",2),n(e("input",{type:"text","onUpdate:modelValue":o[13]||(o[13]=r=>l.value.s3_access_key_id=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_access_key_id]])]),e("div",se,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 SecretAccessKey ",2),n(e("input",{type:"password","onUpdate:modelValue":o[14]||(o[14]=r=>l.value.s3_secret_access_key=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_secret_access_key]])]),e("div",le,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 BucketName ",2),n(e("input",{type:"text","onUpdate:modelValue":o[15]||(o[15]=r=>l.value.s3_bucket_name=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_bucket_name]])]),e("div",ne,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 EndpointUrl ",2),n(e("input",{type:"text","onUpdate:modelValue":o[16]||(o[16]=r=>l.value.s3_endpoint_url=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_endpoint_url]])]),e("div",de,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Region Name ",2),n(e("input",{type:"text","onUpdate:modelValue":o[17]||(o[17]=r=>l.value.s3_region_name=r),placeholder:"auto",class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_region_name]])]),e("div",ie,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Signature Version ",2),n(e("select",{"onUpdate:modelValue":o[18]||(o[18]=r=>l.value.s3_signature_version=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[33]||(o[33]=[e("option",{value:"s3v2"},"S3v2",-1),e("option",{value:"s3v4"},"S3v4",-1)]),2),[[x,l.value.s3_signature_version]])]),e("div",ue,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," S3 Hostname ",2),n(e("input",{type:"text","onUpdate:modelValue":o[19]||(o[19]=r=>l.value.s3_hostname=r),class:t(["w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.s3_hostname]])]),e("div",ge,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 启用代理 ",2),e("div",ce,[e("button",{type:"button",onClick:o[20]||(o[20]=r=>l.value.s3_proxy=l.value.s3_proxy===1?0:1),class:t(["relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",[l.value.s3_proxy===1?"bg-indigo-600":"bg-gray-200"]]),role:"switch","aria-checked":l.value.s3_proxy===1},[e("span",{class:t(["pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",[l.value.s3_proxy===1?"translate-x-5":"translate-x-0",s(a)&&l.value.s3_proxy!==1?"bg-gray-100":"bg-white"]])},null,2)],10,ye),e("span",{class:t(["ml-3 text-sm",[s(a)?"text-gray-300":"text-gray-700"]])},b(l.value.s3_proxy===1?"已开启":"已关闭"),3)])])])])):_("",!0)])]),e("div",pe,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 上传限制 ",2),e("div",be,[e("div",ve,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 每分钟上传限制 ",2),e("div",me,[n(e("input",{type:"number","onUpdate:modelValue":o[21]||(o[21]=r=>l.value.uploadMinute=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.uploadMinute]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"分钟",2)])]),e("div",xe,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 上传数量限制 ",2),e("div",he,[n(e("input",{type:"number","onUpdate:modelValue":o[22]||(o[22]=r=>l.value.uploadCount=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.uploadCount]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"个文件",2)])]),e("div",fe,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 文件大小限制 ",2),e("div",we,[n(e("input",{type:"number","onUpdate:modelValue":o[23]||(o[23]=r=>c.value=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,c.value]]),n(e("select",{"onUpdate:modelValue":o[24]||(o[24]=r=>y.value=r),class:t(["rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[34]||(o[34]=[e("option",{value:"KB"},"KB",-1),e("option",{value:"MB"},"MB",-1),e("option",{value:"GB"},"GB",-1)]),2),[[x,y.value]])])]),e("div",_e,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 过期方式 ",2),e("div",ke,[(v(),p(f,null,w(["day","hour","minute","forever","count"],r=>e("label",{key:r,class:"relative inline-flex items-center group cursor-pointer"},[n(e("input",{type:"checkbox",value:r,"onUpdate:modelValue":o[25]||(o[25]=C=>l.value.expireStyle=C),class:"peer sr-only"},null,8,Ue),[[A,l.value.expireStyle]]),e("div",{class:t(["px-4 py-2 rounded-full border-2 transition-all duration-200 select-none",[l.value.expireStyle.includes(r)?(s(a),"bg-indigo-600 border-indigo-600 text-white"):s(a)?"bg-gray-700 border-gray-600 text-gray-300 hover:border-indigo-500":"bg-white border-gray-300 text-gray-700 hover:border-indigo-500"]])},b({day:"按天",hour:"按小时",minute:"按分钟",forever:"永久",count:"按次数"}[r]),3)])),64))])]),e("div",Se,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 最长保存时间 ",2),e("div",Ve,[n(e("input",{type:"number","onUpdate:modelValue":o[26]||(o[26]=r=>u.value=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,u.value]]),n(e("select",{"onUpdate:modelValue":o[27]||(o[27]=r=>g.value=r),class:t(["rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white hover:border-gray-500":"border-gray-300 hover:border-gray-400"]])},o[35]||(o[35]=[e("option",{value:"秒"},"秒",-1),e("option",{value:"分"},"分",-1),e("option",{value:"时"},"时",-1),e("option",{value:"天"},"天",-1)]),2),[[x,g.value]])])]),e("div",De,[e("label",{class:t(["block text-sm font-medium mb-2",[s(a)?"text-gray-300":"text-gray-700"]])}," 游客上传 ",2),e("div",Ce,[e("button",{type:"button",onClick:o[28]||(o[28]=r=>l.value.openUpload=l.value.openUpload===1?0:1),class:t(["relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",[l.value.openUpload===1?"bg-indigo-600":"bg-gray-200"]]),role:"switch","aria-checked":l.value.openUpload===1},[e("span",{class:t(["pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",[l.value.openUpload===1?"translate-x-5":"translate-x-0",s(a)&&l.value.openUpload!==1?"bg-gray-100":"bg-white"]])},null,2)],10,Be),e("span",{class:t(["ml-3 text-sm",[s(a)?"text-gray-300":"text-gray-700"]])},b(l.value.openUpload===1?"已开启":"已关闭"),3)])])])]),e("div",Me,[e("h3",{class:t(["text-lg font-medium mb-4",[s(a)?"text-white":"text-gray-800"]])}," 错误限制 ",2),e("div",Fe,[e("div",Ae,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 每分钟错误限制 ",2),e("div",ze,[n(e("input",{type:"number","onUpdate:modelValue":o[29]||(o[29]=r=>l.value.errorMinute=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.errorMinute]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"分钟",2)])]),e("div",Ee,[e("label",{class:t(["block text-sm font-medium",[s(a)?"text-gray-300":"text-gray-700"]])}," 错误次数限制 ",2),e("div",Te,[n(e("input",{type:"number","onUpdate:modelValue":o[30]||(o[30]=r=>l.value.errorCount=r),class:t(["w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none",[s(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500":"border-gray-300 hover:border-gray-400 placeholder-gray-500"]])},null,2),[[d,l.value.errorCount]]),e("span",{class:t([s(a)?"text-gray-300":"text-gray-700"])},"次",2)])])])]),e("div",{class:"flex justify-end mt-8"},[e("button",{onClick:D,class:"px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-200"}," 保存设置 ")])])],2)]))}});export{je as default}; diff --git a/themes/2024/assets/_commonjsHelpers-GlvjlJV-.js b/themes/2024/assets/_commonjsHelpers-CoPwux66.js similarity index 99% rename from themes/2024/assets/_commonjsHelpers-GlvjlJV-.js rename to themes/2024/assets/_commonjsHelpers-CoPwux66.js index 757d891..5d6466f 100644 --- a/themes/2024/assets/_commonjsHelpers-GlvjlJV-.js +++ b/themes/2024/assets/_commonjsHelpers-CoPwux66.js @@ -1,4 +1,4 @@ -import{c as k,B as F,D as R,r as _,E as K,o as V,F as X,G as x,H as Y}from"./index-CiI2cp0V.js";/** +import{c as k,B as F,D as R,r as _,E as K,o as V,F as X,G as x,H as Y}from"./index-BXFy05WO.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/box-BA8SMkDM.js b/themes/2024/assets/box-Cg0hrykV.js similarity index 90% rename from themes/2024/assets/box-BA8SMkDM.js rename to themes/2024/assets/box-Cg0hrykV.js index 0969ac1..c5615e1 100644 --- a/themes/2024/assets/box-BA8SMkDM.js +++ b/themes/2024/assets/box-Cg0hrykV.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-CiI2cp0V.js";/** +import{c as a}from"./index-BXFy05WO.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/file-CWusGEpI.js b/themes/2024/assets/file-DYxS796P.js similarity index 88% rename from themes/2024/assets/file-CWusGEpI.js rename to themes/2024/assets/file-DYxS796P.js index b5c024f..bc0d60f 100644 --- a/themes/2024/assets/file-CWusGEpI.js +++ b/themes/2024/assets/file-DYxS796P.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-CiI2cp0V.js";/** +import{c as a}from"./index-BXFy05WO.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/assets/index-CiI2cp0V.js b/themes/2024/assets/index-BXFy05WO.js similarity index 99% rename from themes/2024/assets/index-CiI2cp0V.js rename to themes/2024/assets/index-BXFy05WO.js index 5da341f..09aec20 100644 --- a/themes/2024/assets/index-CiI2cp0V.js +++ b/themes/2024/assets/index-BXFy05WO.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RetrievewFileView-BckF8ahS.js","assets/_commonjsHelpers-GlvjlJV-.js","assets/box-BA8SMkDM.js","assets/file-CWusGEpI.js","assets/trash-dDHutUhM.js","assets/RetrievewFileView-DguaL712.css","assets/SendFileView-Ctmzhn2X.js","assets/SendFileView-D1tJweYo.css","assets/AdminLayout-DGEvILen.js","assets/AdminLayout-BA8HwEVA.css","assets/DashboardView-6JCRMawe.js","assets/FileManageView-BYyHY3ZZ.js","assets/LoginView-CvDOmLlY.js","assets/LoginView-Cf0iN_2x.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RetrievewFileView--mI6JURl.js","assets/_commonjsHelpers-CoPwux66.js","assets/box-Cg0hrykV.js","assets/file-DYxS796P.js","assets/trash-CUA4S_ac.js","assets/RetrievewFileView-DguaL712.css","assets/SendFileView-BElzCnKe.js","assets/SendFileView-D1tJweYo.css","assets/AdminLayout-DDemRuZ3.js","assets/AdminLayout-BA8HwEVA.css","assets/DashboardView-62OQJn6e.js","assets/FileManageView-pSYIZ4a9.js","assets/LoginView-CUuunog8.js","assets/LoginView-DO0tOjab.css"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();/** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -83,4 +83,4 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RetrievewFileVi `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[hi]=this[hi]={accessors:{}}).accessors,r=this.prototype;function o(i){const l=gn(i);s[l]||(Jh(r,i),s[l]=!0)}return b.isArray(t)?t.forEach(o):o(t),this}};Le.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);b.reduceDescriptors(Le.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});b.freezeMethods(Le);function or(e,t){const n=this||Wn,s=t||n,r=Le.from(s.headers);let o=s.data;return b.forEach(e,function(l){o=l.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function Rc(e){return!!(e&&e.__CANCEL__)}function fn(e,t,n){J.call(this,e??"canceled",J.ERR_CANCELED,t,n),this.name="CanceledError"}b.inherits(fn,J,{__CANCEL__:!0});function Cc(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new J("Request failed with status code "+n.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Gh(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xh(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,o=0,i;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),a=s[o];i||(i=u),n[r]=c,s[r]=u;let f=o,p=0;for(;f!==r;)p+=n[f++],f=f%e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),u-i{n=a,r=null,o&&(clearTimeout(o),o=null),e.apply(null,u)};return[(...u)=>{const a=Date.now(),f=a-n;f>=s?i(u,a):(r=u,o||(o=setTimeout(()=>{o=null,i(r)},s-f)))},()=>r&&i(r)]}const gs=(e,t,n=3)=>{let s=0;const r=Xh(50,250);return Qh(o=>{const i=o.loaded,l=o.lengthComputable?o.total:void 0,c=i-s,u=r(c),a=i<=l;s=i;const f={loaded:i,total:l,progress:l?i/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&a?(l-i)/u:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},pi=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},mi=e=>(...t)=>b.asap(()=>e(...t)),Yh=ve.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ve.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ve.origin),ve.navigator&&/(msie|trident)/i.test(ve.navigator.userAgent)):()=>!0,Zh=ve.hasStandardBrowserEnv?{write(e,t,n,s,r,o){const i=[e+"="+encodeURIComponent(t)];b.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),b.isString(s)&&i.push("path="+s),b.isString(r)&&i.push("domain="+r),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ep(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function tp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Tc(e,t){return e&&!ep(t)?tp(e,t):t}const gi=e=>e instanceof Le?{...e}:e;function Ut(e,t){t=t||{};const n={};function s(u,a,f,p){return b.isPlainObject(u)&&b.isPlainObject(a)?b.merge.call({caseless:p},u,a):b.isPlainObject(a)?b.merge({},a):b.isArray(a)?a.slice():a}function r(u,a,f,p){if(b.isUndefined(a)){if(!b.isUndefined(u))return s(void 0,u,f,p)}else return s(u,a,f,p)}function o(u,a){if(!b.isUndefined(a))return s(void 0,a)}function i(u,a){if(b.isUndefined(a)){if(!b.isUndefined(u))return s(void 0,u)}else return s(void 0,a)}function l(u,a,f){if(f in t)return s(u,a);if(f in e)return s(void 0,u)}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(u,a,f)=>r(gi(u),gi(a),f,!0)};return b.forEach(Object.keys(Object.assign({},e,t)),function(a){const f=c[a]||r,p=f(e[a],t[a],a);b.isUndefined(p)&&f!==l||(n[a]=p)}),n}const Ac=e=>{const t=Ut({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:o,headers:i,auth:l}=t;t.headers=i=Le.from(i),t.url=Ec(Tc(t.baseURL,t.url),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(b.isFormData(n)){if(ve.hasStandardBrowserEnv||ve.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((c=i.getContentType())!==!1){const[u,...a]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...a].join("; "))}}if(ve.hasStandardBrowserEnv&&(s&&b.isFunction(s)&&(s=s(t)),s||s!==!1&&Yh(t.url))){const u=r&&o&&Zh.read(o);u&&i.set(r,u)}return t},np=typeof XMLHttpRequest<"u",sp=np&&function(e){return new Promise(function(n,s){const r=Ac(e);let o=r.data;const i=Le.from(r.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=r,a,f,p,m,y;function _(){m&&m(),y&&y(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let x=new XMLHttpRequest;x.open(r.method.toUpperCase(),r.url,!0),x.timeout=r.timeout;function A(){if(!x)return;const P=Le.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),j={data:!l||l==="text"||l==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:P,config:e,request:x};Cc(function(z){n(z),_()},function(z){s(z),_()},j),x=null}"onloadend"in x?x.onloadend=A:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(A)},x.onabort=function(){x&&(s(new J("Request aborted",J.ECONNABORTED,e,x)),x=null)},x.onerror=function(){s(new J("Network Error",J.ERR_NETWORK,e,x)),x=null},x.ontimeout=function(){let L=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const j=r.transitional||Sc;r.timeoutErrorMessage&&(L=r.timeoutErrorMessage),s(new J(L,j.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,x)),x=null},o===void 0&&i.setContentType(null),"setRequestHeader"in x&&b.forEach(i.toJSON(),function(L,j){x.setRequestHeader(j,L)}),b.isUndefined(r.withCredentials)||(x.withCredentials=!!r.withCredentials),l&&l!=="json"&&(x.responseType=r.responseType),u&&([p,y]=gs(u,!0),x.addEventListener("progress",p)),c&&x.upload&&([f,m]=gs(c),x.upload.addEventListener("progress",f),x.upload.addEventListener("loadend",m)),(r.cancelToken||r.signal)&&(a=P=>{x&&(s(!P||P.type?new fn(null,e,x):P),x.abort(),x=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const C=Gh(r.url);if(C&&ve.protocols.indexOf(C)===-1){s(new J("Unsupported protocol "+C+":",J.ERR_BAD_REQUEST,e));return}x.send(o||null)})},rp=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,r;const o=function(u){if(!r){r=!0,l();const a=u instanceof Error?u:this.reason;s.abort(a instanceof J?a:new fn(a instanceof Error?a.message:a))}};let i=t&&setTimeout(()=>{i=null,o(new J(`timeout ${t} of ms exceeded`,J.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:c}=s;return c.unsubscribe=()=>b.asap(l),c}},op=function*(e,t){let n=e.byteLength;if(n{const r=ip(e,t);let o=0,i,l=c=>{i||(i=!0,s&&s(c))};return new ReadableStream({async pull(c){try{const{done:u,value:a}=await r.next();if(u){l(),c.close();return}let f=a.byteLength;if(n){let p=o+=f;n(p)}c.enqueue(new Uint8Array(a))}catch(u){throw l(u),u}},cancel(c){return l(c),r.return()}},{highWaterMark:2})},Bs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Oc=Bs&&typeof ReadableStream=="function",cp=Bs&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Pc=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ap=Oc&&Pc(()=>{let e=!1;const t=new Request(ve.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),bi=64*1024,Cr=Oc&&Pc(()=>b.isReadableStream(new Response("").body)),ys={stream:Cr&&(e=>e.body)};Bs&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ys[t]&&(ys[t]=b.isFunction(e[t])?n=>n[t]():(n,s)=>{throw new J(`Response type '${t}' is not supported`,J.ERR_NOT_SUPPORT,s)})})})(new Response);const up=async e=>{if(e==null)return 0;if(b.isBlob(e))return e.size;if(b.isSpecCompliantForm(e))return(await new Request(ve.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(b.isArrayBufferView(e)||b.isArrayBuffer(e))return e.byteLength;if(b.isURLSearchParams(e)&&(e=e+""),b.isString(e))return(await cp(e)).byteLength},fp=async(e,t)=>{const n=b.toFiniteNumber(e.getContentLength());return n??up(t)},dp=Bs&&(async e=>{let{url:t,method:n,data:s,signal:r,cancelToken:o,timeout:i,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:a,withCredentials:f="same-origin",fetchOptions:p}=Ac(e);u=u?(u+"").toLowerCase():"text";let m=rp([r,o&&o.toAbortSignal()],i),y;const _=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let x;try{if(c&&ap&&n!=="get"&&n!=="head"&&(x=await fp(a,s))!==0){let j=new Request(t,{method:"POST",body:s,duplex:"half"}),X;if(b.isFormData(s)&&(X=j.headers.get("content-type"))&&a.setContentType(X),j.body){const[z,V]=pi(x,gs(mi(c)));s=yi(j.body,bi,z,V)}}b.isString(f)||(f=f?"include":"omit");const A="credentials"in Request.prototype;y=new Request(t,{...p,signal:m,method:n.toUpperCase(),headers:a.normalize().toJSON(),body:s,duplex:"half",credentials:A?f:void 0});let C=await fetch(y);const P=Cr&&(u==="stream"||u==="response");if(Cr&&(l||P&&_)){const j={};["status","statusText","headers"].forEach(N=>{j[N]=C[N]});const X=b.toFiniteNumber(C.headers.get("content-length")),[z,V]=l&&pi(X,gs(mi(l),!0))||[];C=new Response(yi(C.body,bi,z,()=>{V&&V(),_&&_()}),j)}u=u||"text";let L=await ys[b.findKey(ys,u)||"text"](C,e);return!P&&_&&_(),await new Promise((j,X)=>{Cc(j,X,{data:L,headers:Le.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:y})})}catch(A){throw _&&_(),A&&A.name==="TypeError"&&/fetch/i.test(A.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,e,y),{cause:A.cause||A}):J.from(A,A&&A.code,e,y)}}),Tr={http:Th,xhr:sp,fetch:dp};b.forEach(Tr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const _i=e=>`- ${e}`,hp=e=>b.isFunction(e)||e===null||e===!1,Lc={getAdapter:e=>{e=b.isArray(e)?e:[e];const{length:t}=e;let n,s;const r={};for(let o=0;o`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since : `+o.map(_i).join(` `):" "+_i(o[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return s},adapters:Tr};function ir(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new fn(null,e)}function vi(e){return ir(e),e.headers=Le.from(e.headers),e.data=or.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Lc.getAdapter(e.adapter||Wn.adapter)(e).then(function(s){return ir(e),s.data=or.call(e,e.transformResponse,s),s.headers=Le.from(s.headers),s},function(s){return Rc(s)||(ir(e),s&&s.response&&(s.response.data=or.call(e,e.transformResponse,s.response),s.response.headers=Le.from(s.response.headers))),Promise.reject(s)})}const Ic="1.7.9",$s={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$s[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const wi={};$s.transitional=function(t,n,s){function r(o,i){return"[Axios v"+Ic+"] Transitional option '"+o+"'"+i+(s?". "+s:"")}return(o,i,l)=>{if(t===!1)throw new J(r(i," has been removed"+(n?" in "+n:"")),J.ERR_DEPRECATED);return n&&!wi[i]&&(wi[i]=!0,console.warn(r(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,l):!0}};$s.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function pp(e,t,n){if(typeof e!="object")throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const o=s[r],i=t[o];if(i){const l=e[o],c=l===void 0||i(l,o,e);if(c!==!0)throw new J("option "+o+" must be "+c,J.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new J("Unknown option "+o,J.ERR_BAD_OPTION)}}const rs={assertOptions:pp,validators:$s},et=rs.validators;let Bt=class{constructor(t){this.defaults=t,this.interceptors={request:new di,response:new di}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const o=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=` -`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ut(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&rs.assertOptions(s,{silentJSONParsing:et.transitional(et.boolean),forcedJSONParsing:et.transitional(et.boolean),clarifyTimeoutError:et.transitional(et.boolean)},!1),r!=null&&(b.isFunction(r)?n.paramsSerializer={serialize:r}:rs.assertOptions(r,{encode:et.function,serialize:et.function},!0)),rs.assertOptions(n,{baseUrl:et.spelling("baseURL"),withXsrfToken:et.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&b.merge(o.common,o[n.method]);o&&b.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),n.headers=Le.concat(i,o);const l=[];let c=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(n)===!1||(c=c&&_.synchronous,l.unshift(_.fulfilled,_.rejected))});const u=[];this.interceptors.response.forEach(function(_){u.push(_.fulfilled,_.rejected)});let a,f=0,p;if(!c){const y=[vi.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,u),p=y.length,a=Promise.resolve(n);f{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const i=new Promise(l=>{s.subscribe(l),o=l}).then(r);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,l){s.reason||(s.reason=new fn(o,i,l),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Nc(function(r){t=r}),cancel:t}}};function gp(e){return function(n){return e.apply(null,n)}}function yp(e){return b.isObject(e)&&e.isAxiosError===!0}const Ar={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ar).forEach(([e,t])=>{Ar[t]=e});function Mc(e){const t=new Bt(e),n=uc(Bt.prototype.request,t);return b.extend(n,Bt.prototype,t,{allOwnKeys:!0}),b.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Mc(Ut(e,r))},n}const he=Mc(Wn);he.Axios=Bt;he.CanceledError=fn;he.CancelToken=mp;he.isCancel=Rc;he.VERSION=Ic;he.toFormData=js;he.AxiosError=J;he.Cancel=he.CanceledError;he.all=function(t){return Promise.all(t)};he.spread=gp;he.isAxiosError=yp;he.mergeConfig=Ut;he.AxiosHeaders=Le;he.formToJSON=e=>xc(b.isHTMLForm(e)?new FormData(e):e);he.getAdapter=Lc.getAdapter;he.HttpStatusCode=Ar;he.default=he;const{Axios:qp,AxiosError:Kp,CanceledError:Wp,isCancel:zp,CancelToken:Jp,VERSION:Gp,all:Xp,Cancel:Qp,isAxiosError:Yp,spread:Zp,toFormData:em,AxiosHeaders:tm,HttpStatusCode:nm,formToJSON:sm,getAdapter:rm,mergeConfig:om}=he,bp="",kc=bp,Zr=he.create({baseURL:kc,timeout:1e15,headers:{"Content-Type":"application/json"}});Zr.interceptors.request.use(e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=`Bearer ${t}`),e.url&&!e.url.startsWith("http")&&(e.url=`${kc}/${e.url.replace(/^\//,"")}`),e},e=>Promise.reject(e));Zr.interceptors.response.use(e=>e.data,e=>{if(e.response)switch(e.response.status){case 401:console.error("未授权,请重新登录"),localStorage.clear(),window.location.href="/#/login";break;case 403:console.error("禁止访问");break;case 404:console.error("请求的资源不存在");break;default:console.error("发生错误:",e.response.data)}else e.request?console.error("未收到响应:",e.request):console.error("请求配置错误:",e.message);return Promise.reject(e)});const Fc=Cf("alert",{state:()=>({alerts:[]}),actions:{showAlert(e,t="info",n=5e3){const s=Date.now(),r=Date.now();this.alerts.push({id:s,message:e,type:t,progress:100,duration:n,startTime:r}),setTimeout(()=>this.removeAlert(s),n)},removeAlert(e){const t=this.alerts.findIndex(n=>n.id===e);t>-1&&this.alerts.splice(t,1)},updateAlertProgress(e){const t=this.alerts.find(n=>n.id===e);if(t){const s=100-(Date.now()-t.startTime)/t.duration*100;t.progress=Math.max(0,s),t.progress<=0&&this.removeAlert(e)}}}}),_p={class:"p-4"},vp={class:"flex items-start"},wp={class:"flex-shrink-0"},Ep={class:"ml-3 flex-1 pt-0.5"},Sp=["innerHTML"],xp={class:"ml-4 flex-shrink-0 flex"},Rp=["onClick"],Cp={class:"h-1 bg-white bg-opacity-25"},Tp=Vn({__name:"AlertComponent",setup(e){const t=Fc(),{alerts:n}=Tf(t),{removeAlert:s,updateAlertProgress:r}=t,o={success:"from-green-500 to-green-600",error:"from-red-500 to-red-600",warning:"from-yellow-500 to-yellow-600",info:"from-blue-500 to-blue-600"},i={success:kd,error:Bd,warning:Md,info:Fd};let l;return As(()=>{l=setInterval(()=>{n.value.forEach(c=>{r(c.id)})},100)}),qr(()=>{clearInterval(l)}),(c,u)=>(qe(),tn(lf,{name:"alert-fade",tag:"div",class:"fixed top-4 left-4 z-50 w-full sm:max-w-sm md:max-w-md space-y-4 px-4 sm:px-0"},{default:us(()=>[(qe(!0),Nn(He,null,Va(Oe(n),a=>(qe(),Nn("div",{key:a.id,class:an(["w-full rounded-lg shadow-xl overflow-hidden","bg-gradient-to-r",o[a.type]])},[ke("div",_p,[ke("div",vp,[ke("div",wp,[(qe(),tn(ml(i[a.type]),{class:"h-6 w-6 text-white"}))]),ke("div",Ep,[ke("p",{class:"text-sm font-medium text-white",innerHTML:a.message},null,8,Sp)]),ke("div",xp,[ke("button",{onClick:f=>Oe(s)(a.id),class:"inline-flex text-white hover:text-gray-200 focus:outline-none transition-colors duration-200"},[u[0]||(u[0]=ke("span",{class:"sr-only"},"关闭",-1)),me(Oe($d),{class:"h-5 w-5"})],8,Rp)])])]),ke("div",Cp,[ke("div",{class:"h-full bg-white transition-all duration-100 ease-out",style:Es({width:`${a.progress}%`})},null,4)])],2))),128))]),_:1}))}}),Ap=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Op=Ap(Tp,[["__scopeId","data-v-6fdbaa84"]]),Pp={key:0,class:"loading-overlay"},Lp=Vn({__name:"App",setup(e){const t=en(!1),n=en(!1),s=Ld(),r=Fc(),o=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>{const c=localStorage.getItem("colorMode");return c?c==="dark":null},l=c=>{t.value=c,localStorage.setItem("colorMode",c?"dark":"light")};return As(()=>{const c=i();l(c!==null?c:o()),Zr.post("/",{}).then(u=>{u.code===200&&(localStorage.setItem("config",JSON.stringify(u.detail)),u.detail.notify_title&&u.detail.notify_content&&localStorage.getItem("notify")!==u.detail.notify_title+u.detail.notify_content&&(localStorage.setItem("notify",u.detail.notify_title+u.detail.notify_content),r.showAlert(u.detail.notify_title+": "+u.detail.notify_content,"success")))})}),fu(()=>{document.documentElement.classList.toggle("dark",t.value)}),s.beforeEach((c,u,a)=>{n.value=!0,a()}),s.afterEach(()=>{setTimeout(()=>{n.value=!1},200)}),jt("isDarkMode",t),jt("setColorMode",l),jt("isLoading",n),(c,u)=>(qe(),Nn("div",{class:an(["app-container",t.value?"dark":"light"])},[me(Hd,{modelValue:t.value,"onUpdate:modelValue":u[0]||(u[0]=a=>t.value=a)},null,8,["modelValue"]),n.value?(qe(),Nn("div",Pp,u[1]||(u[1]=[ke("div",{class:"loading-spinner"},null,-1)]))):xu("",!0),me(Oe(ac),null,{default:us(({Component:a})=>[me($u,{name:"fade",mode:"out-in"},{default:us(()=>[(qe(),tn(ml(a),{key:c.$route.fullPath}))]),_:2},1024)]),_:1}),me(Op)],2))}}),Ip="modulepreload",Np=function(e){return"/"+e},Ei={},vt=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=Np(c),c in Ei)return;Ei[c]=!0;const u=c.endsWith(".css"),a=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${a}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Ip,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return r.then(i=>{for(const l of i||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})},Mp=Od({history:od("/"),routes:[{path:"/",name:"Retrieve",component:()=>vt(()=>import("./RetrievewFileView-BckF8ahS.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/send",name:"Send",component:()=>vt(()=>import("./SendFileView-Ctmzhn2X.js"),__vite__mapDeps([6,1,3,4,7]))},{path:"/admin",name:"Manage",component:()=>vt(()=>import("./AdminLayout-DGEvILen.js"),__vite__mapDeps([8,2,9])),redirect:"/admin/dashboard",children:[{path:"/admin/dashboard",name:"Dashboard",component:()=>vt(()=>import("./DashboardView-6JCRMawe.js"),__vite__mapDeps([10,3,4]))},{path:"/admin/files",name:"FileManage",component:()=>vt(()=>import("./FileManageView-BYyHY3ZZ.js"),__vite__mapDeps([11,3]))},{path:"/admin/settings",name:"Settings",component:()=>vt(()=>import("./SystemSettingsView-DMnqdwce.js"),[])}]},{path:"/login",name:"Login",component:()=>vt(()=>import("./LoginView-CvDOmLlY.js"),__vite__mapDeps([12,2,13]))}]});vt(()=>import("./SendFileView-Ctmzhn2X.js"),__vite__mapDeps([6,1,3,4,7]));const eo=yf(Lp);eo.use(vf());eo.use(Mp);eo.mount("#app");export{Zr as A,Vn as B,Bp as C,nn as D,fl as E,He as F,Cf as G,Hn as H,qr as I,tn as J,ml as K,jp as L,lf as T,$d as X,Ap as _,Hp as a,Fe as b,qt as c,Nn as d,ke as e,me as f,Oe as g,$p as h,Pe as i,kp as j,xu as k,us as l,Su as m,an as n,As as o,Fp as p,Va as q,en as r,Tf as s,Xc as t,Fc as u,Dp as v,Sn as w,$u as x,Ld as y,qe as z}; +`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ut(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&rs.assertOptions(s,{silentJSONParsing:et.transitional(et.boolean),forcedJSONParsing:et.transitional(et.boolean),clarifyTimeoutError:et.transitional(et.boolean)},!1),r!=null&&(b.isFunction(r)?n.paramsSerializer={serialize:r}:rs.assertOptions(r,{encode:et.function,serialize:et.function},!0)),rs.assertOptions(n,{baseUrl:et.spelling("baseURL"),withXsrfToken:et.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&b.merge(o.common,o[n.method]);o&&b.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),n.headers=Le.concat(i,o);const l=[];let c=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(n)===!1||(c=c&&_.synchronous,l.unshift(_.fulfilled,_.rejected))});const u=[];this.interceptors.response.forEach(function(_){u.push(_.fulfilled,_.rejected)});let a,f=0,p;if(!c){const y=[vi.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,u),p=y.length,a=Promise.resolve(n);f{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const i=new Promise(l=>{s.subscribe(l),o=l}).then(r);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,l){s.reason||(s.reason=new fn(o,i,l),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Nc(function(r){t=r}),cancel:t}}};function gp(e){return function(n){return e.apply(null,n)}}function yp(e){return b.isObject(e)&&e.isAxiosError===!0}const Ar={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ar).forEach(([e,t])=>{Ar[t]=e});function Mc(e){const t=new Bt(e),n=uc(Bt.prototype.request,t);return b.extend(n,Bt.prototype,t,{allOwnKeys:!0}),b.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Mc(Ut(e,r))},n}const he=Mc(Wn);he.Axios=Bt;he.CanceledError=fn;he.CancelToken=mp;he.isCancel=Rc;he.VERSION=Ic;he.toFormData=js;he.AxiosError=J;he.Cancel=he.CanceledError;he.all=function(t){return Promise.all(t)};he.spread=gp;he.isAxiosError=yp;he.mergeConfig=Ut;he.AxiosHeaders=Le;he.formToJSON=e=>xc(b.isHTMLForm(e)?new FormData(e):e);he.getAdapter=Lc.getAdapter;he.HttpStatusCode=Ar;he.default=he;const{Axios:qp,AxiosError:Kp,CanceledError:Wp,isCancel:zp,CancelToken:Jp,VERSION:Gp,all:Xp,Cancel:Qp,isAxiosError:Yp,spread:Zp,toFormData:em,AxiosHeaders:tm,HttpStatusCode:nm,formToJSON:sm,getAdapter:rm,mergeConfig:om}=he,bp="",kc=bp,Zr=he.create({baseURL:kc,timeout:1e15,headers:{"Content-Type":"application/json"}});Zr.interceptors.request.use(e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=`Bearer ${t}`),e.url&&!e.url.startsWith("http")&&(e.url=`${kc}/${e.url.replace(/^\//,"")}`),e},e=>Promise.reject(e));Zr.interceptors.response.use(e=>e.data,e=>{if(e.response)switch(e.response.status){case 401:console.error("未授权,请重新登录"),localStorage.clear(),window.location.href="/#/login";break;case 403:console.error("禁止访问");break;case 404:console.error("请求的资源不存在");break;default:console.error("发生错误:",e.response.data)}else e.request?console.error("未收到响应:",e.request):console.error("请求配置错误:",e.message);return Promise.reject(e)});const Fc=Cf("alert",{state:()=>({alerts:[]}),actions:{showAlert(e,t="info",n=5e3){const s=Date.now(),r=Date.now();this.alerts.push({id:s,message:e,type:t,progress:100,duration:n,startTime:r}),setTimeout(()=>this.removeAlert(s),n)},removeAlert(e){const t=this.alerts.findIndex(n=>n.id===e);t>-1&&this.alerts.splice(t,1)},updateAlertProgress(e){const t=this.alerts.find(n=>n.id===e);if(t){const s=100-(Date.now()-t.startTime)/t.duration*100;t.progress=Math.max(0,s),t.progress<=0&&this.removeAlert(e)}}}}),_p={class:"p-4"},vp={class:"flex items-start"},wp={class:"flex-shrink-0"},Ep={class:"ml-3 flex-1 pt-0.5"},Sp=["innerHTML"],xp={class:"ml-4 flex-shrink-0 flex"},Rp=["onClick"],Cp={class:"h-1 bg-white bg-opacity-25"},Tp=Vn({__name:"AlertComponent",setup(e){const t=Fc(),{alerts:n}=Tf(t),{removeAlert:s,updateAlertProgress:r}=t,o={success:"from-green-500 to-green-600",error:"from-red-500 to-red-600",warning:"from-yellow-500 to-yellow-600",info:"from-blue-500 to-blue-600"},i={success:kd,error:Bd,warning:Md,info:Fd};let l;return As(()=>{l=setInterval(()=>{n.value.forEach(c=>{r(c.id)})},100)}),qr(()=>{clearInterval(l)}),(c,u)=>(qe(),tn(lf,{name:"alert-fade",tag:"div",class:"fixed top-4 left-4 z-50 w-full sm:max-w-sm md:max-w-md space-y-4 px-4 sm:px-0"},{default:us(()=>[(qe(!0),Nn(He,null,Va(Oe(n),a=>(qe(),Nn("div",{key:a.id,class:an(["w-full rounded-lg shadow-xl overflow-hidden","bg-gradient-to-r",o[a.type]])},[ke("div",_p,[ke("div",vp,[ke("div",wp,[(qe(),tn(ml(i[a.type]),{class:"h-6 w-6 text-white"}))]),ke("div",Ep,[ke("p",{class:"text-sm font-medium text-white",innerHTML:a.message},null,8,Sp)]),ke("div",xp,[ke("button",{onClick:f=>Oe(s)(a.id),class:"inline-flex text-white hover:text-gray-200 focus:outline-none transition-colors duration-200"},[u[0]||(u[0]=ke("span",{class:"sr-only"},"关闭",-1)),me(Oe($d),{class:"h-5 w-5"})],8,Rp)])])]),ke("div",Cp,[ke("div",{class:"h-full bg-white transition-all duration-100 ease-out",style:Es({width:`${a.progress}%`})},null,4)])],2))),128))]),_:1}))}}),Ap=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Op=Ap(Tp,[["__scopeId","data-v-6fdbaa84"]]),Pp={key:0,class:"loading-overlay"},Lp=Vn({__name:"App",setup(e){const t=en(!1),n=en(!1),s=Ld(),r=Fc(),o=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>{const c=localStorage.getItem("colorMode");return c?c==="dark":null},l=c=>{t.value=c,localStorage.setItem("colorMode",c?"dark":"light")};return As(()=>{const c=i();l(c!==null?c:o()),Zr.post("/",{}).then(u=>{u.code===200&&(localStorage.setItem("config",JSON.stringify(u.detail)),u.detail.notify_title&&u.detail.notify_content&&localStorage.getItem("notify")!==u.detail.notify_title+u.detail.notify_content&&(localStorage.setItem("notify",u.detail.notify_title+u.detail.notify_content),r.showAlert(u.detail.notify_title+": "+u.detail.notify_content,"success")))})}),fu(()=>{document.documentElement.classList.toggle("dark",t.value)}),s.beforeEach((c,u,a)=>{n.value=!0,a()}),s.afterEach(()=>{setTimeout(()=>{n.value=!1},200)}),jt("isDarkMode",t),jt("setColorMode",l),jt("isLoading",n),(c,u)=>(qe(),Nn("div",{class:an(["app-container",t.value?"dark":"light"])},[me(Hd,{modelValue:t.value,"onUpdate:modelValue":u[0]||(u[0]=a=>t.value=a)},null,8,["modelValue"]),n.value?(qe(),Nn("div",Pp,u[1]||(u[1]=[ke("div",{class:"loading-spinner"},null,-1)]))):xu("",!0),me(Oe(ac),null,{default:us(({Component:a})=>[me($u,{name:"fade",mode:"out-in"},{default:us(()=>[(qe(),tn(ml(a),{key:c.$route.fullPath}))]),_:2},1024)]),_:1}),me(Op)],2))}}),Ip="modulepreload",Np=function(e){return"/"+e},Ei={},vt=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=Np(c),c in Ei)return;Ei[c]=!0;const u=c.endsWith(".css"),a=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${a}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Ip,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return r.then(i=>{for(const l of i||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})},Mp=Od({history:od("/"),routes:[{path:"/",name:"Retrieve",component:()=>vt(()=>import("./RetrievewFileView--mI6JURl.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/send",name:"Send",component:()=>vt(()=>import("./SendFileView-BElzCnKe.js"),__vite__mapDeps([6,1,3,4,7]))},{path:"/admin",name:"Manage",component:()=>vt(()=>import("./AdminLayout-DDemRuZ3.js"),__vite__mapDeps([8,2,9])),redirect:"/admin/dashboard",children:[{path:"/admin/dashboard",name:"Dashboard",component:()=>vt(()=>import("./DashboardView-62OQJn6e.js"),__vite__mapDeps([10,3,4]))},{path:"/admin/files",name:"FileManage",component:()=>vt(()=>import("./FileManageView-pSYIZ4a9.js"),__vite__mapDeps([11,3]))},{path:"/admin/settings",name:"Settings",component:()=>vt(()=>import("./SystemSettingsView-Cnrs3zpT.js"),[])}]},{path:"/login",name:"Login",component:()=>vt(()=>import("./LoginView-CUuunog8.js"),__vite__mapDeps([12,2,13]))}]});vt(()=>import("./SendFileView-BElzCnKe.js"),__vite__mapDeps([6,1,3,4,7]));const eo=yf(Lp);eo.use(vf());eo.use(Mp);eo.mount("#app");export{Zr as A,Vn as B,Bp as C,nn as D,fl as E,He as F,Cf as G,Hn as H,qr as I,tn as J,ml as K,jp as L,lf as T,$d as X,Ap as _,Hp as a,Fe as b,qt as c,Nn as d,ke as e,me as f,Oe as g,$p as h,Pe as i,kp as j,xu as k,us as l,Su as m,an as n,As as o,Fp as p,Va as q,en as r,Tf as s,Xc as t,Fc as u,Dp as v,Sn as w,$u as x,Ld as y,qe as z}; diff --git a/themes/2024/assets/trash-dDHutUhM.js b/themes/2024/assets/trash-CUA4S_ac.js similarity index 95% rename from themes/2024/assets/trash-dDHutUhM.js rename to themes/2024/assets/trash-CUA4S_ac.js index 6746ade..dd636dd 100644 --- a/themes/2024/assets/trash-dDHutUhM.js +++ b/themes/2024/assets/trash-CUA4S_ac.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-CiI2cp0V.js";/** +import{c as a}from"./index-BXFy05WO.js";/** * @license lucide-vue-next v0.445.0 - ISC * * This source code is licensed under the ISC license. diff --git a/themes/2024/index.html b/themes/2024/index.html index 140ed51..8bbb78f 100644 --- a/themes/2024/index.html +++ b/themes/2024/index.html @@ -11,7 +11,7 @@ {{title}} - +