Skip to content

Commit

Permalink
Merge pull request #141 from jemu75/dev-v4
Browse files Browse the repository at this point in the history
v4.7.0
  • Loading branch information
jemu75 authored Jan 5, 2025
2 parents 69c0fac + 40ae6c4 commit c24360a
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 47 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ Zeigt ein Bild an.
|value||siehe Parameter [value](#konfiguration-der-elemente)|
|source||URL die auf ein Bild verweist. Bei direkter Eingabe von URLs müssen Doppelpunkte entsprechend ersetzt werden. (siehe auch [Ersetzungen](#ersetzungen)) [string]|
|height||legt die absolute Höhe des Bildes in Pixeln fest [string]|
|lazyload|true|schaltet das dynamische Nachladen aus bzw. ein [boolean]|
### Level Element IFrame iframe
Bettet ein iframe ein.

Expand All @@ -501,6 +502,7 @@ Bettet ein iframe ein.
|reading||siehe Parameter [reading](#konfiguration-der-elemente)|
|value||siehe Parameter [value](#konfiguration-der-elemente)|
|source||URL deren Inhalt im Panel angezeigt werden soll. Bei direkter Eingabe von URLs müssen Doppelpunkte entsprechend ersetzt werden. (siehe auch [Ersetzungen](#ersetzungen)) [string]|
|lazyload|true|schaltet das dynamische Nachladen aus bzw. ein [boolean]|
### Level Element Menu btn
Zeigt einen Button an, der beim Klicken ein DropDown-Menü öffnet. Wenn dieses Element nicht definiert ist wird ein Standard-Button angezeigt, sobald mindestens ein [Menüeintrag](#level-element-menu-menu) definiert ist.

Expand Down
11 changes: 11 additions & 0 deletions public/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# v4.7.0 (05.01.2025)
## Core
- Optimization of Reconnect and Refreshing Session
## Image
- new Option for disabling lazy loading
## iFrame
- new Option for disabling lazy loading
## Chart
- Bugfix if no LogData from FHEM received
## Devices View
- Bugfix if no route is defined
# v4.6.1 (27.12.2024)
## Slider
- Bugfix for setting Height of vertical slider
Expand Down
2 changes: 1 addition & 1 deletion src/components/PanelMainChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
logData = await fhem.request('text', cmd.join(' '))
data = []
rows = logData.split('\n')
if(logData) rows = logData.split('\n')
if(rows.length > 0) {
for(const row of rows) {
Expand Down
8 changes: 5 additions & 3 deletions src/components/PanelMainIframe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
const extContent = ref()
const content = computed(() => {
let res = {
source: fhem.handleDefs(props.el.iframe, ['source'],['']).source,
let src = fhem.handleDefs(props.el.iframe, ['source', 'lazyload'],['', true]),
res = {
source: src.source,
lazy: src.lazyload ? 'lazy' :'eager',
width: extContent.value && extContent.value.scrollWidth ? extContent.value.scrollWidth : 0,
height: /=maximized$/.test(fhem.app.currentView) ? (window.innerHeight - 170) : props.height
}
Expand All @@ -30,7 +32,7 @@
:src="content.source"
:width="content.width"
:height="content.height"
loading="lazy"
:loading="content.lazy"
style="border:none;">
</iframe>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/PanelMainImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
const loaded = ref(false)
const image = computed(() => {
return fhem.handleDefs(props.el.image, ['source','height'],['', 'auto'])
return fhem.handleDefs(props.el.image, ['source','height', 'lazyload'],['', 'auto', true])
})
const contentSize = computed(() => {
Expand All @@ -26,7 +26,7 @@
</script>

<template>
<v-skeleton-loader v-if="!loaded" type="image">
<v-skeleton-loader v-if="image.lazyload && !loaded" type="image">
</v-skeleton-loader>
<v-img
:src="image.source"
Expand Down
4 changes: 2 additions & 2 deletions src/components/SettingsPropsMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
{ type: 'defs', required: false, prop: 'size', def: 'reading:value:size', help: 'level-element-size', assist: 'props' }
],
image: [
{ type: 'defs', required: false, prop: 'image', def: 'reading:value:source:height', help: 'level-element-image-image', assist: 'props' },
{ type: 'defs', required: false, prop: 'image', def: 'reading:value:source:height:lazyload', help: 'level-element-image-image', assist: 'props' },
{ type: 'defs', required: false, prop: 'divider', def: 'reading:value:divider', help: 'level-element-divider', assist: 'props' },
{ type: 'defs', required: false, prop: 'size', def: 'reading:value:size', help: 'level-element-size', assist: 'props' }
],
iframe: [
{ type: 'defs', required: false, prop: 'iframe', def: 'reading:value:source', help: 'level-element-iframe-iframe', assist: 'props' },
{ type: 'defs', required: false, prop: 'iframe', def: 'reading:value:source:lazyload', help: 'level-element-iframe-iframe', assist: 'props' },
{ type: 'defs', required: false, prop: 'divider', def: 'reading:value:divider', help: 'level-element-divider', assist: 'props' },
{ type: 'defs', required: false, prop: 'size', def: 'reading:value:size', help: 'level-element-size', assist: 'props' }
],
Expand Down
2 changes: 1 addition & 1 deletion src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"headLineRouteTitle": "aktuelle Seite",
"headLineRouteSubTitle": "Zeigt den aktuell ausgewählte Seite in der mobilen Ansicht in der Mitte der Kopfzeile an",
"headLineNavigationTitle": "Navigationsmenü ausblenden",
"headLineNavigationSubTitle": "Zeigt den Buttom zum Einblenden des Navigaitonsmenü in der Desktopansicht an",
"headLineNavigationSubTitle": "Zeigt den Buttom zum Einblenden des Navigationsmenü in der Desktopansicht an",
"darkMode": "Farbschema",
"darkModeTitle": "DarkMode über FHEM",
"darkModeSubTitle": "Schaltet in das dunkle Farbschema um, wenn der Wert des FHEM Reading zutrifft",
Expand Down
34 changes: 17 additions & 17 deletions src/stores/fhem.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,9 +774,9 @@ export const useFhemStore = defineStore('fhem', () => {
}

//coreFunction inital Loading from FHEM
async function initialLoad() {
async function initialLoad(refresh) {
let deviceList = [],
panelList = JSON.parse(JSON.stringify(app.panelList)),
panelList = refresh ? app.panelList : JSON.parse(JSON.stringify(app.panelList)),
device,
res,
parts,
Expand Down Expand Up @@ -826,7 +826,7 @@ export const useFhemStore = defineStore('fhem', () => {
if(item.task) taskList.push({ idx: mapIdx, value: val })
}

app.panelList = panelList
if(!refresh) app.panelList = panelList

for(const item of taskList) handleInternalTask(stat.panelMap[item.idx], item.value)

Expand Down Expand Up @@ -1114,33 +1114,33 @@ export const useFhemStore = defineStore('fhem', () => {
}

//coreFunction create a new Session
async function createSession(connect) {
async function createSession(refresh) {
let res = true
let tid = thread()

log(4, connect ? 'Create Session...' : 'Refresh Session...')
log(4, refresh ? 'Refresh Session...' : 'Create Session...')

app.isReady = false

if(connect) stat.conn = null
if(res && connect) res = await getToken()
if(res && connect) res = openEventWatcher()
stat.conn = null
if(res) res = await getToken()
if(res) res = openEventWatcher()
if(res) res = await timeSync()
if(res) res = await loadConfig()
if(res) res = await loadTemplates()
if(res) res = createPanelList()
if(res) res = await initialLoad()
if(res) res = createNavigation()
if(res) res = loadPanelView()
if(res && !refresh) res = await loadConfig()
if(res && !refresh) res = await loadTemplates()
if(res && !refresh) res = createPanelList()
if(res) res = await initialLoad(refresh)
if(res && !refresh) res = createNavigation()
if(res && !refresh) res = loadPanelView()

if(!res) {
log(3, 'FHEMApp launching failed.')
} else {
app.message = false
app.isReady = true
log(1, connect ? 'FHEMApp launched.' : 'Session refreshed.')
log(1, refresh ? 'Session refreshed.' : 'FHEMApp launched.')

if(connect && app.noConfig) {
if(!refresh && app.noConfig) {
await router.push({ name: 'settings', query: router.currentRoute.value.query })
log(3, 'No Config handling', null, 'noConfig')
}
Expand All @@ -1164,7 +1164,7 @@ export const useFhemStore = defineStore('fhem', () => {

if(res.langChanged) i18n.locale.value = app.settings.lang
if(res.darkChanged) changeDarkMode(app.settings.dark === '0' ? 'light' : 'dark')
if(res.connChanged || !app.isReady) return createSession(true)
if(res.connChanged || !app.isReady) return createSession()
if(res.configChanged) return location.reload()
if(res.routeChanged) loadPanelView()
})
Expand Down
2 changes: 2 additions & 0 deletions src/views/DevicesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
})
function getCols(route, navObj) {
if(!route) return null
if(/=maximized$/.test(route)) return 1
let path = route.split('->'),
Expand Down
8 changes: 8 additions & 0 deletions www/fhemapp4/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# v4.7.0 (05.01.2025)
## Core
- Optimization of Reconnect and Refreshing Session
## Image
- new Option for disabling lazy loading
## iFrame
- new Option for disabling lazy loading
# v4.6.1 (27.12.2024)
## Slider
- Bugfix for setting Height of vertical slider
# v4.6.0 (21.12.2024)
## Panel
Expand Down
1 change: 0 additions & 1 deletion www/fhemapp4/assets/DevicesView-CVBEpMUF.js

This file was deleted.

1 change: 1 addition & 0 deletions www/fhemapp4/assets/DevicesView-DJzHjw6h.js

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.

Large diffs are not rendered by default.

Loading

0 comments on commit c24360a

Please sign in to comment.