From 8b61f74cb51e6e093d7573f5c37b0063e005c881 Mon Sep 17 00:00:00 2001 From: jemu75 Date: Fri, 2 Apr 2021 22:31:23 +0200 Subject: [PATCH] V3.5.1 --- src/App.vue | 2 +- src/plugins/fhem.js | 9 +++++++-- src/views/Devices.vue | 2 +- www/fhemapp/index.html | 2 +- www/fhemapp/js/app.6d66cd01.js | 1 + www/fhemapp/js/app.f4160953.js | 1 - ...k-2d212bf1.846db353.js => chunk-2d212bf1.61adf40b.js} | 2 +- 7 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 www/fhemapp/js/app.6d66cd01.js delete mode 100644 www/fhemapp/js/app.f4160953.js rename www/fhemapp/js/{chunk-2d212bf1.846db353.js => chunk-2d212bf1.61adf40b.js} (65%) diff --git a/src/App.vue b/src/App.vue index 45fe08b1..052f0337 100644 --- a/src/App.vue +++ b/src/App.vue @@ -119,7 +119,7 @@ header: '' } }, - version: 'v3.5.0', + version: 'v3.5.1', status: { color: 'secondary', icon: 'mdi-circle', diff --git a/src/plugins/fhem.js b/src/plugins/fhem.js index 7fdade37..315b9a79 100644 --- a/src/plugins/fhem.js +++ b/src/plugins/fhem.js @@ -87,7 +87,11 @@ export default class Fhem extends EventEmitter { getDateTime(val) { let timestamp = val ? val : Date.now(); - return new Date(timestamp).toLocaleString('de-DE', { dateStyle: 'short', timeStyle: 'medium' }).replace(',',''); + let options = { dateStyle: 'short', timeStyle: 'medium' }; + let dateFormatter = new Intl.DateTimeFormat('de-DE', options); + let date = new Date(timestamp); + + return dateFormatter.format(date).replace(',',''); } // mainfunction get element from deep nested objects @@ -285,7 +289,8 @@ export default class Fhem extends EventEmitter { if(defs && options.template) { let vals = defs.split(','); for (let val of vals) { - let route = '/devices/' + attr + '=' + val.replaceAll(' ','\\s').replaceAll('&','.'); + let route = '/devices/' + attr + '=' + val.replace(/\s/g,'\\s').replace(/&/g,'.'); + if(options[attr]) route += '&appOptions=' + attr; if(list.map((e) => e.title).indexOf(val) == -1) { diff --git a/src/views/Devices.vue b/src/views/Devices.vue index 0102b5df..0f5505ba 100644 --- a/src/views/Devices.vue +++ b/src/views/Devices.vue @@ -61,7 +61,7 @@ export default { let parts = this.$route.params.filter.split('&'); if(parts.indexOf('appOptions=room') != -1 || parts.indexOf('appOptions=group') != -1) { - fltr = 'appOptions=.*' + parts[0].replace('=', '.:..') + '.*'; + fltr = 'appOptions=.*' + parts[0].replace('=', '.*') + '.*'; } else { fltr += parts[0]; } diff --git a/www/fhemapp/index.html b/www/fhemapp/index.html index 672fef9c..cecd3591 100644 --- a/www/fhemapp/index.html +++ b/www/fhemapp/index.html @@ -1 +1 @@ -fhemapp
\ No newline at end of file +fhemapp
\ No newline at end of file diff --git a/www/fhemapp/js/app.6d66cd01.js b/www/fhemapp/js/app.6d66cd01.js new file mode 100644 index 00000000..d5861b4e --- /dev/null +++ b/www/fhemapp/js/app.6d66cd01.js @@ -0,0 +1 @@ +(function(e){function t(t){for(var a,r,o=t[0],c=t[1],p=t[2],u=0,l=[];u0?(this.type=this.msgList[0].type,this.message=this.msgList[0].message,this.meta=this.msgList[0].meta,this.alert=!0):(this.alert=!1,this.type="info",this.message="",this.meta="")}},methods:{clearMessage:function(){this.msgList.length>0&&this.msgList.splice(0,1)}},mounted:function(){var e=this;this.$fhem.on("message",(function(t){var n={type:"warning",message:"no valid message received",meta:""};Object.assign(n,t),e.msgList.unshift(n)}))}}),u=p,l=n("2877"),h=n("6544"),d=n.n(h),f=n("0798"),m=n("8336"),g=n("62ad"),v=n("132d"),b=n("0fd9"),y=Object(l["a"])(u,o,c,!1,null,null,null),k=y.exports;d()(y,{VAlert:f["a"],VBtn:m["a"],VCol:g["a"],VIcon:v["a"],VRow:b["a"]});var O={data:function(){return{drawer:null,back:!1,app:{options:{loading:!1,clock:null},session:{connect:!1},data:{roomList:[],groupList:[],header:""}},version:"v3.5.1",status:{color:"secondary",icon:"mdi-circle",text:"unbekannt",time:""}}},components:{Broadcaster:k},watch:{"app.session.connect":function(e){this.status.color=e?"success":"error",this.status.text=e?"online":"offline",this.status.time=this.$fhem.getDateTime()},$route:function(e){this.back="/"!==e.path}},computed:{showRooms:function(){return this.app.data.roomList.length>0},showGroups:function(){return this.app.data.groupList.length>0}},methods:{loadRoutes:function(){this.app.session.connect&&(this.$fhem.getRoutes("room"),this.$fhem.getRoutes("group"))},goTo:function(){this.$router.go(-1)}},mounted:function(){var e=this;this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data,this.$fhem.on("connect",(function(){return e.loadRoutes()})),this.$fhem.init(),this.loadRoutes()}},w=O,j=n("7496"),x=n("40dc"),R=n("5bc1"),L=n("cc20"),C=n("a523"),_=n("ce7e"),P=n("adda"),E=n("8860"),S=n("56b0"),D=n("da13"),F=n("5d23"),V=n("34c3"),T=n("f6c4"),A=n("f774"),N=n("a797"),$=n("490a"),I=n("2fa4"),M=n("3a2f"),H=Object(l["a"])(w,s,i,!1,null,null,null),B=H.exports;d()(H,{VApp:j["a"],VAppBar:x["a"],VAppBarNavIcon:R["a"],VBtn:m["a"],VChip:L["a"],VContainer:C["a"],VDivider:_["a"],VIcon:v["a"],VImg:P["a"],VList:E["a"],VListGroup:S["a"],VListItem:D["a"],VListItemContent:F["a"],VListItemIcon:V["a"],VListItemSubtitle:F["b"],VListItemTitle:F["c"],VMain:T["a"],VNavigationDrawer:A["a"],VOverlay:N["a"],VProgressCircular:$["a"],VSpacer:I["a"],VTooltip:M["a"]});n("3ca3"),n("ddb0");var q=n("8c4f");r["a"].use(q["a"]);var U=[{path:"/",name:"Home",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/system",name:"System",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/dashboard",name:"Dashboard",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/devices/:filter",name:"Devices",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/edit-devices",name:"EditDevice",component:function(){return Promise.all([n.e("chunk-0458398b"),n.e("chunk-62d9ca09"),n.e("chunk-72c6e8d8"),n.e("chunk-f90907bc")]).then(n.bind(null,"f87a"))}},{path:"/syslog",name:"Syslog",component:function(){return Promise.all([n.e("chunk-0458398b"),n.e("chunk-62d9ca09"),n.e("chunk-72c6e8d8"),n.e("chunk-2c05d556")]).then(n.bind(null,"beee"))}}],J=new q["a"]({mode:"hash",base:"",routes:U}),G=J,z=n("f309"),X=n("0fe0"),W=n.n(X),K=n("fcf4");r["a"].use(z["a"]);var Y={lang:{locales:{de:W.a},current:"de"},theme:{dark:!0,themes:{dark:{primary:K["a"].grey.darken4,secondary:K["a"].grey.darken3,success:K["a"].green.accent2,accent:K["a"].green.accent2},light:{primary:K["a"].grey,secondary:K["a"].grey.lighten3,success:K["a"].green.accent3,accent:K["a"].green.accent3}}}},Q=new z["a"](Y),Z=n("b85c"),ee=n("1da1"),te=n("53ca"),ne=n("d4ec"),ae=n("bee2"),re=n("262e"),se=n("2caf"),ie=(n("96cf"),n("fb6a"),n("1276"),n("ac1f"),n("5319"),n("13d5"),n("159b"),n("466d"),n("d81d"),n("b680"),n("99af"),n("4d63"),n("25f0"),n("b64b"),n("b0c0"),n("07ac"),n("faa1")),oe=n.n(ie),ce=function(e){Object(re["a"])(n,e);var t=Object(se["a"])(n);function n(){var e;return Object(ne["a"])(this,n),e=t.call(this),e.app={connection:{location:window.location.protocol+"//"+window.location.hostname,port:window.location.port,path:"fhem"},socket:null,session:{connect:!1,csrf:null,restart:!1,logList:[],logLast:{}},options:{loading:!1,loadCount:0,clock:null,maxChartPoints:100,updateProcess:!1,logRecord:!0,logBuffer:500,ignoreFhemRoom:!1,ignoreFhemGroup:!1,ignoreFhemSortby:!1,mobileHeader:!1},templates:[],componentMap:[],data:{roomList:[],groupList:[],deviceList:[],header:""}},e}return Object(ae["a"])(n,[{key:"loading",set:function(e){e&&this.app.options.loadCount++,!e&&this.app.options.loadCount>0&&this.app.options.loadCount--,this.app.options.loading=this.app.options.loadCount>0}},{key:"log",set:function(e){var t={type:"info",timestamp:Date.now(),timeFlag:null,message:"",icon:"",color:""};Object.assign(t,e);var n=new Date(t.timestamp).toLocaleTimeString("de-DE"),a=new Date(t.timestamp).getMilliseconds();t.timeFlag=n+":"+("000"+a).slice(-3),t.icon="error"===t.type?"mdi-alert":"info"===t.type?"mdi-information":"mdi-sync-circle",t.color=t.type,this.app.session.logLast=t,"error"===t.type&&this.emit("message",{type:t.type,message:t.message,meta:t.meta}),this.app.options.logRecord&&(this.app.session.logList.unshift(t),this.app.session.logList.length>this.app.options.logBuffer&&(this.app.session.logList.length=this.app.options.logBuffer))}},{key:"getDate",value:function(e){var t=e?parseInt(e):0;return function(e){return new Date(e.setDate(e.getDate()+t)).toISOString()}(new Date).split("T")[0]}},{key:"getDateTime",value:function(e){var t=e||Date.now(),n={dateStyle:"short",timeStyle:"medium"},a=new Intl.DateTimeFormat("de-DE",n),r=new Date(t);return a.format(r).replace(",","")}},{key:"getEl",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a0&&e.forEach((function(e){e.param&&e.value&&(s+=s?"&":"?",s+=e.param+"="+encodeURIComponent(e.value))})),n+a+r+s}},{key:"getCsrfToken",value:function(){var e=Object(ee["a"])(regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=new Promise((function(e,t){n.request({},"csrf").then((function(t){return e(t)})).catch((function(e){return t(e)}))})),e.abrupt("return",t);case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}()},{key:"request",value:function(){var e=Object(ee["a"])(regeneratorRuntime.mark((function e(t,n,r){var s,i=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return s=new Promise((function(e,s){var o=[];"csrf"!=n&&o.push({param:"fwcsrf",value:i.app.session.csrf}),"json"!==n&&"csrf"!==n||o.push({param:"XHR",value:"1"}),"object"===Object(te["a"])(t)&&(t.length>0?o.push.apply(o,Object(a["a"])(t)):o.push(t)),"string"===typeof t&&o.push({param:"cmd",value:t});var c=i.createURL(o);i.log={type:"info",message:"Request: "+c},fetch(c).then((function(t){if(t.ok)if("csrf"===n){var a=t.headers.get("x-fhem-csrftoken");e("object"===Object(te["a"])(r)?Object.assign(r,{data:a}):a)}else"json"===n?t.json().then((function(t){e("object"===Object(te["a"])(r)?Object.assign(r,{data:t}):t)})):t.text().then((function(t){e("object"===Object(te["a"])(r)?Object.assign(r,{data:t}):t)}))})).catch((function(e){s({error:e,request:c})}))})),e.abrupt("return",s);case 2:case"end":return e.stop()}}),e)})));function t(t,n,a){return e.apply(this,arguments)}return t}()},{key:"handleLogData",value:function(e){var t=e.split("\n");t.length>3&&t.splice(-3,3);var n,a=[],r=t.length>this.app.options.maxChartPoints?parseInt(t.length/this.app.options.maxChartPoints):1,s=r,i=0,o=1,c=Object(Z["a"])(t);try{for(c.s();!(n=c.n()).done;){var p=n.value,u=p.split(" "),l=Date.parse(u[0].replace("_","T")),h=parseFloat(u[1]);i+=h,(o>=s||o===t.length)&&(o===t.length&&(r-=s-o),a.push({timestamp:l,value:i/r}),s+=r,i=0),o++}}catch(d){c.e(d)}finally{c.f()}return a}},{key:"readLogFile",value:function(){var e=Object(ee["a"])(regeneratorRuntime.mark((function e(t){var n,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=new Promise((function(e,n){t.defs&&t.defs.length>0?function(){var r,s=[],i=0,o=Object(Z["a"])(t.defs);try{for(o.s();!(r=o.n()).done;){var c=r.value,p=/\(.*\)/.exec(c);p&&c.replace(p[0],"_");var u=c.split(":"),l="get ";l+=u[0]?u[0]:t.deviceName,l+=t.from?" - - "+t.from:"",l+=t.to?" "+t.to:"",l+=p?" "+p[0].replace(/\(|\)/g,""):" 4:"+u[1],a.request([{param:"cmd",value:l},{param:"XHR",value:"1"}],"text",{id:i}).then((function(n){s.push({id:n.id,data:a.handleLogData(n.data)}),s.length===t.defs.length&&(Object.assign(t,{data:s}),e(t))})).catch((function(e){a.log={type:"error",message:"Fetch data from FHEM Logfile failed.",meta:e},n()})),i++}}catch(h){o.e(h)}finally{o.f()}}():(a.log={type:"error",message:"No Definitions for Chart found.",meta:t},n())})),e.abrupt("return",n);case 2:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"checkUpdate",value:function(){var e=Object(ee["a"])(regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=new Promise((function(e,t){n.request([{param:"cmd",value:"update check"},{param:"XHR",value:"1"}]).then((function(t){var n,a=t.split("\n").splice(2),r=0,s=1,i=Object(Z["a"])(a);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.match("UPD")&&!o.match("excluded")&&r++,s===a.length&&e(r>0),s++}}catch(c){i.e(c)}finally{i.f()}})).catch((function(e){n.log={type:"error",message:"FHEM check for Updates failed.",meta:e},t(e)}))})),e.abrupt("return",t);case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}()},{key:"getRoutes",value:function(e){var t=this;if(this.app.options.loading=!0,"room"===e||"group"===e){var n=e+"List",a=[];this.app.data[n].splice(0),this.request({param:"cmd",value:"jsonList2 appOptions!= appOptions "+e},"json").then(function(){var n=Object(ee["a"])(regeneratorRuntime.mark((function n(r){var s,i,o,c,p,u,l,h,d,f,m,g;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:s=1,i=Object(Z["a"])(r.Results),n.prev=2,i.s();case 4:if((o=i.n()).done){n.next=19;break}return c=o.value,n.next=8,t.createOptions(c,!0);case 8:if(p=n.sent,u=p[e],l=!1,t.app.options.ignoreFhemRoom&&"room"===e&&(l=!0),t.app.options.ignoreFhemGroup&&"group"===e&&(l=!0),u||l||(u=c.Attributes[e]),u&&p.template){h=u.split(","),d=Object(Z["a"])(h);try{for(d.s();!(f=d.n()).done;)m=f.value,g="/devices/"+e+"="+m.replace(/\s/g,"\\s").replace(/&/g,"."),p[e]&&(g+="&appOptions="+e),-1==a.map((function(e){return e.title})).indexOf(m)&&a.push({title:m,route:g})}catch(v){d.e(v)}finally{d.f()}}s===r.Results.length&&(a.sort((function(e,t){return e.title>t.title?1:t.title>e.title?-1:0})),t.app.data[e+"List"]=Object.assign([],a),t.app.options.loading=!1),s++;case 17:n.next=4;break;case 19:n.next=24;break;case 21:n.prev=21,n.t0=n["catch"](2),i.e(n.t0);case 24:return n.prev=24,i.f(),n.finish(24);case 27:case"end":return n.stop()}}),n,null,[[2,21,24,27]])})));return function(e){return n.apply(this,arguments)}}()).catch((function(n){t.log={type:"error",message:"Loading "+e+"s from FHEM failed.",meta:n},t.app.options.loading=!1}))}else this.log={type:"error",message:"Creating Routes failed.",meta:e},this.app.options.loading=!1}},{key:"replaceVals",value:function(e,t){for(var n=/[0-9]/.exec(t),a=[],r=2;r0){var r,s=Object(Z["a"])(t);try{for(s.s();!(r=s.n()).done;){var i=r.value,o=i.split(":");if(o.length>2){var c=o[0].match(/\./)?o[0].split("."):["Readings",o[0],"Value"],p=this.getEl.apply(this,[e].concat(Object(a["a"])(c)));if(p){var u=!1;if(isNaN(parseFloat(o[1])))RegExp(o[1]?o[1]:".").test(p)&&(u=!0);else{var l=/[0-9]/.exec(p);-1!=l.index&&parseFloat(p.slice(l.index))>=parseFloat(o[1])&&(u=!0)}if(u){n=this.replaceVals(o,p);break}}}}}catch(h){s.e(h)}finally{s.f()}}return n}},{key:"handleStates",value:function(e,t,n){var r=this.getEl(e,"Options","states")||n;if(r){var s,i=Object(Z["a"])(r);try{for(i.s();!(s=i.n()).done;){var o=s.value,c=o.split(":");if(c[0]){var p=c[0].match(/\./)?c[0].split("."):["Readings",c[0],"Value"],u=this.getEl.apply(this,[e].concat(Object(a["a"])(p)));if(u){var l=!1;if(isNaN(parseFloat(c[1]))?RegExp(c[1]?c[1]:".").test(u)&&(l=!0):parseFloat(u)>=parseFloat(c[1])&&(l=!0),l){var h={};c[2]&&(h.mainState=c[0]===c[2]?u:c[2]),c[3]&&(h.mainLevel=c[0]===c[3]?u:c[3]),c[4]&&(h.mainColor=c[4]),c[5]&&(h.systemIcon=c[5]),Object.assign(t,h);break}}}else this.log={type:"error",message:"Wrong Definition for Device-States.",meta:e}}}catch(d){i.e(d)}finally{i.f()}}return t}},{key:"createConnected",value:function(){var e=Object(ee["a"])(regeneratorRuntime.mark((function e(t){var n,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=new Promise((function(e,n){"connected"in t.Options?function(){for(var r=Object.keys(t.Options.connected),s={},i=1,o=function(){var o=p[c];a.request({param:"cmd",value:"jsonlist2 "+t.Options.connected[o]},"json").then(function(){var t=Object(ee["a"])(regeneratorRuntime.mark((function t(n){var c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return s[o]=n.Results[0],"PossibleSets"in s[o]&&delete s[o].PossibleSets,"PossibleAttrs"in s[o]&&delete s[o].PossibleAttrs,t.next=5,a.createOptions(s[o]);case 5:c=t.sent,c&&(s[o].Options=c),i===r.length&&e(s),i++;case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(e){return n(e)}))},c=0,p=r;c0)){n.next=21;break}i=Object(Z["a"])(a.Results),n.prev=4,c=regeneratorRuntime.mark((function n(){var i,c,p;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=o.value,"PossibleSets"in i&&delete i.PossibleSets,"PossibleAttrs"in i&&delete i.PossibleAttrs,c=!1,n.next=6,t.createOptions(i);case 6:p=n.sent,p?(i.Options=p,i.Options.sortby||t.app.options.ignoreFhemSortby||(i.Options.sortby=i.Attributes.sortby),i.Options.sortby||(i.Options.sortby="zzz"),e.match("FILTER=group")&&i.Options.group&&(c=!0),e.match("FILTER=room")&&i.Options.room&&(c=!0),t.createConnected(i).then((function(e){i.Connected=e,c||s.push(i),r===a.Results.length&&(s.sort((function(e,t){return e.Options.sortby>t.Options.sortby?1:t.Options.sortby>e.Options.sortby?-1:0})),t.app.data.deviceList=Object.assign([],s),t.app.options.loading=!1),r++})).catch((function(e){t.log={type:"error",message:"Add Connected Element failed.",meta:e},t.app.options.loading=!1}))):t.app.options.loading=!1;case 8:case"end":return n.stop()}}),n)})),i.s();case 7:if((o=i.n()).done){n.next=11;break}return n.delegateYield(c(),"t0",9);case 9:n.next=7;break;case 11:n.next=16;break;case 13:n.prev=13,n.t1=n["catch"](4),i.e(n.t1);case 16:return n.prev=16,i.f(),n.finish(16);case 19:n.next=22;break;case 21:t.app.options.loading=!1;case 22:case"end":return n.stop()}}),n,null,[[4,13,16,19]])})));return function(e){return n.apply(this,arguments)}}()).catch((function(e){t.log={type:"error",message:"Request to FHEM failed.",meta:e},t.app.options.loading=!1}))}},{key:"handleData",value:function(e){var t=JSON.parse(e),n=null;if(!t[2].match("0){var n=t.handleData(e);n&&t.app.data.deviceList.forEach((function(e,a){var r=t.app.data.deviceList[a],s=Object.assign({},r);e.Name===n.Name&&("Readings"===n.devicePart&&t.getEl(s,"Readings",n.param,n.paramPart)&&(s.Readings[n.param][n.paramPart]=n.value),"Attributes"===n.devicePart&&t.getEl(s,"Attributes",n.param)&&(s.Attributes[n.param]=n.value),t.app.data.deviceList.splice(a,1,s)),"Connected"in e&&Object.values(e.Connected).forEach((function(r,i){if(r.Name===n.Name){var o=Object.keys(e.Connected)[i];"Readings"===n.devicePart&&t.getEl(s.Connected[o],"Readings",n.param,n.paramPart)&&(s.Connected[o].Readings[n.param][n.paramPart]=n.value),"Attributes"===n.devicePart&&t.getEl(s.Connected[o],"Attributes",n.param)&&(s.Connected[o].Attributes[n.param]=n.value),t.app.data.deviceList.splice(a,1,s)}}))}))}}))}},{key:"connClose",value:function(){var e=this;this.app.session.connect=!1,this.app.session.csrf=null,this.app.session.socket=null,this.app.session.restart||(this.app.session.restart=!0,setTimeout((function(){e.app.session.restart=!1,e.init()}),3e3)),this.log={type:"info",message:"Connection with FHEM was closed. Try to Reconnect in 3 seconds..."}}},{key:"connOpen",value:function(){var e=this;this.app.options.loading=!0,this.getCsrfToken().then((function(t){e.app.session.csrf=t,e.app.session.connect=!0,e.emit("connect"),e.log={type:"info",message:"Connection with FHEM is opened.",meta:e.session},e.app.options.loading=!1})).catch((function(t){e.app.session.csrf=null,e.app.session.connect=!1,e.log={type:"error",message:"Retrieve csrf-Token failed.",meta:t}})).finally((function(){return e.app.options.loading=!1}))}},{key:"init",value:function(){var e=this,t=[{param:"inform",value:"type=status;filter=.*;fmt=JSON"},{param:"XHR",value:"1"}],n=this.createURL(t).replace("http","ws");this.app.socket=new WebSocket(n),this.app.socket.onopen=function(){return e.connOpen()},this.app.socket.onmessage=function(t){return e.doUpdate(t)},this.app.socket.onclose=function(){return e.connClose()},setInterval((function(){e.app.options.clock=(new Date).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})}),1e3)}}]),n}(oe.a),pe=n("1321"),ue=n.n(pe);r["a"].use(ue.a),r["a"].component("apexchart",ue.a),r["a"].config.productionTip=!1,r["a"].prototype.$fhem=new ce,fetch("./cfg/config.json").then((function(e){return e.json()})).catch((function(e){r["a"].prototype.$fhem.log={type:"error",message:"Loading config.json failed.",meta:e}})).then((function(e){var t;e&&(e.connection&&Object.assign(r["a"].prototype.$fhem.app.connection,e.connection),e.options&&Object.assign(r["a"].prototype.$fhem.app.options,e.options),e.custom&&e.custom.length>0&&(t=r["a"].prototype.$fhem.app.templates).push.apply(t,Object(a["a"])(e.custom)),e.theme&&(-1!=e.theme.dark&&Object.assign(Q.framework.theme,{dark:e.theme.dark}),e.theme.themes&&(e.theme.themes.light&&Object.assign(Q.framework.theme.themes.light,e.theme.themes.light),e.theme.themes.dark&&Object.assign(Q.framework.theme.themes.dark,e.theme.themes.dark))));r["a"].prototype.$fhem.log={type:"info",message:"Config: "+JSON.stringify(e)},r["a"].prototype.$fhem.log={type:"info",message:"Connection: "+JSON.stringify(r["a"].prototype.$fhem.app.connection)},new r["a"]({vuetify:Q,router:G,render:function(e){return e(B)}}).$mount("#app")}))},c274:function(e,t,n){e.exports=n.p+"img/FHEM_Logo.2d0f7a38.png"}}); \ No newline at end of file diff --git a/www/fhemapp/js/app.f4160953.js b/www/fhemapp/js/app.f4160953.js deleted file mode 100644 index cee414b4..00000000 --- a/www/fhemapp/js/app.f4160953.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){function t(t){for(var a,r,o=t[0],c=t[1],p=t[2],u=0,l=[];u0?(this.type=this.msgList[0].type,this.message=this.msgList[0].message,this.meta=this.msgList[0].meta,this.alert=!0):(this.alert=!1,this.type="info",this.message="",this.meta="")}},methods:{clearMessage:function(){this.msgList.length>0&&this.msgList.splice(0,1)}},mounted:function(){var e=this;this.$fhem.on("message",(function(t){var n={type:"warning",message:"no valid message received",meta:""};Object.assign(n,t),e.msgList.unshift(n)}))}}),u=p,l=n("2877"),h=n("6544"),d=n.n(h),f=n("0798"),m=n("8336"),g=n("62ad"),v=n("132d"),b=n("0fd9"),y=Object(l["a"])(u,o,c,!1,null,null,null),k=y.exports;d()(y,{VAlert:f["a"],VBtn:m["a"],VCol:g["a"],VIcon:v["a"],VRow:b["a"]});var O={data:function(){return{drawer:null,back:!1,app:{options:{loading:!1,clock:null},session:{connect:!1},data:{roomList:[],groupList:[],header:""}},version:"v3.5.0",status:{color:"secondary",icon:"mdi-circle",text:"unbekannt",time:""}}},components:{Broadcaster:k},watch:{"app.session.connect":function(e){this.status.color=e?"success":"error",this.status.text=e?"online":"offline",this.status.time=this.$fhem.getDateTime()},$route:function(e){this.back="/"!==e.path}},computed:{showRooms:function(){return this.app.data.roomList.length>0},showGroups:function(){return this.app.data.groupList.length>0}},methods:{loadRoutes:function(){this.app.session.connect&&(this.$fhem.getRoutes("room"),this.$fhem.getRoutes("group"))},goTo:function(){this.$router.go(-1)}},mounted:function(){var e=this;this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data,this.$fhem.on("connect",(function(){return e.loadRoutes()})),this.$fhem.init(),this.loadRoutes()}},w=O,j=n("7496"),x=n("40dc"),R=n("5bc1"),L=n("cc20"),C=n("a523"),_=n("ce7e"),P=n("adda"),E=n("8860"),S=n("56b0"),D=n("da13"),V=n("5d23"),F=n("34c3"),A=n("f6c4"),T=n("f774"),N=n("a797"),$=n("490a"),I=n("2fa4"),M=n("3a2f"),H=Object(l["a"])(w,s,i,!1,null,null,null),B=H.exports;d()(H,{VApp:j["a"],VAppBar:x["a"],VAppBarNavIcon:R["a"],VBtn:m["a"],VChip:L["a"],VContainer:C["a"],VDivider:_["a"],VIcon:v["a"],VImg:P["a"],VList:E["a"],VListGroup:S["a"],VListItem:D["a"],VListItemContent:V["a"],VListItemIcon:F["a"],VListItemSubtitle:V["b"],VListItemTitle:V["c"],VMain:A["a"],VNavigationDrawer:T["a"],VOverlay:N["a"],VProgressCircular:$["a"],VSpacer:I["a"],VTooltip:M["a"]});n("3ca3"),n("ddb0");var q=n("8c4f");r["a"].use(q["a"]);var U=[{path:"/",name:"Home",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/system",name:"System",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/dashboard",name:"Dashboard",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/devices/:filter",name:"Devices",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/edit-devices",name:"EditDevice",component:function(){return Promise.all([n.e("chunk-0458398b"),n.e("chunk-62d9ca09"),n.e("chunk-72c6e8d8"),n.e("chunk-f90907bc")]).then(n.bind(null,"f87a"))}},{path:"/syslog",name:"Syslog",component:function(){return Promise.all([n.e("chunk-0458398b"),n.e("chunk-62d9ca09"),n.e("chunk-72c6e8d8"),n.e("chunk-2c05d556")]).then(n.bind(null,"beee"))}}],J=new q["a"]({mode:"hash",base:"",routes:U}),G=J,z=n("f309"),X=n("0fe0"),W=n.n(X),K=n("fcf4");r["a"].use(z["a"]);var Y={lang:{locales:{de:W.a},current:"de"},theme:{dark:!0,themes:{dark:{primary:K["a"].grey.darken4,secondary:K["a"].grey.darken3,success:K["a"].green.accent2,accent:K["a"].green.accent2},light:{primary:K["a"].grey,secondary:K["a"].grey.lighten3,success:K["a"].green.accent3,accent:K["a"].green.accent3}}}},Q=new z["a"](Y),Z=n("b85c"),ee=n("1da1"),te=n("53ca"),ne=n("d4ec"),ae=n("bee2"),re=n("262e"),se=n("2caf"),ie=(n("96cf"),n("fb6a"),n("1276"),n("ac1f"),n("5319"),n("13d5"),n("159b"),n("466d"),n("d81d"),n("b680"),n("99af"),n("4d63"),n("25f0"),n("b64b"),n("b0c0"),n("07ac"),n("faa1")),oe=n.n(ie),ce=function(e){Object(re["a"])(n,e);var t=Object(se["a"])(n);function n(){var e;return Object(ne["a"])(this,n),e=t.call(this),e.app={connection:{location:window.location.protocol+"//"+window.location.hostname,port:window.location.port,path:"fhem"},socket:null,session:{connect:!1,csrf:null,restart:!1,logList:[],logLast:{}},options:{loading:!1,loadCount:0,clock:null,maxChartPoints:100,updateProcess:!1,logRecord:!0,logBuffer:500,ignoreFhemRoom:!1,ignoreFhemGroup:!1,ignoreFhemSortby:!1,mobileHeader:!1},templates:[],componentMap:[],data:{roomList:[],groupList:[],deviceList:[],header:""}},e}return Object(ae["a"])(n,[{key:"loading",set:function(e){e&&this.app.options.loadCount++,!e&&this.app.options.loadCount>0&&this.app.options.loadCount--,this.app.options.loading=this.app.options.loadCount>0}},{key:"log",set:function(e){var t={type:"info",timestamp:Date.now(),timeFlag:null,message:"",icon:"",color:""};Object.assign(t,e);var n=new Date(t.timestamp).toLocaleTimeString("de-DE"),a=new Date(t.timestamp).getMilliseconds();t.timeFlag=n+":"+("000"+a).slice(-3),t.icon="error"===t.type?"mdi-alert":"info"===t.type?"mdi-information":"mdi-sync-circle",t.color=t.type,this.app.session.logLast=t,"error"===t.type&&this.emit("message",{type:t.type,message:t.message,meta:t.meta}),this.app.options.logRecord&&(this.app.session.logList.unshift(t),this.app.session.logList.length>this.app.options.logBuffer&&(this.app.session.logList.length=this.app.options.logBuffer))}},{key:"getDate",value:function(e){var t=e?parseInt(e):0;return function(e){return new Date(e.setDate(e.getDate()+t)).toISOString()}(new Date).split("T")[0]}},{key:"getDateTime",value:function(e){var t=e||Date.now();return new Date(t).toLocaleString("de-DE",{dateStyle:"short",timeStyle:"medium"}).replace(",","")}},{key:"getEl",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a0&&e.forEach((function(e){e.param&&e.value&&(s+=s?"&":"?",s+=e.param+"="+encodeURIComponent(e.value))})),n+a+r+s}},{key:"getCsrfToken",value:function(){var e=Object(ee["a"])(regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=new Promise((function(e,t){n.request({},"csrf").then((function(t){return e(t)})).catch((function(e){return t(e)}))})),e.abrupt("return",t);case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}()},{key:"request",value:function(){var e=Object(ee["a"])(regeneratorRuntime.mark((function e(t,n,r){var s,i=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return s=new Promise((function(e,s){var o=[];"csrf"!=n&&o.push({param:"fwcsrf",value:i.app.session.csrf}),"json"!==n&&"csrf"!==n||o.push({param:"XHR",value:"1"}),"object"===Object(te["a"])(t)&&(t.length>0?o.push.apply(o,Object(a["a"])(t)):o.push(t)),"string"===typeof t&&o.push({param:"cmd",value:t});var c=i.createURL(o);i.log={type:"info",message:"Request: "+c},fetch(c).then((function(t){if(t.ok)if("csrf"===n){var a=t.headers.get("x-fhem-csrftoken");e("object"===Object(te["a"])(r)?Object.assign(r,{data:a}):a)}else"json"===n?t.json().then((function(t){e("object"===Object(te["a"])(r)?Object.assign(r,{data:t}):t)})):t.text().then((function(t){e("object"===Object(te["a"])(r)?Object.assign(r,{data:t}):t)}))})).catch((function(e){s({error:e,request:c})}))})),e.abrupt("return",s);case 2:case"end":return e.stop()}}),e)})));function t(t,n,a){return e.apply(this,arguments)}return t}()},{key:"handleLogData",value:function(e){var t=e.split("\n");t.length>3&&t.splice(-3,3);var n,a=[],r=t.length>this.app.options.maxChartPoints?parseInt(t.length/this.app.options.maxChartPoints):1,s=r,i=0,o=1,c=Object(Z["a"])(t);try{for(c.s();!(n=c.n()).done;){var p=n.value,u=p.split(" "),l=Date.parse(u[0].replace("_","T")),h=parseFloat(u[1]);i+=h,(o>=s||o===t.length)&&(o===t.length&&(r-=s-o),a.push({timestamp:l,value:i/r}),s+=r,i=0),o++}}catch(d){c.e(d)}finally{c.f()}return a}},{key:"readLogFile",value:function(){var e=Object(ee["a"])(regeneratorRuntime.mark((function e(t){var n,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=new Promise((function(e,n){t.defs&&t.defs.length>0?function(){var r,s=[],i=0,o=Object(Z["a"])(t.defs);try{for(o.s();!(r=o.n()).done;){var c=r.value,p=/\(.*\)/.exec(c);p&&c.replace(p[0],"_");var u=c.split(":"),l="get ";l+=u[0]?u[0]:t.deviceName,l+=t.from?" - - "+t.from:"",l+=t.to?" "+t.to:"",l+=p?" "+p[0].replace(/\(|\)/g,""):" 4:"+u[1],a.request([{param:"cmd",value:l},{param:"XHR",value:"1"}],"text",{id:i}).then((function(n){s.push({id:n.id,data:a.handleLogData(n.data)}),s.length===t.defs.length&&(Object.assign(t,{data:s}),e(t))})).catch((function(e){a.log={type:"error",message:"Fetch data from FHEM Logfile failed.",meta:e},n()})),i++}}catch(h){o.e(h)}finally{o.f()}}():(a.log={type:"error",message:"No Definitions for Chart found.",meta:t},n())})),e.abrupt("return",n);case 2:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"checkUpdate",value:function(){var e=Object(ee["a"])(regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=new Promise((function(e,t){n.request([{param:"cmd",value:"update check"},{param:"XHR",value:"1"}]).then((function(t){var n,a=t.split("\n").splice(2),r=0,s=1,i=Object(Z["a"])(a);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.match("UPD")&&!o.match("excluded")&&r++,s===a.length&&e(r>0),s++}}catch(c){i.e(c)}finally{i.f()}})).catch((function(e){n.log={type:"error",message:"FHEM check for Updates failed.",meta:e},t(e)}))})),e.abrupt("return",t);case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}()},{key:"getRoutes",value:function(e){var t=this;if(this.app.options.loading=!0,"room"===e||"group"===e){var n=e+"List",a=[];this.app.data[n].splice(0),this.request({param:"cmd",value:"jsonList2 appOptions!= appOptions "+e},"json").then(function(){var n=Object(ee["a"])(regeneratorRuntime.mark((function n(r){var s,i,o,c,p,u,l,h,d,f,m,g;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:s=1,i=Object(Z["a"])(r.Results),n.prev=2,i.s();case 4:if((o=i.n()).done){n.next=19;break}return c=o.value,n.next=8,t.createOptions(c,!0);case 8:if(p=n.sent,u=p[e],l=!1,t.app.options.ignoreFhemRoom&&"room"===e&&(l=!0),t.app.options.ignoreFhemGroup&&"group"===e&&(l=!0),u||l||(u=c.Attributes[e]),u&&p.template){h=u.split(","),d=Object(Z["a"])(h);try{for(d.s();!(f=d.n()).done;)m=f.value,g="/devices/"+e+"="+m.replaceAll(" ","\\s").replaceAll("&","."),p[e]&&(g+="&appOptions="+e),-1==a.map((function(e){return e.title})).indexOf(m)&&a.push({title:m,route:g})}catch(v){d.e(v)}finally{d.f()}}s===r.Results.length&&(a.sort((function(e,t){return e.title>t.title?1:t.title>e.title?-1:0})),t.app.data[e+"List"]=Object.assign([],a),t.app.options.loading=!1),s++;case 17:n.next=4;break;case 19:n.next=24;break;case 21:n.prev=21,n.t0=n["catch"](2),i.e(n.t0);case 24:return n.prev=24,i.f(),n.finish(24);case 27:case"end":return n.stop()}}),n,null,[[2,21,24,27]])})));return function(e){return n.apply(this,arguments)}}()).catch((function(n){t.log={type:"error",message:"Loading "+e+"s from FHEM failed.",meta:n},t.app.options.loading=!1}))}else this.log={type:"error",message:"Creating Routes failed.",meta:e},this.app.options.loading=!1}},{key:"replaceVals",value:function(e,t){for(var n=/[0-9]/.exec(t),a=[],r=2;r0){var r,s=Object(Z["a"])(t);try{for(s.s();!(r=s.n()).done;){var i=r.value,o=i.split(":");if(o.length>2){var c=o[0].match(/\./)?o[0].split("."):["Readings",o[0],"Value"],p=this.getEl.apply(this,[e].concat(Object(a["a"])(c)));if(p){var u=!1;if(isNaN(parseFloat(o[1])))RegExp(o[1]?o[1]:".").test(p)&&(u=!0);else{var l=/[0-9]/.exec(p);-1!=l.index&&parseFloat(p.slice(l.index))>=parseFloat(o[1])&&(u=!0)}if(u){n=this.replaceVals(o,p);break}}}}}catch(h){s.e(h)}finally{s.f()}}return n}},{key:"handleStates",value:function(e,t,n){var r=this.getEl(e,"Options","states")||n;if(r){var s,i=Object(Z["a"])(r);try{for(i.s();!(s=i.n()).done;){var o=s.value,c=o.split(":");if(c[0]){var p=c[0].match(/\./)?c[0].split("."):["Readings",c[0],"Value"],u=this.getEl.apply(this,[e].concat(Object(a["a"])(p)));if(u){var l=!1;if(isNaN(parseFloat(c[1]))?RegExp(c[1]?c[1]:".").test(u)&&(l=!0):parseFloat(u)>=parseFloat(c[1])&&(l=!0),l){var h={};c[2]&&(h.mainState=c[0]===c[2]?u:c[2]),c[3]&&(h.mainLevel=c[0]===c[3]?u:c[3]),c[4]&&(h.mainColor=c[4]),c[5]&&(h.systemIcon=c[5]),Object.assign(t,h);break}}}else this.log={type:"error",message:"Wrong Definition for Device-States.",meta:e}}}catch(d){i.e(d)}finally{i.f()}}return t}},{key:"createConnected",value:function(){var e=Object(ee["a"])(regeneratorRuntime.mark((function e(t){var n,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=new Promise((function(e,n){"connected"in t.Options?function(){for(var r=Object.keys(t.Options.connected),s={},i=1,o=function(){var o=p[c];a.request({param:"cmd",value:"jsonlist2 "+t.Options.connected[o]},"json").then(function(){var t=Object(ee["a"])(regeneratorRuntime.mark((function t(n){var c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return s[o]=n.Results[0],"PossibleSets"in s[o]&&delete s[o].PossibleSets,"PossibleAttrs"in s[o]&&delete s[o].PossibleAttrs,t.next=5,a.createOptions(s[o]);case 5:c=t.sent,c&&(s[o].Options=c),i===r.length&&e(s),i++;case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(e){return n(e)}))},c=0,p=r;c0)){n.next=21;break}i=Object(Z["a"])(a.Results),n.prev=4,c=regeneratorRuntime.mark((function n(){var i,c,p;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=o.value,"PossibleSets"in i&&delete i.PossibleSets,"PossibleAttrs"in i&&delete i.PossibleAttrs,c=!1,n.next=6,t.createOptions(i);case 6:p=n.sent,p?(i.Options=p,i.Options.sortby||t.app.options.ignoreFhemSortby||(i.Options.sortby=i.Attributes.sortby),i.Options.sortby||(i.Options.sortby="zzz"),e.match("FILTER=group")&&i.Options.group&&(c=!0),e.match("FILTER=room")&&i.Options.room&&(c=!0),t.createConnected(i).then((function(e){i.Connected=e,c||s.push(i),r===a.Results.length&&(s.sort((function(e,t){return e.Options.sortby>t.Options.sortby?1:t.Options.sortby>e.Options.sortby?-1:0})),t.app.data.deviceList=Object.assign([],s),t.app.options.loading=!1),r++})).catch((function(e){t.log={type:"error",message:"Add Connected Element failed.",meta:e},t.app.options.loading=!1}))):t.app.options.loading=!1;case 8:case"end":return n.stop()}}),n)})),i.s();case 7:if((o=i.n()).done){n.next=11;break}return n.delegateYield(c(),"t0",9);case 9:n.next=7;break;case 11:n.next=16;break;case 13:n.prev=13,n.t1=n["catch"](4),i.e(n.t1);case 16:return n.prev=16,i.f(),n.finish(16);case 19:n.next=22;break;case 21:t.app.options.loading=!1;case 22:case"end":return n.stop()}}),n,null,[[4,13,16,19]])})));return function(e){return n.apply(this,arguments)}}()).catch((function(e){t.log={type:"error",message:"Request to FHEM failed.",meta:e},t.app.options.loading=!1}))}},{key:"handleData",value:function(e){var t=JSON.parse(e),n=null;if(!t[2].match("0){var n=t.handleData(e);n&&t.app.data.deviceList.forEach((function(e,a){var r=t.app.data.deviceList[a],s=Object.assign({},r);e.Name===n.Name&&("Readings"===n.devicePart&&t.getEl(s,"Readings",n.param,n.paramPart)&&(s.Readings[n.param][n.paramPart]=n.value),"Attributes"===n.devicePart&&t.getEl(s,"Attributes",n.param)&&(s.Attributes[n.param]=n.value),t.app.data.deviceList.splice(a,1,s)),"Connected"in e&&Object.values(e.Connected).forEach((function(r,i){if(r.Name===n.Name){var o=Object.keys(e.Connected)[i];"Readings"===n.devicePart&&t.getEl(s.Connected[o],"Readings",n.param,n.paramPart)&&(s.Connected[o].Readings[n.param][n.paramPart]=n.value),"Attributes"===n.devicePart&&t.getEl(s.Connected[o],"Attributes",n.param)&&(s.Connected[o].Attributes[n.param]=n.value),t.app.data.deviceList.splice(a,1,s)}}))}))}}))}},{key:"connClose",value:function(){var e=this;this.app.session.connect=!1,this.app.session.csrf=null,this.app.session.socket=null,this.app.session.restart||(this.app.session.restart=!0,setTimeout((function(){e.app.session.restart=!1,e.init()}),3e3)),this.log={type:"info",message:"Connection with FHEM was closed. Try to Reconnect in 3 seconds..."}}},{key:"connOpen",value:function(){var e=this;this.app.options.loading=!0,this.getCsrfToken().then((function(t){e.app.session.csrf=t,e.app.session.connect=!0,e.emit("connect"),e.log={type:"info",message:"Connection with FHEM is opened.",meta:e.session},e.app.options.loading=!1})).catch((function(t){e.app.session.csrf=null,e.app.session.connect=!1,e.log={type:"error",message:"Retrieve csrf-Token failed.",meta:t}})).finally((function(){return e.app.options.loading=!1}))}},{key:"init",value:function(){var e=this,t=[{param:"inform",value:"type=status;filter=.*;fmt=JSON"},{param:"XHR",value:"1"}],n=this.createURL(t).replace("http","ws");this.app.socket=new WebSocket(n),this.app.socket.onopen=function(){return e.connOpen()},this.app.socket.onmessage=function(t){return e.doUpdate(t)},this.app.socket.onclose=function(){return e.connClose()},setInterval((function(){e.app.options.clock=(new Date).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})}),1e3)}}]),n}(oe.a),pe=n("1321"),ue=n.n(pe);r["a"].use(ue.a),r["a"].component("apexchart",ue.a),r["a"].config.productionTip=!1,r["a"].prototype.$fhem=new ce,fetch("./cfg/config.json").then((function(e){return e.json()})).catch((function(e){r["a"].prototype.$fhem.log={type:"error",message:"Loading config.json failed.",meta:e}})).then((function(e){var t;e&&(e.connection&&Object.assign(r["a"].prototype.$fhem.app.connection,e.connection),e.options&&Object.assign(r["a"].prototype.$fhem.app.options,e.options),e.custom&&e.custom.length>0&&(t=r["a"].prototype.$fhem.app.templates).push.apply(t,Object(a["a"])(e.custom)),e.theme&&(-1!=e.theme.dark&&Object.assign(Q.framework.theme,{dark:e.theme.dark}),e.theme.themes&&(e.theme.themes.light&&Object.assign(Q.framework.theme.themes.light,e.theme.themes.light),e.theme.themes.dark&&Object.assign(Q.framework.theme.themes.dark,e.theme.themes.dark))));r["a"].prototype.$fhem.log={type:"info",message:"Config: "+JSON.stringify(e)},r["a"].prototype.$fhem.log={type:"info",message:"Connection: "+JSON.stringify(r["a"].prototype.$fhem.app.connection)},new r["a"]({vuetify:Q,router:G,render:function(e){return e(B)}}).$mount("#app")}))},c274:function(e,t,n){e.exports=n.p+"img/FHEM_Logo.2d0f7a38.png"}}); \ No newline at end of file diff --git a/www/fhemapp/js/chunk-2d212bf1.846db353.js b/www/fhemapp/js/chunk-2d212bf1.61adf40b.js similarity index 65% rename from www/fhemapp/js/chunk-2d212bf1.846db353.js rename to www/fhemapp/js/chunk-2d212bf1.61adf40b.js index 334ef011..092d8090 100644 --- a/www/fhemapp/js/chunk-2d212bf1.846db353.js +++ b/www/fhemapp/js/chunk-2d212bf1.61adf40b.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d212bf1"],{aa72:function(e,n,t){"use strict";t.r(n);var s=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",[t("v-row",e._l(e.app.data.deviceList,(function(e){return t(e.Options.component,{key:e.Internals.FUUID,tag:"component",attrs:{item:e}})})),1)],1)},a=[],o=(t("d3b7"),t("3ca3"),t("ddb0"),t("b0c0"),t("1276"),t("ac1f"),t("4de4"),t("5319"),{name:"Devices",data:function(){return{app:{session:{connect:!1},options:{mobileHeader:!1},data:{deviceList:[],header:""}}}},components:{templ_default:function(){return Promise.all([t.e("chunk-0458398b"),t.e("chunk-83618c9a")]).then(t.bind(null,"121f"))},templ_panel:function(){return t.e("chunk-58038582").then(t.bind(null,"5d11"))},templ_chart:function(){return Promise.all([t.e("chunk-0458398b"),t.e("chunk-62d9ca09"),t.e("chunk-d584b056")]).then(t.bind(null,"b009"))},templ_weather:function(){return t.e("chunk-03454508").then(t.bind(null,"1de8"))},templ_scenes:function(){return t.e("chunk-098d33d4").then(t.bind(null,"09fe"))},templ_sonos:function(){return Promise.all([t.e("chunk-0458398b"),t.e("chunk-57a6c555")]).then(t.bind(null,"dd08"))},templ_sysmon:function(){return t.e("chunk-27250ed3").then(t.bind(null,"86eb"))},templ_hmlan:function(){return t.e("chunk-15fa718e").then(t.bind(null,"fca9"))}},watch:{$route:function(){this.subscribe()}},methods:{setHeader:function(){if(this.app.options.mobileHeader)if("Devices"===this.$route.name){var e=this.$route.params.filter.split("&")[0].split("=")[1];this.app.data.header=e.replace(/\\s.\\s/g," & ")}else this.app.data.header=this.$route.name},subscribe:function(){if(this.app.session.connect){var e="appOptions!=:FILTER=";if(this.$route.params.filter){var n=this.$route.params.filter.split("&");-1!=n.indexOf("appOptions=room")||-1!=n.indexOf("appOptions=group")?e="appOptions=.*"+n[0].replace("=",".:..")+".*":e+=n[0]}"Dashboard"==this.$route.name&&(e="appOptions=.*dashboard.:..true.*"),"System"==this.$route.name&&(e="appOptions=.*system.:..true.*"),"Home"==this.$route.name&&(e="appOptions=.*home.:..true.*"),this.setHeader(),this.$fhem.getDevices(e)}}},mounted:function(){var e=this;this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data,this.$fhem.app.componentMap=[{name:"panel",component:"templ_panel"},{name:"chart",component:"templ_chart"},{name:"weather",component:"templ_weather"},{name:"sysmon",component:"templ_sysmon"},{name:"hmlan",component:"templ_hmlan"},{name:"sonos",component:"templ_sonos"},{name:"scenes",component:"templ_scenes"}],this.$fhem.on("connect",(function(){return e.subscribe()})),this.subscribe()}}),i=o,p=t("2877"),r=t("6544"),c=t.n(r),u=t("0fd9"),h=Object(p["a"])(i,s,a,!1,null,null,null);n["default"]=h.exports;c()(h,{VRow:u["a"]})}}]); \ No newline at end of file +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d212bf1"],{aa72:function(e,n,t){"use strict";t.r(n);var s=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",[t("v-row",e._l(e.app.data.deviceList,(function(e){return t(e.Options.component,{key:e.Internals.FUUID,tag:"component",attrs:{item:e}})})),1)],1)},a=[],o=(t("d3b7"),t("3ca3"),t("ddb0"),t("b0c0"),t("1276"),t("ac1f"),t("4de4"),t("5319"),{name:"Devices",data:function(){return{app:{session:{connect:!1},options:{mobileHeader:!1},data:{deviceList:[],header:""}}}},components:{templ_default:function(){return Promise.all([t.e("chunk-0458398b"),t.e("chunk-83618c9a")]).then(t.bind(null,"121f"))},templ_panel:function(){return t.e("chunk-58038582").then(t.bind(null,"5d11"))},templ_chart:function(){return Promise.all([t.e("chunk-0458398b"),t.e("chunk-62d9ca09"),t.e("chunk-d584b056")]).then(t.bind(null,"b009"))},templ_weather:function(){return t.e("chunk-03454508").then(t.bind(null,"1de8"))},templ_scenes:function(){return t.e("chunk-098d33d4").then(t.bind(null,"09fe"))},templ_sonos:function(){return Promise.all([t.e("chunk-0458398b"),t.e("chunk-57a6c555")]).then(t.bind(null,"dd08"))},templ_sysmon:function(){return t.e("chunk-27250ed3").then(t.bind(null,"86eb"))},templ_hmlan:function(){return t.e("chunk-15fa718e").then(t.bind(null,"fca9"))}},watch:{$route:function(){this.subscribe()}},methods:{setHeader:function(){if(this.app.options.mobileHeader)if("Devices"===this.$route.name){var e=this.$route.params.filter.split("&")[0].split("=")[1];this.app.data.header=e.replace(/\\s.\\s/g," & ")}else this.app.data.header=this.$route.name},subscribe:function(){if(this.app.session.connect){var e="appOptions!=:FILTER=";if(this.$route.params.filter){var n=this.$route.params.filter.split("&");-1!=n.indexOf("appOptions=room")||-1!=n.indexOf("appOptions=group")?e="appOptions=.*"+n[0].replace("=",".*")+".*":e+=n[0]}"Dashboard"==this.$route.name&&(e="appOptions=.*dashboard.:..true.*"),"System"==this.$route.name&&(e="appOptions=.*system.:..true.*"),"Home"==this.$route.name&&(e="appOptions=.*home.:..true.*"),this.setHeader(),this.$fhem.getDevices(e)}}},mounted:function(){var e=this;this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data,this.$fhem.app.componentMap=[{name:"panel",component:"templ_panel"},{name:"chart",component:"templ_chart"},{name:"weather",component:"templ_weather"},{name:"sysmon",component:"templ_sysmon"},{name:"hmlan",component:"templ_hmlan"},{name:"sonos",component:"templ_sonos"},{name:"scenes",component:"templ_scenes"}],this.$fhem.on("connect",(function(){return e.subscribe()})),this.subscribe()}}),i=o,p=t("2877"),r=t("6544"),c=t.n(r),u=t("0fd9"),h=Object(p["a"])(i,s,a,!1,null,null,null);n["default"]=h.exports;c()(h,{VRow:u["a"]})}}]); \ No newline at end of file