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/index502.js
import{L as k,da as A,R as B,X as E,k as g,g5 as v,gJ as T,c5 as q,w as R,g0 as D}from"./utils-lib.js?v=1777008528";import{b as S,g as f,d as j}from"./form-item.js?v=1777008528";import{g as V}from"./index3.js?v=1777008528";import{r as b,aF as u,g as I,e as o,b8 as N,x as O,z as G,c as H,o as J,j as z,C as M,p as X}from"./base-lib.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./index119.js?v=1777008528";import"./index116.js?v=1777008528";const K=()=>{const{refs:{settingData:y},getUrlList:d}=k(),n=b(!1),c=b([]),m=(e,r)=>{r(c.value)},_=async(e,r,s)=>{try{n.value=!0;const t=[];for(let a=0;a<r.data.length;a++){const w=r.data[a];w.url!==e&&t.push(w.url)}await g({loading:"正在删除加速URL,请稍候...",request:v({registry_mirrors_address:t.join(",")}),message:!0,success:a=>{a.status&&s()}})}catch(t){}},p=async(e,r,s)=>{try{let t="";e&&e.registry_mirrors_address&&(t=e.registry_mirrors_address.replaceAll("\n",",").replaceAll(",",",")+","),n.value=!0,await g({loading:"正在设置加速URL,请稍候...",request:v({registry_mirrors_address:t+r.data.map(a=>a.url).join(",")}),message:!0,success:a=>{a.status&&(e&&(e.registry_mirrors_address=""),s())}})}catch(t){}},x=async(e,r)=>{try{await g({loading:"正在检测,请稍候...",request:T({mirrors:e}),success:s=>{r()}})}catch(s){}},h=(e,r)=>{const s=document.querySelector(".urlListTable .el-table__body-wrapper tbody");q.create(s,{animation:500,handle:".svgtofont-icon-drag",onEnd:async t=>{const a=e.data.splice(t.oldIndex,1)[0];e.data.splice(t.newIndex,0,a),p(!1,e,r)}})},{BtTable:F,refresh:l,config:i}=A({request:async()=>{const e=await d();return setTimeout(()=>{h(i,l)},0),{data:e.registry_mirrors}},columns:[{width:50,render:()=>u("i",{class:"svgtofont-icon-drag cursor-move mover align-middle",props:{title:"拖拽排序"}})},{label:"URL",prop:"url"},{label:"状态",width:60,prop:"available",render:e=>{switch(e.available){case!0:return u("span",{class:"text-primary"},"正常");case!1:return u("span",{class:"text-danger"},"异常");case null:return u("span",{class:"text-warning"},"未知")}}},{label:"检测时间",width:160,prop:"ts",render:e=>e.available===null?"--":u("span",{},B(e.ts))},V([{onClick:e=>x(e.url,l),title:"检测"},{onClick:e=>_(e.url,i,l),title:"移除"}],{fixed:!1})]}),{BtForm:U,param:C,validate:L}=E({data:()=>({registry_mirrors_address:""}),options:e=>I(()=>[S([f("",()=>o(N,{class:"!w-[53rem]",modelValue:e.value.registry_mirrors_address,"onUpdate:modelValue":r=>e.value.registry_mirrors_address=r,"fetch-suggestions":m,"popper-class":"my-urlautocomplete",placeholder:"请选择或输入加速URL,可一次添加多个加速URL,使用逗号分隔"},{default:({item:r})=>o("div",{class:"flex items-center justify-between px-[2rem]"},[o("div",{class:"w-[50rem] truncate"},[r.label])]),suffix:()=>o("span",{class:"svgtofont-el-arrow-down"},null)}),"registry_mirrors_address",{rules:[{validator:(r,s,t)=>{s?s.indexOf("http")===-1?t(new Error("请输入正确的加速URL,如https://docker.1ms.run")):t():t(new Error("请输入加速URL"))},trigger:["blur","change"]}]}),f("",()=>o(G,{class:"ml-[1rem]",type:"primary",onClick:()=>{L().then(()=>{p(C.value,i,l)})}},{default:()=>[O("添加")]}))]),f("",()=>o(F,{class:"urlListTable","row-key":"url","max-height":"500"},null)),j("",[{content:"通过拖拽调整加速URL顺序,优先使用第一个加速URL执行操作,请求超时将依次使用后续加速URL"},{content:"当状态为异常时,可能是加速站不可用或需要认证,请检查加速站的可用性和认证要求"},{content:"设置加速后若未生效请手动重启docker"}])]),submit:async(e,r,s)=>{}});return{BtForm:U,init:()=>{c.value=[...y.value.options],h(i,l)},onCancel:async()=>{if(n.value)try{await R({title:"提示",content:"修改加速URL后需要重启docker生效,是否立即重启docker?",cancelText:"暂不重启",confirmText:"立即重启"}),await D({data:JSON.stringify({act:"restart"})}),window.location.reload()}catch(e){return!0}return!0}}},se=H({__name:"index",props:{compData:{default:()=>({})}},setup(y,{expose:d}){const{BtForm:n,init:c,onCancel:m}=K();return J(()=>{c()}),d({onCancel:m}),(_,p)=>(z(),M(X(n),{class:"p-[1.6rem]"}))}});export{se as default};