Skip to content

Commit

Permalink
v3.13.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jemu75 committed Apr 25, 2021
1 parent 04ec904 commit 25d37a8
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fhemapp",
"version": "3.13.3",
"version": "3.13.4",
"private": true,
"author": "jemu75",
"scripts": {
Expand Down
49 changes: 41 additions & 8 deletions src/components/TemplSysmon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
:disabled="!restart"
@click="fhemRestart"
>
Restart
{{ $t('templates.sysmon.restartBtn') }}
</v-btn>
</v-card-actions>
<v-divider />
Expand All @@ -87,6 +87,36 @@
{{ vals.info.right2Icon }}
</v-icon>{{ vals.info.right2Text }}
</v-system-bar>

<v-dialog
v-model="updateDialog"
max-width="420px"
>
<v-card color="secondary lighten-2">
<v-card-title>
{{ $t('templates.sysmon.updateDialog.header') }}
<v-spacer />
<v-btn
icon
small
@click="updateDialog = false"
>
<v-icon>mdi-close</v-icon>
</v-btn>
</v-card-title>
<v-card-text>
{{ $t('templates.sysmon.updateDialog.text') }}
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
@click="fhemRestart()"
>
{{ $t('templates.sysmon.updateDialog.restartBtn') }}
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-card>
</v-col>
</template>
Expand Down Expand Up @@ -157,7 +187,8 @@
},
restart: true,
update: true,
updateText: 'prüfe updates...',
updateText: '',
updateDialog: false
}),
watch: {
Expand All @@ -183,8 +214,8 @@
'app.options.updateProcess'(val) {
if(!val) {
this.$fhem.emit('message', { lvl: 4, msg: 'Update war erfolgreich. Das System sollte neu gestartet werden.' });
this.updateText = 'system aktuell';
this.updateDialog = true;
this.updateText = this.$t('templates.sysmon.updateBtn[1]');
this.restart = true;
}
}
Expand Down Expand Up @@ -280,25 +311,27 @@
fhemRestart() {
this.restart = false;
this.updateDialog = false;
this.$fhem.request({ param: 'cmd', value: 'shutdown restart' });
},
async fhemUpdateCheck() {
let promise = new Promise((resolve, reject) => {
this.restart = false;
this.update = false;
this.updateText = this.$t('templates.sysmon.updateBtn[0]')
this.$fhem.checkUpdate()
.then((res) => {
if(res) {
this.updateText = 'update';
this.updateText = this.$t('templates.sysmon.updateBtn[2]');
this.update = true;
} else {
this.updateText = 'system aktuell';
this.updateText = this.$t('templates.sysmon.updateBtn[1]');
}
resolve(res);
})
.catch((err) => {
this.$fhem.emit('message', { type: 'error', message: 'Updateprüfung fehlgeschlagen.', meta: err });
this.$fhem.log({ lvl: 1, msg: 'Update check failed.', meta: err });
reject();
})
.finally(() => {
Expand All @@ -311,7 +344,7 @@
fhemUpdate() {
this.restart = false;
this.update = false;
this.updateText ='update läuft...';
this.updateText = this.$t('templates.sysmon.updateBtn[3]');
this.app.options.updateProcess = true;
this.$fhem.request({ param: 'cmd', value: 'update' })
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/TemplWeather.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
this.vals.forecast.splice(0);
for(let i = 1; i < 7; i++) {
let weekd = this.$fhem.getDate(i - 1)
let weekd = this.$fhem.getDate(-i + 1)
let weekday = new Date(weekd).toLocaleString(this.app.options.lang, { weekday: 'long' });
let condition = this.$fhem.getEl(this.item, 'Readings', 'fc' + i + '_condition', 'Value');
let icon = this.$fhem.getEl(this.item, 'Readings', 'fc' + i + '_icon', 'Value');
Expand Down
16 changes: 16 additions & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,21 @@
"from": "von",
"to": "bis"
}
},
"templates": {
"sysmon": {
"updateBtn": [
"prüfe Updates...",
"system aktuell",
"update",
"update läuft.."
],
"restartBtn": "neustart",
"updateDialog": {
"header": "FHEM Update",
"text": "Update wurde erfolgreich beendet. FHEM sollte neu gestartet werden.",
"restartBtn": "jetzt neustarten"
}
}
}
}
17 changes: 17 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,22 @@
"from": "From",
"to": "To"
}
},
"templates": {
"sysmon": {
"updateBtn": [
"check updates...",
"up to date",
"update",
"update running..."
],
"restartBtn": "restart",
"updateDialog": {
"header": "FHEM Update",
"text": "Update was successful finished. FHEM should be restarted now.",
"restartBtn": "restart now"
}
}
}

}
6 changes: 3 additions & 3 deletions src/plugins/fhem.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,9 @@ class Fhem extends EventEmitter {

this.log({ lvl: 2, msg: 'Connection with FHEM is opened.', meta: this.app.connection })

this.app.session.csrf = await this.request({}, 'csrf');
this.log(this.app.session.csrf ? { lvl: 2, msg: 'Crsf-Token received.' } : { lvl: 1, msg: 'No Crsf-Token received.' });

this.loadStructure();
}

Expand Down Expand Up @@ -662,9 +665,6 @@ class Fhem extends EventEmitter {
let params = [ { param: 'inform', value: 'type=status;filter=.*;fmt=JSON' }, { param: 'XHR', value: '1' } ];
let url = this.createURL(params).replace(/^http/i,'ws');

this.app.session.csrf = await this.request({}, 'csrf');
this.log(this.app.session.csrf ? { lvl: 2, msg: 'Crsf-Token received.' } : { lvl: 1, msg: 'No Crsf-Token received.' });

this.app.socket = new WebSocket(url);
this.app.socket.onopen = () => this.wsOpen();
this.app.socket.onmessage = (message) => this.doUpdate(message);
Expand Down
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-07709945.d4481170.css" rel="prefetch"><link href="css/chunk-085bcd30.01cf6fd8.css" rel="prefetch"><link href="css/chunk-15fa718e.55c011d2.css" rel="prefetch"><link href="css/chunk-28a3f15f.fc346ba4.css" rel="prefetch"><link href="css/chunk-3c9d184f.1bbdaac2.css" rel="prefetch"><link href="css/chunk-46bea2ee.1bbdaac2.css" rel="prefetch"><link href="css/chunk-50f89d12.b490d9b1.css" rel="prefetch"><link href="css/chunk-53c4ff2a.9398bfa8.css" rel="prefetch"><link href="css/chunk-72c6e8d8.d4bef30a.css" rel="prefetch"><link href="css/chunk-dc5178fa.cb4d0868.css" rel="prefetch"><link href="css/chunk-dd03e16c.cb4d0868.css" rel="prefetch"><link href="css/chunk-ecd3142c.86805334.css" rel="prefetch"><link href="js/chunk-03454508.86732017.js" rel="prefetch"><link href="js/chunk-07709945.536f8338.js" rel="prefetch"><link href="js/chunk-085bcd30.fce1ca94.js" rel="prefetch"><link href="js/chunk-15fa718e.8e403831.js" rel="prefetch"><link href="js/chunk-21b07e80.b3f882b2.js" rel="prefetch"><link href="js/chunk-28a3f15f.fd07f95d.js" rel="prefetch"><link href="js/chunk-2d0aa92c.855dd2bf.js" rel="prefetch"><link href="js/chunk-2d212bf1.e377c778.js" rel="prefetch"><link href="js/chunk-3c9d184f.28dc459c.js" rel="prefetch"><link href="js/chunk-46bea2ee.942f5a8a.js" rel="prefetch"><link href="js/chunk-50f89d12.d065ef66.js" rel="prefetch"><link href="js/chunk-53c4ff2a.a3ca272e.js" rel="prefetch"><link href="js/chunk-72c6e8d8.c00175b8.js" rel="prefetch"><link href="js/chunk-dc5178fa.4891b2bc.js" rel="prefetch"><link href="js/chunk-dd03e16c.f4db6a88.js" rel="prefetch"><link href="js/chunk-ecd3142c.0688a723.js" rel="prefetch"><link href="css/chunk-vendors.95431e8e.css" rel="preload" as="style"><link href="js/app.0bdba360.js" rel="preload" as="script"><link href="js/chunk-vendors.b9a283db.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.b9a283db.js"></script><script src="js/app.0bdba360.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-07709945.d4481170.css" rel="prefetch"><link href="css/chunk-085bcd30.01cf6fd8.css" rel="prefetch"><link href="css/chunk-15fa718e.55c011d2.css" rel="prefetch"><link href="css/chunk-28a3f15f.fc346ba4.css" rel="prefetch"><link href="css/chunk-3c9d184f.1bbdaac2.css" rel="prefetch"><link href="css/chunk-46bea2ee.1bbdaac2.css" rel="prefetch"><link href="css/chunk-50f89d12.b490d9b1.css" rel="prefetch"><link href="css/chunk-53c4ff2a.9398bfa8.css" rel="prefetch"><link href="css/chunk-72c6e8d8.d4bef30a.css" rel="prefetch"><link href="css/chunk-dc5178fa.cb4d0868.css" rel="prefetch"><link href="css/chunk-dd03e16c.cb4d0868.css" rel="prefetch"><link href="css/chunk-ecd3142c.86805334.css" rel="prefetch"><link href="js/chunk-03454508.94b22464.js" rel="prefetch"><link href="js/chunk-07709945.536f8338.js" rel="prefetch"><link href="js/chunk-085bcd30.fce1ca94.js" rel="prefetch"><link href="js/chunk-15fa718e.8e403831.js" rel="prefetch"><link href="js/chunk-21b07e80.b3f882b2.js" rel="prefetch"><link href="js/chunk-28a3f15f.fd07f95d.js" rel="prefetch"><link href="js/chunk-2d0aa92c.855dd2bf.js" rel="prefetch"><link href="js/chunk-2d212bf1.e377c778.js" rel="prefetch"><link href="js/chunk-3c9d184f.28dc459c.js" rel="prefetch"><link href="js/chunk-46bea2ee.99e1909a.js" rel="prefetch"><link href="js/chunk-50f89d12.d065ef66.js" rel="prefetch"><link href="js/chunk-53c4ff2a.a3ca272e.js" rel="prefetch"><link href="js/chunk-72c6e8d8.c00175b8.js" rel="prefetch"><link href="js/chunk-dc5178fa.4891b2bc.js" rel="prefetch"><link href="js/chunk-dd03e16c.f4db6a88.js" rel="prefetch"><link href="js/chunk-ecd3142c.0688a723.js" rel="prefetch"><link href="css/chunk-vendors.95431e8e.css" rel="preload" as="style"><link href="js/app.561e4ccc.js" rel="preload" as="script"><link href="js/chunk-vendors.b9a283db.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.b9a283db.js"></script><script src="js/app.561e4ccc.js"></script></body></html>

Large diffs are not rendered by default.

Loading

0 comments on commit 25d37a8

Please sign in to comment.