1import{a as e,c as t,d as n,g as r,l as i,m as a,n as o,o as s,p as c,r as l,s as u,u as d,v as f}from"./index-C32yDzkE.js";var p={name:`OpenHAB`,mixins:[o],props:{item:Object},data:()=>({status:``,things:{count:0,online:0},items:{count:0}}),computed:{headers:function(){let e=`${this.item.apikey}:`;return{Authorization:`Basic ${btoa(e)}`}},details:function(){let e=[];return this.item.things&&e.push(`${this.things.count} things (${this.things.online} Online)`),this.item.items&&e.push(`${this.items.count} items`),e.join(`, `)}},created(){this.fetchServerStatus(),!this.item.subtitle&&this.status!==`dead`&&this.fetchServerStats()},methods:{fetchServerStatus:async function(){let e=this.headers;this.fetch(`/rest/systeminfo`,{headers:e}).then(e=>{if(e&&e.systemInfo)this.status=`running`;else throw Error()}).catch(e=>{console.log(e),this.status=`dead`})},fetchServerStats:async function(){let e=this.headers;if(this.item.things){let t=await this.fetch(`/rest/things?summary=true`,{headers:e}).catch(e=>{console.log(e)});this.things.count=t.length,this.things.online=t.filter(e=>e.statusInfo.status===`ONLINE`).length}if(this.item.items){let t=await this.fetch(`/rest/items`,{headers:e}).catch(e=>{console.log(e)});this.items.count=t.length}}}},m={class:`title is-4`},h={class:`subtitle is-6`};function g(o,l,p,g,_,v){let y=c(`Generic`);return n(),u(y,{item:p.item},{content:a(()=>[s(`p`,m,f(p.item.name),1),s(`p`,h,[p.item.subtitle?(n(),i(e,{key:0},[d(f(p.item.subtitle),1)],64)):(n(),i(e,{key:1},[d(f(v.details),1)],64))])]),indicator:a(()=>[o.status?(n(),i(`div`,{key:0,class:r([`status`,o.status])},f(o.status),3)):t(``,!0)]),_:1},8,[`item`])}var _=l(p,[[`render`,g],[`__scopeId`,`data-v-066f0589`]]);export{_ 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.