Commit Graph

1771 Commits (main)

Author SHA1 Message Date
stefan-hoehn ac2d89abdd
Add blockly "rule enable" block (#3209)
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>
2025-06-15 20:05:12 +02:00
Nadahar 548d1c6d36
Regenerate rule templates (#3197)
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>
2025-06-15 19:49:05 +02:00
lolodomo f1bc650743
[BasicUI] Reload the chart with higher dimensions when zooming (#3183)
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>
2025-06-14 13:55:46 +02:00
stefan-hoehn c12c18cdde
[blockly] Fix typed var not working for dictionary (#3210)
Fixes #3038.

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2025-06-06 19:02:15 +02:00
Holger Friedrich b76889373a
Add top dir marker for Maven 4 (#3203)
This suppresses the warning about missing top level directory marker
during build with Maven 4.
The approach to add `.mvn` dir is the option to do it which does not
impact our standard builds with Maven 3.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2025-06-01 11:16:26 +02:00
Dan Cunningham 6c66733bd9
Add Matter metadata (#3129)
Refs https://github.com/openhab/openhab-addons/pull/18486

---------

Also-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
2025-05-28 17:23:40 +02:00
Mark Herwege 60d7f8cf3f
Model editor: drag drop fixes (#3199)
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>
2025-05-26 20:46:10 +02:00
openhab-bot 2e9c8c8e0c
New Crowdin updates (#3189) 2025-05-26 20:31:05 +02:00
Florian Hotze 2b5be47e9e
Analyzer: Add comment to silent series option (#3196)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-05-26 20:21:51 +02:00
Florian Hotze 63a00c254e Regenerate component docs
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-05-21 14:01:40 +02:00
Florian Hotze 68df4be547
Widget actions: Add aggregation type parameter for analyzer action (#3195)
Closes #3088.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-05-21 14:00:50 +02:00
Florian Hotze 3742650a9e Regenerate component docs
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-05-21 11:39:35 +02:00
Mark Herwege 6bdfe408e6
Model editor: Add drag & drop (#2970)
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>
2025-05-21 11:32:19 +02:00
jsjames d17072ae31
Charts: Add oh-state-series to render state transitions over time (#3179)
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>
2025-05-21 00:41:54 +02:00
Mark Herwege 5d01ce3efc
Sitemap editor: Various fixes (#3194)
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>
2025-05-19 19:33:30 +02:00
Nadahar 68d47c5d22
Fix Python syntax highlighting (#3193)
The MIME types for Jython/Python were changed, breaking syntax
highlighting in the script editor:
https://github.com/openhab/openhab-addons/pull/18616

Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
2025-05-19 16:04:26 +02:00
Florian Hotze 63a3c33fa6
Make Vue clipboard plugin available globally (#3192)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-05-16 12:10:36 +02:00
jimtng 794f5e9ee1
Log Viewer: Add text mode option (#3177)
- 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>
2025-05-16 11:49:43 +02:00
Mark Herwege 1ae5fc6ec5
Sitemap editor: Small fixes & Add duplicate element functionality (#3184)
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>
2025-05-16 11:31:11 +02:00
jimtng 7133f9e79d
Log Viewer: Add next/prev to log details popup & make it movable (#3172)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-05-16 11:30:52 +02:00
Mark Herwege a266cf03d4
[Blockly] Add previous state item fields (#3166)
This adds the previousState item enhancements to Blockly.
Refs https://github.com/openhab/openhab-core/pull/4351.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2025-05-16 11:20:59 +02:00
openhab-bot 5579ef8ffc
New Crowdin updates (#3151) 2025-05-05 10:46:26 +02:00
jimtng 3fefe9042e
Rule Module Popup: Hide Save link on inline script language selection (#3174)
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>
2025-05-05 10:43:45 +02:00
jimtng 7add1895f2
Left Menu: show with shortcut when pinned but hidden (#3170)
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>
2025-05-05 10:40:48 +02:00
jimtng 0e37ba676b
Add Widget: Sort Personal Widgets (#3175)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-05-05 10:38:57 +02:00
jimtng b907329a70
Thing Edit: Thing UID should not change when bridge is changed (#3173)
Regression from #3009.

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-05-05 10:37:16 +02:00
Holger Hees d661f558f7
Add mime type & code snippet for PY transformation (#3169)
Signed-off-by: Holger Hees <holger.hees@gmail.com>
2025-05-05 10:36:14 +02:00
lolodomo ec871afa97
[BasicUI] Enable dynamic icons for Chart element (#3182)
Fix #3176

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2025-05-04 11:49:42 +02:00
jimtng b67616fd79
[BasicUI] Shrink labels before values (#3143)
Resolve #3094

Here's an animated gif:

![label-value-width](https://github.com/user-attachments/assets/fc4a60db-dd00-4c8a-9c4d-94bebb1f0ac0)

---------

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-05-04 09:51:05 +02:00
Chris Jackson efe3fefd4f
Add log details popup (#3160)
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>
2025-04-28 21:31:38 +02:00
Dan Cunningham afe96e1c4a
Thing details: Add dialog view for properties with overflow key/values (#3162)
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>
2025-04-28 19:53:07 +02:00
jimtng 7c0e759b04
Developer Sidebar: Make pinned objects persistent (#3164)
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>
2025-04-28 19:48:40 +02:00
jimtng 67409fe3e4
Addon Store: Add Python Scripting to featured automations (#3168)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-04-28 19:46:59 +02:00
jimtng c9c4ab6f76
Copy File Definition: Process multiple objects with single api request (#3163)
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>
2025-04-23 23:01:16 +02:00
jimtng 19c3a42d60
Script Editor: Add shortcut key Shift+Cmd+K/Shift+Ctrl+K to delete the current line (#3156)
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>
2025-04-20 14:48:40 +02:00
jimtng e3812d5105
Add Copy Thing YAML file definition & Refactor copy file definition code (#3130)
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>
2025-04-20 14:42:22 +02:00
Chris Jackson 0b6159401a
Show thing firmware status (#3158)
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>
2025-04-20 11:43:34 +02:00
jimtng 57a7f1dae4
Sidebar Search: Fix rules/scenes/scripts search result count (#3159)
Fixes #3157.

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-04-20 11:14:56 +02:00
dependabot[bot] 4d00851a3e
Bump http-proxy-middleware from 2.0.7 to 2.0.9 in /bundles/org.openhab.ui/web (#3154)
Bumps
[http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware)
from 2.0.7 to 2.0.9.

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-16 22:59:30 +02:00
Nadahar 270d80f022
Remove ESLintPlugin from webpack build (#3142)
Removed `ESLintPlugin` execution from the webpack build as discussed
at https://community.openhab.org/t/using-eclipse-with-openhab-webui/162923/30.

Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
2025-04-16 22:51:58 +02:00
spacemanspiff2007 64a0bf08df
Item edit: Relabel category to icon (#3149)
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>
2025-04-16 10:21:56 +02:00
Mark Herwege 0864b52e09
Persistence edit: Support configuring aliases (#3070)
Configuration in the UI for persistence alias changes introduced in
https://github.com/openhab/openhab-core/pull/4363.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2025-04-15 23:34:23 +02:00
Florian Hotze d8a31769d2
Layout edit: Fix details chevron up icon/link missing (#3153)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-04-15 22:07:14 +02:00
Florian Hotze 266f5dbbae
Align search behaviour in case of nothing found (#3152)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-04-15 19:09:12 +02:00
jimtng eaee49c9f6
Items List: Add select all / deselect all (#3144)
Also-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-04-15 18:26:06 +02:00
Mark Herwege 9e3b377796
Create equipment from model: Use semanticEquipmentTag of Thing (#3124)
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>
2025-04-15 17:43:42 +02:00
jimtng 56ee4d15e0
Inbox List: Add select all / deselect all (#3145)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-04-15 17:42:17 +02:00
jimtng df5f0e3cc2
[BasicUI] Add a setting to render buttons with rounded corners (#3147)
<img width="549" alt="image"
src="https://github.com/user-attachments/assets/75ec1b38-2cab-49bb-bfb2-e074f201e4a2"
/>

<img width="557" alt="image"
src="https://github.com/user-attachments/assets/2a8b2f90-8139-4c1f-92cd-4720f760453a"
/>


Default:
<img width="384" alt="image"
src="https://github.com/user-attachments/assets/6b2c421b-4306-48b5-8233-099b5ca43124"
/>

Rounded:
<img width="378" alt="image"
src="https://github.com/user-attachments/assets/06651f04-1aaa-413b-b08b-b60ddfc0712f"
/>


Pill:
<img width="378" alt="image"
src="https://github.com/user-attachments/assets/0e716d1e-f499-43f6-94f4-3fd992c65c5d"
/>

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-04-13 12:16:11 +02:00
jimtng 0404c5eb47
[BasicUI] Remove top/bottom margins in buttons-multiline (#3148)
Before:
<img width="882" alt="image"
src="https://github.com/user-attachments/assets/cfd7b872-ecc0-487d-a1dd-4b56b3da03b7"
/>
condensed mode:
<img width="847" alt="image"
src="https://github.com/user-attachments/assets/54ee7e8e-f980-4505-b9ae-54f02562b331"
/>


After:

<img width="881" alt="image"
src="https://github.com/user-attachments/assets/2f75f02e-4dfe-4eba-84e3-005a07aefe95"
/>

condensed mode:
<img width="854" alt="image"
src="https://github.com/user-attachments/assets/f66904d7-25f5-4d14-85aa-0e1ec499211f"
/>


```java
sitemap test {
    Text item=TestString1 label="Test"
    Switch item=TestSwitch1 label="Test" mappings=[ON="ON Label", OFF="OFF label"]
    Text item=TestString1  label="Test"
    Switch item=TestSwitch1 label="Test" mappings=[ON="ON Label", OFF="OFF label"]
}
```

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-04-12 16:28:18 +02:00
Florian Hotze ac6dff3941
Link add/edit: Fix config-sheet not properly re-rendered on profile type change (#3141)
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>
2025-04-08 22:19:48 +02:00