Files
PhaseWeb3-Vue/assets/MachinesView.b3613221.js

2 lines
1.3 KiB
JavaScript

import{r,o as _,a as c,c as p,w as s,b as e,i as f,X as h,e as b,a6 as v,_ as w,g as l,F as x,k as g,l as k,n as $,p as y}from"./index.26ff47d4.js";import{_ as C}from"./ArcadeCard.c1ce6a82.js";import{_ as I}from"./GeneralTable.939c2b56.js";import{A}from"./arcade.ae9af55b.js";const B={class:"bg-white dark:bg-slate-900/95 rounded-2xl lg:flex lg:justify-between"},F={class:"w-full"},G={__name:"MachinesView",setup(N){const t=r({}),o=r(!0),n=y(),i=parseInt(n.params.id);async function d(){try{t.value=null;const a=await A(i);t.value=a,o.value=!1}catch(a){console.error("Failed to fetch arcade data:",a)}}_(()=>{d()});const u=[{text:"PCBID",value:"pcbId",width:200},{text:"Name",value:"description",width:200},{text:"Port",value:"port",sortable:!0,width:120},{text:"OTA",value:"ota",sortable:!0,width:120}],m=a=>{navigator.clipboard.writeText(a.pcbId).then(()=>{alert("Copied to clipboard!")}).catch(()=>{alert("Failed to copy to clipboard!")})};return(a,V)=>(c(),p($,null,{default:s(()=>[e(k,null,{default:s(()=>[o.value?g("",!0):(c(),f(x,{key:0},[e(C,{class:"mb-6",arcade:t.value,"use-small":!0},null,8,["arcade"]),e(h,{icon:b(v),title:"Machines",main:""},null,8,["icon"]),e(w,{"has-table":""},{default:s(()=>[l("div",B,[l("div",F,[e(I,{headers:u,items:t.value.machines,onRowClicked:m},null,8,["items"])])])]),_:1})],64))]),_:1})]),_:1}))}};export{G as default};