platypush/platypush/backend/http/webapp/dist/static/js/346-legacy.f3cfa402.js

2 lines
5.6 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([[346,1595],{1595:function(e,t,s){s.r(t),s.d(t,{default:function(){return m}});var n=s(6252),r=s(3577),a={class:"date-time"},i=["textContent"],o=["textContent"];function u(e,t,s,u,h,l){return(0,n.wg)(),(0,n.iD)("div",a,[l._showDate?((0,n.wg)(),(0,n.iD)("div",{key:0,class:"date",textContent:(0,r.zw)(e.formatDate(e.now))},null,8,i)):(0,n.kq)("",!0),l._showTime?((0,n.wg)(),(0,n.iD)("div",{key:1,class:"time",textContent:(0,r.zw)(e.formatTime(e.now,l._showSeconds))},null,8,o)):(0,n.kq)("",!0)])}var h=s(6813),l={name:"DateTime",mixins:[h.Z],props:{showDate:{required:!1,default:!0},showTime:{required:!1,default:!0},showSeconds:{required:!1,default:!0}},computed:{_showTime:function(){return this.parseBoolean(this.showTime)},_showDate:function(){return this.parseBoolean(this.showDate)},_showSeconds:function(){return this.parseBoolean(this.showSeconds)}},data:function(){return{now:new Date}},methods:{refreshTime:function(){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},346:function(e,t,s){s.r(t),s.d(t,{default:function(){return z}});s(7941);var n=s(6252),r=function(e){return(0,n.dD)("data-v-69d38a93"),e=e(),(0,n.Cn)(),e},a={class:"date-time-weather"},i={class:"row date-time-container"},o={class:"row weather-container"},u={class:"row sensors-container"},h={key:0,class:"row"},l={class:"col-3"},d=r((function(){return(0,n._)("div",{class:"col-6"}," ",-1)})),c={class:"col-3"};function m(e,t,s,r,m,w){var f=(0,n.up)("DateTime"),p=(0,n.up)("Weather"),v=(0,n.up)("Sensor");return(0,n.wg)(),(0,n.iD)("div",a,[(0,n._)("div",i,[w._showDate||w._showTime?((0,n.wg)(),(0,n.j4)(f,{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,n.kq)("",!0)]),(0,n._)("div",o,[s.showWeather?((0,n.wg)(),(0,n.j4)(p,{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,n.kq)("",!0)]),(0,n._)("div",u,[w._showSensors&&Object.keys(e.sensors).length?((0,n.wg)(),(0,n.iD)("div",h,[(0,n._)("div",l,[null!=e.sensors[s.sensorTemperatureAttr]?((0,n.wg)(),(0,n.j4)(v,{key:0,"icon-class":"fas fa-thermometer-half",value:e.sensors[s.sensorTemperatureAttr],unit:"°"},null,8,["value"])):(0,n.kq)("",!0)]),d,(0,n._)("div",c,[null!=e.sensors[s.sensorHumidityAttr]?((0,n.wg)(),(0,n.j4)(v,{key:0,"icon-class":"fas fa-tint",value:e.sensors[s.sensorHumidityAttr],unit:"%"},null,8,["value"])):(0,n.kq)("",!0)])])):(0,n.kq)("",!0)])])}s(9653);var w=s(6813),f=s(1595),p=s(1798),v=(s(8309),s(3577)),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,r,a,i){return(0,n.wg)(),(0,n.iD)("div",y,[s.iconClass||s.name?((0,n.wg)(),(0,n.iD)("div",_,[s.iconClass?((0,n.wg)(),(0,n.iD)("i",{key:0,class:(0,v.C_)(s.iconClass)},null,2)):s.name?((0,n.wg)(),(0,n.iD)("span",{key:1,textContent:(0,v.zw)(s.name)},null,8,S)):(0,n.kq)("",!0)])):(0,n.kq)("",!0),(0,n._)("div",q,[(0,n._)("span",{class:"value",textContent:(0,v.zw)(i._value)},null,8,D)])])}var T=s(3336),g=(s(8862),s(6977),s(2222),{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:function(){if(null==this.value)return"N/A";if(this.isBoolean)return this.parseBoolean(this.value);if(Array.isArray(this.value)||"object"===(0,T.Z)(this.value))return JSON.stringify(this.value);var e=parseFloat(this.value);return null!=this.decimals&&(e=e.toFixed(this.decimals)),this.unit&&(e="".concat(e).concat(this.unit)),e}}}),C=s(3744);const A=(0,C.Z)(g,[["render",k],["__scopeId","data-v-5031881e"]]);var B=A,b={name:"DateTimeWeather",mixins:[w.Z],components:{Sensor:B,DateTime:f["default"],Weather:p["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:function(){return this.parseBoolean(this.showDate)},_showTime:function(){return this.parseBoolean(this.showTime)},_showSeconds:function(){return this.parseBoolean(this.showSeconds)},_showWeather:function(){return this.parseBoolean(this.showWeather)},_showSummary:function(){return this.parseBoolean(this.showSummary)},_showSensors:function(){return this.parseBoolean(this.showSensors)},_animate:function(){return this.parseBoolean(this.animate)}},data:function(){return{sensors:{}}},methods:{onSensorData:function(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:function(){this.subscribe(this.onSensorData,null,"platypush.message.event.sensor.SensorDataChangeEvent")}};const x=(0,C.Z)(b,[["render",m],["__scopeId","data-v-69d38a93"]]);var z=x}}]);
//# sourceMappingURL=346-legacy.f3cfa402.js.map