Files
yakpanel-core/YakPanel/static/vite/js/index-DNBADCAq.js

2 lines
9.3 KiB
JavaScript
Raw Normal View History

2026-04-07 02:04:22 +05:30
import{_ as ae}from"./index-BGYvyLDv.js?v=1773287522785";import{_ as V}from"./index-DIKmrNCq.js?v=1773287522785";import{i as I,l as N,h as J,m as A,c as W}from"./index-BTglIPU2.js?v=1773287522785";import{Z as oe,J as le,_ as ie,$ as re}from"./ssl-Bm8jcneQ.js?v=1773287522785";import{r as w,k as j,R as Z,O as E,e as H,c as Y,o as ee,ab as X,$ as k,Z as R,_ as s,a0 as n,a9 as l,aa as c,S as o,j as _,X as q,ak as ce,a8 as U}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{b8 as ne,Z as se,b1 as te,a9 as F,B as G,k as K,ad as ue,a0 as pe}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const D=w(!1),g=w({}),Q=async h=>{try{D.value=!0;const{message:S}=await oe({hash:h});I(S)&&(g.value=S)}finally{D.value=!1}},me={class:"text-#20a53a"},de={class:"mt-16px"},_e=j({__name:"index",props:{row:{},onRefresh:{}},setup(h){const{t:S}=Z(),p=h,{row:i}=E(p),m=w("all"),d=H({domains:i.value.user_for.sites||[]}),r=w([]),a=w([]),L=Y(()=>m.value==="matched"?a.value:r.value),f=({option:t})=>{const e=t.match?"ssl-lock":"ssl-unlock",u=t.match?"text-#20a53a":"text-error";return n(K,{size:5,class:"items-center flex-nowrap!"},{default:()=>[n(N,{name:e,class:u,size:18},null),n("div",{class:"truncate w-full"},[t.label])]})},x=()=>{J({title:"Deploy SSL Certificate",content:d.domains.length?"Are you sure you want to deploy this certificate?":"Are you sure you want to cancel the deployment",onConfirm:async()=>{const{message:t}=await le({hash:i.value.hash,domains:JSON.stringify(d.domains)});I(t)&&(t.faild?A.error("".concat(S("SSL.index_31"),"").concat(t.faildList.map(e=>e.siteName).join(","),"")):A.success(S("SSL.index_32")),p.onRefresh())}})},y=t=>t.map(e=>({label:e.name,value:e.name,match:e.match})),$=async()=>{await Q(i.value.hash);const t=g.value.sites.filter(u=>u.match),e=g.value.sites.filter(u=>!u.match);r.value=y([...t,...e]),a.value=y(t),d.domains=d.domains.filter(u=>r.value.some(b=>b.value===u))};return ee(()=>{$()}),(t,e)=>{const u=X("i18n-t"),b=ne,T=se,B=te,M=F,O=G,C=N,P=V;return k(),R("div",null,[s("div",null,[n(u,{keypath:"SSL.index_26",tag:"span",scope:"global"},{a:l(()=>{var v,z;return[s("span",me,c((z=(v=o(i))==null?void 0:v.verify_domains)==null?void 0:z.join(",")),1)]}),_:1}),e[2]||(e[2]=s("span",null," site",-1))]),n(T,{type:"segment",animated:"",value:o(m),"onUpdate:value":e[0]||(e[0]=v=>q(m)?m.value=v:null),class:"my-10px"},{default:l(()=>[n(b,{name:"all"},{default:l(()=>[_(c(t.$t("SSL.index_28")),1)]),_:1}),n(b,{name:"matched"},{default:l(()=>[_(c(t.$t("SSL.index_27")),1)]),_:1})]),_:1},8,["value"]),n(M,{show:o(D)},{default:l(()=>[n(B,{"render-source-label":f,"render-target-label":f,value:o(d).domains,"onUpdate:value":e[1]||(e[1]=v=>o(d).domains=v),options:o(L),"source-filterable":"","virtual-scroll":""},null,8,["value","options"])]),_:1},8,["show"]),s("div",de,[n(O,{type:"primary",onClick:x},{default:l(()=>[_(c(t.$t("SSL.index_29")),1)]),_:1})]),n(P,{class:"mt-20px"},{default:l(()=>[s("li",null,[n(C,{name:"ssl-lock",class:"text-#20a53a",size:18}),e[3]||(e[3]=s("span",{class:"ml-8px"},"This SSL is applicable to the this domain",-1))]),s("li",null,[n(C,{name:"ssl-unlock",class:"text-error",size:18}),e[4]||(e[4]=s("span",{class:"ml-8px"},'After using this SSL, accessing the domain will show a "Not Secure" warning',-1))])]),_:1})])}}}),fe=W(_e,[["__scopeId","data-v-1cd65fd9"]]),ve={key:0,class:"text-#20a53a"},Se={class:"icon-box"},ye=j({__name:"index",props:{row:{}},setup(h){const S=h,{row:p}=E(S),i=H({domains:"",issuer:"",end_date:"",is_match:1}),m=r=>{J({title:"Deploy SSL Certificate",content:r===0?"Are you sure to deploy this SSL certificate to the panel?":"Are you sure you want to restore it?",onConfirm:async()=>{await ie({hash:p.value.hash,recover:r}),window.location.href=window.location.href.split("?")[0]+"?_t="+Date.now()}})},d=async()=>{await Q(p.value.hash),i.domains=g.value.panel[0].info.subject,i.issuer=g.value.panel[0].info.issuer,i.end_date=g.value.panel[0].info.notAfter,i.is_match=g.value.panel[0].match};return ee(()=>{d()}),(r,a)=>{const L=X("i18n-t"),f=N,x=pe,y=K,$=ue,t=F,