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/store.js
import{c as je,k as n,bM as Z,w as h,R as _,bN as l,e as m,_ as p,M as o,j as Fe,bO as Je,bP as Ge,bQ as Qe,bR as z,bS as We,bT as Xe,bU as Ye,bV as Ze,bW as ze,n as b,bX as Ke,bY as et,bZ as K,b_ as tt,b$ as st,c0 as at,c1 as rt,c2 as ot,c3 as it}from"./utils-lib.js?v=1777008528";import{aJ as nt,t as I,aI as lt,g as ut,r as a,aC as ct,H as dt}from"./base-lib.js?v=1777008528";import{H as vt}from"./store2.js?v=1777008528";import{j as C,k as mt,n as pt}from"./index3.js?v=1777008528";const St=nt("HOME-HEADER-STORE",()=>{const{panelVersion:L,payment:ee,updatePush:u,panel:te,push:se,plugin:ae,getUpdatePushInfo:O,getOldSenderAlarmListInfo:re,ltdRemarks:oe,proRemarks:gt}=je(),{bindUser:ie,authType:ne,authExpirationTime:le}=I(ee.value),ue=vt(),{panelInfo:w,systemInfo:ce}=lt(ue),{upgrade:de,currentInfo:g}=I(w.value),ve=ut(()=>{const e=[...oe.value];return e.length=5,[...e,["other","更多特权>>"]]}),me=async()=>{if(await C())return null;await n({loading:"正在获取数据,请稍后...",request:Z(),success:async s=>{const t=s.data;t.upgrade===1?(await h({title:"修复面板",content:'<div class="flex items-center">\n              <div class="mr-1rem w-[4rem]"><img width="40" src="/static/icons/icon-upgrade.svg"></img></div>\n              <div class="flex-1">\n                <div class="text-medium leading-2.4rem">发现新版本,继续修复面板能修复使用中遇到的各种异常问题</div>\n              </div>\n            </div>\n            <div class="pl-5rem mt-[4px]">\n              <div>最新版本:'.concat(t.cloud.version,"</div>\n              <div>更新时间:").concat(_(t.cloud.update_time*1e3),"</div>\n            </div>"),icon:!1,width:"40rem",isHtml:!0,confirmText:"继续修复"}),n({loading:"正在修复面板,请稍后...",request:Z({force:1}),message:!0,success:r=>{l(),r.status&&setTimeout(()=>{m({title:"正在".concat(t.type==="repair"?"修复":"更新","面板,请耐心等候..."),area:70,compData:{type:"repair"},component:()=>p(()=>import("./index2.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)})},1500)}})):o.msg({message:'<div style="line-height:22px;">\n              <div>当前已是最新版本</div>\n              <div>当前版本:'.concat(t.local.version,"</div>\n              <div>更新时间:").concat(_(t.local.update_time*1e3),"</div>\n            </div>"),type:"success",dangerouslyUseHTMLString:!0})}})},pe=async()=>m({title:"历史版本",area:[60,52],component:()=>p(()=>import("./index162.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)}),ge=async()=>await C()?null:m({title:"重启服务器或者面板",area:[33,11],component:()=>p(()=>import("./index163.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)}),fe=async()=>await C()?null:m({area:50,customClass:"update-version-dialog",component:()=>p(()=>import("./index164.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)}),he=e=>{Fe.push({path:"/config/".concat(e)})},we=()=>{mt({disablePro:!0,sourceId:300})},{isDebug:ye}=te.value,{isBeta:S,cloudBeta:_e,isUpgrade:$,grayscale:q}=I(w.value),R=a(!1),T=a(!1),y=a(""),x=a(!1),V=a(null),H=a({}),U=a({}),c=a({phone:"",status:!1}),be=a({phone:[{validator:(e,s,t)=>{c.value.status&&!/^1[3456789]\d{9}$/.test(s)&&!/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(s)?t(new Error("请输入正确的手机号码或邮箱")):t()}}],give:[{required:!0,validator:(e,s,t)=>{s.length===0?t(new Error("请选择至少一种告警方式")):t()},trigger:["blur","change"]}]}),E=ct("popupClose",()=>{}),Se=e=>{const s=/^1[3456789]\d{9}$/,t=/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;return s.test(e)?"phone":t.test(e)?"email":"unknown"},Re=async()=>{u.value.updatePush?M(!u.value.updatePush):n({loading:"正在设置更新提醒,请稍后...",request:Je({task_id:u.value.updateTaskId,status:0}),message:!0})},Te=async e=>{let s;try{const t=e?"升级Linux测试版":"切换到正式版";await h({type:"calc",title:t,content:e?"请仔细阅读内测升级须知,是否升级Linux测试版?":"是否从测试版切换到正式版?"}),s=o.load("正在".concat(t,",请稍候...")),l(),ye&&(await z(),T.value=!0);const v=e?await ot():await it();if(!v.status)return o.request(v)}catch(t){return!1}finally{E(),l()}return s},Ee=async e=>{let s;try{if(typeof e=="boolean"){if(await h({title:"升级面板",content:"温馨提示:升级面板,有助于面板的BUG修复和功能加强,但不会影响用户的数据,即使面板发生故障,用户数据也不会受到影响。请您放心进行升级。"}),s=await Te(e),!s)return}else if(de.value!==0){await h({title:"升级面板",content:'<div class="flex items-center">\n            <div class="mr-1rem w-[4rem]"><img width="40" src="/static/icons/icon-upgrade.svg"></img></div>\n              <div class="flex-1">\n                <div class="text-medium leading-2.4rem">升级面板可以修复大部分已知BUG,同时安装最新的功能,用户数据也不会受到影响</div>\n              </div>\n            </div>\n            <div class="pl-5rem mt-[4px]">\n              <div>即将更新到:'.concat(g.value.version,"</div>\n              <div>更新时间:").concat(_(g.value.update_time*1e3),"</div>\n            </div>"),icon:!1,width:"40rem",isHtml:!0,confirmText:"继续升级"}),n({loading:"正在升级面板,请稍后...",request:Ge({force:!0,version:g.value.version}),message:!0,success:r=>{l(),r.status&&setTimeout(()=>{m({title:"正在更新面板,请耐心等候...",area:70,compData:{type:"upgrade"},component:()=>p(()=>import("./index2.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)})},1500)}});return}else{o.msg({message:'<div style="line-height:22px;">\n              <div>当前已是最新版本</div>\n              <div>当前版本:'.concat(g.value.version,"</div>\n              <div>更新时间:").concat(_(g.value.update_time*1e3),"</div>\n            </div>"),type:"success",dangerouslyUseHTMLString:!0});return}await A({check:!0});const t=await Qe({toUpdate:"yes"});T.value&&(await z(),T.value=!1),t.status?(o.success({msg:t.msg,onClose:()=>window.location.reload()}),setTimeout(()=>{window.location.reload()},2e3)):o.error(t.msg)}catch(t){s&&s.close()}finally{s&&s.close(),E(),l()}},Pe=(e,s)=>{n({loading:"正在忽略本次更新,请稍后...",request:We({version:e}),message:!0,success:t=>{t.status&&s()}})},ke=async e=>{if(y.value==="")throw o.error("还有必填项没有填写哦~"),new Error("还有必填项没有填写哦~");V.value.validate(async s=>{if(s){const t=Se(c.value.phone),r={questions:JSON.stringify({22:y.value}),product_type:18,software_name:1,rate:0};c.value.status&&(r.feedback=JSON.stringify(t==="phone"?{phone:c.value.phone}:{email:c.value.phone})),n({loading:"正在提交问卷,请稍后...",request:Xe(r),success:v=>{v.status&&(pt(),e())}})}})},A=async(e={})=>{try{const{data:s}=await Ye(e),t=window.vite_public_version,r=t==null?void 0:t.split(".").pop(),v=Number.parseInt(r).toString()===r&&r.length===2,{is_beta:Ue,version:X,beta:Y,downUrl:Ae,updateMsg:Me,uptime:Ne,grayscale_test:Be}=s.msg;return _e.value=Ue,S.value=v,H.value=Y,U.value={downUrl:Ae,updateMsg:Me,version:X,uptime:Ne},q.value=Be,s.status&&($.value=Ze(L.value,S.value?Y.version:X)),s}catch(s){return!1}},M=async e=>{N.value=e||!1,d.value.switch=!0,m({title:"更新提示",area:50,btn:!0,component:()=>p(()=>import("./alarm.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)})},De=async()=>{try{R.value=!0;const e=await A({check:!0});if(ze(e))return;!e.status&&b(e.msg)&&(E(),o.error(e.msg))}catch(e){}finally{R.value=!1}},N=a(!1),B=a(),j=a(),P=a(!1),d=a({switch:u.value.updatePush,give:[""],option:{}}),Ie=async()=>{P.value=!0,await re(),P.value=!1,d.value.give=u.value.modulePush,d.value.option=se.value.config},Ce=()=>{var e;(e=B.value)==null||e.refresh(),o.success("刷新成功")},Le=e=>{j.value.validate(async s=>{if(s){const t={task_data:JSON.stringify({task_data:{tid:"10",type:"panel_update",title:"面板更新提醒",status:d.value.switch,count:0,interval:600,project:""},status:d.value.switch,sender:d.value.give,number_rule:{day_num:0,total:2},time_rule:{send_interval:0,time_range:[0,86399]}}),template_id:"10"};n({loading:"正在提交更新提示,请稍后...",request:Ke(t),message:!0,success:r=>{e(),O()}})}})},Oe=()=>{u.value.updatePush=N.value},F=a(!0),$e=a(!1),J=a(),k=a([]);let i;const f=dt({webServe:!1,mysqlServe:!1,restartServe:!1,serveStart:!1}),qe=async()=>{await h({icon:"warning-filled",title:"重启面板",content:"即将重启面板服务,继续吗?"}),n({loading:"正在重启面板,请稍候...",request:et(),message:!0,success:e=>{e.status&&setTimeout(()=>{l(),window.location.reload()},1e3)}})},xe=async()=>{var e;try{w.value.isRestart=!0,k.value.splice(0,k.value.length),F.value=!1;const s=(e=J.value)==null?void 0:e.closest(".el-dialog");if(s){const t=s.querySelector(".el-dialog__footer"),r=s.querySelector(".el-dialog__body");r.style.height="49rem",t&&(t.style.display="none")}f.webServe=!0,await K({name:ae.value.webserver,type:"stop"}),f.mysqlServe=!0,await K({name:"mysqld",type:"stop"}),f.restartServe=!0,await tt(),f.serveStart=!0,Ve()}catch(s){}},Ve=()=>{i=setInterval(async()=>{try{const e=await st();e&&(e.hasOwnProperty("status")||e.code!==void 0)&&(o.success("服务器重启成功!"),setTimeout(()=>{l(),window.location.reload()},2e3),clearInterval(i))}catch(e){}},3e3)},He=()=>{i&&clearInterval(i)},G=a(""),D=async()=>{try{i&&clearTimeout(i);const{data:e}=await at();e.status||b(e.data)?(G.value=b(e.data)?e.data:e.msg||"暂无日志",b(e.data)?(o.msg({customClass:"bt-message-error-html",dangerouslyUseHTMLString:!0,message:e.msg+"".concat(e.status?"<br>请按 Ctrl+F5 刷新缓存,或等待5s自动刷新!":""),type:e.status?"success":"error",showClose:!e.status,duration:e.status?5e3:0}),e.status&&setTimeout(()=>{l(),window.location.reload()},5e3)):i=setTimeout(()=>{l(),D()},2e3)):o.error(e.msg)}catch(e){i&&clearTimeout(i),i=setTimeout(()=>{D()},2e3)}},Q=a(!1),W=a([]);return{bindUser:ie,authType:ne,authExpirationTime:le,systemInfo:ce,panelInfo:w,panelVersion:L,formPhone:V,jumpRouter:he,histVersionInfoDialog:pe,onRepair:me,restartSeverDialog:ge,updateVersionDialog:fe,advantageList:ve,productPayment:we,loading:R,isUpgrade:$,grayscale:q,isBeta:S,betaInfo:H,officialInfo:U,update:u,isNPSShow:x,questions:y,form:c,rules:be,onOpen:De,submit:ke,ignoreUpdatEVersion:Pe,getUpdatePushInfo:O,openUpdateReminder:Re,updateReminderDialog:M,updateVersion:Ee,alarmRef:B,pushMsgRef:j,msgForm:d,checkedLoad:P,renderPushConfig:Ie,refreshAlarmEvent:Ce,onCancel:Oe,onConfirm:Le,showFooter:F,showServer:$e,serverRestartRef:J,tipsList:k,courseList:f,clearRestart:He,onRestartServer:xe,onRestartPanel:qe,logContent:G,getLog:D,hisLoading:Q,histVersion:W,getHistoryVersion:async()=>{await n({loading:Q,request:rt(),data:[Array,W]})},$reset:()=>{x.value=!1,y.value="",c.value={phone:"",status:!1}}}});export{St as H};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}