test_lgq/niucloud/public/admin/assets/index-3983f14a.js

2 lines
12 KiB
JavaScript
Raw Permalink Normal View History

2024-01-24 17:36:08 +08:00
import{a3 as T,d as ae,r as h,s as se,a1 as K,h as n,I as q,w as l,y as L,c,e,a as t,t as o,u as i,N as a,F as R,G as A,B as F,z as M,af as ne,ag as J,a8 as oe,an as ue,ao as ce,a2 as re,ap as ie,aq as de,aa as pe,a0 as xe,_ as _e,i as S,a4 as Z,ar as ke,E as ye,p as be,g as we}from"./index-4dcc0234.js";/* empty css */import{T as fe,_ as ve}from"./vue-web-terminal-6f196033.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */function Ce(g=""){return T.get(g?`upgrade/${g}`:"upgrade")}function Be(){return T.get("upgrade/task")}function Te(g=""){return T.post(g?`upgrade/${g}`:"upgrade")}function Ee(){return T.post("upgrade/execute")}function $e(g=""){return T.get(g?`upgrade/check/${g}`:"upgrade/check")}function Ie(){return T.post("upgrade/clear")}function Ue(){return T.post("niucloud/build")}function Se(){return T.get("niucloud/build")}function Ve(){return T.get("niucloud/build/log")}function Fe(){return T.post("niucloud/build/clear")}function Le(){return T.get("niucloud/build/check")}const Me={class:"h-[60vh]"},Ne={key:0,class:"h-[60vh] flex flex-col"},Re={key:0,class:"bg-[#fff] my-3"},De={class:"pt-[20px] pl-[20px]"},He={class:"px-[20px] pt-[10px] text-[14px] el-table"},je={key:0},qe={key:1},Ae={key:0},Pe={key:1},ze={class:"h-[60vh]"},Ge={class:"h-[60vh] flex flex-col"},Ke={class:"flex-1 h-0"},Je=ae({__name:"index",emits:["complete"],setup(g,{expose:O,emit:ee}){const r=h(!1),d=h(null),p=h("build"),m=h(null),w=h(!1),b=h(null);let C=[];(()=>{Se().then(({data:_})=>{_&&(d.value=_,r.value||W())}).catch()})();const $=()=>{Ve().then(_=>{if(!_.data){r.value&&C.length&&(p.value="complete",b.value.execute("clear")),I&&I.close(),d.value=null;return}const f=_.data.data??[];let v="";f[0]&&f[0].length&&r.value&&(C.length==0&&(b.value.execute("clear"),b.value.execute("开始编译")),f[0].forEach(x=>{C.includes(x.action)||(b.value.pushMessage({content:`正在执行:${x.action}`}),C.push(x.action),x.code==0&&(v=x.msg,b.value.pushMessage({content:x.msg,class:"error"})))})),!v&&setTimeout(()=>{$()},2e3)}).catch()};let I=null;const W=()=>{I=ne.success({title:a("warning"),dangerouslyUseHTMLString:!0,message:J("div",{},[a("cloudbuild.executingTips"),J("span",{class:"text-primary cursor-pointer",onClick:V},[a("cloudbuild.clickView")])]),duration:0,showClose:!1})},V=()=>{r.value=!0,p.value="build",$()},X=async()=>{if(r.value=!0,w.value=!0,p.value="build",d.value){w.value=!1,$();return}Le().then(async({data:_})=>{_.is_pass?Ue().then(({data:f})=>{w.value=!1,d.value=f,$()}).catch(()=>{r.value=!1}):(w.value=!1,m.value=_)}).catch(()=>{r.value=!1})};let D=null;const P=new fe,Y=(_,f,v,x,j)=>{if(f=="开始编译"){v(P);const s=H(["/","——","\\","|"]);D=setInterval(()=>{P.flush("> "+s.next().value)},150)}},H=_=>{var f=0;return{next(){return f+1==_.length&&(f=0),{value:_[f++]}}}},z=_=>{p.value=="cloudbuild"&&d.value?oe.confirm(a("cloudbuild.showDialogCloseTips"),a("warning"),{confirmButtonText:a("confirm"),cancelButtonText:a("cancel"),type:"warning"}).then(()=>{_()}).catch(()=>{}):_()};return se(()=>r.value,()=>{r.value||(C=[],D&&clearInterval(D),Fe())}),O({open:X,cloudBuildTask:d}),(_,f)=>{const v=ue,x=ce,j=K("Select"),s=re,u=K("CloseBold"),E=ie,U=de,N=pe,k=xe;return n(),q(N,{modelValue:r.value,"onUpdate:modelValue":f[0]||(f[0]=B=>r.value=B),title:i(a)("cloudbuild.title"),width:"850px","close-on-click-modal":!1,"close-on-press-escape":!1,"before-close":z},{default:l(()=>[L((n(),c("div",Me,[m.value&&!d.value?(n(),c("div",Ne,[e(E,null,{default:l(()=>[m.value.dir?(n(),c("div",Re,[t("p",De,o(i(a)("cloudbuild.dirPermission")),1),t("div",He,[e(x,{class:"py-[10px] items table-head-bg pl-[15px] mb-[10px]"},{default:l(()=>[e(v,{span:12},{default:l(()=>[t("span",null,o(i(a)("cloudbuild.path")),1)]),_:1}),e(v,{span:6},{default:l(()=>[t("span",null,o(i(a)("cloudbuild.demand")),1)]),_:1}),e(v,{span:6},{default:l(()=>[t("span",null,o(i(a)("status")),1)]),_:1})]),_:1}),(n(!0),c(R,null,A(m.value.dir.is_read