| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/clients/client2/web30/web/backup/resources/ |
Upload File : |
import{s as l}from"./service-DfnCLkIR.js";import{_ as d,G as f,r as g,o as i,c as _,w as o,a as c,t as n,b as a,F as h,d as r,n as p,e as y}from"./index-UxwdVxub.js";const b={name:"OpenHAB",mixins:[l],props:{item:Object},components:{Generic:f},data:()=>({status:"",things:{count:0,online:0},items:{count:0}}),computed:{headers:function(){const t=`${this.item.apikey}:`;return{Authorization:`Basic ${btoa(t)}`}},details:function(){const t=[];return this.item.things&&t.push(`${this.things.count} things (${this.things.online} Online)`),this.item.items&&t.push(`${this.items.count} items`),t.join(", ")}},created(){this.fetchServerStatus(),!this.item.subtitle&&this.status!=="dead"&&this.fetchServerStats()},methods:{fetchServerStatus:async function(){const t=this.headers;this.fetch("/rest/systeminfo",{headers:t}).then(e=>{if(e&&e.systemInfo)this.status="running";else throw new Error}).catch(e=>{console.log(e),this.status="dead"})},fetchServerStats:async function(){const t=this.headers;if(this.item.things){const e=await this.fetch("/rest/things?summary=true",{headers:t}).catch(s=>{console.log(s)});this.things.count=e.length,this.things.online=e.filter(s=>s.statusInfo.status==="ONLINE").length}if(this.item.items){const e=await this.fetch("/rest/items",{headers:t}).catch(s=>{console.log(s)});this.items.count=e.length}}}},S={class:"title is-4"},v={class:"subtitle is-6"};function k(t,e,s,B,w,m){const u=g("Generic");return i(),_(u,{item:s.item},{content:o(()=>[c("p",S,n(s.item.name),1),c("p",v,[s.item.subtitle?(i(),a(h,{key:0},[r(n(s.item.subtitle),1)],64)):(i(),a(h,{key:1},[r(n(m.details),1)],64))])]),indicator:o(()=>[t.status?(i(),a("div",{key:0,class:p(["status",t.status])},n(t.status),3)):y("",!0)]),_:1},8,["item"])}const A=d(b,[["render",k],["__scopeId","data-v-76f1cd6b"]]);export{A as default};