PageSourceSearch

https://app.vemcogroup.com/build/assets/ZoneIndex-4x8_Gw7B.js

js vemcogroup.com collected 2026-10-06 00:08:49 UTC 6,871 bytes, 1 lines download raw bytes

1import{A as S,C as n,D as F,E as r,It as T,M as P,Pt as l,Rt as R,S as U,T as d,Tt as f,X as a,et as x,k as u,mt as p,pt as c,q,rt as b,t as O,v as g,w as v,zt as s}from"./vue.esm-bundler-oxAUYVOu.js";import{t as X}from"./axios-CYWqtgGi.js";import{n as i}from"./i18n-BYvtSVlQ.js";import{h as G}from"./useApi-BPuI6ZR9-CdqwwY9R.js";import{n as H}from"./BaseError-VGoTG76J.js";import{t as J}from"./OrbitLoadingIndicator-V8MOoKwO.js";import{t as K}from"./BaseIcon-BK0cOGQX.js";import{t as Q}from"./BaseButton-Dc3UtcjG.js";import{t as W}from"./LocationNavigationBar-BvNKACN5.js";import{t as Y}from"./BaseDropdown-BL-UUuD2.js";import{n as V}from"./BaseDropdownItem-BKm7PDUj.js";import{t as z}from"./BaseTable-DKymC5EN.js";O();var ee={"data-zone-index":"",class:"card mb-8 rounded-xl border-0 px-3 shadow-sm"},te={class:"card-body"},ae={class:"pl-8 rtl:pr-8"},se={class:"py-4 ps-8"},re={key:0,class:"text-sm font-medium text-gray-700 hover:underline"},ne={key:1,class:"text-sm font-medium text-gray-700"},ie={key:2,class:"mt-2 text-xs text-gray-500"},le={class:"text-xs text-gray-600"},oe={class:"mt-1 flex flex-wrap gap-1"},de={key:0,class:"inline-flex rounded-full bg-green-100 px-2 py-1.5 text-xs font-semibold text-green-800"},_e={key:1,class:"inline-flex rounded-full bg-rose-50 px-2 py-1.5 text-xs font-semibold text-rose-600"},ue={class:"py-4"},ce={class:"flex flex-wrap gap-2"},me=["title"],pe={key:0,class:"text-xs font-semibold text-slate-600 hover:underline"},ve={key:1,class:"text-xs font-semibold text-slate-600"},fe={key:0,class:"mt-2 text-xs text-gray-600"},ye={key:0,class:"cursor-pointer hover:underline"},ge={key:1},he={key:1,class:"mt-4 inline-flex items-center text-xs"},xe={class:"font-medium text-gray-600"},be={class:"mr-5 ml-1 rounded-full bg-indigo-100 px-1.5 py-0.5 font-semibold text-indigo-800"},ke={key:2,class:"mt-4 inline-flex items-center text-xs"},we={class:"font-medium text-gray-600"},Be={class:"mr-5 ml-1 rounded-full bg-indigo-100 px-1.5 py-0.5 font-semibold text-indigo-800"},$e={class:"py-4"},Ce={class:"flex h-16 w-full items-center justify-center text-gray-700 italic"},Ie=P({__name:"ZoneIndex",setup(De){const B=G(),k=`/company/${B.params.company}/location/${B.params.location}/zone`,Z=`${k}/create`,$=f({id:0,uuid:"",name:""}),C=f({id:0,name:"",breadcrumb_ancestors:[]}),I=f([]),D=f(!1),w=f(!0),h=f(""),L=U(()=>{const e=[],m=y=>{for(const _ of y)e.push(_),m(_.children)};return m(I.value),e});function N(e){const[m,y,_]=e.split("-");return`${_}-${y}-${m}`}function M(e){return{entrance:"bg-purple-100 text-purple-800",room:"bg-green-100 text-green-800",invisible:"bg-gray-200 text-gray-700",total:"bg-blue-100 text-blue-800",plan:"bg-orange-100 text-orange-800",area:"bg-pink-100 text-pink-800",single:"bg-yellow-100 text-yellow-800",test:"bg-indigo-100 text-indigo-800"}[e]??"bg-slate-100 text-slate-800"}async function j(){w.value=!0,h.value="";try{const e=await X.get(k,{headers:{Accept:"application/json"}});$.value=e.data.data.company,C.value=e.data.data.location,D.value=e.data.data.can_create,I.value=e.data.data.zones}catch{h.value=i("something_went_wrong_please_try_again")}finally{w.value=!1}}return q(()=>{j()}),(e,m)=>{const y=b("tooltip"),_=b("xhr-modal"),A=b("copy-text"),E=b("xhr-delete");return a(),r("div",ee,[n("div",te,[S(W,{company:$.value,location:C.value,title:("i18n_tr"in e?e.i18n_tr:l(i))("zones")},{breadcrumb:c(()=>[n("a",{class:"ms-2 text-gray-500",href:k},s(("i18n_tr"in e?e.i18n_tr:l(i))("zones")),1)]),buttons:c(()=>[D.value?p((a(),v(Q,{key:0,variant:"create"},{default:c(()=>[u(s(("i18n_tr"in e?e.i18n_tr:l(i))("company.shop.add_zone")),1)]),_:1})),[[y,("i18n_tr"in e?e.i18n_tr:l(i))("add_new")],[_,Z]]):d("",!0)]),_:1},8,["company","location","title"]),w.value?(a(),v(J,{key:0,class:"mx-auto my-8"})):h.value?(a(),v(H,{key:1,text:h.value},null,8,["text"])):(a(),v(z,{key:2},F({header:c(()=>[n("tr",null,[n("th",ae,s(("i18n_tr"in e?e.i18n_tr:l(i))("name")),1),n("th",null,s(("i18n_tr"in e?e.i18n_tr:l(i))("sensors")),1),m[0]||(m[0]=n("th",{class:"dropdown"},null,-1))])]),body:c(()=>[(a(!0),r(g,null,x(L.value,t=>(a(),r("tr",{key:t.id},[n("td",se,[n("div",{class:"flex flex-col items-start",style:R({paddingInlineStart:`${t.level*1.5}rem`})},[t.can_edit?p((a(),r("a",re,[u(s(t.name),1)])),[[_,t.edit_url]]):(a(),r("span",ne,s(t.name),1)),t.custom_id?(a(),r("span",ie,s(t.custom_id),1)):d("",!0),n("span",le,[u(s(("i18n_tr"in e?e.i18n_tr:l(i))("id"))+": ",1),p((a(),r("span",null,[u(s(t.
1id),1)])),[[A]])]),n("div",oe,[(a(!0),r(g,null,x(t.tags,o=>(a(),r("span",{key:o,class:T(["inline-flex items-center rounded-full px-3 py-1.5 text-xs font-semibold",M(o)])},s(("i18n_tr"in e?e.i18n_tr:l(i))(o)),3))),128)),t.active_at?(a(),r("span",de,s(("i18n_tr"in e?e.i18n_tr:l(i))("active_date"))+": "+s(N(t.active_at)),1)):d("",!0),t.deactive_at?(a(),r("span",_e,s(("i18n_tr"in e?e.i18n_tr:l(i))("deactive_date"))+": "+s(N(t.deactive_at)),1)):d("",!0)])],4)]),n("td",ue,[n("div",ce,[(a(!0),r(g,null,x(t.sensors.slice(0,7),o=>(a(),r("div",{key:`sensor-${o.id}`,class:"inline-flex items-center rounded-full bg-slate-50 px-2.5 py-1.5",title:o.mac??""},[n("span",{class:T(["mr-1.5 size-2 rounded-full bg-current",o.status_class])},null,2),o.edit_url?p((a(),r("a",pe,[u(s(o.name),1)])),[[_,o.edit_url]]):(a(),r("span",ve,s(o.name),1)),o.inverted?(a(),v(K,{key:2,icon:"icon-inverted",class:"ml-1 h-5"})):d("",!0)],8,me))),128)),t.sensors.length<=7?(a(!0),r(g,{key:0},x(t.terminals.slice(0,7-t.sensors.length),o=>(a(),r("span",{key:`terminal-${o.id}`,class:"inline-flex items-center rounded-full bg-slate-50 px-2.5 py-1.5 text-xs font-semibold text-slate-600"},s(o.name),1))),128)):d("",!0)]),t.sensors.length>7?(a(),r("div",fe,[t.can_edit?p((a(),r("a",ye,[u(s(t.sensors.length-7)+" "+s(("i18n_tr"in e?e.i18n_tr:l(i))("more"))+"... ",1)])),[[_,t.edit_url]]):(a(),r("span",ge,s(t.sensors.length-7)+" "+s(("i18n_tr"in e?e.i18n_tr:l(i))("more"))+"...",1))])):d("",!0),t.sensors.length?(a(),r("div",he,[n("span",xe,s(("i18n_tr"in e?e.i18n_tr:l(i))("selected_lines")),1),n("span",be,[u(s(t.active_sensor_count),1),t.historical_sensor_count?(a(),r(g,{key:0},[u(" | "+s(t.historical_sensor_count),1)],64)):d("",!0)])])):d("",!0),t.master_sensor_count?(a(),r("div",ke,[n("span",we,s(("i18n_tr"in e?e.i18n_tr:l(i))("sensors_used")),1),n("span",Be,s(t.master_sensor_count),1)])):d("",!0)]),n("td",$e,[S(Y,null,{default:c(()=>[t.can_edit?p((a(),v(V,{key:0},{default:c(()=>[u(s(("i18n_tr"in e?e.i18n_tr:l(i))("edit")),1)]),_:1})),[[_,t.edit_url]]):d("",!0),t.can_delete?p((a(),v(V,{key:1,class:"text-rose-600"},{default:c(()=>[u(s(("i18n_tr"in e?e.i18n_tr:l(i))("delete")),1)]),_:1})),[[E,t.delete_url]]):d("",!0)]),_:2},1024)])]))),128))]),_:2},[L.value.length===0?{name:"empty",fn:c(()=>[n("div",Ce,s(("i18n_tr"in e?e.i18n_tr:l(i))("company.shop.no_zones_created")),1)]),key:"0"}:void 0]),1024))])])}}}),Oe=Ie;export{Oe as default};

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.