import{_ as e}from"./public.js?v=1753954525509";import{_ as t}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{o as a,fz as l,fA as r}from"./page_layout.js?v=1753954525509";import{k as s,P as o,r as n,U as i,V as u,Q as c,a2 as p,W as m,X as d,ah as _,a3 as f,F as v,u as x}from"./vue.js?v=1753954525509";import{cG as b,cA as g}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const j={class:"p-20px"},y={class:"w-460px"};const h=s({__name:"index",props:{url:{default:""},mirrors:{default:()=>({})}},emits:["refresh"],setup(s,{expose:h,emit:k}){const w=s,S=k,{t:D}=o(),$=n(null),O=n([]),P=({option:e})=>c(v,null,[e.title?"".concat(e.value,"(").concat(e.title,")"):e.label]),A=e=>{$.value=e},C=async()=>{await S("refresh",(e=>{U(e)}))},U=e=>{O.value=Object.entries(e).map((([e,t])=>({label:()=>{let l;return c("div",{class:"flex items-center justify-between w-full"},[c("span",{class:"mr-16px"},["".concat(e,"(").concat(t,")")]),c(a,{type:"error",onClick:t=>{t.stopPropagation(),(async e=>{await r({registry_mirrors_address:e}),await C()})(e)}},(s=l=D("Public.Btn.Del"),"function"==typeof s||"[object Object]"===Object.prototype.toString.call(s)&&!x(s)?l:{default:()=>[l]}))]);var s},title:t,value:e}))),O.value.push({label:D("Docker.Setting.url.index_5"),value:""})};(()=>{const{url:e,mirrors:t}=w;e&&($.value=e),U(t)})();return h({onConfirm:async()=>{await l({registry_mirrors_address:$.value?$.value:""}),S("refresh")}}),(a,l)=>{const r=b,s=g,o=t,n=e;return i(),u("div",j,[c(o,null,{default:p((()=>[c(s,{label:a.$t("Docker.Setting.index_7"),"show-feedback":!1},{default:p((()=>[m("div",y,[c(r,{value:d($),"onUpdate:value":l[0]||(l[0]=e=>_($)?$.value=e:null),filterable:!0,options:d(O),"consistent-menu-width":!1,"render-tag":P,placeholder:a.$t("Docker.Setting.url.index_1"),onSearch:A},null,8,["value","options","placeholder"])])])),_:1},8,["label"])])),_:1}),c(n,{class:"mt-24px"},{default:p((()=>[m("li",null,f(a.$t("Docker.Setting.url.index_2")),1),m("li",null,f(a.$t("Docker.Setting.url.index_3")),1),m("li",null,f(a.$t("Docker.Setting.url.index_4")),1)])),_:1})])}}});export{h as default};
