diff --git a/bundles/org.openhab.ui/web/src/components/app.vue b/bundles/org.openhab.ui/web/src/components/app.vue index 4a5eaab83f..9f46cd24ff 100644 --- a/bundles/org.openhab.ui/web/src/components/app.vue +++ b/bundles/org.openhab.ui/web/src/components/app.vue @@ -100,8 +100,8 @@ :class="{ currentsection: currentUrl.indexOf('/developer/api-explorer') === 0 }"> - @@ -140,8 +140,8 @@ - - + + @@ -248,7 +248,7 @@ import Framework7 from 'framework7/framework7-lite.esm.bundle.js' import cordovaApp from '../js/cordova-app.js' import routes from '../js/routes.js' import PanelRight from '../pages/panel-right.vue' -import DeveloperSidebar from './developer/developer-sidebar.vue' +import DeveloperDock from './developer/developer-dock.vue' import EmptyStatePlaceholder from '@/components/empty-state-placeholder.vue' import { loadLocaleMessages } from '@/js/i18n' @@ -266,7 +266,7 @@ export default { components: { EmptyStatePlaceholder, PanelRight, - DeveloperSidebar + DeveloperDock }, data () { let theme = localStorage.getItem('openhab.ui:theme') @@ -370,7 +370,11 @@ export default { showSettingsSubmenu: false, showDeveloperSubmenu: false, - showDeveloperSidebar: false, + showDeveloperDock: false, + activeDock: 'tools', + activeToolTab: 'pin', + activeHelpTab: 'current', + quickStartShow: true, currentUrl: '' } }, @@ -501,6 +505,12 @@ export default { if (data[2]) dayjs.locale(data[2].key) + const page = data[0].find((p) => p.uid === 'overview') + if ((!page) || (page.component !== 'oh-layout-page') || (!page.slots || (!page.slots.default.length && !page.slots.masonry && !page.slots.canvas && !page.slots.grid))) { + if (this.quickStartShow) this.selectDeveloperDock({ 'dock': 'help', 'helpTab': 'quick' }) + this.quickStartShow = false + } + // finished with loading this.ready = true return Promise.resolve() @@ -586,11 +596,19 @@ export default { this.$nextTick(() => this.$f7.panel.get('left').disableVisibleBreakpoint()) } }, - toggleDeveloperSidebar () { + toggleDeveloperDock () { if (!this.$store.getters.isAdmin) return - this.showDeveloperSidebar = !this.showDeveloperSidebar - if (this.showDeveloperSidebar) this.$store.dispatch('startTrackingStates') - this.$store.commit('setDeveloperSidebar', this.showDeveloperSidebar) + this.showDeveloperDock = !this.showDeveloperDock + if (this.showDeveloperDock) this.$store.dispatch('startTrackingStates') + this.$store.commit('setDeveloperDock', this.showDeveloperDock) + }, + selectDeveloperDock (dockOpts) { + if (dockOpts) { + if (dockOpts.dock) this.activeDock = dockOpts.dock + if (dockOpts.helpTab) this.activeHelpTab = dockOpts.helpTab + if (dockOpts.toolTab) this.activeToolTab = dockOpts.toolTab + } + if (!this.showDeveloperDock) this.toggleDeveloperDock() }, toggleVisibleBreakpoint () { this.$f7.panel.get('left').toggleVisibleBreakpoint() @@ -599,7 +617,7 @@ export default { }, keyDown (ev) { if (ev.keyCode === 68 && ev.shiftKey && ev.altKey) { - this.toggleDeveloperSidebar() + this.toggleDeveloperDock() ev.stopPropagation() ev.preventDefault() } @@ -671,6 +689,7 @@ export default { this.showSettingsSubmenu = page.route.url.indexOf('/settings/') === 0 || page.route.url.indexOf('/settings/addons/') === 0 this.showDeveloperSubmenu = page.route.url.indexOf('/developer/') === 0 this.currentUrl = page.route.url + this.$store.commit('setPagePath', this.currentUrl) } }) @@ -690,8 +709,12 @@ export default { this.updateThemeOptions() }) - this.$f7.on('toggleDeveloperSidebar', () => { - this.toggleDeveloperSidebar() + this.$f7.on('toggleDeveloperDock', () => { + this.toggleDeveloperDock() + }) + + this.$f7.on('selectDeveloperDock', (opts) => { + this.selectDeveloperDock(opts) }) this.$f7.on('smartSelectOpened', (smartSelect) => { diff --git a/bundles/org.openhab.ui/web/src/components/developer/developer-dock.vue b/bundles/org.openhab.ui/web/src/components/developer/developer-dock.vue new file mode 100644 index 0000000000..5c48621370 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/developer-dock.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/bundles/org.openhab.ui/web/src/components/developer/developer-sidebar.vue b/bundles/org.openhab.ui/web/src/components/developer/developer-sidebar.vue index dce6a849b4..99c06fafcf 100644 --- a/bundles/org.openhab.ui/web/src/components/developer/developer-sidebar.vue +++ b/bundles/org.openhab.ui/web/src/components/developer/developer-sidebar.vue @@ -1,21 +1,13 @@ + + diff --git a/bundles/org.openhab.ui/web/src/components/developer/help/addon-context.vue b/bundles/org.openhab.ui/web/src/components/developer/help/addon-context.vue new file mode 100644 index 0000000000..928cd49416 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/help/addon-context.vue @@ -0,0 +1,29 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/components/developer/help/default-context.vue b/bundles/org.openhab.ui/web/src/components/developer/help/default-context.vue new file mode 100644 index 0000000000..4a846f0ca7 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/help/default-context.vue @@ -0,0 +1,48 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/components/developer/help/help-faq-defs.json b/bundles/org.openhab.ui/web/src/components/developer/help/help-faq-defs.json new file mode 100644 index 0000000000..d5e61bdd01 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/help/help-faq-defs.json @@ -0,0 +1,74 @@ +[ + { + "title" : "Access openHAB from a remote network", + "goto" : { + "target" : "/addons/misc-openhabcloud", + "text" : "the openHAB Cloud Connector" + }, + "text" : "The most secure ways to enable remote access to your openHAB instance are through a VPN or a service such as myopenhab.org with the openHAB Cloud Connector. DO NOT expose your openHAB instance directly to the internet, that is insecure", + "doclink" : "addons/integrations/openhabcloud/" + }, + { + "title" : "Change the UID of a configuration", + "text" : "Once a configuration is created you cannot change its UID. You can delete the configuration and create a new one that is identical except for the UID, but beware of potential consequeces of other configurations that may rely on the deleted UID." + }, + { + "title" : "Create a new configuration", + "goto" : { + "target" : "/settings/", + "text" : "Settings" + }, + "text" : "Use the Settings page to go to the listing page for the type of configuration you want to create then click on the plus_circle_fill in the lower right corner to add a new configuration of that type.", + "doclink" : "docs/configuration/" + }, + { + "title" : "Delete a configuration", + "goto" : { + "target" : "/settings/", + "text" : "Settings" + }, + "text" : "Use the Settings page to go to the listing page for the type of configuration you want to delete and then goto the details page of that configuration. Click on the Remove button at the bottom of the page (you may have to expand the bottom bar of the configuration window by clicking on the chevron_up button in the bottom right corner)." + }, + { + "title" : "Delete multiple configurations", + "goto" : { + "target" : "/settings/", + "text" : "Settings" + }, + "text" : "Use the Settings page to go to the listing page for the type of configurations you want to delete and then click on Select in the upper-right corner (or Ctrl + Click on any listing). Select all configurations to be deleted using the checkboxes and then click on the Remove button at the bottom of the screen." + }, + { + "title" : "Find available icons", + "text" : "OpenHAB specific icons can be found at the docs page linked below. F7 icons are listed in the F7 docs. Material icons can be found here. The entire Iconify library is also available for use.", + "doclink" : "docs/configuration/iconsets/classic/" + }, + { + "title" : "Get involved in openHAB", + "text" : "openHAB only grows with contributions from volunteers. You can answer questions in the community forum, help with language translations, or even contribute your own code.", + "doclink" : "docs/developer/contributing.html" + }, + { + "title" : "Get openHAB notifications", + "goto" : { + "target" : "/addons/misc-openhabcloud", + "text" : "the openHAB Cloud Connector" + }, + "text" : "There are many different add-ons that will allow you to send messages from openHAB to other devices. One easy and secure method is to use myopenhab.org with the openHAB Cloud Connector.", + "doclink" : "addons/integrations/openhabcloud/" + }, + { + "title" : "See openHAB logs", + "text" : "If you have installed openHAB using openaHABian, then you can use the openHABian config Optional Components menu to install a web based log viewer. Otherwise the location of the log files will depend on your installation method so use the link below to find out more.", + "doclink" : "docs/administration/logging.html" + }, + { + "title" : "View openHAB on an Android device", + "text" : "openHAB UIs can all be viewed via any web browser, desktop or mobile. There is also an Android app that can connect to your openHAB instance and give you better integration with the mobile device.", + "doclink" : "docs/apps/android.html" + }, + { + "title" : "View openHAB on an iOS device", + "text" : "openHAB UIs can all be viewed via any web browser, desktop or mobile. There is also an iOS app that can connect to your openHAB instance and give you better integration with the mobile device.", + "doclink" : "docs/apps/ios.html" + } +] diff --git a/bundles/org.openhab.ui/web/src/components/developer/help/help-qstart-defs.json b/bundles/org.openhab.ui/web/src/components/developer/help/help-qstart-defs.json new file mode 100644 index 0000000000..dc1eaea9f3 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/help/help-qstart-defs.json @@ -0,0 +1,147 @@ +[ + { + "opened": true, + "title": "1. Install a Binding (Add-on)", + "steps": [ + { + "link": "/settings/addons", + "title": "Addon-Store", + "text": "Left panel > Settings > Add-on Store or click here arrow_right" + }, + { + "title": "Install", + "text": "Scroll to the Binding you need and click the INSTALL button" + } + ], + "button": { + "title": "More help on Bindings", + "link": "docs/configuration/addons.html" + } + }, + { + "title": "2. Add a Thing", + "steps": [ + { + "link": "/settings/things/inbox", + "title": "Thing Inbox", + "text": "Left panel > Settings > Things > Inbox or click here arrow_right" + }, + { + "link": "/settings/things/add", + "title": "New Thing", + "text": "Click on the plus_circle_fill in the lower-right corner" + }, + { + "title": "Choose Binding", + "text": "Click on the listing of the Binding for the Thing you want to add to openHAB" + }, + { + "title": "Scan", + "text": "Click the Scan button to automatically search for related devices" + }, + { + "title": "Add Thing", + "text": "Select the device from the list of Discovered Things and Click OK to add the Thing" + } + ], + "button": { + "title": "More help on Things", + "link": "docs/tutorial/things_intermediate.html" + } + }, + { + "title": "3. Configure the Thing", + "steps": [ + { + "link": "/settings/things/", + "title": "Thing List", + "text": "Left panel > Settings > Things or click here arrow_right" + }, + { + "title": "Select Thing", + "text": "Click on the listing for the Thing you want to configure" + }, + { + "title": "Configuration", + "text": "Follow the documentation for the Thing's Binding to add configuration then click Save in upper right-hand corner" + } + ], + "button": { + "title": "Binding Documentation", + "link": "addons/" + } + }, + { + "title": "4. Create an Item", + "steps": [ + { + "link": "/settings/things/", + "title": "Thing List", + "text": "Left panel > Settings > Things or click here arrow_right" + }, + { + "title": "Select Thing", + "text": "Click on the listing for the Thing you want to interface with" + }, + { + "title": "Channels", + "text": "Click on the Channels tab in the center at the top of the Thing Page" + }, + { + "title": "Select Channel", + "text": "Click to expand the Channel you will control and then click plus_circle_fill Add Link to Item" + }, + { + "title": "New Item", + "text": "Select the Create a new Item option" + }, + { + "title": "Add Item", + "text": "Click the blue Link button at the bottom of the page" + } + ], + "button": { + "title": "More help on Items", + "link": "docs/configuration/items.html" + } + }, + { + "title": "5. Display Item in UI", + "steps": [ + { + "link": "/settings/pages/layout/overview", + "title": "Select Page from Page List", + "text": "Left panel > Settings > Pages > Overview or click here arrow_right" + }, + { + "title": "Add Block, Row, and Column", + "text": "Click on the Add Block, Add Row, and Add Column buttons in the editor" + }, + { + "title": "Add Widget", + "text": "Click the gray rectangle and select a card appropriate for the intended item (for example, a toggle card for a switch item)" + }, + { + "title": "Configure Widget", + "text": "Click the black menu button above the right corner of the widget and select Configure Widget" + }, + { + "title": "Select Item", + "text": "Click on the Item field and select an appropriate item from the list then click Done" + }, + { + "title": "Save Page", + "text": "Click Save in the upper right corner of the editor" + }, + { + "link": "/", + "title": "View Home Page", + "text": "Click here to return to the Home Overview Page arrow_right" + } + ], + "button": { + "title": "More help on UI pages", + "link": "docs/tutorial/pages_intro.html" + } + } +] diff --git a/bundles/org.openhab.ui/web/src/components/developer/help/item-context.vue b/bundles/org.openhab.ui/web/src/components/developer/help/item-context.vue new file mode 100644 index 0000000000..26bcefb718 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/help/item-context.vue @@ -0,0 +1,33 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/components/developer/help/model-context.vue b/bundles/org.openhab.ui/web/src/components/developer/help/model-context.vue new file mode 100644 index 0000000000..3af5051c6a --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/help/model-context.vue @@ -0,0 +1,38 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/components/developer/help/page-context.vue b/bundles/org.openhab.ui/web/src/components/developer/help/page-context.vue new file mode 100644 index 0000000000..ba4df865c1 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/help/page-context.vue @@ -0,0 +1,36 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/components/developer/help/rule-context.vue b/bundles/org.openhab.ui/web/src/components/developer/help/rule-context.vue new file mode 100644 index 0000000000..98cfb632a4 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/help/rule-context.vue @@ -0,0 +1,58 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/components/developer/help/thing-context.vue b/bundles/org.openhab.ui/web/src/components/developer/help/thing-context.vue new file mode 100644 index 0000000000..e99375eb7f --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/help/thing-context.vue @@ -0,0 +1,36 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/components/developer/help/transform-context.vue b/bundles/org.openhab.ui/web/src/components/developer/help/transform-context.vue new file mode 100644 index 0000000000..23ea26f980 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/help/transform-context.vue @@ -0,0 +1,38 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/components/developer/help/widget-context.vue b/bundles/org.openhab.ui/web/src/components/developer/help/widget-context.vue new file mode 100644 index 0000000000..1d70757ef4 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/components/developer/help/widget-context.vue @@ -0,0 +1,27 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/js/store/index.js b/bundles/org.openhab.ui/web/src/js/store/index.js index 91bc8c85ae..a7c5da56e1 100644 --- a/bundles/org.openhab.ui/web/src/js/store/index.js +++ b/bundles/org.openhab.ui/web/src/js/store/index.js @@ -23,7 +23,8 @@ const store = new Vuex.Store({ apiEndpoints: null, locale: null, runtimeInfo: null, - developerSidebar: false + developerDock: false, + pagePath: null }, getters: { apiEndpoint: (state) => (type) => (!state.apiEndpoints) ? null : state.apiEndpoints.find((e) => e.type === type), @@ -38,9 +39,12 @@ const store = new Vuex.Store({ setLocale (state, locale) { state.locale = locale }, - setDeveloperSidebar (state, value) { - state.developerSidebar = value + setDeveloperDock (state, value) { + state.developerDock = value state.states.keepConnectionOpen = value + }, + setPagePath (state, value) { + state.pagePath = value } }, actions: { diff --git a/bundles/org.openhab.ui/web/src/pages/developer/developer-tools.vue b/bundles/org.openhab.ui/web/src/pages/developer/developer-tools.vue index ffa3ecbb5e..daa542a9e5 100644 --- a/bundles/org.openhab.ui/web/src/pages/developer/developer-tools.vue +++ b/bundles/org.openhab.ui/web/src/pages/developer/developer-tools.vue @@ -32,10 +32,10 @@ Maintenance Tools - +
- +
diff --git a/bundles/org.openhab.ui/web/src/pages/home.vue b/bundles/org.openhab.ui/web/src/pages/home.vue index 2cbf318c00..c2f77fa77b 100644 --- a/bundles/org.openhab.ui/web/src/pages/home.vue +++ b/bundles/org.openhab.ui/web/src/pages/home.vue @@ -12,6 +12,8 @@ {{ title }} + + diff --git a/bundles/org.openhab.ui/web/src/pages/home/overview-tab.vue b/bundles/org.openhab.ui/web/src/pages/home/overview-tab.vue index c6109709b0..d97e1db190 100644 --- a/bundles/org.openhab.ui/web/src/pages/home/overview-tab.vue +++ b/bundles/org.openhab.ui/web/src/pages/home/overview-tab.vue @@ -15,7 +15,7 @@
- + diff --git a/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue b/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue index 34ecbf4a11..e58f98459f 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue @@ -2,6 +2,8 @@ + + @@ -54,8 +56,7 @@ - {{ items.length }} Items - - + {{ items.length }} Items - + diff --git a/bundles/org.openhab.ui/web/src/pages/settings/model/model.vue b/bundles/org.openhab.ui/web/src/pages/settings/model/model.vue index 6e894baf19..47fdfd2be5 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/model/model.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/model/model.vue @@ -1,6 +1,10 @@