Commit Graph

152 Commits (74be454d153982ef48c7b97a096ac55e51fef1f7)

Author SHA1 Message Date
Chris Jackson 74be454d15
Fix conditional display of sections on settings page (#280)
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
2020-06-20 23:06:41 +02:00
Chris Jackson 58def6bc5d
Don't allow adding new bindings if not supported by server (#281)
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
2020-06-20 14:02:57 +02:00
Chris Jackson 82b36714e3
Fix duplicate thing state being printed (#279)
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
2020-06-18 10:30:14 +02:00
Yannick Schaus 57ac4ab0dd
Fix points names in Add Points to Model scenario (#278)
Fix a bug introduced with #275 when points being added to the model without an
equipment would not have their default name properly computed.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-17 20:12:37 +02:00
Yannick Schaus a41d91f926
Fix desktop HABot interim results regression (#277)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-17 13:30:50 +02:00
Yannick Schaus 23ba7caaf1
Config parameter options shown inline if 5 or less (#276)
Fix parameter not saved when unset & absent from payload on save.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-17 13:30:30 +02:00
Yannick Schaus 238a0aecee
Add Items from Thing: use model picker for parent group (#275)
Use a treeview-based semantic picker to select a parent
location or equipment group item when using the
Add Equipment to Model or Add Points to Model functions
in a Thing's Channels tab.
Replaces the current flat list of group items.

Add functionality to the model picker popup to support this
use case and adjust some texts and controls on the page.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-17 13:30:07 +02:00
Dan Cunningham 98ab3be96b
Main UI Fix for selecting multiple items in the inbox (#273)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-06-16 18:13:14 +02:00
Yannick Schaus 2cf8d8cedf
Main UI HABot client on home page (#271)
This implementation transforms certain cards issued
by HABot for its own GUI to compatible equivalents.
It will not try to transform cards saved on HABot's
"card deck"/CardRegistry because they may have been
modified and compatiblity cannot be guaranteed.

The main UI's client calls /rest/habot/chat with a
`?useCardRegistry=false` option which has to be added
to the API to prevent saved cards from being reused.
This will be done in a separate PR.

The chat input box appears on the home page only if
the "habot" endpoint is present, by calling the root
/rest early to determine the version of the API and
its links (it's stored in the Vuex store for the
remainder of the session for easy access). It's also
possible to disable the feature on a per-device basis
with an option on the about page.

The 5 most recent unique queries will be retained for
quick recalling (also per-device, stored in the local
storage).

For charts, it simply opens the Analyzer window since
since image-related support in widgets is not yet done.
(altered the analyzer to be able to open it with a
predefined initial period).

The "create rule" skill featured in the HABot app with
its dedicated card is not supported.

Refactor OH access layer, add speech interface
Only a browser-based implementation
of speech recognition with
window.webkitSpeechRecognition is
implemented for now, the API is subject
to change.

Dynamic settings menu & sidebar depending on the available endpoints

Reload endpoints after an addon install/uninstall to refresh the UI
(this will allow e.g. service configuration menus and the HABot input box to
appear or disappear without reloading the page)

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-15 22:18:42 +02:00
Yannick Schaus 19178a1386
Standard list item widgets; default widget logic for list display (#270)
Add list items widgets:

- oh-label-item
- oh-toggle-item
- oh-slider-item
- oh-rollershutter-item
- oh-player-item
- oh-stepper-item
- oh-colorpicker-item

Most config options are forwarded to the system
widget displayed on the "after" slot, which may also be
defined in the widgets' definitions.

Move default standalone widget logic to dedicated JS file.

Default list widget logic.

Change the label of the standard library's card widgets.

Add standard list widgets to listWidget metadata editor
picker; add preview sheet.

Misc fixes in global app styles, analyzer.

Let the user choose the list item widget to add in an oh-list.

"Add from Model..." option in new widget action sheets.
Add a model treeview popup to add default widgets (standalone or list)
easily to a layout (block column or masonry) or a list, simply by
browsing the semantic model and picking items.

Other renames and file structure reorganizations.

Add a new action to show group members in a popup, using their
default list representation. Make it the default action for Group items,
for both standalone and list widgets.

Make semantic cards on the home page functional:
Use the default list widgets to render items in the card.
(order not considered for now, but visible and visibleTo
configured in the listWidget metadata might work to filter
out items based on an expression/the current user's roles?)
Remove warning messages.
Make cards (and headers) a little bit thinner.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-06-10 22:56:31 +02:00
Yannick Schaus b0bdefe5b5
Misc style fixes (#265)
Better filled bars defaults

Add per-device option to set the home page background
to the standard color (i.e. gray in light mode, no effect
in dark mode)

Consider safe area (fullscreen iOS) for map, plans, charts

Convert CSS remains to stylus, cleanups, fixes

Add page transition effect option for navigation
widget actions
(https://framework7.io/docs/view.html#custom-page-transitions)

Restyle theme/dark mode pickers

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-27 11:54:59 +02:00
Dan Cunningham e2da5cc16e
Auto selects the color default color scheme based on the system preference (#263)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-05-25 22:15:54 +02:00
Yannick Schaus 344fd6cd03
Conditional visibility fixes for widgets (#256)
- Move visible computed property to widget-mixin
- Fix bug when visible is undefined but visibleTo is not
- Add conditional visibility evaluation for layout widgets (block, row, col)
- Move sidebar account controls to fixed slot (Hopefully prevents some glitches in iOS Safari.)

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-25 11:59:21 +02:00
Yannick Schaus f50d480560
Add HomeKit metadata editor (#261)
Link to relevant docs on the supported third-party integrations using metadata

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-25 11:58:41 +02:00
Yannick Schaus 90ff071a72
REST docs: use the redirect URI as client ID (#257)
Depends on https://github.com/openhab/openhab-core/pull/1496

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-25 11:58:09 +02:00
Wouter Born 3513dadeb1
Fix ConfigurableService deprecations (#262)
Related to: openhab/openhab-core#1491

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-24 00:55:38 +02:00
Wouter Born 4d6a11ffcb
Add more null annotatons (#260)
Adds null annotations to:

* Default UI
* Basic UI
* HomeBuilder
* REST Docs
* Tiles

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-23 11:20:02 +02:00
Wouter Born 764925b0d3
Use constructor injection and update null annotations (#258)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-22 08:30:16 +02:00
Yannick Schaus 551fd92f46
Move the login hint in the sidebar (#255)
* Move the login hint in the sidebar

Displayed only when there are no pages - if there are, it means the admin
user already found the button.
Closes #254.

Change some label texts & empty overview icon.

Make the whole logo area clickable.

Display an indicator when there are no pages to display on the sidebar.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-18 16:42:35 +02:00
lolodomo 32ca168e7f [basicui] Fix for selection widget when no mapping (#253)
Relative to #247

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2020-05-17 21:52:43 +02:00
Yannick Schaus cae84cf2c1
Refactor page editors, conditional visibility (#248)
Move duplicated code in page editors and modals
to mixins.

Move the general page settings form to a common
component.

This also introduces two new common config parameters:

- `visibleTo` allows to restrict the visibility of
  pages or widgets to certain users or roles. It
  accepts an array with strings like:
  `["user:user1", "role:administrator"]`
  Multiple entries are "OR"ed - the component will be
  displayed if any matches.
  If the parameter is not present, the component
  is visible by default (even to unauthenticated users).
  This parameter is available to widgets which accept
  expressions in their configuration (typically in
  layout pages).

- `visible` allows to restrict the visibility of
  a widget based on the result of the evaluation of an
  expression. For example:
  `visible: "=items.Item1.state == 'ON'"`
  This allows to build dynamic pages e.g. by setting
  this property on blocks, grid rows or columns, or
  individual widgets which will appear or disappear
  typically based on the state of an item.
  This property is not evaluated for top-level pages or
  widgets that don't support expressions (charts etc.).

Note that these only restrict the visibility and are not
to be considered as security measures.

Allow to specify `visibleTo` as a general page setting.

Contact-style pages list, allow to group by type

Add visibleTo indication and sidebar order badges

Add pages counter to settings menu

Remove highlight on segmented button controls
(rollershutter, player controls)

Minor lists layout fixes

Move widget config & code editors to components

Restore config sheets on plan & chart page editors

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-17 17:51:30 +02:00
Yannick Schaus 66d73e32c4
Better support for non-editable rules (#243)
Depends on https://github.com/openhab/openhab-core/pull/1451.

Change the rules list to a "contacts" list with initials in
headers and a list index.
Add a lock icon to denote rules which cannot be edited with the
rule editor.

Strip all editing features in the rule editor when the rule is
not editable.

Move the module title/description suggestions to a mixin and add
the new group member triggers.

Fix bug, look & feel in tag editor.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-17 17:50:12 +02:00
Yannick Schaus 3527aaba86
Fix router issues when page animations are disabled (#252)
- Fix router issues when page animations are disabled
- Change some texts and fix some issues on the about page.
- Remove debug leftover

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-17 17:49:07 +02:00
Wouter Born 46962a874a
Add null annotations to REST resources (#249)
- Remove unused language headers from HABotResource
- Remove redundant this references in HABotResource

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-17 17:47:48 +02:00
Wouter Born aa05fab9d2
Migrate to JAX-RS Whiteboard (#242)
* Update REST Docs feature dependency
* Annotate habot for whiteboard
* Fix default UI classpath, fix null context ID warning
* Annotate cometvisu for whiteboard

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-15 14:03:44 +02:00
Yannick Schaus e624727564
Rewrite the Analyzer tool using oh-chart-page (#234)
Leverage the chart component used in pages to
provide an interactive persistence analysis
for arbitrary items, including Numbers, Switches,
Contacts and others (and eventually save the
resulting chart as a page).

WIP: better tooltips (to complete in subsequent PRs
for other types of series).

Add trend lines to default quantifiable numbers cards.

Fix state trackers not properly closed:
The number of state tracker connections would increase when returning to
the thing details page from a link details page.
Also make sure there's only 1 state tracker SSE connection at a given
time - close them before opening a new one.
Decrease the level of most log messages to debug.

Add no-gap to oh-grid-row

Upgrade Framework7 to 5.7.2.

Remove old analyzer components

Add analyze to widget actions

Fix item parameter in multiple mode

No state preview for items being created in model

Better mobile flow when creating new items in tree view pages

Add analyze button for Dimmers

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-05-12 19:51:36 +02:00
Wouter Born 937cf2456c
Infra improvements (#240)
* Update to SAT 0.10.0
* Add sortpom-maven-plugin configuration
* Sort POMs
* Add spotless-maven-plugin configuration
* Apply Spotless changes

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-08 21:33:24 +02:00
Tobias Bräutigam 5f72e38409
[cometvisu] adding rest api for cometvisu manager (#231)
Signed-off-by: Tobias Bräutigam <tbraeutigam@gmail.com>
2020-05-08 20:39:16 +02:00
Yannick Schaus 6d12fe94fe
Display layout page as overview (#235)
Move the UI tiles back to the right panel, and display
a placeholder in the home page's overview tab until a
layout page with an ID of "overview" has been created.
This is (normally?) temporary until a specially-designed
overview page has been implemented - discussion on
https://github.com/openhab/openhab-webui/issues/155).

Various styling fixes & clean up.

Move the onboarding cards to separate component
(not used for now).

Don't display the Back button in a page view if it's shown
on the sidebar.

Layout pages: switch the "add widget" action sheet from
grid to simple list with groups, headers and cancel button.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-27 09:16:55 +02:00
Yannick Schaus 8a41670ca4
nearley items parser: avoid recognizing item types in names (#237)
Fixes #233.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-27 09:08:09 +02:00
Yannick Schaus 82f2934f4d
Some improvements to rule editing, misc fixes (#232)
Remove the ability to close script editors with the ESC key

Save the code being edited when saving the rule (for instance
with Ctrl-S/Cmd-S)

Add Ctrl-R/Cmd-R keyboard shortcut to run the rule

Fix player controls & add oh-player-card as default for Player items
Don't display the title/track part of the player card until items
are set; otherwise only display the playback controls

Add the ability (unstable/not documented for now) to use standard
widgets in modals

Fix modal config not being considered in popover

Fix default slider control min/max bounds using stateDescription

auth: check the token validity when the app becomes visible again
and renew it if necessary

Remove test card widget

Fix rule module reordering

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-19 23:12:53 +02:00
Dan Cunningham aefda74919
avoid rendering markers on every view change (#228)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-04-19 20:56:13 +02:00
Yannick Schaus d5ad2bd5c1
Color picker control (#229)
Make toggle controls compatible with Color items/HSB values

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-19 00:47:06 +02:00
Yannick Schaus 6e003b410c
Items: metadata & group management, improve default rendering (#226)
Add the ability to edit metadata from the items details page
and the semantic model page:

- Provide interactive forms for the alexa, ga, synonyms, widget,
  listwidget, stateDescription, commandDescription namespaces
- Fallback to YAML view for other namespaces (or in a tab for
  supported namespaces as an alternative).

Add "options" widget action to open an action sheet with a list
of command options.

Add default representation for items: look in the widget for
a preconfigured widget (custom or from the standard library),
or try to build a default live representation of the item's state
(WIP), considering its type, state/command descriptions and
other properties.

Change the "current state" part of the items details & link edit
pages with the default representation.

Add a convenient way to add or remove members to/from a group item.

Real-time state display to model and thing details pages

Add rollershutter system control and card to standard library

Add default state representation and metadata editing to
the items details pane in the model page

Misc fixes, improve mobile-friendliness of model page

Harmonize actions below cards, fix homepage hamburger menu

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-18 19:18:02 +02:00
Yannick Schaus 9130557a24
Set the dev server API proxy target with an env variable (#222)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-18 19:10:32 +02:00
Christoph Weitkamp a06c7666f4
[ui] Adapted list of dimensions (#223)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-04-18 19:10:06 +02:00
Yannick Schaus 909226e272
Fix various chart range boundaries problems (#221)
- Don't include the start time of the next period
- Don't include the first day of the next month in calendars
- Fix weekly aggregate series
- Fix rounding bug when abs(point) >= 1000 

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-15 19:07:15 +02:00
Christoph Weitkamp cb3a07b159
Use command options for rendering Switch and Selection elements (#217) (#220)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-04-14 22:40:06 +02:00
Yannick Schaus ca080036f3
Chart pages (#206)
Also-by: Dan Cunningham <dan@digitaldan.com>
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-13 00:25:24 +02:00
Wouter Born 54d7297039
Add null annotations to SubscriptionProvider (#214)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-04-12 16:51:18 +02:00
Yannick Schaus 73f743ae12
Fix rule creation bug (#213)
Introduced by #207 (wrong path param name).

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-07 08:47:28 +02:00
Dan Cunningham 99a29633ad
Allows markers to be visible at both min and max zoom levels. (#209)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-04-06 22:53:08 +02:00
Yannick Schaus b4df833899
Do not display empty channel group headers (#210)
Following discussion on https://github.com/openhab/openhab-core/issues/1402

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-04-04 21:38:22 +02:00
Dan Cunningham 723e55c162
Add zoom visibility property for floor plan markers (#208)
Additional zoom visibility property to markers to show/hide based on current zoom level.

Signed-off-by: digitaldan <dan@digitaldan.com>
2020-03-31 02:26:19 +02:00
Dan Cunningham e88b4ea95c
Adds ability to disable moving or zooming a floor plan. (#204)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-03-27 02:39:19 +01:00
Yannick Schaus 921ca198eb
Optimize webpack bundling (#207)
Split heavy dependencies away from the entrypoint
by using dynamic imports at critical places along with
some cleanup.

Also replace crypto-based `uuidv4()` by `f7.utils.id()`.

This reduces the main app.js by more than 25%
(from >2 MB to around 1.4 MB).

Add npm script to launch the Webpack bundle
analyzer (`npm run webpack-analyzer`) after a
production build.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-27 02:37:18 +01:00
Dan Cunningham 03d08e1df6
Add static path to proxy list to allow images and other assets through (#203)
Signed-off-by: digitaldan <dan@digitaldan.com>
2020-03-26 17:21:07 +01:00
Yannick Schaus f6a2feee49
OAuth2, hide administration pages until authorized (#200)
* Unlock administration pages after authorization
* Support PKCE (RFC 7636)

Depends on https://github.com/openhab/openhab-core/pull/1389.

Implements an OAuth2 authorization flow and token storage.
Hides the admin pages & links until the user is signed in
with an administrator role.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-25 16:41:35 +01:00
Yannick Schaus 6804a55780
Use latest node & npm versions (#202)
* Use latest node & npm versions
* Fix the Basic UI build
* Upgrade frontend-maven-plugin, node-sass (HomeBuilder)

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-25 08:11:57 +01:00
Yannick Schaus 9ae7cdf3ef
Add floorplan pages (#199)
Fix location parameter map pickup
Fix attribution links on maps
Fix popover modals on map icons
Fix about page refresh/purge cache feature
Fix designers context menus cut off at bottom of page

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-06 22:40:09 +01:00