platypush/platypush/backend/http/webapp/dist/static/js/app.b00986ef.js

2 lines
48 KiB
JavaScript
Raw Normal View History

2022-03-30 17:41:38 +02:00
(function(){var e={5250:function(e,t,s){"use strict";s.d(t,{$:function(){return i}});var n=s(9652);const i=(0,n.Z)()},9646:function(e,t,s){"use strict";var n=s(9963),i=s(6252);function a(e,t,s,n,a,o){const r=(0,i.up)("Events"),l=(0,i.up)("Notifications"),c=(0,i.up)("VoiceAssistant"),d=(0,i.up)("Pushbullet"),u=(0,i.up)("router-view");return(0,i.wg)(),(0,i.iD)(i.HY,null,[o.hasWebsocket?((0,i.wg)(),(0,i.j4)(r,{key:0,ref:"events","ws-port":a.config["backend.http"].websocket_port},null,8,["ws-port"])):(0,i.kq)("",!0),(0,i.Wm)(l,{ref:"notifications"},null,512),o.hasAssistant?((0,i.wg)(),(0,i.j4)(c,{key:1,ref:"voice-assistant"},null,512)):(0,i.kq)("",!0),o.hasPushbullet?((0,i.wg)(),(0,i.j4)(d,{key:2,ref:"pushbullet"},null,512)):(0,i.kq)("",!0),(0,i.Wm)(u)],64)}const o={class:"notifications"};function r(e,t,s,n,a,r){const l=(0,i.up)("Notification");return(0,i.wg)(),(0,i.iD)("div",o,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.notifications,((e,t,s)=>((0,i.wg)(),(0,i.j4)(l,{key:s,id:t,text:e.text,html:e.html,title:e.title,link:e.link,image:e.image,warning:e.warning,error:e.error,onClicked:r.destroy},null,8,["id","text","html","title","link","image","warning","error","onClicked"])))),128))])}var l=s(3577);const c=["textContent"],d={class:"body"},u={key:0,class:"image col-3"},h={class:"row"},p=["src"],m={key:3,class:"fa fa-exclamation"},f={key:4,class:"fa fa-times"},g=["textContent"],w=["innerHTML"],v=["textContent"],b=["innerHTML"];function y(e,t,s,n,a,o){return(0,i.wg)(),(0,i.iD)("div",{class:(0,l.C_)(["notification fade-in",{warning:s.warning,error:s.error}]),onClick:t[0]||(t[0]=(...e)=>o.clicked&&o.clicked(...e))},[s.title?((0,i.wg)(),(0,i.iD)("div",{key:0,class:"title",textContent:(0,l.zw)(s.title)},null,8,c)):(0,i.kq)("",!0),(0,i._)("div",d,[s.image||s.warning||s.error?((0,i.wg)(),(0,i.iD)("div",u,[(0,i._)("div",h,[s.image&&s.image.src?((0,i.wg)(),(0,i.iD)("img",{key:0,src:s.image.src,alt:""},null,8,p)):s.image&&s.image.icon?((0,i.wg)(),(0,i.iD)("i",{key:1,class:(0,l.C_)(["fa","fa-"+s.image.icon]),style:(0,l.j5)(s.image.color?"--color: "+s.image.color:"")},null,6)):s.image&&s.image.iconClass?((0,i.wg)(),(0,i.iD)("i",{key:2,class:(0,l.C_)(s.image.iconClass),style:(0,l.j5)(s.image.color?"--color: "+s.image.color:"")},null,6)):s.warning?((0,i.wg)(),(0,i.iD)("i",m)):s.error?((0,i.wg)(),(0,i.iD)("i",f)):(0,i.kq)("",!0)])])):(0,i.kq)("",!0),s.text&&s.image?((0,i.wg)(),(0,i.iD)("div",{key:1,class:"text col-9",textContent:(0,l.zw)(s.text)},null,8,g)):(0,i.kq)("",!0),s.html&&s.image?((0,i.wg)(),(0,i.iD)("div",{key:2,class:"text col-9",innerHTML:s.html},null,8,w)):(0,i.kq)("",!0),s.text&&!s.image?((0,i.wg)(),(0,i.iD)("div",{key:3,class:"text row horizontal-center",textContent:(0,l.zw)(s.text)},null,8,v)):(0,i.kq)("",!0),s.html&&!s.image?((0,i.wg)(),(0,i.iD)("div",{key:4,class:"text row horizontal-center",innerHTML:s.html},null,8,b)):(0,i.kq)("",!0)])],2)}var k={name:"Notification",props:["id","text","html","title","image","link","error","warning"],methods:{clicked(){this.link&&window.open(this.link,"_blank"),this.$emit("clicked",this.id)}}},_=s(3744);const x=(0,_.Z)(k,[["render",y],["__scopeId","data-v-7646705e"]]);var C=x,D={name:"Notifications",components:{Notification:C},props:{duration:{type:Number,default:1e4}},data:function(){return{index:0,notifications:{},timeouts:{}}},methods:{create:function(e){const t=this.index++;this.notifications[t]=e,null==e.duration&&(e.duration=this.duration);const s=e.duration?parseInt(e.duration):0;s&&(this.timeouts[t]=setTimeout(this.destroy.bind(null,t),s))},destroy:function(e){delete this.notifications[e],delete this.timeouts[e]}}};const I=(0,_.Z)(D,[["render",r],["__scopeId","data-v-6dc8bebc"]]);var S=I,T=s(2628);function U(e,t,s,n,a,o){return(0,i.wg)(),(0,i.iD)("div")}var P=s(5250),$={name:"Events",props:{wsPort:{type:Number,default:8009}},data(){return{ws:null,initialized:!1,pending:!1,opened:!1,timeout:null,reconnectMsecs:3e4,handlers:{},handlerNameToEventTypes:{}}},methods:{onWebsocketTimeout(){console.log("Websocket reconnection timed out, retrying"),this.pending=!1,this.ws&&this.ws.close()
//# sourceMappingURL=app.b00986ef.js.map