ot-gateway 0.11.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 +452 -145
- package/apps/web/out/404/index.html +1 -1
- package/apps/web/out/404.html +1 -1
- package/apps/web/out/__next.__PAGE__.txt +6 -6
- package/apps/web/out/__next._full.txt +6 -6
- 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/2-12vm-gmodvi.css +1 -0
- package/apps/web/out/_next/static/chunks/2hhp92plmhxim.js +1 -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 +4 -4
- package/apps/web/out/_not-found/__next._not-found.__PAGE__.txt +4 -4
- package/apps/web/out/_not-found/__next._tree.txt +2 -2
- package/apps/web/out/_not-found/index.html +1 -1
- package/apps/web/out/_not-found/index.txt +4 -4
- package/apps/web/out/index.html +1 -1
- package/apps/web/out/index.txt +6 -6
- package/apps/web/out/messages/__next._full.txt +6 -6
- package/apps/web/out/messages/__next._tree.txt +2 -2
- package/apps/web/out/messages/__next.messages.__PAGE__.txt +6 -6
- package/apps/web/out/messages/index.html +1 -1
- package/apps/web/out/messages/index.txt +6 -6
- package/apps/web/out/points/__next._full.txt +6 -6
- package/apps/web/out/points/__next._tree.txt +2 -2
- package/apps/web/out/points/__next.points.__PAGE__.txt +6 -6
- package/apps/web/out/points/index.html +1 -1
- package/apps/web/out/points/index.txt +6 -6
- package/apps/web/out/settings/__next._full.txt +6 -6
- package/apps/web/out/settings/__next._tree.txt +2 -2
- package/apps/web/out/settings/__next.settings.__PAGE__.txt +6 -6
- package/apps/web/out/settings/index.html +1 -1
- package/apps/web/out/settings/index.txt +6 -6
- package/package.json +1 -1
- package/packaging/compose.yaml +1 -1
- package/apps/web/out/_next/static/chunks/03_syxbyimnor.js +0 -1
- package/apps/web/out/_next/static/chunks/1-_c1aqhwim5t.css +0 -1
- package/apps/web/out/_next/static/chunks/1bh2-eknm9t8k.js +0 -1
- package/apps/web/out/_next/static/chunks/259s9pubapqip.js +0 -1
- package/apps/web/out/_next/static/chunks/25dqruymh00rk.js +0 -1
- package/apps/web/out/_next/static/chunks/3b0ql-jh_xg_k.js +0 -12
- package/apps/web/out/_next/static/chunks/3o5cr1y-sws-u.js +0 -1
- /package/apps/web/out/_next/static/{r5hL3CDxDJkHMarR92YKm → XiBzAo3f0YeQ4E_ciqAE_}/_buildManifest.js +0 -0
- /package/apps/web/out/_next/static/{r5hL3CDxDJkHMarR92YKm → XiBzAo3f0YeQ4E_ciqAE_}/_clientMiddlewareManifest.js +0 -0
- /package/apps/web/out/_next/static/{r5hL3CDxDJkHMarR92YKm → XiBzAo3f0YeQ4E_ciqAE_}/_ssgManifest.js +0 -0
|
@@ -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})])}]);
|