智慧教务系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
5.1 KiB

import{R as B,d as G,r as x,aj as K,V as L,h as n,m as V,w as l,J as S,c as d,e,a as c,t as p,u as _,k as a,F as N,W as D,B as w,ac as O,aV as Q,a8 as M,M as Y,at as Z,au as ee,_ as le,a7 as te,aX as ae,U as se,L as oe}from"./index-f5d841af.js";/* empty css *//* empty css *//* empty css */import{T as ne,_ as ue}from"./dark-fe8149ea.js";/* empty css *//* empty css */import{_ as ce}from"./_plugin-vue_export-helper-c27b6911.js";function ie(){return B.post("niucloud/build",{})}function de(){return B.get("niucloud/build")}function re(){return B.get("niucloud/build/log")}function R(){return B.post("niucloud/build/clear")}function _e(){return B.get("niucloud/build/check")}const pe={key:0,class:"h-[60vh]"},fe={key:0,class:"h-[60vh] flex flex-col"},ve={key:0,class:"bg-[#fff] my-3"},he={class:"pt-[20px] pl-[20px]"},me={class:"px-[20px] pt-[10px] text-[14px] el-table"},ge={key:0},xe={key:1},be={key:0},ke={key:1},Be={class:"h-[60vh]"},Ce={key:1},we={class:"h-[60vh] flex flex-col"},ye={class:"flex-1 h-0"},Ee=G({__name:"index",emits:["complete"],setup(Te,{expose:U,emit:Ve}){const u=x(!1),r=x(null),f=x("build"),b=x(null),v=x(!1),h=x(null);let k=[];(()=>{de().then(({data:t})=>{t&&(r.value=t,u.value||$())}).catch()})();const C=()=>{re().then(t=>{if(!t.data){u.value&&k.length&&(f.value="complete",h.value.execute("clear"),R()),y&&y.close(),r.value=null;return}const s=t.data.data??[];let o="";s[0]&&s[0].length&&u.value&&(k.length==0&&(h.value.execute("clear"),h.value.execute("开始编译")),s[0].forEach(i=>{k.includes(i.action)||(h.value.pushMessage({content:`正在执行:${i.action}`}),k.push(i.action),i.code==0&&(o=i.msg,h.value.pushMessage({content:i.msg,class:"error"})))})),!o&&setTimeout(()=>{C()},2e3)}).catch()};let y=null;const $=()=>{y=Q.success({title:a("warning"),dangerouslyUseHTMLString:!0,message:M("div",{},[a("cloudbuild.executingTips"),M("span",{class:"text-primary cursor-pointer",onClick:j},[a("cloudbuild.clickView")])]),duration:0,showClose:!1})},j=()=>{u.value=!0,f.value="build",C()},q=async()=>{if(v.value=!0,f.value="build",r.value){u.value=!0,v.value=!1,C();return}_e().then(async({data:t})=>{t.is_pass?ie().then(({data:s})=>{v.value=!1,r.value=s,u.value=!0,C()}).catch(()=>{u.value=!1,v.value=!1}):(v.value=!1,b.value=t)}).catch(()=>{u.value=!1})};let E=null;const F=new ne,H=(t,s,o,i,T)=>{if(s=="开始编译"){o(F);const g=J(["/","——","\\","|"]);E=setInterval(()=>{F.flush("> "+g.next().value)},150)}},J=t=>{var s=0;return{next(){return s+1==t.length&&(s=0),{value:t[s++]}}}},P=t=>{f.value=="build"&&r.value?Y.confirm(a("cloudbuild.showDialogCloseTips"),a("warning"),{confirmButtonText:a("confirm"),cancelButtonText:a("cancel"),type:"warning"}).then(()=>{h.value.execute("clear"),t()}).catch(()=>{}):t()};return K(()=>u.value,()=>{u.value||(r.value=null,f.value="build",k=[],E&&clearInterval(E),R())}),U({open:q,cloudBuildTask:r,loading:v}),(t,s)=>{const o=Z,i=ee,T=L("Select"),g=le,I=L("CloseBold"),W=te,X=ae,z=se,A=oe;return n(),V(z,{modelValue:u.value,"onUpdate:modelValue":s[0]||(s[0]=m=>u.value=m),title:_(a)("cloudbuild.title"),width:"850px","close-on-click-modal":!1,"close-on-press-escape":!1,"before-close":P},{default:l(()=>[f.value=="build"?S((n(),d("div",pe,[b.value&&!r.value?(n(),d("div",fe,[e(W,null,{default:l(()=>[b.value.dir?(n(),d("div",ve,[c("p",he,p(_(a)("cloudbuild.dirPermission")),1),c("div",me,[e(i,{class:"py-[10px] items table-head-bg pl-[15px] mb-[10px]"},{default:l(()=>[e(o,{span:12},{default:l(()=>[c("span",null,p(_(a)("cloudbuild.path")),1)]),_:1}),e(o,{span:6},{default:l(()=>[c("span",null,p(_(a)("cloudbuild.demand")),1)]),_:1}),e(o,{span:6},{default:l(()=>[c("span",null,p(_(a)("status")),1)]),_:1})]),_:1}),(n(!0),d(N,null,D(b.value.dir.is_readable,m=>(n(),V(i,{class:"pb-[10px] items pl-[15px]"},{default:l(()=>[e(o,{span:12},{default:l(()=>[c("span",null,p(m.dir),1)]),_:2},1024),e(o,{span:6},{default:l(()=>[c("span",null,p(_(a)("cloudbuild.readable")),1)]),_:1}),e(o,{span:6},{default:l(()=>[m.status?(n(),d("span",ge,[e(g,{color:"green"},{default:l(()=>[e(T)]),_:1})])):(n(),d("span",xe,[e(g,{color:"red"},{default:l(()=>[e(I)]),_:1})]))]),_:2},1024)]),_:2},1024))),256)),(n(!0),d(N,null,D(b.value.dir.is_write,m=>(n(),V(i,{class:"pb-[10px] items pl-[15px]"},{default:l(()=>[e(o,{span:12},{default:l(()=>[c("span",null,p(m.dir),1)]),_:2},1024),e(o,{span:6},{default:l(()=>[c("span",null,p(_(a)("cloudbuild.write")),1)]),_:1}),e(o,{span:6},{default:l(()=>[m.status?(n(),d("span",be,[e(g,{color:"green"},{default:l(()=>[e(T)]),_:1})])):(n(),d("span",ke,[e(g,{color:"red"},{default:l(()=>[e(I)]),_:1})]))]),_:2},1024)]),_:2},1024))),256))])])):w("",!0)]),_:1})])):w("",!0),S(c("div",Be,[e(_(ue),{ref_key:"terminalRef",ref:h,context:"","init-log":null,"show-header":!1,"show-log-time":!0,onExecCmd:H},null,512)],512),[[O,r.value]])])),[[A,v.value]]):w("",!0),f.value=="complete"?(n(),d("div",Ce,[c("div",we,[c("div",ye,[e(X,{icon:"success",title:_(a)("cloudbuild.cloudbuildSuccess")},null,8,["title"])])])])):w("",!0)]),_:1},8,["modelValue","title"])}}});const $e=ce(Ee,[["__scopeId","data-v-a1452bd3"]]);export{$e as default};