Depens on https://github.com/openhab/openhab-core/pull/4515.
This refactors the WebSocket connection code from #2884 to the `$oh`
namespace, same as it is for the SSE logic.
It also passes the access token as WebSocket subprotocol so it is sent
with the `Sec-WebSocket-Protocol` header.
---------
Signed-off-by: Florian Hotze <dev@florianhotze.com>
Related to #2584 and
https://github.com/openhab/openhab-core/issues/4466.
This avoids that the global SSE connection is always established, and
therefore reduces problems with the max parallel HTTP connections
limitation. The global SSE connection is now only established if the web
audio sink or the command Item are enabled.
Whilst this change potentially makes the UI not reload the model
automatically on change, practically the now removed mechanism might
haven't been really useful at all because the model is already reloaded
on Main UI start, and if SSE was not connected the moment an Item
changed the mechanism did not trigger.
Signed-off-by: Florian Hotze <dev@florianhotze.com>
This PR implements drag and drop in the sitemap tree, to make it easier
to graphically rearange sitemaps.
To achieve this, [Vue.Draggable](https://github.com/SortableJS/Vue.Draggable) (by itself
based on SortableJS) is included.
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Adds String type support to the interactive SVG canvas by allowing to
compare a string to a specific value that is perceived as state ON:
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
Regression from #2690.
Reported here:
https://community.openhab.org/t/enocean-impossible-to-link-a-rockerswitch-channel-with-an-item-in-main-ui-there-is-no-profile-available-for-the-selected-item/160987
When creating a Thing channel link to an item, the profile selection are
disabled. This presents two problems:
- It made linking a trigger channel to an item not possible, because a
profile must be selected, but they're disabled.
- Linking a non-trigger channel to a new item is possible, but selecting
a profile is not possible at link creation. The user has to create the
link without a profile first, then go back to edit the link in order to
assign a profile.
When editing a channel link, profile selection was possible for
unsupported profiles, e.g. when editing a link between a Switch Item and
a Number channel, one could edit the link to use the default or follow
profiles.
---------
Signed-off-by: Florian Hotze <dev@florianhotze.com>
This avoids confusion because `background` is not working anymore.
Use `style: background: ` instead.
---------
Signed-off-by: Florian Hotze <dev@florianhotze.com>
Add @stefan-hoehn as Blockly CODEOWNER so he is automatically requested
for review in his role as Blockly maintainer.
Signed-off-by: Florian Hotze <dev@florianhotze.com>
This should fix the performance problems in the log viewer when the
number of items reaches the max buffer size.
---------
Signed-off-by: Yannick Schaus <github@schaus.net>
This updates the tern defs used for autocompletion to the current
library version included in the add-on (5.8.1).
See https://github.com/openhab/openhab-js/compare/v5.3.1...v5.8.1 for
changes.
Last update was in #2642.
Signed-off-by: Florian Hotze <dev@florianhotze.com>
This fixes safe-area issues all over the UI:
- Issues where the safe area was applied to elements where it should
not, e.g. the settings menus' entries.
- Issues where the safe area was missing, e.g. model cards, which were
hidden under the notch.
Due to webpack's CssMinimizerPlugin minimizing `0px` to `0` when
overriding the Framework7 safe area CSS vars, which then broke the
calculation, a new .css file has been introduced.
---------
Signed-off-by: Florian Hotze <dev@florianhotze.com>
- Fix navbar button color and arrangement on iOS devices.
- Remove tooltip for iPhones as it is hidden behing the notch, which
looks weird.
- Fix safe area issues with log table and badge in landscape on iPhone.
- Clean-up code a bit.
---------
Signed-off-by: Florian Hotze <dev@florianhotze.com>
Closes#2883.
This adds a basic log viewer into the Main UI, and displays the logs
from openHAB log file using a websocket connection.
## Overview
This adds the log viewer to the Developer Tools -:
The main logger window is reasonably simple, and a little busy. Log
entries are styled with a background color:
red=error, yellow=warn, greed=info, grey text = trace, no change = debug.
The window scrolls horizontally - the time column
remains fixed, but the log level, class and message scroll left/right.
This allows the user to effectively remove these columns if they desire
by simply setting the horizontal scroll point accordingly.
Across the top in the navbar and the bottom toolbar are a bunch of status and configuration
data/buttons. These are:
* Play button: Continues receiving/processing logs if paused / stopped.
* Pause: Continues to receive logs from openHAB, but doesn't add them to
the display, so the display is static. When Play is pressed, the filter
is updated, so any recent entries will be added.
* Stop: Stops receiving data from the server. The websocket connection
is disconnected - this ensures there is no change to the local buffer.
* Filter input box - this filters the display to display only text in
either the logger name or message containing the filter text (case
insensitive).
* Time of the oldest and latest log entries held in the local buffer.
* Number of log entries currently displayed and in the buffer.
The color of the badge is green if all are displayed, orange if some are
filtered out, or red if the max size of the buffer (2000) is reached.
* Download: Downloads a CSV of the filtered log file for further
processing.
* Copy: Copies the log as HTML to the clipboard. This allows pasting of
the filtered log complete with highlighting.
* Delete: Clears the log buffer.
* Exclamation: Shows `ERROR` logs even if they would otherwise be
filtered out.
* Pen: Configures highlighting (more on this below).
* Cog: Configured logging (more on this below).
## Highlighting
The UI allows the user to add any number of text elements that will be
highlighted. The user can specify a colour, and enable and disable if
the highlighting is active or not. The list of highlights is saved
locally.
## Log Settings
The user can directly manipulate log levels. This allows the user to
simply change the log level for existing packages, or delete the log
entry (restoring it to default) or adding a new logger for a custom
package. If adding a custom package, this gets added as `WARN` level (it
uses the log level provided in the `ROOT` logger), which can then be
changed in the dropdown.
Also-by: Yannick Schaus <github@schaus.net>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>