Skip to content

Instantly share code, notes, and snippets.

@splatch
Created December 31, 2023 11:21
Show Gist options
  • Save splatch/e759d5b2d8b14da01294acea9336970c to your computer and use it in GitHub Desktop.
Save splatch/e759d5b2d8b14da01294acea9336970c to your computer and use it in GitHub Desktop.
Example teamplate of overview page for openHAB made with handlebars.
basic: true
configurationPid: "cloud.connectorio.gateway.manaco.view.overview"
--
uid: overview
#tags: []
#props: []
component: oh-tabs-page
config:
visibleTo:
- role:administrator
- role:user
label: Overview
slots:
default:
{{#if config.tabOrder}}
{{#each config.tabOrder}}
{{#if (eq . "electricity")}}
- component: oh-tab
config:
page: page:overview_electricity
title: {{translate scope="dictionary" key="tab_electricity" fallback="Electricity"}}
{{/if}}
{{#if (eq . "heat")}}
- component: oh-tab
config:
page: page:overview_heat
title: {{translate scope="dictionary" key="tab_heat" fallback="Heat"}}
{{/if}}
{{#if (eq . "status")}}
- component: oh-tab
config:
page: page:overview_status
title: {{translate scope="dictionary" key="tab_status" fallback="Status"}}
{{/if}}
{{/each}}
{{else}}
# no config or empty tabOrder, default view assumption
- component: oh-tab
config:
page: page:overview_electricity
title: {{translate scope="dictionary" key="tab_electricity" fallback="Electricity"}}
- component: oh-tab
config:
page: page:overview_heat
title: {{translate scope="dictionary" key="tab_heat" fallback="Heat"}}
- component: oh-tab
config:
page: page:overview_status
title: {{translate scope="dictionary" key="tab_status" fallback="Status"}}
{{/if}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment