import{_ as y}from"./Modal-ChMy0A7y.js";import{_ as v}from"./Paginate-DtQjslkz.js";import{_ as C}from"./NoDataFound-su6Kbmdk.js";import{_ as L}from"./UserLayout-DG2qUs8x.js";import{u as $}from"./modalStore-BgORG3Nn.js";import{h as N}from"./moment-BAtM24Ew.js";import{k as h,c as l,o,a as _,b as t,w as S,t as e,j as i,i as A,F as b,g as B,f as F,n as T,u as V}from"./app-B4kV47qU.js";import"./sharedComposable-VJJUONp6.js";import"./toastComposable-CvcyPmJb.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ToastrContainer-Cfx6wOd2.js";import"./AssetModal-vtiWQmiY.js";import"./IntersectionObserver-DbdokySM.js";import"./assetStore-cDK0Afhq.js";const q={class:"card card-body"},w={class:"card card-body mb-2"},j={class:"table-responsive w-full"},D={class:"table"},M={class:"!text-right"},R={class:"!text-right"},z={key:0,class:"tbody"},E={class:"!text-right"},K={class:"!text-right"},O=["onClick"],P=["onClick"],at=Object.assign({layout:L},{__name:"Logs",props:["app","logs"],setup(n){const f=$(),r=h("request"),d=h(null),u=(s,c)=>{d.value=s,r.value=c,f.open("modal",r.value)};return(s,c)=>(o(),l(b,null,[_(y,{"header-state":!0,"header-title":"Log Details - "+r.value,state:"modal"},{default:S(()=>[t("pre",q,"            "+e(d.value[r.value])+`
        `,1)]),_:1},8,["header-title"]),t("div",w,[t("p",null,[t("strong",null,e(s.trans("Name")),1),i(" "+e(n.app.name),1)]),t("p",null,[t("strong",null,e(s.trans("App Key")),1),i(" "+e(n.app.key),1)]),t("p",null,[t("strong",null,e(s.trans("App Link")),1),i(" "+e(n.app.site_link),1)]),t("p",null,[t("strong",null,e(s.trans("Created")),1),i(" "+e(n.app.created_at),1)])]),t("div",j,[t("table",D,[t("thead",null,[t("tr",null,[t("th",null,e(s.trans("Platform")),1),t("th",null,e(s.trans("From")),1),t("th",null,e(s.trans("To")),1),t("th",null,e(s.trans("Status")),1),t("th",M,e(s.trans("Created At")),1),t("th",R,e(s.trans("Action")),1)])]),n.logs.data.length?(o(),l("tbody",z,[(o(!0),l(b,null,B(n.logs.data,(a,k)=>{var m,p;return o(),l("tr",{key:k},[t("td",null,e((m=a.platform)==null?void 0:m.name),1),t("td",null,e((p=a.platform.meta)==null?void 0:p.phone_number),1),t("td",null,e(a.to),1),t("td",null,[a.status_code?(o(),l("span",{key:0,class:T(["badge",a.status_code==200?"badge-success":"badge-danger"])},e(a.status_code),3)):F("",!0)]),t("td",E,e(V(N)(a.created_at).toLocaleString()),1),t("td",K,[t("button",{class:"btn btn-outline-primary btn-xs mr-2",onClick:g=>u(a,"request")},e(s.trans("Request")),9,O),t("button",{class:"btn btn-outline-primary btn-xs",onClick:g=>u(a,"response")},e(s.trans("Response")),9,P)])])}),128))])):(o(),A(C,{key:1,forTable:!0}))]),_(v,{links:n.logs.links},null,8,["links"])])],64))}});export{at as default};
