HEX
Server: nginx/1.28.3
System: Linux ip-172-31-12-242 6.17.0-1007-aws #7~24.04.1-Ubuntu SMP Thu Jan 22 21:04:49 UTC 2026 x86_64
User: root (0)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/server/panel/BTPanel/static/js/useController16.js
import{k as p,cX as $,c as J,e as w,_ as L,w as M,a2 as I,M as x}from"./utils-lib.js?v=1777008528";import{modifyRedirect as h,removeRedirect as N,getRedirectFile as j,getFileBody as H,getRedirectList as B,createRedirect as k,getProjectDomain as V,setErrorRedirect as G,MulDelRedirect as X}from"./site.js?v=1777008528";import{aI as z,aJ as K,r as u}from"./base-lib.js?v=1777008528";import{b as Q}from"./index3.js?v=1777008528";import{u as O,S as W}from"./useStore2.js?v=1777008528";const P=K("SITE-REDIRECT-STORE",()=>{const{siteType:e,siteInfo:a}=O(),t=u(!1);return{getDomainEvent:async c=>{try{const r=["php","html"].includes(e.value),{data:i}=await p({request:r?$(c):V(c,e.value)});return e.value==="proxy"?{data:i.data.domain_list,status:!0}:{data:Array.isArray(i)?i:i.data,status:!0}}catch(r){return{status:!1,msg:"获取域名失败"}}},changeStatusEvent:async c=>{try{const r=await p({loading:"正在修改,请稍后...",request:h(c,e.value),message:!0});return{status:r.status,msg:r.msg}}catch(r){return{status:!1,msg:"修改状态失败"}}},delRedirectEvent:async c=>{try{const r=await p({loading:"正在删除,请稍后...",request:N(c,e.value),message:!0});return{status:r.status,msg:r.msg}}catch(r){return{status:!1,msg:"删除重定向失败"}}},getRedirectFileEvent:async c=>{try{const r=["php","html","proxy"].includes(e.value),i=await p({loading:"正在获取内容,请稍候...",request:r?j(c,e.value):H(c)});return e.value==="php"||e.value==="html"?{data:{content:i.data[0].data,redirect_conf_file:i.data[1]},status:!0}:{data:{content:i.data.data,redirect_conf_file:c.path},status:!0}}catch(r){return{status:!1,msg:"获取配置文件失败"}}},getRedirectDataEvent:async c=>{try{const r=await p({request:B(c,e.value),data:Array});return{data:r,total:r.length,other:{}}}catch(r){return{data:[],total:0,other:{}}}},submitRedirectEvent:async(c,r)=>{try{const i=await p({loading:"正在提交,请稍后...",request:r?h(c,e.value):k(c,e.value),message:!0});return{status:i.status,msg:i.msg}}catch(i){return{status:!1,msg:"添加重定向失败"}}},submitErrorRedirectEvent:async(c,r)=>{try{const i=await p({loading:"正在保存,请稍后...",request:r||e.value==="html"?h(c,e.value):G(c),message:!0});return{status:i.status,msg:i.msg}}catch(i){return{status:!1,msg:"添加错误重定向失败"}}},isRefreshList:t}}),Y=()=>z(P()),{plugin:Z}=J(),{siteInfo:l,siteType:d,isBindExtranet:b}=O(),{saveFileEvent:ee}=W(),{isRefreshList:f}=Y(),{getDomainEvent:te,changeStatusEvent:ae,delRedirectEvent:re,getRedirectDataEvent:se,getRedirectFileEvent:ne,submitRedirectEvent:oe,submitErrorRedirectEvent:ce}=P(),_=u(!1),T=u(!1),q=u(""),F=u(""),R=u(!1),E=u(),S=u(!1),y=u(),U=u(),he=[{content:"设置域名重定向后,该域名的404重定向将失效"},{content:"取消重定向时,由于浏览器会缓存重定向信息,在清除缓存前,浏览器仍会根据缓存自动重定向"}],ye=[{content:"重定向类型:表示访问选择的“域名”或输入的“路径”时将会重定向到指定URL"},{content:"目标URL:可以填写你需要重定向到的站点,目标URL必须为可正常访问的URL,否则将返回错误"},{content:"重定向方式:使用301表示永久重定向,使用302表示临时重定向"},{content:"保留URI参数:表示重定向后访问的URL是否带有子路径或参数如设置访问http://b.com"},{content:"重定向到http://a.com 保留URI参数: http://b.com/1.html ---> http://a.com/1.html"},{content:"不保留URI参数:http://b.com/1.html ---> http://a.com"}],A=(e,a=d.value)=>{let t={...e,type:e.type?0:1,redirectdomain:JSON.stringify(e.redirectdomain)};return delete t.redirect_conf_file,a==="proxy"&&(t.site_name=l.value.name,delete t.sitename),t},Re=async(e,a,t,s)=>{const{label:n,value:o}=s,m=new Map([["start","批量启用选中的规则后,配置的重定向域名/目录将会生效"],["stop","批量停用选中的规则后,配置的重定向域名/目录将会失效"],["delete","批量删除当前选中的规则后,配置的重定向域名/目录将会彻底失效"]]),D=async v=>{const g=new Map([["start",h],["stop",h],["delete",X]]),{redirectname:c}=v,r=g.get(o);switch(o){case"start":case"stop":if(r){const i=A({...v,type:o==="stop"?1:0});return await r(i,d.value)}case"delete":if(r)return await r({site_id:l.value.id,redirectnames:c},d.value)}};await e({title:"批量".concat(n),content:"".concat(m.get(o),",是否继续操作?"),column:[{label:"规则名称",render:v=>{var g;return v.errorpage?"404错误页面":v.domainorpath==="domain"?(g=I(v.redirectdomain,"array",[]))==null?void 0:g.join("、"):v.redirectpath}},Q()],onConfirm:async()=>(await a(D),f.value=!0,!1)})},Ee=async e=>{try{const a=A(e),t=await ae(a);return t.status&&(f.value=!0),t}catch(a){return{status:!1,msg:"修改状态失败"}}},_e=async(e,a=d.value)=>{var t;try{await M({title:"删除重定向【".concat(e.domainorpath==="domain"?(t=I(e.redirectdomain,"array",[]))==null?void 0:t.join("、"):e.redirectpath,"】"),content:"删除选中的规则后,配置的重定向域名/目录将指向源地址,是否继续操作?",icon:"warning-filled",type:"calc"});const{name:s}=l.value,{redirectname:n}=e,o={proxy:{site_name:s,redirectname:n},default:{sitename:s,redirectname:n}},m=await re(o[a]||o.default);return m.status&&(f.value=!0),m}catch(s){return{status:!1,msg:"删除重定向失败"}}},Se=async e=>{var a,t;try{T.value=!0;const s=["php","html"].includes(d.value);let n={};s?n={sitename:l.value.name,redirectname:e.redirectname,webserver:Z.value.webserver}:n={path:e.redirect_conf_file};const o=await ne(n);o.status?(_.value=!0,q.value=(a=o.data)==null?void 0:a.content,F.value=(t=o.data)==null?void 0:t.redirect_conf_file):(x.error(o.msg),_.value=!1),T.value=!1}catch(s){_.value=!1}},De=async(e={data:q.value,encoding:"utf-8",path:F.value})=>await ee(e),ie=async(e=!1)=>{const a={sitename:l.value.name};try{const t=await se(a);return e&&x.success("刷新成功"),R.value=!1,E.value=null,Array.isArray(t.data)&&t.data.forEach(s=>{s.errorpage&&(R.value=!0,E.value=s)}),t}catch(t){return{data:[],total:0,other:{}}}},be=e=>{S.value=!!e,U.value=e||!1,w({title:"".concat(e?"编辑":"添加","重定向").concat(e?"【".concat(e.sitename,"】"):""),area:68,component:()=>L(()=>import("./add-redirect.js?v=1777008528"),__vite__mapDeps([]),import.meta.url),btn:!0})},Te=e=>{!e&&R.value&&(e=E.value),U.value=e||!1,w({title:"404重定向设置",area:42,component:()=>L(()=>import("./error-redirect.js?v=1777008528"),__vite__mapDeps([]),import.meta.url),compData:{rowData:e,siteType:d.value,refresh:()=>f.value=!0},btn:!0})},we=async()=>{var e;try{const{project_type:a,project_config:t}=l.value;b.value=!!(t!=null&&t.bind_extranet),["php","html","proxy","phpasync"].includes(a)&&(b.value=!0);const n=await ie();return C.value=n.data,{...n,data:((e=n.data)==null?void 0:e.map((o,m)=>({...o,id:m+1})))||[]}}catch(a){}},le=e=>{const{name:a}=l.value,{holdpath:t,type:s,redirectdomain:n}=e;let o={...e,sitename:a,holdpath:t?"1":"0",type:s?"1":"0",redirectdomain:JSON.stringify(n),redirectname:e.redirectname||new Date().getTime()};return d.value==="proxy"&&(o.site_name=a,delete o.sitename),o},Le=async e=>{try{const a=le(e),t=await oe(a,S.value);return t.status&&(f.value=!0),t.status}catch(a){return!1}},ue=e=>{if(e)return{table:"domain",list:"True",search:l.value.id};const a={python:{data:JSON.stringify({name:l.value.name})},phpasync:{data:JSON.stringify({sitename:l.value.name})},proxy:{id:l.value.id,site_name:l.value.name},default:{data:JSON.stringify({project_name:l.value.name})}};return a[d.value]||a.default},C=u([]),Ie=async()=>{try{const e=["php","html"].includes(d.value),a=ue(e),t=await te(a);if(S.value)y.value=t.data;else{let s=C.value.map(n=>n.redirectdomain).flat();y.value=t.data.filter(n=>!s.includes(n.name))}return y.value=y.value.filter((s,n,o)=>n===o.findIndex(m=>m.name===s.name)),t}catch(e){return{status:!1,msg:"获取域名失败"}}},de=e=>{var s;const{name:a}=l.value;let t={...e,sitename:a,type:Number(e.type)};return t.redirectname=((s=E.value)==null?void 0:s.redirectname)||new Date().getTime(),d.value==="html"&&(t.domainorpath="path",t.holdpath=999,t.redirectpath=""),t.topath==="/"&&(t.tourl=""),t},xe=async e=>{try{const a=de(e),t=await ce(a,R.value);return f.value=!0,t.status}catch(a){return!1}};export{Te as a,q as b,T as c,_ as d,be as e,Ee as f,Se as g,he as h,we as i,_e as j,Re as k,Le as l,Ie as m,y as n,ye as o,xe as p,U as r,De as s,Y as u};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}