1import{d as X,r as b,f as Z,w as ee,p as l,G as o,k as v,y as m,u as n,q as te,x as g,E as c,C as r,W as V,_ as z,aw as se,ar as ae,av as oe,c as j,B as A,F,L as ne,m as i,g as ie}from"./vendor-D7HY6vXs.js";import{s as le,b as k,c as re,d as de,e as Q}from"./vendor-servebolt-BwnDPTSW.js";import{M as ce}from"./menu-search-DovOqSMn.js";import{u as me}from"./vendor-i18n-BAJQGTf1.js";import{P as R}from"./Provisionings-D3KQgVWy.js";import{d as ue,u as pe,h as ve,b as fe,O as E,g as he,e as xe,w as _e}from"./index-DAxIWTJb.js";import{_ as be}from"./SHint-Cm2k1UxI.js";import{u as ye}from"./useCronAntComponents-DeVBZY2i.js";import"./vendor-auth0-B88dyU-W.js";import"./vendor-toast-BA6wVAZy.js";import"./vendor-antdv-base-QySV-hqZ.js";import"./vendor-lodash-BvL3EwUt.js";import"./vendor-antdv-slider-CkgCtKC6.js";import"./vendor-antdv-table-DFhwV24V.js";const{t:S}=ue.global,ge=[{title:S("customer"),dataIndex:"customer",key:"customer",width:"20%",responsive:["md"]},{title:S("environment"),dataIndex:"envName",key:"envName",width:"20%",responsive:["md"]},{title:S("domains"),dataIndex:"domain",key:"domain",responsive:["md"]},{title:S("status"),dataIndex:"status",key:"status",width:"10%",responsive:["md"]},{title:"",dataIndex:"operation",key:"operation",width:"20%",responsive:["md"]},{title:"",dataIndex:"mobile",key:"mobile",responsive:["xs","sm"]}],ke={class:"md:mx-0 md:mb-[86px] flex flex-col"},we={class:"base-border rounded-base md:p-[24px] p-[16px] min-w-[320px]"},Ie={class:"flex-1 w-full flex flex-col mb-[24px]"},Ce={class:"flex items-center justify-between"},Se={key:1,class:"underline text-[13px]"},$e={class:"lg:w-[60%] md:min-w-[270px] w-full md:inline"},qe={key:0},Ne={class:"flex items-center gap-[1rem]"},Oe={class:"w-[1.5rem] h-[1.5rem] overflow-hidden"},Pe=["src"],Be={key:0},De={key:0},Le={class:"flex whitespace-nowrap truncate"},Te={class:"underline cursor-help"},Ve={key:0},ze={key:0,class:"flex justify-end gap-[1.3rem] items-center"},je={key:0,class:"border border-border p-[16px] mb-[10px] rounded-[5px]"},Ae={class:"flex flex-col mb-[40px]"},Fe={class:"mobile-header-table-block"},Qe={class:"grid grid-cols-2 gap-4"},Re={key:0},Ee={key:0},Me={class:"text-[9px] mb-[4px]"},Ge={class:"text-[13px] mb-[4px]"},Ue={class:"mb-4"},We={class:"text-[9px] mb-[4px]"},Ye={class:"text-[13px] mb-[4px]"},Ke={class:"mb-[20px] w-[150px]"},He=X({__name:"OrdersListView",setup(Je){ye();const $=se(),w=ae(),u=oe(),{t:f}=me({useScope:"global"});let N=b(),d=b({});const p=b(w.query.q?w.query.q:"");let q=b(!1);const O=b({}),h=b(!1),M=ie(),I=pe("tailwind");let P=!1;const B=u.state.accessTokenObject?.isServeboltAdmin||u.state.accessTokenObject?.isServeboltStaff;Z(()=>{y()}),ee(p,()=>{p.value||(d.value={},y())});const C=j(()=>I.breakpoint==="md"||I.breakpoint==="lg"||I.breakpoint==="xl"||I.breakpoint==="2xl"),G=j(()=>C.value?700:0);async function y(){q.value=!0;const e=ve(P,!0,w.query,d.value.q,d.value),s=fe(p,d).toString();P=e.hasCheckedQuery,d.value=e.query;try{await $.replace({query:{...d.value}});const a=await new R().getOrders(s,B);O.value=a.getMeta();const t=a.getData();Y(t)}catch(a){console.log({err:a})}finally{q.value=!1}}function U(e){d.value={...e.value};const s=w.query.q||p.value||d.value.q;s&&(d.value.q=s),y()}function D(e){if(e.domain)return`https://admin.servebolt.com/bolts/${e.boltId}/environments/${e.envId}/domains/settings/${e.domain.domain}/${e.domain.aliasId}`}function W(e){if(e.length>1){const s=e[0],a=e.map(t=>t.domain);return{domain:e[0].domain,domains:e,tooltip:String(a),aliasId:s.aliasId}}else if(!e.length)return{domain:""};return e[0]}function Y(e){N.value=e.map(s=>({id:s.id,customer:s?.attributes?.customerName,avatar:s?.attributes?.customerPicture,envName:s?.attributes?.environmentName||"-",domain:W(s?.attributes?.domains),status:s?.attributes?.status||"-",envId:s?.attributes?.environmentId,boltId:s?.attributes?.boltId,domains:s?.attributes?.domains}))}async function K(e){try{await new R().deleteOrder(e,B),he(f("orderDeleted")),await y()}catch(s){xe(s.response,f("couldNotDeleteOrder"))}}function H(){d.value.page=1,d.value.q=p.value,y()}async function L(e){try{await M?.appContext?.config?.globalProperties?.$servebolt.prompt.open({textParam:f("doYouWantToDeleteThisOrder"),confirmTextParam:"Yes",cancelParam:"No",heightParam:"400px",
1widthParam:"560px"}),await K(e)}catch(s){console.log({error:s})}}function J(){localStorage.removeItem("orderId"),u.commit("setOrderId",null),u.dispatch("addStep","started"),$.push({name:"cdn-wizard"})}function T(e){localStorage.removeItem("orderId"),u.dispatch("addStep","validation"),u.dispatch("addCdnRoutingDomainsList",e.domains),localStorage.setItem("orderId",String(e.id)),u.commit("setOrderId",e.id),$.push({name:"cdn-wizard"})}return(e,s)=>(i(),l("div",null,[o("div",ke,[v(n(le),null,{default:m(()=>[A(r(n(f)("serveboltCdn")),1)]),_:1})]),o("div",we,[o("div",Ie,[o("div",{class:te(["flex flex-col md:flex-row lg:w-[80%]",{"flex-col-reverse gap-[10px]":h.value}])},[o("div",Ce,[v(n(k),{class:"self-start md:mr-[24px]",text:e.$t("newOrder"),type:"outline",iconAnimated:"",iconPosition:"before",onClick:J},null,8,["text"]),o("div",{class:"inline md:hidden",onClick:s[0]||(s[0]=a=>h.value=!h.value)},[h.value?c("",!0):(i(),g(n(ce),{key:0})),h.value?(i(),l("div",Se,r(n(f)("cancel")),1)):c("",!0)])]),V(o("div",$e,[v(n(re),{modelValue:p.value,"onUpdate:modelValue":s[1]||(s[1]=a=>p.value=a),placeholder:n(f)("searchBy"),isButton:"",search:"",btnText:"Search",onClickBtn:H},null,8,["modelValue","placeholder"])],512),[[z,C.value||h.value]])],2)]),(i(),g(n(de),{scheme:n(ge),key:String(C.value),data:n(N),loading:n(q),meta:O.value,onSetQuery:U,scroll:G.value},{customer:m(({column:a,record:t})=>[a&&a.key==="customer"?(i(),l("span",qe,[o("div",Ne,[o("div",Oe,[o("img",{class:"rounded-[6px] w-full h-full object-cover",src:t.avatar,alt:"Avatar",loading:"lazy"},null,8,Pe)]),o("span",null,r(t.customer),1)])])):c("",!0)]),domain:m(({column:a,record:t})=>[a&&a.key==="domain"?(i(),l("span",Be,[t?.domain?.domain?c("",!0):(i(),l("span",De,"-")),t.domain?.tooltip?(i(),g(n(Q),{key:1,class:"block 2xl:flex",href:D(t)},{default:m(()=>[o("span",Le,r(t?.domain?.domain),1),v(be,{tooltip:t.domain?.tooltip},{default:m(()=>[o("span",Te,"+ "+r(t.domain.domains.length-1),1)]),_:2},1032,["tooltip"])]),_:2},1032,["href"])):(i(),g(n(Q),{key:2,href:D(t)},{default:m(()=>[A(r(t?.domain?.domain),1)]),_:2},1032,["href"]))])):c("",!0)]),status:m(({column:a,record:t})=>[a&&a.key==="status"?(i(),l("span",Ve,r(t.status),1)):c("",!0)]),operation:m(({column:a,record:t})=>[a&&a.key==="operation"?(i(),l("div",ze,[V(v(n(k),{disabled:t.status==="complete",type:"outline",size:"sm",text:e.$t("continue"),onClick:x=>T(t)},null,8,["disabled","text","onClick"]),[[z,t?.domain?.domain&&n(E)]]),v(n(k),{type:"link",size:"sm",text:e.$t("delete"),onClick:x=>L(t.id)},null,8,["text","onClick"])])):c("",!0)]),mobile:m(({column:a,record:t})=>[a&&a.key==="mobile"&&!C.value?(i(),l("div",je,[o("div",Ae,[o("div",Fe,r(t.name),1)]),o("div",Qe,[(i(!0),l(F,null,ne(t,(x,_)=>(i(),l(F,{key:_},[String(_)!=="name"?(i(),l("div",Re,[String(_)==="domain"?(i(),l("div",Ee,[o("div",Me,r(_),1),o("div",Ge,r(x.name),1)])):(i(),l("div",{key:_,class:"text-gray-700"},[o("div",Ue,[o("div",We,r(_),1),o("div",Ye,r(x),1)])]))])):c("",!0)],64))),128)),o("div",Ke,[n(E)?(i(),g(n(k),{key:0,type:"outline",size:"sm",text:e.$t("continue"),onClick:x=>T(t)},null,8,["text","onClick"])):c("",!0),v(n(k),{type:"link",size:"sm",text:e.$t("delete"),onClick:x=>L(t.id)},null,8,["text","onClick"])])])])):c("",!0)]),_:1},8,["scheme","data","loading","meta","scroll"]))])]))}}),ut=_e(He,[["__scopeId","data-v-72e4fe6e"]]);export{ut as default}; 2//# sourceMappingURL=OrdersListView-BanGNBh0.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.