fix: hide webcam panel in config & dashboard if no webcam exists
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
1 file changed
+11
@@ -15,6 +15,11 @@ export default class DashboardMixin extends BaseMixin {
|
||||
return this.$store.getters['gui/macros/getAllMacrogroups'] ?? []
|
||||
}
|
||||
|
||||
|
||||
get webcams() {
|
||||
return this.$store.getters['gui/webcams/getWebcams'] ?? []
|
||||
}
|
||||
|
||||
get missingPanelsMobile() {
|
||||
const panels = [
|
||||
...this.$store.state.gui.dashboard.mobileLayout,
|
||||
@@ -55,6 +60,7 @@ export default class DashboardMixin extends BaseMixin {
|
||||
let allPanels = [...allDashboardPanels]
|
||||
const missingPanels: any[] = []
|
||||
|
||||
// remove macros panel and add macrogroups panels if macroMode === expert
|
||||
if (this.macroMode === 'expert') {
|
||||
this.macrogroups.forEach((group: GuiMacrosStateMacrogroup) => {
|
||||
allPanels.push('macrogroup_'+group.id)
|
||||
@@ -63,6 +69,11 @@ export default class DashboardMixin extends BaseMixin {
|
||||
allPanels = allPanels.filter((name) => name !== 'macros')
|
||||
}
|
||||
|
||||
// remove webcam panel, if no webcam exists
|
||||
if (this.webcams.length === 0) {
|
||||
allPanels = allPanels.filter((name) => name !== 'webcam')
|
||||
}
|
||||
|
||||
allPanels.forEach((panelname) => {
|
||||
if (!panels.find((panel) => panel.name === panelname))
|
||||
missingPanels.push({
|
||||
|
||||
Reference in new issue
Block a user