Skip to content

Commit

Permalink
V3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jemu75 committed Apr 9, 2021
1 parent 1e72f0f commit ffe68ba
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 47 deletions.
4 changes: 1 addition & 3 deletions public/cfg/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
},
"options": {
"maxChartPoints": 100,
"logBuffer": 500,
"debugMode": true,
"debugLevel": 5
"logBuffer": 500
},
"theme": {
"dark": true,
Expand Down
58 changes: 22 additions & 36 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,36 @@
>
<div class="hidden-lg-and-up">
<v-app-bar-nav-icon
v-if="!back"
@click.stop="drawer = !drawer"
/>
<v-btn
v-if="back"
icon
@click.stop="goTo"
>
<v-icon>mdi-chevron-left</v-icon>
</v-btn>
</div>
<h2 class="hidden-md-and-down">
<div class="hidden-md-and-down text-h5">
{{ app.options.clock }}
</h2>
</div>
<v-spacer />
<div v-if="app.options.debugMode">
DebugMode - Level {{ app.options.debugLevel }}
<div class="hidden-md-and-down text-h5">
{{ app.options.date }}
</div>

<div class="hidden-lg-and-up text-h5">
{{ app.data.header }}
</div>
<v-spacer />
<v-btn
v-if="app.options.debugMode"
small
icon
link
to="/syslog"
>
<v-icon
<div v-if="app.options.debugMode">
<v-btn
small
icon
link
to="/syslog"
>
mdi-format-list-bulleted
</v-icon>
</v-btn>
<v-icon
small
>
mdi-format-list-bulleted
</v-icon>
</v-btn>
</div>

<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon
Expand Down Expand Up @@ -196,12 +190,12 @@
},
data: () => ({
drawer: null,
back: false,
appBarColor: 'primary',
app: {
options: {
loading: false,
clock: null
clock: null,
date: null
},
session: {
connect: false,
Expand All @@ -212,7 +206,7 @@
header: ''
}
},
version: 'v3.7.2',
version: 'v3.8.0', // Datum in Header, Hamburger immer da -> back button ausgebaut
status: {
color: 'secondary',
icon: 'mdi-circle',
Expand All @@ -235,10 +229,6 @@
this.status.color = val ? 'success' : 'error';
this.status.text = val ? 'online' : 'offline';
this.status.time = this.$fhem.getDateTime();
},
$route(val) {
this.back = val.path === '/' ? false : true;
}
},
Expand All @@ -259,11 +249,7 @@
this.$fhem.getRoutes('room');
this.$fhem.getRoutes('group');
},
goTo() {
this.$router.go(-1);
},
}
}
};
}
</script>
22 changes: 16 additions & 6 deletions src/plugins/fhem.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export default class Fhem extends EventEmitter {
debugLevel: 3, // 1 = fehler, 2 = status, 3 = requests, 4 = informChannel, 5 = internals
loading: false,
loadCount: 0,
clockInterval: 5000,
clock: null,
date: null,
maxChartPoints: 100,
updateProcess: false,
logRecord: true,
Expand Down Expand Up @@ -92,9 +94,9 @@ export default class Fhem extends EventEmitter {

// mainfunction, Format Date and Time from FHEM
getDateTime(val) {
let timestamp = val ? val : Date.now();
let timestamp = val ? val : (new Date);

return new Date(timestamp).toLocaleString(undefined, { dateStyle: 'short', timeStyle: 'medium' }).replace(',','');
return new Date(timestamp).toLocaleString('de-DE', { dateStyle: 'short', timeStyle: 'medium' }).replace(',','');
}

// mainfunction get element from deep nested objects
Expand Down Expand Up @@ -744,19 +746,27 @@ export default class Fhem extends EventEmitter {
.finally(() => this.app.options.loading = false);
}

// subfunction, set the actual timestamp for menubar
setClock() {
let timestamp = new Date();

this.app.options.clock = timestamp.toLocaleString('de-DE', { hour: '2-digit', minute: '2-digit' })
this.app.options.date = timestamp.toLocaleString('de-DE', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })
}

// mainfunction, create websocket and listen for updates from FHEM
init() {
let options = [ { param: 'inform', value: 'type=status;filter=.*;fmt=JSON' }, { param: 'XHR', value: '1' } ];
let url = this.createURL(options).replace('http','ws');
let url = this.createURL(options).replace(/^http/i,'ws');

this.app.socket = new WebSocket(url);

this.app.socket.onopen = () => this.connOpen();
this.app.socket.onmessage = (message) => this.doUpdate(message);
this.app.socket.onclose = () => this.connClose();

setInterval(() => {
this.app.options.clock = new Date().toLocaleTimeString('de-DE', { hour: '2-digit', minute: '2-digit' })
}, 1000)
this.setClock();

setInterval(() => this.setClock(), this.app.options.clockInterval);
}
}
2 changes: 1 addition & 1 deletion www/fhemapp/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="de"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta name="mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-capable" content="yes"><link rel="icon" href="favicon.png"><link rel="apple-touch-icon" href="apple-touch-icon.png"><title>fhemapp</title><link href="css/chunk-03454508.55c011d2.css" rel="prefetch"><link href="css/chunk-085bcd30.01cf6fd8.css" rel="prefetch"><link href="css/chunk-098d33d4.61e1e199.css" rel="prefetch"><link href="css/chunk-0c00f6a2.460ac60a.css" rel="prefetch"><link href="css/chunk-15fa718e.55c011d2.css" rel="prefetch"><link href="css/chunk-225a9a68.288ff701.css" rel="prefetch"><link href="css/chunk-27250ed3.55c011d2.css" rel="prefetch"><link href="css/chunk-2c05d556.cb4d0868.css" rel="prefetch"><link href="css/chunk-4034692a.0df12065.css" rel="prefetch"><link href="css/chunk-58038582.55c011d2.css" rel="prefetch"><link href="css/chunk-72c6e8d8.8d89ed40.css" rel="prefetch"><link href="css/chunk-96c51cba.a8205ada.css" rel="prefetch"><link href="css/chunk-d584b056.4c33e4ab.css" rel="prefetch"><link href="js/chunk-03454508.24dbacbb.js" rel="prefetch"><link href="js/chunk-085bcd30.81f15153.js" rel="prefetch"><link href="js/chunk-098d33d4.5726246b.js" rel="prefetch"><link href="js/chunk-0c00f6a2.2f161139.js" rel="prefetch"><link href="js/chunk-15fa718e.7a2c6eb5.js" rel="prefetch"><link href="js/chunk-225a9a68.093a2e75.js" rel="prefetch"><link href="js/chunk-27250ed3.fe26b469.js" rel="prefetch"><link href="js/chunk-2c05d556.843edd83.js" rel="prefetch"><link href="js/chunk-2d212bf1.8735e89e.js" rel="prefetch"><link href="js/chunk-2d22937e.25120a02.js" rel="prefetch"><link href="js/chunk-4034692a.f27c222f.js" rel="prefetch"><link href="js/chunk-58038582.fc7957fc.js" rel="prefetch"><link href="js/chunk-72c6e8d8.c00175b8.js" rel="prefetch"><link href="js/chunk-96c51cba.d799cc05.js" rel="prefetch"><link href="js/chunk-d584b056.82929027.js" rel="prefetch"><link href="css/chunk-vendors.95431e8e.css" rel="preload" as="style"><link href="js/app.453e9b15.js" rel="preload" as="script"><link href="js/chunk-vendors.aacf57ae.js" rel="preload" as="script"><link href="css/chunk-vendors.95431e8e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but fhemapp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.aacf57ae.js"></script><script src="js/app.453e9b15.js"></script></body></html>
<!DOCTYPE html><html lang="de"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta name="mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-capable" content="yes"><link rel="icon" href="favicon.png"><link rel="apple-touch-icon" href="apple-touch-icon.png"><title>fhemapp</title><link href="css/chunk-03454508.55c011d2.css" rel="prefetch"><link href="css/chunk-085bcd30.01cf6fd8.css" rel="prefetch"><link href="css/chunk-098d33d4.61e1e199.css" rel="prefetch"><link href="css/chunk-0c00f6a2.460ac60a.css" rel="prefetch"><link href="css/chunk-15fa718e.55c011d2.css" rel="prefetch"><link href="css/chunk-225a9a68.288ff701.css" rel="prefetch"><link href="css/chunk-27250ed3.55c011d2.css" rel="prefetch"><link href="css/chunk-2c05d556.cb4d0868.css" rel="prefetch"><link href="css/chunk-4034692a.0df12065.css" rel="prefetch"><link href="css/chunk-58038582.55c011d2.css" rel="prefetch"><link href="css/chunk-72c6e8d8.8d89ed40.css" rel="prefetch"><link href="css/chunk-96c51cba.a8205ada.css" rel="prefetch"><link href="css/chunk-d584b056.4c33e4ab.css" rel="prefetch"><link href="js/chunk-03454508.24dbacbb.js" rel="prefetch"><link href="js/chunk-085bcd30.81f15153.js" rel="prefetch"><link href="js/chunk-098d33d4.5726246b.js" rel="prefetch"><link href="js/chunk-0c00f6a2.2f161139.js" rel="prefetch"><link href="js/chunk-15fa718e.7a2c6eb5.js" rel="prefetch"><link href="js/chunk-225a9a68.093a2e75.js" rel="prefetch"><link href="js/chunk-27250ed3.fe26b469.js" rel="prefetch"><link href="js/chunk-2c05d556.843edd83.js" rel="prefetch"><link href="js/chunk-2d212bf1.8735e89e.js" rel="prefetch"><link href="js/chunk-2d22937e.25120a02.js" rel="prefetch"><link href="js/chunk-4034692a.f27c222f.js" rel="prefetch"><link href="js/chunk-58038582.fc7957fc.js" rel="prefetch"><link href="js/chunk-72c6e8d8.c00175b8.js" rel="prefetch"><link href="js/chunk-96c51cba.d799cc05.js" rel="prefetch"><link href="js/chunk-d584b056.82929027.js" rel="prefetch"><link href="css/chunk-vendors.95431e8e.css" rel="preload" as="style"><link href="js/app.44d737f1.js" rel="preload" as="script"><link href="js/chunk-vendors.aacf57ae.js" rel="preload" as="script"><link href="css/chunk-vendors.95431e8e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but fhemapp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.aacf57ae.js"></script><script src="js/app.44d737f1.js"></script></body></html>
1 change: 1 addition & 0 deletions www/fhemapp/js/app.44d737f1.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion www/fhemapp/js/app.453e9b15.js

This file was deleted.

0 comments on commit ffe68ba

Please sign in to comment.