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/useStore2.js
import{getSystemUserList as F,advanceCheckPort as I,getProjectList as R,getSiteTypes as H,getProjectInfo as U,createProject as k,modifyProject as B,removeProject as G,getFileBody as A,saveFileBody as D,setProject as O,getPhpVersion as V}from"./site.js?v=1777008528";import{c as J,M as u,k as c,o as W,n as $}from"./utils-lib.js?v=1777008528";import{aJ as z,aI as K,r as a,g as v,b as N}from"./base-lib.js?v=1777008528";const Q=z("SITE-STORE",()=>{const{mainWidth:d}=J(),l=a(""),m=a(!1),o=v(()=>{var t;const e=((t=N())==null?void 0:t.name)||"php";return e==="otherModel"?"other":e.replace("site-","")}),h=a(!1),f=a(!1),i=a({addtime:"",edate:"0000-00-00",id:null,index:null,listen:[],listen_ok:!0,load_info:{},name:"",path:"",project_config:{},project_type:"",ps:"",rname:"",run:!1,ssl:{},status:"",stop:"",type_id:0}),y=a(""),j=a([]),P=a({enable:!1,exclude:[]}),S=a(!1),_=a(),w=v(()=>d.value>1530?320:d.value>1400?200:d.value>1200?180:140),T=async e=>{try{const t=await F(e);return{data:t.data,status:t.status}}catch(t){return{msg:"获取用户列表失败",status:!1}}},E=async e=>{if(!(!e||typeof e=="object"))try{const t=await I({port:e},"go");return t.status||u.request(t),{status:t.status,msg:t.msg}}catch(t){return{status:!1,msg:"检查端口失败"}}},b=async e=>{try{const t=await c({request:R(e,o.value),data:{data:Array,page:String}});return{data:t.data,total:W(t.page),other:{}}}catch(t){return{data:[],total:0,other:{}}}},L=async()=>{try{let e=[];return await c({request:H(o.value),data:Array,success:t=>{e=[{label:"全部分类",value:"all"},...t.map(r=>({label:r.name,value:String(r.id)}))]}}),{data:e,status:!0}}catch(e){return{data:[],status:!1}}},q=async e=>{var t,r;try{const s=await c({request:U(e,o.value)});return p(s.data),f.value=((r=(t=s.data)==null?void 0:t.project_config)==null?void 0:r.bind_extranet)===1||!1,{data:s.data,status:s.status}}catch(s){return{msg:"获取失败",status:!1,data:{}}}},C=async e=>{const t=u.load("正在添加项目,请稍后...");try{const{data:r}=await k(e,o.value),s=r.msg||r.data||r.error_msg;return s?{status:r.status,msg:s}:{status:r.status,data:r}}catch(r){return{status:!1,msg:"添加项目失败"}}finally{t.close()}},x=async e=>{const t=u.load("正在编辑项目,请稍后...");try{const{data:r}=await B(e,o.value);if(typeof r=="string")return{status:!1,msg:r};const s=r.msg||r.data||r.error_msg;return s?{status:r.status,msg:s}:{status:r.status,data:r}}catch(r){return{status:!1,msg:"编辑项目失败"}}finally{t.close()}},M=async e=>{try{const{data:t}=await c({loading:"正在删除项目,请稍后...",request:G(e,o.value)});return{status:t.status,msg:t.msg||t.data||t.error_msg}}catch(t){return{status:!1,msg:"删除项目失败"}}},p=async(e,t)=>{var r,s,g;if(e){((r=e==null?void 0:e.project_config)==null?void 0:r.type)==="PHPMOD"&&(e.project_type="phpasync");let n=((s=e==null?void 0:e.project_type)==null?void 0:s.toLowerCase())||"";n||(n=o.value),n==="node"&&(n="nodejs"),n==="nginx"&&(n="proxy"),i.value={...e,project_type:n},y.value=((g=i.value)==null?void 0:g.project_type)||""}return l.value=($(t)?t:"")||"",i.value};return{activeType:o,isRefreshList:h,isBindExtranet:f,siteInfo:i,siteType:y,rowData:_,settingTabActive:l,isJump:m,selectedList:j,searchWidth:w,jumpTabEvent:e=>{l.value=e,m.value=!0},resetTab:()=>{l.value="",m.value=!1},setSiteInfo:p,getRootUser:T,getSiteList:b,getClassList:L,getPhpVersionList:async()=>{try{const e=await c({request:V()});return{data:e.data,status:e.status}}catch(e){return{status:!1,msg:"获取PHP版本失败"}}},getProjectConfig:q,addGeneralProject:C,editGeneralProject:x,getFileEvent:async e=>{try{const t=await A(e);return{data:t.data,status:t.status}}catch(t){return{status:!1,msg:"获取配置文件失败"}}},saveFileEvent:async e=>{try{const t=await c({loading:"正在保存内容,请稍候...",request:D(e),data:{status:Boolean,msg:String}});return u.msg({dangerouslyUseHTMLString:!0,message:t.msg,type:t.status?"success":"error",duration:t.status?2e3:0,showClose:!t.status}),{status:t.status,msg:t.msg}}catch(t){return{status:!1,msg:"保存文件失败"}}},checkPortUseEvent:E,delGeneralProjectEvent:M,setProjectStatusEvent:async(e,t,r)=>{try{const{data:s}=await c({loading:"正在".concat(t!=="restart"?"设置状态":"重启项目",",请稍后..."),request:O(e,r,t)});u.msg({customClass:"bt-message-error-html",dangerouslyUseHTMLString:!0,message:s.status?s.msg||s.data:s.error_msg||s.data||s.msg,type:s.status?"success":"error",duration:s.status?3e3:0,showClose:!s.status});const g=s.msg||s.data||s.error_msg;return{status:s.status,msg:g}}catch(s){return{status:!1,msg:"操作失败"}}},batchConfig:P,isSiteMult:S}}),nt=()=>K(Q());export{Q as S,nt as u};