Skip to content

Commit 6d12fe9

Browse files
authored
Display layout page as overview (openhab#235)
Move the UI tiles back to the right panel, and display a placeholder in the home page's overview tab until a layout page with an ID of "overview" has been created. This is (normally?) temporary until a specially-designed overview page has been implemented - discussion on openhab#155). Various styling fixes & clean up. Move the onboarding cards to separate component (not used for now). Don't display the Back button in a page view if it's shown on the sidebar. Layout pages: switch the "add widget" action sheet from grid to simple list with groups, headers and cancel button. Signed-off-by: Yannick Schaus <[email protected]>
1 parent 8a41670 commit 6d12fe9

File tree

8 files changed

+263
-210
lines changed

8 files changed

+263
-210
lines changed

bundles/org.openhab.ui/web/src/assets/i18n/en/empty-states.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"overview.title": "Welcome to openHAB!",
3+
"overview.text": "Once your system is configured, create a layout page with the ID <code>\"overview\"</code> to display it here.",
4+
25
"inbox.title": "The Inbox is empty",
36
"inbox.text": "Discovery results from your bindings that can be added as things will appear here.<br><br>You can also start a scan for a certain binding or add things manually with the button below.",
47

bundles/org.openhab.ui/web/src/components/app.vue

+12-13
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<f7-list-item link="/" class="logo" panel-close v-else>
1111
<img src="../res/img/openhab-logo.png" width="100%">
1212
</f7-list-item>
13-
<!-- <f7-block-title>Sitemaps</f7-block-title> -->
1413
<f7-list>
1514
<!-- <f7-list-item v-for="sitemap in sitemaps" :animate="false" :key="sitemap.name"
1615
:class="{ currentsection: currentUrl.indexOf('/sitemap/' + sitemap.name) >= 0 }"
@@ -79,24 +78,18 @@
7978
:class="{ currentsection: currentUrl.indexOf('/about') >= 0 }">
8079
<f7-icon slot="media" ios="f7:question_circle_fill" aurora="f7:question_circle_fill" md="material:help" color="gray"></f7-icon>
8180
</f7-list-item>
82-
<!-- <f7-list-item v-if="loggedIn" link="/" title="Logout" @click="logout()" panel-close>
83-
<f7-icon slot="media" ios="f7:square_arrow_right" md="material:exit_to_app" color="gray"></f7-icon>
84-
</f7-list-item> -->
85-
<!-- <f7-list-item title="Master-Details" view=".view-main" panel-close>
86-
<f7-icon slot="media" ios="f7:exit" md="material:exit_to_app"></f7-icon>
87-
</f7-list-item> -->
8881
</f7-list>
82+
8983
<div class="account" v-if="ready">
9084
<div class="display-flex justify-content-center">
9185
<f7-button v-if="!loggedIn" large color="gray" icon-size="36" tooltip="Unlock Administration" icon-f7="lock_shield_fill" @click="authorize()" />
9286
</div>
93-
<f7-list v-if="$store.getters.user" class="admin-links" media-list>
87+
<f7-list v-if="$store.getters.user" media-list>
9488
<f7-list-item :title="$store.getters.user.name" :footer="serverDisplayUrl" io="f7:person_alt_circle_fill" link="/profile/" no-chevron panel-close view=".view-main"
9589
:class="{ currentsection: currentUrl.indexOf('/profile') >= 0 }">
9690
<f7-icon slot="media" size="36" ios="f7:person_alt_circle_fill" aurora="f7:person_alt_circle_fill" md="f7:person_alt_circle_fill" color="gray"></f7-icon>
9791
</f7-list-item>
9892
</f7-list>
99-
<!-- <f7-link v-if="user" color="gray" icon-size="30" :text="accountLabel" tooltip="Sign out" icon-f7="person_alt_circle_fill" @click="logout()" /> -->
10093
</div>
10194
</f7-page>
10295
</f7-panel>
@@ -108,7 +101,7 @@
108101
</f7-panel>
109102

110103
<!-- Your main view, should have "view-main" class -->
111-
<f7-view main class="safe-areas" url="/" :master-detail-breakpoint="960" @routeChanged="console.log('hello')"></f7-view>
104+
<f7-view main v-show="ready" class="safe-areas" url="/" :master-detail-breakpoint="960" @routeChanged="console.log('hello')"></f7-view>
112105

113106
<f7-login-screen id="my-login-screen" :opened="loginScreenOpened">
114107
<f7-view name="login" v-if="$device.cordova">
@@ -155,13 +148,12 @@
155148
height 0
156149
157150
.panel-left
158-
overflow-y scroll
159151
scrollbar-width none /* Firefox */
160152
-ms-overflow-style none /* IE 10+ */
161153
162154
.page
163155
background #f5f5f5 !important
164-
padding-bottom 4rem
156+
padding-bottom calc(var(--f7-tabbar-labels-height) + var(--f7-safe-area-bottom))
165157
.logo
166158
margin-top var(--f7-safe-area-top)
167159
list-style none
@@ -178,11 +170,18 @@
178170
color var(--f7-color-white) !important
179171
.account
180172
z-index 300
181-
height 4rem
173+
height calc(var(--f7-tabbar-labels-height) + var(--f7-safe-area-bottom))
182174
background #f5f5f5 !important
183175
position fixed
184176
bottom calc(var(--f7-safe-area-bottom))
185177
width 100%
178+
.list
179+
position absolute
180+
bottom 0
181+
left 0
182+
width 100%
183+
margin-bottom 0
184+
height calc(var(--f7-tabbar-labels-height) + var(--f7-safe-area-bottom))
186185
187186
.theme-dark
188187
.panel-left
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<template>
2+
<div>
3+
<f7-card
4+
v-show="showSetup"
5+
title="Welcome to openHAB!"
6+
content="Congratulations, your server is up and running! However, it is not configured yet. Follow the setup wizard and let it guide you through the initial configuration. (Note: the wizard could also be started automatically on launch if no package is detected - services/org.openhab.addons > package)."
7+
>
8+
<f7-card-footer>
9+
<f7-link color="blue" @click="skipSetupWizard()">No thanks</f7-link>
10+
<!-- <f7-button color="blue" fill raised login-screen-open="#login-screen">Start Setup Wizard</f7-button> -->
11+
<f7-button color="blue" fill raised href="/setup-wizard/">Start Setup Wizard</f7-button>
12+
</f7-card-footer>
13+
</f7-card>
14+
<f7-card title="Suggested Tasks" v-show="showTasks">
15+
<f7-card-content :padding="false">
16+
<ol>
17+
<li>
18+
<f7-link no-link-class color="blue" href="#">Install Bindings &amp; other add-ons</f7-link>
19+
</li>
20+
<li>
21+
<f7-link no-link-class color="blue" href="#">Discover &amp; configure Things</f7-link>
22+
</li>
23+
<li>
24+
<f7-link
25+
no-link-class
26+
color="blue"
27+
href="#"
28+
>Design your home's conceptually with the semantic model builder and link the Things to Items</f7-link>
29+
</li>
30+
<li>
31+
<f7-link
32+
no-link-class
33+
color="blue"
34+
href="#"
35+
>Connect to openHAB Cloud for remote access and integration with voice assistants</f7-link>
36+
</li>
37+
</ol>
38+
</f7-card-content>
39+
<f7-card-footer>
40+
<f7-link color="blue" @click="dismissTasks">Dismiss</f7-link>
41+
</f7-card-footer>
42+
</f7-card>
43+
</div>
44+
</template>
45+
46+
<script>
47+
export default {
48+
props: ['showSetup', 'showTasks'],
49+
methods: {
50+
skipSetupWizard () {
51+
this.$f7.dialog.confirm(
52+
'Are you sure? You currently only have a minimal set of features available and you will need to install all essential add-ons by hand!',
53+
'Skip Setup Wizard',
54+
() => {
55+
// TODO
56+
}
57+
)
58+
},
59+
dismissTasks () {
60+
// TODO
61+
}
62+
}
63+
}
64+
</script>

bundles/org.openhab.ui/web/src/components/widgets/layout/oh-placeholder-widget.vue

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
display inline-block
1313
opacity 0.5
1414
height calc(2*3rem + 50px)
15+
z-index 100
1516
.button
1617
width calc(100% - var(--f7-typography-margin))
1718
padding 3rem 0

0 commit comments

Comments
 (0)