platypush/platypush/backend/http/webapp/dist/static/js/5779.a25186e7.js

2 lines
5.1 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([[5779,1595],{1595:function(e,t,s){s.r(t),s.d(t,{default:function(){return m}});var a=s(6252),r=s(3577);const n={class:"date-time"},o=["textContent"],i=["textContent"];function u(e,t,s,u,h,l){return(0,a.wg)(),(0,a.iD)("div",n,[l._showDate?((0,a.wg)(),(0,a.iD)("div",{key:0,class:"date",textContent:(0,r.zw)(e.formatDate(e.now))},null,8,o)):(0,a.kq)("",!0),l._showTime?((0,a.wg)(),(0,a.iD)("div",{key:1,class:"time",textContent:(0,r.zw)(e.formatTime(e.now,l._showSeconds))},null,8,i)):(0,a.kq)("",!0)])}var h=s(2628),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 c=(0,d.Z)(l,[["render",u],["__scopeId","data-v-ca42eb9c"]]);var m=c},5779:function(e,t,s){s.r(t),s.d(t,{default:function(){return z}});var a=s(6252);const r=e=>((0,a.dD)("data-v-0167095e"),e=e(),(0,a.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=r((()=>(0,a._)("div",{class:"col-6"}," ",-1))),c={class:"col-3"};function m(e,t,s,r,m,w){const p=(0,a.up)("DateTime"),f=(0,a.up)("Weather"),v=(0,a.up)("Sensor");return(0,a.wg)(),(0,a.iD)("div",n,[(0,a._)("div",o,[w._showDate||w._showTime?((0,a.wg)(),(0,a.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,a.kq)("",!0)]),(0,a._)("div",i,[s.showWeather?((0,a.wg)(),(0,a.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,a.kq)("",!0)]),(0,a._)("div",u,[w._showSensors&&Object.keys(e.sensors).length?((0,a.wg)(),(0,a.iD)("div",h,[(0,a._)("div",l,[null!=e.sensors.temperature?((0,a.wg)(),(0,a.j4)(v,{key:0,"icon-class":"fas fa-thermometer-half",value:e.sensors.temperature,unit:"°"},null,8,["value"])):(0,a.kq)("",!0)]),d,(0,a._)("div",c,[null!=e.sensors.humidity?((0,a.wg)(),(0,a.j4)(v,{key:0,"icon-class":"fas fa-tint",value:e.sensors.humidity,unit:"%"},null,8,["value"])):(0,a.kq)("",!0)])])):(0,a.kq)("",!0)])])}var w=s(2628),p=s(1595),f=s(1798),v=s(3577);const _={class:"sensor"},y={key:0,class:"label-container col-4"},S=["textContent"],q={class:"value-container col-8"},D=["textContent"];function k(e,t,s,r,n,o){return(0,a.wg)(),(0,a.iD)("div",_,[s.iconClass||s.name?((0,a.wg)(),(0,a.iD)("div",y,[s.iconClass?((0,a.wg)(),(0,a.iD)("i",{key:0,class:(0,v.C_)(s.iconClass)},null,2)):s.name?((0,a.wg)(),(0,a.iD)("span",{key:1,textContent:(0,v.zw)(s.name)},null,8,S)):(0,a.kq)("",!0)])):(0,a.kq)("",!0),(0,a._)("div",q,[(0,a._)("span",{class:"value",textContent:(0,v.zw)(o._value)},null,8,D)])])}var g={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);let e=parseFloat(this.value);return null!=this.decimals&&(e=e.toFixed(this.decimals)),this.unit&&(e=`${e}${this.unit}`),e}}},T=s(3744);const C=(0,T.Z)(g,[["render",k],["__scopeId","data-v-04cf169d"]]);var B=C,x={name:"DateTimeWeather",mixins:[w.Z],components:{Sensor:B,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&&(this.sensors.temperature=e.data.temperature),this.sensorHumidityAttr in e.data&&(this.sensors.humidity=e.data.humidity)}},mounted(){this.subscribe(this.onSensorData,null,"platypush.message.event.sensor.SensorDataChangeEvent")}};const b=(0,T.Z)(x,[["render",m],["__scopeId","data-v-0167095e"]]);var z=b}}]);
//# sourceMappingURL=5779.a25186e7.js.map