This feature is deprecated in OH3 but code remains which would break if `$rootScope.configWidgets` is left undefined.
So define it as an empty object early.
Fixes#733.
Signed-off-by: Yannick Schaus <github@schaus.net>
This adds support for the "OHApp" mobile app interface to HABPanel, and
fixes setting the main UI's dark mode by the app.
They will also call OHApp.goFullscreen()
on startup if the function exists.
Currently supported in the OHApp interface:
```js
window.OHApp = {
preferDarkMode() { return 'light' },
preferTheme() { return 'md' },
pinToHome() { alert('pinned') },
exitToApp() { alert('exit') }
goFullscreen() { console.log('Going fullscreen') }
}
```
Signed-off-by: Yannick Schaus <github@schaus.net>
This PR moves the storage backend for HABPanel's panel registry
from the service configuration to the "habpanel:panelconf" UI
components namespace, so they're accessible without authorization.
The panel registry object format is converted back and forth to
the UI components format during loading/saving.
To save, it tries to find a refresh token from the main UI stored
in LocalStorage and uses it to get access tokens - a new access
token is requested for each save. Whether or not implementing a
complete OAuth2 authorization code flow (given the refresh token
if there for use as it's the same origin as the main UI, and users
can be taught to first sign in with the main UI to be able to edit
HABPanel) can be debated and is still t.b.d.
(The code to load the configuration with the service config, like
in OH2, has been left but it is not loaded. It will also work
because it tries to get access tokens as well.)
The other options that were formally in the service configuration
have been changed as well:
- the "initial panel configuration" is now a "default"/"starred"
flag on the panel configuration itself, it can be set within
HABPanel itself (the "star" icon after the panel config name in
Settings), only one should normally be starred at any given time,
but it's not enforced - it's the admin responsibility to ensure
that.
- the "lock editing" is now tied to the presence of the refresh
token; this means, signing out in the main UI will automatically
disable the editing features in HABPanel because there's no more
possibility to get an access token to save.
Similarly, the locale is taken from /rest/ instead of the i18n
service directly.
Some missing translations have been added and some changed.
Signed-off-by: Yannick Schaus <github@schaus.net>
- Remove unused language headers from HABotResource
- Remove redundant this references in HABotResource
Signed-off-by: Wouter Born <github@maindrain.net>
This add the UI in its current state of development,
the intent is to test the integration in the distro
early. The other apps are listed on the home page by
calling the new REST endpoint introduced in
https://github.com/openhab/openhab-core/pull/1329
The onboarding wizard implementation is not complete
so it isn't possible to select a startup package with
the UI yet. The wizard steps will be discussed in a
separate issue; it should however be possible to install
addons as needed from the settings screen.
Signed-off-by: Yannick Schaus <github@schaus.net>
* Remove all dependencies to the dashboard UI
Migrate all dashboard tiles to the core tile functionality
(https://github.com/openhab/openhab-core/pull/1329)
Signed-off-by: Yannick Schaus <github@schaus.net>
Include a new complete Japanese translation (thanks to koui), and partial translations and fixes in Afrikaans, Arabic, Bulgarian, Korean, Lithuanian, Ukrainian.
Signed-off-by: Yannick Schaus <github@schaus.net>
This change broadcasts the 'openhab-update' event immediately, not waiting for
the result of the /rest/items request, if the items are already populated, when
OHService.reloadItems() is called. This improves the dashboard switching latency
significantly at the expanse of reliability - some widgets (e.g. slider) might
'flicker' slighly.
Signed-off-by: Yannick Schaus <github@schaus.net>
Discourse now seems to use relative "short URLs" redirects (`/uploads/short-url/...`) instead of linking to the absolute URL of the attachment on S3 (for new posts only, those created before are not affected).
Signed-off-by: Yannick Schaus <github@schaus.net>
* fix iconset feature by using new groupId
* Fix SAT configuration
* fix further group IDs
Also-by: Wouter Born <github@maindrain.net>
Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>