UNPKG

zwave-js-ui

Version:

Z-Wave Control Panel and MQTT Gateway

3 lines (2 loc) 1.55 kB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BlinkIcon-CtgPDFLB.js","./index-DwzE-W2i.js","./index-B2zoqM3Y.css"])))=>i.map(i=>d[i]); import{_ as d,m as v,d as _,s as u,e as m,z as w,w as a,H as t,t as r,T as f,b as i,bx as h,j as p,x as T,y as I}from"./index-DwzE-W2i.js";const b={props:{node:{type:Object,required:!0}},components:{BlinkIcon:_(()=>I(()=>import("./BlinkIcon-CtgPDFLB.js"),__vite__mapDeps([0,1,2]),import.meta.url))},data(){return{now:Date.now(),nowInterval:null}},methods:{...v(T,["getDateTimeString"]),jsonToList(o){return p(o,{ignore:["lwr","nlwr","rssi","backgroundRSSI","lastSeen"],suffixes:{rtt:"ms"}})}},mounted(){this.nowInterval=setInterval(()=>{this.now=Date.now()},200)},beforeUnmount(){clearInterval(this.nowInterval)}},g={class:"text-caption last-active-text"},x={style:{"white-space":"pre-wrap"}};function S(o,C,e,k,n,c){const s=u("blink-icon");return w(),m(h,{location:"bottom"},{activator:a(({props:l})=>[t("div",f(l,{class:"center-content"}),[i(s,{icon:"north",activeColor:e.node.errorTransmit?"error":"success",active:n.now-e.node.lastTransmit<200},null,8,["activeColor","active"]),i(s,{icon:"south",activeColor:e.node.errorReceive?"error":"success",active:n.now-e.node.lastReceive<200},null,8,["activeColor","active"]),t("div",g,[t("i",null,r(e.node.lastActive?o.getDateTimeString(e.node.lastActive):"Never"),1)])],16)]),default:a(()=>[t("span",x,r(e.node.statistics?c.jsonToList(e.node.statistics):"-----"),1)]),_:1})}const D=d(b,[["render",S],["__scopeId","data-v-672ed0cd"]]);export{D as default};