Skip to content

Commit

Permalink
v4.0.34-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
jemu75 committed Mar 29, 2024
1 parent ffd1d95 commit 98357d3
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 41 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ Legt den Befehl fest, der bei kurzem Drücken des Button ausgeführt wird.
|Beispiel|Erklärung|
|---|---|
|`::set switch on`|sendet den Befehl `set switch on` an FHEM. Dabei wird im Panel unter dem [Element devices](#element-devices) nach dem Schlüssel `switch` gesucht und falls vorhanden, durch den Name des FHEM Devices ersetzt. Kann kein entsprechender Schlüssel gefunden werden, so wird der Befehl unverändert an FHEM gesendet. Es können auch mehrere Befehle (durch Semikolon getrennt) an FHEM gesendet werden.|
|`::home:route`|wechselt zum Navigationspunkt `home` in **FHEMApp**. Die angegebene Route muss existieren und der Route in der URL (.../devices/{route}/?...)|
|`::home:route`|wechselt zum Navigationspunkt `home` in **FHEMApp**. Die angegebene Route muss existieren und der Route in der URL (.../devices/{route}/?...) entsprechen|
|`::panel=licht_bad:route`|wechselt zum Panel `licht_bad` in **FHEMApp**. Das angegebene Panel muss existieren|
|`::https\\://fhem.de:url`|wechsel direkt zu der URL `https://fhem.de`. Bei direkter Eingabe von URLs müssen Doppelpunkte entsprechend ersetzt werden. (siehe auch [Ersetzungen](#ersetzungen))|
|`cam-link::%s:url`|wechsel direkt zu der URL, die im Device `cam` im Reading `link` hinterlegt ist|
### Level Element Button longClick
Expand Down
3 changes: 3 additions & 0 deletions public/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v4.0.34-beta (29.03.2024)
## Panel Button
- When selecting the type "route" on click/longClick/longRelease, individual panels can now also be addressed
# v4.0.33-beta (27.03.2024)
## Settings
- bugfix for panel / template settings
Expand Down
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
navIdx,
res
navPath.push(...fhem.app.navigation)
if(fhem.app.currentView && !/^panel=/.test(fhem.app.currentView)) {
navPath.push(...fhem.app.navigation)
if(fhem.app.currentView) {
for(const navNode of fhem.app.currentView.split('->')) {
navIdx = navPath.map((e) => e.name).indexOf(navNode)
if(navIdx !== -1) {
Expand Down
9 changes: 8 additions & 1 deletion src/components/PanelCard.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup>
import { computed, watch, onMounted, ref } from 'vue'
import router from '@/router'
import { useFhemStore } from '@/stores/fhem'
import PanelMain from './PanelMain.vue'
Expand Down Expand Up @@ -64,7 +65,13 @@
opts.activeLevels = levelsActive(item.panel.main)
} else {
if(opts.expandable) opts.expanded = !opts.expanded
if(opts.maximizable) fhem.app.panelMaximized = opts.expanded ? item.panel : false
if(opts.maximizable) {
if(opts.expanded) {
router.push({ name: 'devices', params: { view: 'panel=' + item.panel.name + '=maximized' }, query: router.currentRoute.value.query })
} else {
router.back()
}
}
}
if(opts.expanded) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/PanelMainChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
const chartStyle = computed(() => {
loadSeries()
return 'height: ' + (fhem.app.panelMaximized ? (window.innerHeight - 250) + 'px' : props.height)
return 'height: ' + (/=maximized$/.test(fhem.app.currentView) ? (window.innerHeight - 250) + 'px' : props.height)
})
function toLocaleDate(val) {
Expand Down Expand Up @@ -121,7 +121,7 @@
},
options = JSON.parse(JSON.stringify(fhem.getEl(props.el, ['options']) || {})),
options2 = JSON.parse(JSON.stringify(fhem.getEl(props.el, ['options2']) || {})),
opts = Object.assign(preset, fhem.app.panelMaximized && Object.keys(options2).length > 0 ? options2 : options ),
opts = Object.assign(preset, /=maximized$/.test(fhem.app.currentView) && Object.keys(options2).length > 0 ? options2 : options ),
label
chart.value.fromMenu = false
Expand Down Expand Up @@ -163,7 +163,7 @@
</script>

<template>
<div v-if="fhem.app.panelMaximized" class="mx-4 my-4 text-right">
<div v-if="/=maximized$/.test(fhem.app.currentView)" class="mx-4 my-4 text-right">
<v-menu
v-model="chart.fromMenu"
:close-on-content-click="false">
Expand Down
21 changes: 13 additions & 8 deletions src/stores/fhem.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const useFhemStore = defineStore('fhem', () => {
panelView: [],
panelList: [],
navigation: [],
panelMaximized: false,
threads: [],
distTemplates: [],
noConfig: null,
Expand Down Expand Up @@ -892,16 +891,22 @@ export const useFhemStore = defineStore('fhem', () => {

//coreFunction load Panels in View
function loadPanelView() {
let routes
let tid = thread()
let routes,
panelIdx,
tid = thread()

app.panelView = []

for(const [idx, panel] of Object.entries(app.panelList)) {
if(panel.panel.navigation) {
routes = handleDefs(panel.panel.navigation, ['route'], [''], true, ',')

if(routes.map((e) => e.route).indexOf(app.currentView) !== -1) app.panelView.push(idx)
if(/^panel=.*/.test(app.currentView)) {
panelIdx = app.panelList.map((e) => e.name).indexOf(app.currentView.split('=')[1])
if(panelIdx !== -1) app.panelView.push(panelIdx)
} else {
for(const [idx, panel] of Object.entries(app.panelList)) {
if(panel.panel.navigation) {
routes = handleDefs(panel.panel.navigation, ['route'], [''], true, ',')

if(routes.map((e) => e.route).indexOf(app.currentView) !== -1) app.panelView.push(idx)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/views/DevicesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
const cols = computed(() => {
let res = { cols: 12, sm: 6, lg: 4 }
if(fhem.app.panelMaximized) res = { cols: 12 }
if(/=maximized$/.test(fhem.app.currentView)) res = { cols: 12 }
return res
})
Expand Down
3 changes: 3 additions & 0 deletions www/fhemapp4/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v4.0.34-beta (29.03.2024)
## Panel Button
- When selecting the type "route" on click/longClick/longRelease, individual panels can now also be addressed.
# v4.0.33-beta (27.03.2024)
## Settings
- bugfix for panel / template settings
Expand Down
1 change: 1 addition & 0 deletions www/fhemapp4/assets/DevicesView-0bba875a.js

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

1 change: 0 additions & 1 deletion www/fhemapp4/assets/DevicesView-719fa4ef.js

This file was deleted.

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

Loading

0 comments on commit 98357d3

Please sign in to comment.