PageSourceSearch

https://greivinvenegas.com/resources/HomeAssistant-B6hCBEPL.js

js greivinvenegas.com collected 2026-10-04 08:07:25 UTC 2,081 bytes, 1 lines download raw bytes

1import{B as e,R as t,_ as n,a as r,i,l as a,m as o,n as s,o as c,s as l,t as u,y as d}from"./_plugin-vue_export-helper-LledoY8b.js";import{t as f}from"./service-AWe6Zi3q.js";var p={name:`HomeAssistant`,mixins:[f],props:{item:Object},data:()=>({status:``,version:``,entities:0,location_name:``,separator:` `,items:[`name`,`version`]}),computed:{headers:function(){return{Authorization:`Bearer ${this.item.apikey}`,"Content-Type":`application/json`}},details:function(){let e=[],t=this.items,n=this.separator;for(let n in t){let r=t[n];switch(r){case`version`:e.push(`v${this.version}`);break;case`name`:e.push(`${this.location_name}`);break;case`entities`:e.push(`${this.entities} entities`);break;default:e.push(`undefined key ${r} `)}}return e.join(n)}},created(){this.fetchServerStatus().then(()=>{!this.item.subtitle&&this.status!==`dead`&&(this.item.items&&(this.items=this.item.items),this.item.separator&&(this.separator=this.item.separator),this.fetchServerStats())})},methods:{fetchServerStatus:async function(){let e=this.headers;return this.fetch(`/api/`,{headers:e}).then(e=>{if(e&&e.message)this.status=`running`;else throw Error()}).catch(e=>{console.log(e),this.status=`dead`})},fetchServerStats:async function(){let e=this.headers;this.fetch(`/api/config`,{headers:e}).then(e=>{if(e)e.version&&(this.version=e.version),e.location_name&&(this.location_name=e.location_name);else throw Error()}).catch(e=>{console.log(e),this.status=`dead`}),this.fetch(`/api/states`,{headers:e}).then(e=>{if(e)this.entities=e.length;else throw Error()}).catch(e=>{console.log(e),this.status=`dead`})}}},m={class:`title is-4`},h={class:`subtitle is-6`};function g(u,f,p,g,_,v){let y=n(`Generic`);return o(),r(y,{item:p.item},{content:d(()=>[i(`p`,m,e(p.item.name),1),i(`p`,h,[p.item.subtitle?(o(),l(s,{key:0},[a(e(p.item.subtitle),1)],64)):(o(),l(s,{key:1},[a(e(v.details),1)],64))])]),indicator:d(()=>[u.status?(o(),l(`div`,{key:0,class:t([`status`,u.status])},e(u.status),3)):c(``,!0)]),_:1},8,[`item`])}var _=u(p,[[`render`,g],[`__scopeId`,`data-v-d44d2f06`]]);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.