platypush/platypush/backend/http/webapp/dist/static/js/9962.8fc631e7.js

2 lines
5.4 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[9962,4619],{4619:function(e,t,s){s.r(t),s.d(t,{default:function(){return c}});var r=s(6252),a=s(3577);const n={class:"date-time"},o=["textContent"],i=["textContent"];function u(e,t,s,u,h,l){return(0,r.wg)(),(0,r.iD)("div",n,[l._showDate?((0,r.wg)(),(0,r.iD)("div",{key:0,class:"date",textContent:(0,a.zw)(e.formatDate(e.now))},null,8,o)):(0,r.kq)("",!0),l._showTime?((0,r.wg)(),(0,r.iD)("div",{key:1,class:"time",textContent:(0,a.zw)(e.formatTime(e.now,l._showSeconds))},null,8,i)):(0,r.kq)("",!0)])}var h=s(8637),l={name:"DateTime",mixins:[h.Z],props:{showDate:{required:!1,default:!0},showTime:{required:!1,default:!0},showSeconds:{required:!1,default:!0}},computed:{_showTime(){return this.parseBoolean(this.showTime)},_showDate(){return this.parseBoolean(this.showDate)},_showSeconds(){return this.parseBoolean(this.showSeconds)}},data:function(){return{now:new Date}},methods:{refreshTime(){this.now=new Date}},mounted:function(){this.refreshTime(),setInterval(this.refreshTime,1e3)}},d=s(3744);const m=(0,d.Z)(l,[["render",u],["__scopeId","data-v-ca42eb9c"]]);var c=m},9962:function(e,t,s){s.r(t),s.d(t,{default:function(){return x}});var r=s(6252);const a=e=>((0,r.dD)("data-v-69d38a93"),e=e(),(0,r.Cn)(),e),n={class:"date-time-weather"},o={class:"row date-time-container"},i={class:"row weather-container"},u={class:"row sensors-container"},h={key:0,class:"row"},l={class:"col-3"},d=a((()=>(0,r._)("div",{class:"col-6"}," ",-1))),m={class:"col-3"};function c(e,t,s,a,c,w){const p=(0,r.up)("DateTime"),f=(0,r.up)("Weather"),v=(0,r.up)("Sensor");return(0,r.wg)(),(0,r.iD)("div",n,[(0,r._)("div",o,[w._showDate||w._showTime?((0,r.wg)(),(0,r.j4)(p,{key:0,"show-date":w._showDate,"show-time":w._showTime,"show-seconds":w._showSeconds,animate:s.animate},null,8,["show-date","show-time","show-seconds","animate"])):(0,r.kq)("",!0)]),(0,r._)("div",i,[s.showWeather?((0,r.wg)(),(0,r.j4)(f,{key:0,"show-summary":w._showSummary,animate:w._animate,"icon-size":s.iconSize,"refresh-seconds":s.weatherRefreshSeconds},null,8,["show-summary","animate","icon-size","refresh-seconds"])):(0,r.kq)("",!0)]),(0,r._)("div",u,[w._showSensors&&Object.keys(e.sensors).length?((0,r.wg)(),(0,r.iD)("div",h,[(0,r._)("div",l,[null!=e.sensors[s.sensorTemperatureAttr]?((0,r.wg)(),(0,r.j4)(v,{key:0,"icon-class":"fas fa-thermometer-half",value:e.sensors[s.sensorTemperatureAttr],unit:"°"},null,8,["value"])):(0,r.kq)("",!0)]),d,(0,r._)("div",m,[null!=e.sensors[s.sensorHumidityAttr]?((0,r.wg)(),(0,r.j4)(v,{key:0,"icon-class":"fas fa-tint",value:e.sensors[s.sensorHumidityAttr],unit:"%"},null,8,["value"])):(0,r.kq)("",!0)])])):(0,r.kq)("",!0)])])}var w=s(8637),p=s(4619),f=s(3594),v=s(3577);const y={class:"sensor"},_={key:0,class:"label-container col-4"},S=["textContent"],q={class:"value-container col-8"},D=["textContent"];function k(e,t,s,a,n,o){return(0,r.wg)(),(0,r.iD)("div",y,[s.iconClass||s.name?((0,r.wg)(),(0,r.iD)("div",_,[s.iconClass?((0,r.wg)(),(0,r.iD)("i",{key:0,class:(0,v.C_)(s.iconClass)},null,2)):s.name?((0,r.wg)(),(0,r.iD)("span",{key:1,textContent:(0,v.zw)(s.name)},null,8,S)):(0,r.kq)("",!0)])):(0,r.kq)("",!0),(0,r._)("div",q,[(0,r._)("span",{class:"value",textContent:(0,v.zw)(o._value)},null,8,D)])])}var T={name:"Sensor",props:{iconClass:{type:String,required:!1},name:{type:String,required:!1},value:{required:!1},unit:{type:String,required:!1},decimals:{type:Number,required:!1,default:1},isBoolean:{type:Boolean,required:!1,default:!1}},computed:{_value(){if(null==this.value)return"N/A";if(this.isBoolean)return this.parseBoolean(this.value);if(Array.isArray(this.value)||"object"===typeof this.value)return JSON.stringify(this.value);let e=parseFloat(this.value);return null!=this.decimals&&(e=e.toFixed(this.decimals)),this.unit&&(e=`${e}${this.unit}`),e}}},g=s(3744);const C=(0,g.Z)(T,[["render",k],["__scopeId","data-v-5031881e"]]);var A=C,B={name:"DateTimeWeather",mixins:[w.Z],components:{Sensor:A,DateTime:p["default"],Weather:f["default"]},props:{animate:{required:!1,default:!0},iconSize:{type:Number,required:!1,default:50},showDate:{required:!1,default:!0},showTime:{required:!1,default:!0},showWeather:{required:!1,default:!0},showSummary:{required:!1,default:!0},showSensors:{required:!1,default:!0},showSeconds:{required:!1,default:!0},sensorTemperatureAttr:{type:String,required:!1,default:"temperature"},sensorHumidityAttr:{type:String,required:!1,default:"humidity"},weatherRefreshSeconds:{type:Number,required:!1,default:900}},computed:{_showDate(){return this.parseBoolean(this.showDate)},_showTime(){return this.parseBoolean(this.showTime)},_showSeconds(){return this.parseBoolean(this.showSeconds)},_showWeather(){return this.parseBoolean(this.showWeather)},_showSummary(){return this.parseBoolean(this.showSummary)},_showSensors(){return this.parseBoolean(this.showSensors)},_animate(){return this.parseBoolean(this.animate)}},data:function(){return{sensors:{}}},methods:{onSensorData(e){this.sensorTemperatureAttr in e.data&&"number"===typeof e.data[this.sensorTemperatureAttr]&&(this.sensors.temperature=e.data[this.sensorTemperatureAttr]),this.sensorHumidityAttr in e.data&&"number"===typeof e.data[this.sensorHumidityAttr]&&(this.sensors.humidity=e.data[this.sensorHumidityAttr])}},mounted(){this.subscribe(this.onSensorData,null,"platypush.message.event.sensor.SensorDataChangeEvent")}};const b=(0,g.Z)(B,[["render",c],["__scopeId","data-v-69d38a93"]]);var x=b}}]);
//# sourceMappingURL=9962.8fc631e7.js.map