As console logging consumes a considerable amount of time, even when
the browser console is closed (especially since logging objects requires
deep cloning them), implemented a UI wide log level.
The log level allows to only log to the console when the level is above a
set value. These levels mimic the OH server side log levels.
The log level for the browser can be set in an extra developer tools
screen entry, and are persisted in the browser store when set.
The default logging level is INFO (will include ERROR and WARN), thereby
disabling `console.log`, `console.debug` and `console.trace`.
The impact is UI wide.
---------
Also-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
fixes#3096
Adds a new block to allow enabling/disabling rules.
Variables of type Boolean and String are supported. A String with "true"
or "enabled" will be converted to true, all other values will result
into false.
<img width="471" alt="image"
src="https://github.com/user-attachments/assets/30210a96-5adb-4b65-ad45-0e6a082fe486"
/>
I also added Boolean to typed variables as this was missing:
<img width="417" alt="image"
src="https://github.com/user-attachments/assets/30cf9ec1-46bd-45d8-95bc-6fb11ea99a16"
/>
I used "as" because I think this is the most intuitive way of describing
what the block does, in particular when you use "enabled". If anyone has
a better idea to make the block design better, then please provide
feedback. Using a dropdown with Note that "Enable/Disable" ruleUID would
be nicer but would not allow to use variables.
---------
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
This PR depends on https://github.com/openhab/openhab-core/pull/4718.
It does several things, but the major points are:
* It enables regeneration of rules based on rule templates from the UI.
Regeneration can be desirable if the rule template has been updated and
you want the rule(s) to reflect the change, or if you wish to change one
of the parameters, for example to make the rule work with a different
Item.
* It restores the display of read-only/unmanaged rules in the UI. It is
currently broken because all read-only rules are forwarded to the script
editor, effectively hiding the rule editor, unless you modify the URL
manually. This is very relevant for
https://github.com/openhab/openhab-core/pull/4633, whose rules will
otherwise be quite meaningless in the UI (they will still work, but you
won't be able to see what they do from the UI).
* It provides a third tab "Source" to the rule editor that shows the
"source script" used to create the rule, if the rule is supplied via a
JSR223 based scripting add-on, *if* the "source script" is embedded as
metadata with the rule. This is the current practice with most JSR223
based scripting add-on provided rules, and is the only situation where
showing read-only rules in the script editor makes any sense. The
"Source" tab is thus a replacement for removing the forwarding to the
script editor. Rules that have embedded "source scripts" will by default
open in the "Source" tab, so that the difference for these rules will be
minimal, while it also allows other read-only rules to work.
In addition to the above points, there are quite a few bug fixes that I
have come over while debugging/testing this.
There's a lot that could be said about the details here, but I know from
experience that if I attempt to describe everything, people won't read
it. So, I tried to make this description brief, and can instead
elaborate on any subjects on demand.
---------
Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
Co-authored-by: Yannick Schaus <github@schaus.net>
When zooming, instead of just upscaling the previously loaded chart, a
new chart is built using available width as new chart width. Upscale is
kept and will be used in case the user defined a maximum width for
charts that is lower than the available width.
Closes#3139
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This is a follow-up for #2970.
This applies 2 fixes:
1. Extra non-semantic tag was added with value equal to semantic class
when semantic item was moved.
2. On larger models, SortableJS and Vue DOM updates sometimes got out of
sync. This is solved by forcing SortableJS to use the fallback that does
not directly update the DOM.
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Closes#2728.
Closes#969.
Allow drag and drop in the model view:
1. Drag and drop inside the semantic model
2. Move items into the semantic model
3. Move between non-semantic groups (and duplicate)
4. Ask for creation of location, equipment or point if item does not
have a semantic class yet when moving into the semantic model
---------
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
This implements a new series type to show state transitions on a timeline diagram.
The additional settings in the oh-state-series (in addition to the oh-time-series) are:
- yValue (optional) - where the timeline center should be on the y axis.
Note, if using categories, it will simply be the index of the category, defaults to 0.
- yHeight (optional) - the unit (in relation to the y-axis coordiate system) of the height of the timeline, defaults to .6.
- mapState (optional) - a function to classify item states to a set of "string" states
- stateColor (optional) - a map of specified colors to use in the graph for each state.
---------
Signed-off-by: Jeff James <jeff@james-online.com>
Relates to: https://github.com/openhab/openhab-webui/pull/3184#issuecomment-2886630684
- Fixes scroll through the three on iOS, immediately moves elements.
- Fixes dirty warning when selecting an Item.
- Fixes editor gets dirty when collapsing the tree.
- Drag and drop also struggled when there were mutiple equal trees. When
dragging one of these, it could not find the proper new position. This
has been fixed as well.
---------
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
- Add an option to display the log in "Text mode" vs "Table mode".
- In Text Mode, the "Copy" button will copy the log as plain text. In
Table Mode, the "Copy" button does what it used to do before.
- Hovering the mouse pointer over the log name reveals the full name
- Clicking on the log line still brings up the detail dialog
- You can select the text, and copy / paste it into a text file
---------
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This fixes:
- Scrollbar for sitemap tree not visible on narrow screens
- Details sheet not closed resulting in browser error
- Sitemap marked dirty when no icon defined on one of the sitemap
elements
This adds a sitemap element duplicate function. This will duplicate a
sitemap element with all of its sitemap children elements and can
drastically speeds up sitemap creation or editing. Before, the easiest
way was doing this in the code editor. With this change it can easily be
done in the treeview.
---------
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Clicking Save there would create an invalid module with a missing
language, so just hide the save button.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Previously the shortcut Ctrl+Shift+M only worked when the menu wasn't
pinned.
But being able to show the menu is also very handy when the menu was
pinned but hidden because the screen is narrowed.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Closes#2961.
This adds a click handler to the log entries, and then displays a popup with the details of this entry.
This allows long entries to be viewed, as well as (finally) multi-line stack traces.
---------
Also-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
This adds an icon to properties who have values longer then can be
displayed on the thing details page. Clicking this icon brings up the
key and value of the property in a dialog box. This icon only shows if
the value overflows.
---------
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
Make pinned objects persistent within the browser session, so they don't
disappear when closing / reopening the developer sidebar, or when
switching to Help tab and back.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Refs https://github.com/openhab/openhab-core/pull/4734.
This solves the problem with YAML format returning the `version` and
`things` (or `items`) keys for each item in multi-select requests. By
combining them into a single request, only one key will be returned at
the top.
---------
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This shortcut is quite well known from VS Code.
It is basically the same as Cmd+X / Ctrl X, but without putting the deleted stuff into the clipboard.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
To support https://github.com/openhab/openhab-core/pull/4691
- Refactor file definition code into a mixin to create a consistent UI
in inbox, things-list, items-list, item-details, thing, details, single,
and multi-selection.
- Add `Copy` button in Things List which shows up when multi-selection
is active. This makes it in line with Items list and Inbox
- Standardize the list selection UI for inbox, things, items list.
Action buttons/links are closer together in the center now.
- Remove the selection counter off the buttons to make room. The
selection counter is shown in the list title.
- Use one "Copy" button which opens a dialog to select the file
definition format to export/copy to clipboard.
---------
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Refs #1427.
This adds a block to the thing information to provide the status of
firmware. It just shows if there are firmwares available, the current
firmware version and the status.
---------
Also-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
Closes#3146.
Changed label from "Category" to "Icon" to make usage more clear and make it consistent with the documentation.
---------
Signed-off-by: Sebastian Gerber <github@sgerber.de>
Refs https://github.com/openhab/openhab-core/pull/4617.
If the thing provides a default `semanticEquipmentTag`, this will be
used when creating an equipment from thing instead of the default
`Equipment`.
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Previously, autocomplete for parameter text sometimes did not properly
initialize due to receiving the old config descriptions of the previous
profile type.
This fixes this by making sure the config sheet is re-rendered when the
new profile type config has been loaded.
Signed-off-by: Florian Hotze <dev@florianhotze.com>
Previously, the text parameter used a text area and line breaks to separate multiple entries.
This has been reworked to now use a list of single line text fields, and autocompletion for multiple values has been enhanced as well.
Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
Depends on https://github.com/openhab/openhab-js/pull/401
Depends on https://github.com/openhab/openhab-core/pull/4461
This PR extends the Blockly block getting a statistical value from
persistence to be aligned with core and js scripting extensions.
The added statistical function is Riemann sum. This is an approximation
of the integral value and can e.g. be used to calculate an approximation
for energy consumption (in kWh) when the instantanous power (in W) is
persisted.
The existing sum method calculates a naive sum, ignoring the time
dimension and is not applicable for this. It could be used only if the
persistence interval is constant by using the sum and multiplying with
the interval duration.
There are multiple types of Riemann sum calculations depending on which
value is used as an approximation in each bucket. The ones implemented
in core (and js scripting) are: left, right, trapezoidal and midpoint.
If the Riemann sum statistical method block is selected in the block, a
parameter for this will also be shown, defaulting to left.
As average, variance and deviation statistical methods are based on
Riemann sum calculations (the current average calculation assumes
Riemann sums of type left), these methods now also have this extra type
input parameter (defaulting to left).
Note that in most cases, the trapezoidal (or midpoint) methods would
result in better accuracy. However, for backward compatibility reasons,
the default has been kept on left.
---------
Also-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
The code that should check whether an action is configured did only take
the action prop into account, but an action can also be configured
through actionPropsParameterGroup.
Signed-off-by: Florian Hotze <dev@florianhotze.com>
When oh-input is set to a Number item with unit, the f7-input in
'numeric' mode cannot set its numeric value to the item state because it
contains the unit.
This fixes the above issue and:
- Display the number's unit after the input field for numeric type
- Make numeric input field right-aligned
- Improve input-elements alignment
- Accept Enter key to send the value, with or without a sendButton
- Honor useDisplayState config
- Add `min` and `max` config
- If the stateDescription on the item specifies `minimum`, `maximum`, and `step`,
they will be used as the default, but it can be overridden by the widget's config
- Tested against Dimensionless Percent
- Tested against patterns with multiple format specifiers, e.g. `Test
format %1$.4f and %1$.2f %unit%`. The last format specifier will be used.
---------
Also-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Closes#2128.
Replaces abandonded PR #2129.
Displays the Thing location (if any) in the Thing picker and the channel
description in the channel picker,
which improves UX greatly as it allows to distinguish Things easier and
know the channel functionality without having to lookup documentation.
Also disables virtual list for the Thing picker to avoid issues with the
height due to the different entry heights, as the Things page does not
use a virtual list, we should also be fine without here.
---------
Also-by: Dmitry P. (d51x) <dimonich110@gmail.com>
Signed-off-by: Florian Hotze <dev@florianhotze.com>
- Do not always clean install, do only so in mvn `clean` phase.
- Built web app directly to mvn target dir.
- Perform all Main UI related executions in the `prepare-package` phase
to allow faster Java code compilation.
This improves the behaviour when using Eclipse IDE, as the M2E plugin
causes a recompilation "loop" due to the Main UI build writing to a mvn
source folder.
---------
Signed-off-by: Florian Hotze <dev@florianhotze.com>
Closes https://github.com/openhab/openhab-webui/issues/3104.
As the item picker keys where dependent on the length of the selection,
they got recreated each time something was selected. This made
multi-selection impossible.
---------
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
This displays the title when the mouse hovers over.
Useful in case the title overflows and is hidden.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Refs https://github.com/openhab/openhab-core/pull/4569.
This allows us to quickly create the Thing inside a .things file from the discovered Inbox items.
It works when clicking a single inbox entry, and also when multiple entries are selected.
It also adds a count for the number of the selected Things.
---------
Also-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
- Make Widget Config and Widget Code Editor popups draggable by the
navbar, so they can be moved out of the way to view the widget being
edited
- Preview changes immediately on the widget
- The changes can be reverted if desired by clicking the "Reset" link in
the navbar.
- The changes are reverted if the popup is closed without saving.
- Implement dirty checking confirmation
---------
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This frees up screen real estate to see more widgets.
In Edit mode, remove the page settings from the top of editor page.
In createMode, it is still shown at the top as before, but a note added where to find the settings later.
---------
Also-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Things Filtering/Searching & Selection:
- The Thing count is updated to reflect the number of matches found when
performing search/filtering
- When filtering, the invisible Things (i.e. Things that do not meet the
filter criteria) will be deselected. Only Things within the filtered
result can be selected and acted upon (Remove, Disable, Enable). So if
you first selected all your things (e.g. 100 things) then perform
search/filtering which result in 5 things, then the total selected
Things will now be just 5, and when you hit Remove, only those 5 will be
removed.
- Add `Select All` / `Deselect All`. This also works in tandem with
search/filter. When the filtered result shows only 5 Things, Select All
will only select those 5 Things and not all the available Things on the
system.
- It is possible to search and display multiple Things by separating the
search terms with a comma.
## Preload Things List search
- This allows navigating to Things List page with a pre-defined search
terms, also to support the inbox approval feature
Inbox approval:
- `Add as Thing` and `Add as Thing (with Custom ID)` are merged into
just `Add as Thing`. The subsequent dialog will prompt for both the
Thing ID and the Label in one dialog, removing multiple steps.
- Thing UID / ID validation is performed within the Add a Thing dialog,
and the validation status displayed instantly under the Thing ID input
- It also checks against full UID conflicts against existing Things
- When multiple inbox items are selected and `Approve` is clicked, the
user will be redirected to the `Things List` page, with pre-set filter
to show all and only the approved Things.
---------
Also-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Resolves#3054.
- Refactor how the current url is checked inside app.vue.
- Fix a bug where `Settings` menu item in the sidebar isn't highlighted
when viewing the Transformation and Persistence sections.
- Add a new `browserTitle` config for pages other than the `overview` page
- Hide "Sidebar & Visibility" and "Tags" input for the `overview page`.
This frees up some screen real estate for editing widgets
- Every page has a custom browser page title:
- Pages will use its `browserTitle` || `label` config
- Overview page will just use `label` since it's not used elsewhere
- For other pages, use the section menu's text, so if/when this gets
internationalized, the title will also change
- Settings -> System Settings will use `Settings - <navbar title> -
openHAB` and so it's also automatically localized as the navbar title gets localized.
- Settings -> Addon settings will use `<navbartitle> - openHAB` because
the navbar title always starts with "Configure....". Adding "Settings -" in front of it would seem redundant.
- Things/Items/Widgets/Add-on Store/Pages/Rules/Scripts/Scenes will show
`[X] - [uid] - openHAB` e.g. `Things - mqtt:topic:xxx - openHAB`
---------
Also-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This allows to load locales from multiple sub dirs, e.g.:
```js
loadLocaleMessages(require.context('@/assets/i18n/about'), require.context('@/assets/i18n/empty-states'))
```
Signed-off-by: Florian Hotze <dev@florianhotze.com>
It has always been a pain point when the menu is not pinned,
getting back to it is very difficult, involving several "back" clicks,
and sometimes it also gets lost and it became impossible without a full
browser refresh.
This adds a shortcut Alt-Shift-M (similar to Alt-Shift-D) to show the
menu whereever you are.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>