Skip to content

Commit

Permalink
v4.0.17-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
jemu75 committed Feb 5, 2024
1 parent 59f8e13 commit 351fd7f
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 45 deletions.
5 changes: 4 additions & 1 deletion public/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# v4.0.16-beta (04.02.2024)
# v4.0.17-beta (04.02.2024)
## Core
- Optimization in case of new Instance
# v4.0.16-beta (03.02.2024)
## Settings
- Optimization Panel and Template Settings
- Add rawMode
Expand Down
2 changes: 1 addition & 1 deletion src/components/SettingsProps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
if(el.main.length > 1 || Object.keys(el.main[0].level).length > 0) advanced.push('main')
if(Object.keys(el.info).length > 0) advanced.push('info')
devices = el.panel.devices.join(', ')
if(el.panel.devices) devices = el.panel.devices.join(', ')
} else {
panelCount = fhem.app.config.panels.map((e) => e.template).filter(e => e === el.name).length
}
Expand Down
4 changes: 4 additions & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@
"title": "Interner Fehler",
"text": "Fehler bei der Verarbeitung der Konfiguration. Die Decodierung der base64-codierten Konfiguarationsdaten ist fehlgeschlagen. Für weitere Informationen solltest du das Fehlerlogging über den URL Parameter (?loglevel=7) aktivieren."
},
"noConfig": {
"title": "Keine Einstellungen gefunden",
"text": "Für diese Instanz wurden noch keine Einstellungen vorgenommen. Bitte zuerst die Grundeinstellungen für FHEMapp vornehmen und speichern."
},
"config": {
"title": "Laden der Konfiguration fehalgeschlagen",
"text": "Es konnten keine Konfiguationsdaten verarbeitet werden. Für weitere Informationen solltest du das Fehlerlogging über den URL Parameter (?loglevel=7) aktivieren."
Expand Down
4 changes: 4 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@
"title": "Internal error",
"text": "Error processing the configuration. The decoding of the base64-encoded configuration data has failed. For more information, you should activate error logging via the URL parameter (?loglevel=7)."
},
"noConfig": {
"title": "No settings found",
"text": "No settings have yet been made for this instance. Please make and save the basic settings for FHEMapp first."
},
"config": {
"title": "Failed to load the configuration",
"text": "No configuration data could be processed. For more information, you should activate error logging via the URL parameter (?loglevel=7)."
Expand Down
23 changes: 16 additions & 7 deletions src/stores/fhem.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const useFhemStore = defineStore('fhem', () => {
navigation: [],
panelMaximized: false,
threads: [],
distTemplates: [],
distTemplates: [],
noConfig: null,
isReady: false,
message: false,
currentView: null,
Expand Down Expand Up @@ -297,16 +298,24 @@ export const useFhemStore = defineStore('fhem', () => {
resText = base64ToString(res)
cfg = typeof resText === 'string' ? stringToJson(resText) : false

app.noConfig = false

if(!cfg) {
log(2, 'Loading the Configuration of FHEM failed.', res, 'config')
return false
}

if(cfg.error) {
//ToDo
//evtl. Hinweis in Oberfläche anzeigen
//mit Standardkonfiguration weitermachen
console.log(cfg.error)
if(cfg.error === 'No config found!') {
app.noConfig = true
router.push({ name: 'settings', query: router.currentRoute.value.query })
log(3, cfg.error, null)
} else {
//ToDo
//ggf. weitere Fehler von FHEM, die beim Laden der Konfiguration auftreten, abfangen
console.log(cfg.error)
}

}

for(const cfgPart of Object.keys(app.config)) {
Expand Down Expand Up @@ -808,11 +817,11 @@ export const useFhemStore = defineStore('fhem', () => {
return navObj
}

//subFunction for createNavigation()
function sortNavItems(group) {
for(const item of group) {
if(item.sort && item.group && item.group.length > 1) {
item.group.sort((a, b) => (a.title > b.title) ? 1 : (b.title > a.title) ? -1 : 0)
//console.log(item)
item.group.sort((a, b) => (a.title.toUpperCase() > b.title.toUpperCase()) ? 1 : (b.title.toUpperCase() > a.title.toUpperCase()) ? -1 : 0)
}

if(item.group) sortNavItems(item.group)
Expand Down
5 changes: 5 additions & 0 deletions src/views/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import SettingsProps from '../components/SettingsProps.vue'
import SettingsColors from '../components/SettingsColors.vue'
import SettingsContent from '../components/SettingsContent.vue'
import { onMounted } from 'vue'
const tabs = ['header', 'panels', 'templates', 'navigation', 'colors', 'content']
Expand Down Expand Up @@ -36,6 +37,10 @@
configIsChanged.value = false
}
onMounted(() => {
if(fhem.app.noConfig) fhem.log(3, 'Settings View - No Config handling', null, 'noConfig')
})
</script>

<template>
Expand Down
5 changes: 4 additions & 1 deletion www/fhemapp4/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# v4.0.16-beta (04.02.2024)
# v4.0.17-beta (04.02.2024)
## Core
- Optimization in case of new Instance
# v4.0.16-beta (03.02.2024)
## Settings
- Optimization Panel and Template Settings
- Add rawMode
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 351fd7f

Please sign in to comment.