import{d as _,l as p,r as f,i as v,S as m,o as l,c as r,a as e,e as k,k as i,p as u,F as b,j as L,t as s,x as d,B as h}from"../index.js";import"../vendor.js";const y={id:"resource-lock-component"},g={class:"card"},x={class:"card-header"},w=e("span",{class:"fa fa-sync"},null,-1),B=e("h3",null,"Current resource locks",-1),S={class:"table-responsive"},j={class:"table table-striped table-hover"},C=e("thead",null,[e("th",null,"Resource type"),e("th",null,"ID"),e("th",null,"User"),e("th",null,"Machine"),e("th",null,"Age"),e("th",null,"Expires")],-1),D={class:"card-body no-entries"},R=e("p",null,"(no locks are currently held)",-1),U=[R],M=_({__name:"ResourceLock",setup(A){p();const n=f([]);v(async()=>{await c()});async function c(){n.value=[];const a=await fetch(m.locksBaseUrl);if(a.ok){const o=await a.json();n.value=o}}return(a,o)=>(l(),r("div",y,[e("div",g,[e("div",x,[e("button",{class:"btn btn-link float-right",onClick:o[0]||(o[0]=t=>c()),title:"Update resource locks from the server"},[w,k(" Refresh ")]),B]),e("div",S,[i(e("table",j,[C,(l(!0),r(b,null,L(n.value,t=>(l(),r("tr",{key:t.id},[e("td",null,s(t.resource),1),e("td",null,s(t.id),1),e("td",null,s(t.user),1),e("td",null,s(t.machine),1),e("td",null,s(d(h)(t.created).format("LLL")),1),e("td",null,s(d(h)(t.expires).format("LLL")),1)]))),128))],512),[[u,n.value.length]])]),i(e("div",D,U,512),[[u,!n.value.length]])])]))}});export{M as default};
