ot-gateway 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/apps/gateway/src/main.mjs +821 -233
- package/apps/web/out/404/index.html +1 -0
- package/apps/web/out/404.html +1 -1
- package/apps/web/out/__next.__PAGE__.txt +28 -26
- package/apps/web/out/__next._full.txt +23 -21
- package/apps/web/out/__next._tree.txt +2 -2
- package/apps/web/out/_next/static/chunks/0-tykl1ek9eef.js +1 -0
- package/apps/web/out/_next/static/chunks/0_9hphsk8elkz.js +1 -0
- package/apps/web/out/_next/static/chunks/10i96w66fwhkr.js +31 -0
- package/apps/web/out/_next/static/chunks/2-12vm-gmodvi.css +1 -0
- package/apps/web/out/_next/static/chunks/2hhp92plmhxim.js +1 -0
- package/apps/web/out/_next/static/chunks/2r_w-j--qdreu.js +22 -0
- package/apps/web/out/_next/static/chunks/2t90haogl_st8.js +1 -0
- package/apps/web/out/_next/static/chunks/2vp-i92uyys5d.js +1 -0
- package/apps/web/out/_next/static/chunks/3k0dufyi1j19w.js +12 -0
- package/apps/web/out/_not-found/__next._full.txt +21 -19
- package/apps/web/out/_not-found/__next._not-found.__PAGE__.txt +27 -25
- package/apps/web/out/_not-found/__next._tree.txt +2 -2
- package/apps/web/out/_not-found/index.html +1 -0
- package/apps/web/out/_not-found/index.txt +22 -0
- package/apps/web/out/index.html +1 -1
- package/apps/web/out/index.txt +23 -21
- package/apps/web/out/messages/__next._full.txt +27 -0
- package/apps/web/out/messages/__next._tree.txt +4 -0
- package/apps/web/out/messages/__next.messages.__PAGE__.txt +33 -0
- package/apps/web/out/messages/index.html +1 -0
- package/apps/web/out/messages/index.txt +27 -0
- package/apps/web/out/points/__next._full.txt +27 -0
- package/apps/web/out/points/__next._tree.txt +4 -0
- package/apps/web/out/points/__next.points.__PAGE__.txt +33 -0
- package/apps/web/out/points/index.html +1 -0
- package/apps/web/out/points/index.txt +27 -0
- package/apps/web/out/settings/__next._full.txt +27 -0
- package/apps/web/out/settings/__next._tree.txt +4 -0
- package/apps/web/out/settings/__next.settings.__PAGE__.txt +33 -0
- package/apps/web/out/settings/index.html +1 -0
- package/apps/web/out/settings/index.txt +27 -0
- package/examples/gateway.json +37 -37
- package/package.json +1 -1
- package/packaging/compose.yaml +1 -1
- package/apps/web/out/_next/static/chunks/0csls39kpdzgy.js +0 -22
- package/apps/web/out/_next/static/chunks/162tvyao0-i49.js +0 -12
- package/apps/web/out/_next/static/chunks/29-6f2cs5ih9t.css +0 -1
- package/apps/web/out/_next/static/chunks/3oyy-mvhhfmq3.js +0 -31
- package/apps/web/out/_not-found.html +0 -1
- package/apps/web/out/_not-found.txt +0 -20
- /package/apps/web/out/_next/static/{s63QEywZ_oAqimFgcqV1S → XiBzAo3f0YeQ4E_ciqAE_}/_buildManifest.js +0 -0
- /package/apps/web/out/_next/static/{s63QEywZ_oAqimFgcqV1S → XiBzAo3f0YeQ4E_ciqAE_}/_clientMiddlewareManifest.js +0 -0
- /package/apps/web/out/_next/static/{s63QEywZ_oAqimFgcqV1S → XiBzAo3f0YeQ4E_ciqAE_}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,61981,e=>{"use strict";var t=e.i(94115),a=e.i(20367),s=e.i(80136),r=e.i(71513),l=e.i(7347),n=e.i(64036),i=e.i(44946),o=e.i(29164),d=e.i(19656),c=e.i(89486),u=e.i(86224);let m={value:"default",metadata:"secondary",health:"outline","command result":"warning",other:"outline"},h=[["value","Values"],["metadata","Metadata"],["health","Health"],["command result","Command results"],["other","Other"]],x=e=>`${(0,d.f)(e)} ${1===e?"topic":"topics"}`;e.s(["default",0,()=>{let e=(0,r.Z)((0,s.useGateway)()),{messages:p,failed:f}=(()=>{let[e,t]=(0,a.useState)(void 0),[s,l]=(0,a.useState)(void 0);return(0,a.useEffect)(()=>{let e,a=!1,s=()=>(0,c.I)(c.x).then(n=>{a||("Success"===n._tag?(t(n.success),l(void 0)):l(n.failure.message),e=setTimeout(()=>void s(),r.z))});return s(),()=>{a=!0,void 0!==e&&clearTimeout(e)}},[]),{messages:e,failed:s}})(),[g,v]=(0,a.useState)({query:"",kind:"all"}),b=""!==g.query||"all"!==g.kind,w=p?.messages??[],j=(0,a.useMemo)(()=>w.filter(e=>((e,t)=>{if("all"!==t.kind&&(0,c.D)(e.topic)!==t.kind)return!1;let a=t.query.toLowerCase().split(/\s+/).filter(e=>""!==e);if(0===a.length)return!0;let s=`${e.topic} ${e.payload}`.toLowerCase();return a.every(e=>s.includes(e))})(e,g)),[w,g]);(0,s.useListCount)(p?.messages.length,b?j.length:void 0,"topic");let{body:N,range:y,rowHeight:k}=(0,u.f)(j.length,57),M=(0,a.useMemo)(()=>{let e=(e=>{let t=new Map;for(let a of e){let e=(0,c.D)(a.topic);t.set(e,(t.get(e)??0)+1)}return t})(w);return[{value:"all",label:"All kinds",detail:x(w.length)},...h.filter(([t])=>e.has(t)||t===g.kind).map(([t,a])=>({value:t,label:a,detail:x(e.get(t)??0)}))]},[w,g.kind]),C=void 0===e?"":`${e.site}/${e.building}/`,$=e?.now??Date.now();return void 0===p?(0,t.jsx)("p",{className:"text-muted-foreground",children:void 0===f?"Loading…":`The gateway does not answer: ${f}`}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"max-w-3xl text-sm text-muted-foreground",children:["The latest message on each topic the gateway publishes: what a client subscribed to"," ",(0,t.jsxs)("code",{className:"font-mono",children:[C,"#"]})," receives. A value goes to"," ",(0,t.jsx)("code",{className:"font-mono",children:"site/building/device/point"})," as its publish mode says, its metadata to"," ",(0,t.jsx)("code",{className:"font-mono",children:"…/$meta"}),", and the gateway's health to"," ",(0,t.jsxs)("code",{className:"font-mono",children:["…/$gateway/",e?.id??"id","/health"]}),"."]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative min-w-0 flex-1 basis-64",children:[(0,t.jsx)("input",{"aria-label":"Search messages",className:`h-9 w-full rounded-md border bg-background px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-search-cancel-button]:appearance-none ${""===g.query?"":"pr-20"}`,onChange:e=>v({...g,query:e.target.value}),placeholder:"Search topics and payloads…",type:"search",value:g.query}),""===g.query?null:(0,t.jsxs)("button",{className:"absolute top-1/2 right-1.5 flex -translate-y-1/2 items-center gap-1 rounded px-1.5 py-0.5 text-xs hover:bg-muted",onClick:()=>v({...g,query:""}),type:"button",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"✕"}),"Reset"]})]}),(0,t.jsx)(i.f,{className:"w-full sm:w-56",emptyText:"No kind found.",label:"Kind",onChange:e=>{let t;return v({...g,kind:(t=e,h.find(([e])=>e===t)?.[0]??"all")})},options:M,searchPlaceholder:"Search kinds…",value:g.kind})]}),(0,t.jsx)(n.N,{className:"py-0",children:(0,t.jsx)(n.O,{className:"px-0",children:0===j.length?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 p-6 text-sm text-muted-foreground",children:[(0,t.jsx)("p",{children:0===w.length?"Nothing published yet.":"No message matches."}),b?(0,t.jsx)("button",{className:"font-medium text-foreground underline-offset-4 hover:underline",onClick:()=>v({query:"",kind:"all"}),type:"button",children:"Clear filters"}):null]}):(0,t.jsxs)(o.s,{"aria-rowcount":j.length+1,containerClassName:"overflow-clip rounded-xl",children:[(0,t.jsx)(o.E,{className:"sticky top-0 z-10 [&_th]:bg-card [&_th]:shadow-[inset_0_-1px_0_var(--border)] [&_tr]:border-0",children:(0,t.jsxs)(o.N,{"aria-rowindex":1,className:"hover:bg-transparent",children:[(0,t.jsx)(o.U,{className:"pl-4",children:"Topic"}),(0,t.jsx)(o.U,{children:"Latest payload"}),(0,t.jsx)(o.U,{className:"hidden text-right sm:table-cell",children:"Messages"}),(0,t.jsx)(o.U,{className:"pr-4 text-right",children:"Sent at"})]})}),(0,t.jsxs)(o.z,{ref:N,children:[0===y.start?null:(0,t.jsx)("tr",{"aria-hidden":"true",style:{height:y.start*k}}),j.slice(y.start,y.end).map((e,a)=>{let s=y.start+a,r=(0,c.D)(e.topic),n=e.topic.startsWith(C)?e.topic.slice(C.length):e.topic;return(0,t.jsxs)(o.N,{"aria-rowindex":s+2,className:"h-14","data-row":s,children:[(0,t.jsxs)(o.d,{className:"max-w-56 pl-4 sm:max-w-96",children:[(0,t.jsxs)("p",{className:"truncate font-mono text-xs",title:e.topic,children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:C}),n]}),(0,t.jsxs)("div",{className:"mt-1 flex gap-1",children:[(0,t.jsx)(l.f,{variant:m[r],children:r}),e.retained?(0,t.jsx)(l.f,{title:"The broker keeps it and gives it to every subscriber that connects later",variant:"outline",children:"retained"}):null]})]}),(0,t.jsx)(o.d,{className:"max-w-40 sm:max-w-md",children:(0,t.jsxs)("code",{className:"block truncate font-mono text-xs",title:e.payload,children:[e.payload,e.truncated?"…":""]})}),(0,t.jsx)(o.d,{className:"hidden text-right tabular-nums sm:table-cell",children:(0,d.f)(e.count)}),(0,t.jsx)(o.d,{className:"pr-4 text-right text-muted-foreground tabular-nums",children:(0,c.w)(e.at,$)})]},e.topic)}),y.end===j.length?null:(0,t.jsx)("tr",{"aria-hidden":"true",style:{height:(j.length-y.end)*k}})]})]})})}),p.droppedTopics>0?(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[(0,d.f)(p.droppedTopics)," more topics are not shown, and search does not find them: the gateway keeps the latest message of at most ",(0,d.f)(p.messages.length)," topics."]}):null]})}],61981)},64036,e=>{"use strict";var t=e.i(94115),a=e.i(52088);e.s(["N",0,({className:e,...s})=>(0,t.jsx)("div",{"data-slot":"card",className:(0,a.f)("flex flex-col gap-4 rounded-xl border bg-card py-5 text-card-foreground shadow-sm",e),...s}),"O",0,({className:e,...s})=>(0,t.jsx)("div",{"data-slot":"card-content",className:(0,a.f)("px-5",e),...s}),"u",0,({className:e,...s})=>(0,t.jsx)("div",{"data-slot":"card-description",className:(0,a.f)("text-sm text-muted-foreground",e),...s}),"Y",0,({className:e,...s})=>(0,t.jsx)("div",{"data-slot":"card-header",className:(0,a.f)("grid auto-rows-min items-start gap-1.5 px-5",e),...s}),"v",0,({className:e,...s})=>(0,t.jsx)("div",{"data-slot":"card-title",className:(0,a.f)("leading-none font-semibold",e),...s})])},44946,86224,e=>{"use strict";var t=e.i(94115),a=e.i(20367),s=e.i(81081),r=e.i(19656),l=e.i(52088);let n={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};e.s(["f",0,({options:e,value:i,onChange:o,label:d,searchPlaceholder:c,emptyText:u,className:m})=>{let h=(0,a.useId)(),x=`${h}-list`,p=e=>`${h}-option-${e}`,f=(0,a.useRef)(null),g=(0,a.useRef)(null),v=(0,a.useRef)(null),b=(0,a.useRef)(null),[w,j]=(0,a.useState)(!1),[N,y]=(0,a.useState)(""),[k,M]=(0,a.useState)(0),C=e.find(e=>e.value===i),$=(0,a.useMemo)(()=>e.filter(e=>(0,s.w)(`${e.label} ${e.detail??""} ${e.keywords??""}`,N)),[e,N]),E=$.slice(0,100),L=()=>{y("");let t=void 0===C?-1:e.indexOf(C);M(t>=0&&t<100?t:0),j(!0)},S=e=>{j(!1),e&&g.current?.focus()},D=e=>{void 0!==e&&(o(e.value),S(!0))};return(0,a.useLayoutEffect)(()=>{w&&v.current?.focus()},[w]),(0,a.useLayoutEffect)(()=>{w&&b.current?.querySelector(`[data-index="${k}"]`)?.scrollIntoView({block:"nearest"})},[w,k]),(0,a.useEffect)(()=>{if(!w)return;let e=e=>{e.target instanceof Node&&!f.current?.contains(e.target)&&S(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[w]),(0,t.jsxs)("div",{className:(0,l.f)("relative",m),ref:f,children:[(0,t.jsxs)("button",{"aria-expanded":w,"aria-haspopup":"listbox","aria-label":`${d}: ${C?.label??""}`,className:"flex h-9 w-full items-center gap-2 rounded-md border bg-background px-3 text-sm hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",onClick:()=>w?S(!1):L(),onKeyDown:e=>{"ArrowDown"!==e.key||w||(e.preventDefault(),L())},ref:g,type:"button",children:[C?.leading,(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:C?.label}),(0,t.jsx)("svg",{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground",...n,children:(0,t.jsx)("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"})})]}),w?(0,t.jsxs)("div",{className:"absolute top-[calc(100%+4px)] right-0 z-50 flex w-[min(20rem,calc(100vw-2rem))] flex-col overflow-hidden rounded-lg border bg-card text-card-foreground shadow-lg motion-safe:animate-[popover-in_120ms_ease-out]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b px-3",children:[(0,t.jsxs)("svg",{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground",...n,children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,t.jsx)("path",{d:"m20 20-3.5-3.5"})]}),(0,t.jsx)("input",{"aria-activedescendant":void 0===E[k]?void 0:p(k),"aria-autocomplete":"list","aria-controls":x,"aria-expanded":"true","aria-label":c,className:"h-10 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onChange:e=>{y(e.target.value),M(0)},onKeyDown:e=>{let t=E.length-1,a=a=>{e.preventDefault(),M(Math.min(Math.max(a,0),Math.max(t,0)))};switch(e.key){case"ArrowDown":return a(k+1);case"ArrowUp":return a(k-1);case"Home":return a(0);case"End":return a(t);case"PageDown":return a(k+8);case"PageUp":return a(k-8);case"Enter":return e.preventDefault(),D(E[k]);case"Escape":return e.preventDefault(),e.stopPropagation(),S(!0);case"Tab":return S(!1)}},placeholder:c,ref:v,role:"combobox",value:N})]}),(0,t.jsxs)("ul",{"aria-label":d,className:"max-h-[min(18rem,50dvh)] overflow-y-auto overscroll-contain p-1",id:x,ref:b,role:"listbox",children:[0===E.length?(0,t.jsx)("li",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:u}):E.map((e,a)=>(0,t.jsxs)("li",{"aria-selected":e.value===i,className:(0,l.f)("flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm select-none",a===k&&"bg-muted"),"data-index":a,id:p(a),onMouseDown:e=>e.preventDefault(),onClick:()=>D(e),onPointerMove:()=>M(a),role:"option",children:[e.leading,(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.label}),void 0===e.detail?null:(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:e.detail}),(0,t.jsx)("svg",{"aria-hidden":"true",className:(0,l.f)("size-4 shrink-0",e.value!==i&&"invisible"),...n,children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})})]},e.value)),$.length>E.length?(0,t.jsxs)("li",{className:"px-2 py-2 text-center text-xs text-muted-foreground",role:"presentation",children:[(0,r.f)($.length-E.length)," more: type to narrow"]}):null]})]}):null]})}],44946),e.s(["f",0,(e,t)=>{let s=(0,a.useRef)(null),r=(0,a.useRef)(t),[l,n]=(0,a.useState)(()=>({start:0,end:Math.min(e,30)})),[i,o]=(0,a.useState)(t),d=(0,a.useCallback)(()=>{var t;let a,l=s.current;if(null===l)return;let i=l.querySelector("[data-row]")?.getBoundingClientRect().height;void 0!==i&&i>0&&Math.abs(i-r.current)>.5&&(r.current=i,o(i));let d={start:a=Math.min((t={top:-l.getBoundingClientRect().top,height:window.innerHeight,rowHeight:r.current,count:e,overscan:8}).count,Math.max(0,Math.floor(t.top/t.rowHeight)-t.overscan)),end:Math.max(a,Math.min(t.count,Math.max(0,Math.ceil((t.top+t.height)/t.rowHeight)+t.overscan)))};n(e=>e.start===d.start&&e.end===d.end?e:d)},[e]);(0,a.useLayoutEffect)(d,[d]),(0,a.useEffect)(()=>{let e=0,t=()=>{0===e&&(e=requestAnimationFrame(()=>{e=0,d()}))};return window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t),()=>{cancelAnimationFrame(e),window.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[d]);let c=(0,a.useCallback)(e=>{let t=s.current;if(null===t)return;let a=t.getBoundingClientRect().top+e*r.current;(a<0||a+r.current>window.innerHeight)&&window.scrollBy({top:a-window.innerHeight/2+r.current/2}),d()},[d]);return{body:s,range:l,rowHeight:i,reveal:c}}],86224)},29164,e=>{"use strict";var t=e.i(94115),a=e.i(52088);e.s(["s",0,({className:e,containerClassName:s="overflow-x-auto",...r})=>(0,t.jsx)("div",{"data-slot":"table-container",className:(0,a.f)("relative w-full",s),children:(0,t.jsx)("table",{"data-slot":"table",className:(0,a.f)("w-full caption-bottom text-sm",e),...r})}),"z",0,({className:e,...s})=>(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,a.f)("[&_tr:last-child]:border-0",e),...s}),"d",0,({className:e,...s})=>(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,a.f)("p-2 align-middle whitespace-nowrap",e),...s}),"U",0,({className:e,...s})=>(0,t.jsx)("th",{"data-slot":"table-head",className:(0,a.f)("h-9 px-2 text-left align-middle font-medium whitespace-nowrap text-muted-foreground",e),...s}),"E",0,({className:e,...s})=>(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,a.f)("[&_tr]:border-b",e),...s}),"N",0,({className:e,...s})=>(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,a.f)("border-b transition-colors hover:bg-muted/50",e),...s})])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,82341,e=>{"use strict";var t=e.i(94115),s=e.i(20367),a=e.i(64036),r=e.i(29164),i=e.i(19656);let d={gateway:"Gateway",mqtt:"Broker",buffer:"Buffer",history:"History",status:"Status page",bacnet:"BACnet/IP"},n=e=>d[e]??o(e),l={site:"Site",building:"Building",id:"Gateway id",healthIntervalMs:"Health message every",url:"Broker",clientId:"Client id",username:"User name",passwordEnv:"Password from variable",version:"MQTT version",path:"File",maxRows:"Holds up to",retentionDays:"Keeps",bindAddress:"Listens on",port:"Port",webRoot:"Web files",broadcastAddress:"Broadcasts to",bbmdAddress:"BBMD",requestTimeoutMs:"Reply timeout",retries:"Retries",covLifetimeSeconds:"Subscriptions renewed every",host:"Address",unitId:"Unit id",pollIntervalMs:"Read every",cycleTimeoutMs:"Give up a read after",publish:"Publishes",requestGapMs:"Pause between requests",maxRegistersPerRead:"Registers per request",maxBitsPerRead:"Bits per request",deviceInstance:"Device instance",address:"Address",cov:"Change notifications (COV)"},o=e=>{let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)},c=e=>l[e]??o(e),m=e=>{if(e<1e3)return`${e} ms`;let t=e/1e3;return t<60?`${Number(t.toFixed(1))} s`:t<3600?`${Number((t/60).toFixed(1))} min`:`${Number((t/3600).toFixed(1))} h`},u=new Set(["port","unitId","deviceInstance"]),h=(e,t)=>null===t?"–":"boolean"==typeof t?t?"yes":"no":"number"==typeof t?e.endsWith("Ms")?m(t):e.endsWith("Seconds")?m(1e3*t):"retentionDays"===e?`${t} ${1===t?"day":"days"} per minute`:"maxRows"===e?`${t.toLocaleString("en-US")} messages`:u.has(e)?String(t):t.toLocaleString("en-US"):"string"==typeof t?"version"===e&&"auto"===t?"5, or 3.1.1 if the broker needs it":t:Array.isArray(t)?t.map(t=>h(e,t)).join(", "):"object"!=typeof t||null===t||Array.isArray(t)?String(t):Object.entries(t).map(([e,t])=>`${o(e).toLowerCase()} ${h(e,t)}`).join(" · "),x=(e,t)=>{let s=e=>{let s=t.find(t=>t.key===e)?.value;return"string"==typeof s||"number"==typeof s?String(s):void 0};if("modbus-tcp"===e)return`${s("host")??"?"}:${s("port")??"502"} \xb7 unit ${s("unitId")??"?"}`;if("bacnet-ip"===e){let e=s("address");return`device ${s("deviceInstance")??"?"}${void 0===e?", found by broadcast":` at ${e}`}`}return"simulator"===e?"on this gateway":""},f=new Set(["host","port","unitId","deviceInstance","address","pollIntervalMs"]);var p=e.i(89486);let g=[["buffer","Off: values read while the broker is away are lost."],["history","Off: the point panel shows no history."]];e.s(["default",0,()=>{let e=(()=>{let[e,t]=(0,s.useState)({_tag:"loading"});return(0,s.useEffect)(()=>{let e,s=!1,a=()=>(0,p.I)(p.q).then(r=>{if(!s){if("Success"===r._tag)return t({_tag:"ok",config:r.success});t({_tag:"failed",message:r.failure.message}),e=setTimeout(()=>void a(),5e3)}});return a(),()=>{s=!0,void 0!==e&&clearTimeout(e)}},[]),e})();if("ok"!==e._tag)return(0,t.jsx)("p",{className:"text-muted-foreground",children:"failed"===e._tag?`The gateway does not answer: ${e.message}`:"Loading…"});let{sections:d,devices:l}=e.config,o=new Set(d.map(e=>e.key));return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"max-w-3xl text-sm text-muted-foreground",children:["The settings the gateway runs with, read-only. To change one, edit the config file (",(0,t.jsx)("code",{className:"font-mono",children:"ot-gateway.json"}),"), check it with"," ",(0,t.jsx)("code",{className:"font-mono",children:"ot-gateway check ot-gateway.json"})," and restart the gateway."]}),(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[d.map(e=>(0,t.jsxs)(a.N,{children:[(0,t.jsx)(a.Y,{children:(0,t.jsx)(a.v,{children:n(e.key)})}),(0,t.jsx)(a.O,{children:(0,t.jsx)("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-6 gap-y-2 text-sm",children:e.entries.map(e=>(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",title:e.key,children:c(e.key)}),(0,t.jsx)("dd",{className:"min-w-0 text-right break-words",children:h(e.key,e.value)})]},e.key))})})]},e.key)),g.filter(([e])=>!o.has(e)).map(([e,s])=>(0,t.jsxs)(a.N,{children:[(0,t.jsx)(a.Y,{children:(0,t.jsx)(a.v,{children:n(e)})}),(0,t.jsx)(a.O,{children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s})})]},e))]}),(0,t.jsxs)(a.N,{className:"gap-0 py-0",children:[(0,t.jsx)("div",{className:"border-b px-5 py-4",children:(0,t.jsx)("h2",{className:"leading-none font-semibold",children:"Devices"})}),0===l.length?(0,t.jsx)("p",{className:"p-5 text-sm text-muted-foreground",children:"The config has no devices."}):(0,t.jsxs)(r.s,{children:[(0,t.jsx)(r.E,{children:(0,t.jsxs)(r.N,{className:"hover:bg-transparent",children:[(0,t.jsx)(r.U,{className:"pl-5",children:"Device"}),(0,t.jsx)(r.U,{className:"hidden sm:table-cell",children:"Address"}),(0,t.jsx)(r.U,{className:"text-right",children:"Read every"}),(0,t.jsx)(r.U,{className:"text-right",children:"Points"}),(0,t.jsx)(r.U,{className:"hidden pr-5 lg:table-cell",children:"Other settings"})]})}),(0,t.jsx)(r.z,{children:l.map(e=>{let s=e.entries.find(e=>"pollIntervalMs"===e.key)?.value,a=e.entries.filter(e=>!f.has(e.key)).map(e=>`${c(e.key)}: ${h(e.key,e.value)}`).join(" · ");return(0,t.jsxs)(r.N,{children:[(0,t.jsxs)(r.d,{className:"max-w-56 pl-5",children:[(0,t.jsx)("p",{className:"truncate font-mono",children:e.id}),(0,t.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[p.T[e.protocol]??e.protocol,(0,t.jsxs)("span",{className:"sm:hidden",children:[" · ",x(e.protocol,e.entries)]})]})]}),(0,t.jsx)(r.d,{className:"hidden font-mono text-xs sm:table-cell",children:x(e.protocol,e.entries)}),(0,t.jsx)(r.d,{className:"text-right tabular-nums",children:"number"==typeof s?m(s):"–"}),(0,t.jsx)(r.d,{className:"text-right tabular-nums",children:(0,i.f)(e.pointCount)}),(0,t.jsx)(r.d,{className:"hidden max-w-md truncate pr-5 text-xs text-muted-foreground lg:table-cell",title:a,children:a})]},e.id)})})]})]})]})}],82341)},64036,e=>{"use strict";var t=e.i(94115),s=e.i(52088);e.s(["N",0,({className:e,...a})=>(0,t.jsx)("div",{"data-slot":"card",className:(0,s.f)("flex flex-col gap-4 rounded-xl border bg-card py-5 text-card-foreground shadow-sm",e),...a}),"O",0,({className:e,...a})=>(0,t.jsx)("div",{"data-slot":"card-content",className:(0,s.f)("px-5",e),...a}),"u",0,({className:e,...a})=>(0,t.jsx)("div",{"data-slot":"card-description",className:(0,s.f)("text-sm text-muted-foreground",e),...a}),"Y",0,({className:e,...a})=>(0,t.jsx)("div",{"data-slot":"card-header",className:(0,s.f)("grid auto-rows-min items-start gap-1.5 px-5",e),...a}),"v",0,({className:e,...a})=>(0,t.jsx)("div",{"data-slot":"card-title",className:(0,s.f)("leading-none font-semibold",e),...a})])},29164,e=>{"use strict";var t=e.i(94115),s=e.i(52088);e.s(["s",0,({className:e,containerClassName:a="overflow-x-auto",...r})=>(0,t.jsx)("div",{"data-slot":"table-container",className:(0,s.f)("relative w-full",a),children:(0,t.jsx)("table",{"data-slot":"table",className:(0,s.f)("w-full caption-bottom text-sm",e),...r})}),"z",0,({className:e,...a})=>(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,s.f)("[&_tr:last-child]:border-0",e),...a}),"d",0,({className:e,...a})=>(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,s.f)("p-2 align-middle whitespace-nowrap",e),...a}),"U",0,({className:e,...a})=>(0,t.jsx)("th",{"data-slot":"table-head",className:(0,s.f)("h-9 px-2 text-left align-middle font-medium whitespace-nowrap text-muted-foreground",e),...a}),"E",0,({className:e,...a})=>(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,s.f)("[&_tr]:border-b",e),...a}),"N",0,({className:e,...a})=>(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,s.f)("border-b transition-colors hover:bg-muted/50",e),...a})])}]);
|