import{d as b,a as _,o as d,w as t,j as f,g as a,u as e,l as r,h as v,b as c,F as k,p as w,k as o,W as y}from"./app-Cb9hmj6k.js";import{_ as C,a as V}from"./AppLayout.vue_vue_type_script_setup_true_lang-CteAxl0C.js";import{_ as B,a as N,b as m,c as u,d as D,e as n}from"./TableHeader.vue_vue_type_script_setup_true_lang-EjWQzTd0.js";import{_ as S}from"./AppLogoIcon.vue_vue_type_script_setup_true_lang-DKWl2XLX.js";import{_ as j}from"./index-BSGHlU0A.js";import"./index-hboZUdbT.js";import"./RovingFocusGroup-CP1IPgEn.js";import"./index-bRFR14ax.js";const F={class:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4 sm:p-6"},I={class:"rounded-xl border bg-white overflow-hidden"},H=b({__name:"Index",props:{logs:Object},setup(x){function p(i){y.post(`/integration/retry/${i}`)}const g=[{title:"Панель управления",href:"/dashboard"},{title:"Интеграция с 1С",href:"/integration"},{title:"Логи",href:""}];function $(i){switch(i){case"success":return"default";case"error":return"destructive";default:return"secondary"}}return(i,s)=>(d(),_(V,{breadcrumbs:g},{default:t(()=>[f("div",F,[a(e(C)),s[8]||(s[8]=f("div",{class:"mb-4 flex flex-col gap-1"},[f("h1",{class:"text-2xl sm:text-3xl font-bold"}," Логи синхронизации 1С "),f("p",{class:"text-sm text-muted-foreground"}," История отправки заявок в 1С ")],-1)),f("div",I,[a(e(B),null,{default:t(()=>[a(e(N),null,{default:t(()=>[a(e(m),null,{default:t(()=>[a(e(u),{class:"w-[100px]"},{default:t(()=>s[0]||(s[0]=[r("ID")])),_:1,__:[0]}),a(e(u),null,{default:t(()=>s[1]||(s[1]=[r("Заявка")])),_:1,__:[1]}),a(e(u),null,{default:t(()=>s[2]||(s[2]=[r("Статус")])),_:1,__:[2]}),a(e(u),null,{default:t(()=>s[3]||(s[3]=[r("Ответ 1С")])),_:1,__:[3]}),a(e(u),null,{default:t(()=>s[4]||(s[4]=[r("Дата")])),_:1,__:[4]}),a(e(u),{class:"text-right"},{default:t(()=>s[5]||(s[5]=[r("Действия")])),_:1,__:[5]})]),_:1})]),_:1}),a(e(D),null,{default:t(()=>[(d(!0),v(k,null,w(x.logs.data,l=>(d(),_(e(m),{key:l.id},{default:t(()=>[a(e(n),{class:"font-medium"},{default:t(()=>[r(" #"+o(l.id),1)]),_:2},1024),a(e(n),null,{default:t(()=>[r(" Заявка #"+o(l.request_id),1)]),_:2},1024),a(e(n),null,{default:t(()=>[a(e(j),{variant:$(l.status)},{default:t(()=>[r(o(l.status),1)]),_:2},1032,["variant"])]),_:2},1024),a(e(n),{class:"max-w-[300px] truncate text-xs text-muted-foreground"},{default:t(()=>[r(o(l.response||"—"),1)]),_:2},1024),a(e(n),{class:"text-sm text-muted-foreground"},{default:t(()=>[r(o(new Date(l.created_at).toLocaleString()),1)]),_:2},1024),a(e(n),{class:"text-right"},{default:t(()=>[l.status==="error"?(d(),_(e(S),{key:0,size:"sm",variant:"destructive",onClick:L=>p(l.id)},{default:t(()=>s[6]||(s[6]=[r(" Повторить ")])),_:2,__:[6]},1032,["onClick"])):c("",!0)]),_:2},1024)]),_:2},1024))),128)),x.logs.data.length?c("",!0):(d(),_(e(m),{key:0},{default:t(()=>[a(e(n),{colspan:"6",class:"text-center py-6 text-muted-foreground"},{default:t(()=>s[7]||(s[7]=[r(" Логи отсутствуют ")])),_:1,__:[7]})]),_:1}))]),_:1})]),_:1})])])]),_:1}))}});export{H as default};
