Commit Graph

748 Commits

Author SHA1 Message Date
Maxim Prokhorov
66e8867033 sch: capitalized type name 2024-11-29 20:05:30 +03:00
Maxim Prokhorov
c8ebbbd697 web: trying to fix lingering validity message
reset custom validity state when editing the input box
2024-11-29 20:05:30 +03:00
Maxim Prokhorov
442346708d web: dynamic types and fpstr to sv conversions
de-hardcode sch and led enumeration types from .html
publish raw type & pretty-string from .cpp indexed settings

de-fpstr string view references, use the object directly

publish 'faulty' schedule specs indexes, focus & report elems
ref. #2626

should fix faulty enum<->number references in selects
ref. #2628 - schedule types were numeric, while websocket delivered strings
2024-11-29 20:05:30 +03:00
Maxim Prokhorov
9427286a9b webui: rebuild blobs 2024-09-10 16:54:30 +03:00
Maxim Prokhorov
4000d3538c mqtt: use-json -> json
rename settings key and the corresponding build flags
2024-09-10 16:11:27 +03:00
Maxim Prokhorov
1f93ce4f29 mqtt: settings refactoring & custom topics
- customize will topic qos and retain, ref. #2616
- allow to fully replace will and json topics.
  empty string means the default <root>/<name>
  replacement is taken as-is, after applying placeholders
- validate will and data topic structure before connecting
- validate {suf,post}fix as {suf,post}fix, not as topic
2024-09-08 01:11:56 +03:00
Maxim Prokhorov
cfb83300d0 test: node does not like when gc closes files
> (node:1916) Warning: Closing file descriptor 31 on garbage collection
> (Use `node --trace-warnings ...` to show where the warning was created)
> (node:1916) [DEP0137] DeprecationWarning: Closing a FileHandle object on garbage collection is deprecated. Please close FileHandle objects explicitly using FileHandle.prototype.close(). In the future, an error will be thrown if a file descriptor is closed during garbage collection.
> (node:1916) Warning: Closing file descriptor 32 on garbage collection

per https://nodejs.org/api/deprecations.html#DEP0137
explicitly close after reading
2024-08-24 01:57:41 +03:00
Maxim Prokhorov
2f255c042f webui: same-ey fields for host & ip addresses, fix message alignment 2024-08-22 23:40:32 +03:00
Maxim Prokhorov
8edb7b6333 sch: relative time spec for events
Reference calendar time of other schedules, user-created named events
or the sun{rise,set} (when enabled)

For example
- '15m before sunset'
- '30m after cal#0'
- '1h15m after "foobar"'

Empty time spec is allowed, defaults to '1m'
'before sunrise' is the same as '1m before sunrise'

Internals are reworked to handle a more generalized 'Event' type, based
on the 'time point' and 'event' base classes fron sunrise and sunset

Sunrise and sunset should also track 'last' event as well as 'next
(not currently displayed anywhere, though)
2024-08-22 23:40:31 +03:00
Maxim Prokhorov
71493cc9cb webui: heartbeat select[multiple] with everything in view
explicit size aka number of rows
2024-08-14 13:42:09 +03:00
Maxim Prokhorov
4c005fa9a5 webui: fix password reveal pushed to the next line
narrow screens style rule makes input & span `display: block`
revert to `inline-block`, assume parent node properly separates stuff
2024-08-13 20:59:11 +03:00
Maxim Prokhorov
5334739469 webui: key->value element setters with node root
allow to init limited set of elements, not whole document
update tests for 08f521dc35
2024-08-13 17:53:26 +03:00
Maxim Prokhorov
08f521dc35 webui: ignore group inputs when using generic setters
input[name=foo] means input[name=foo#] in groups, never name as-is
resolve #2615
2024-08-11 13:58:10 +03:00
Maxim Prokhorov
6bfed33469 webui: some margin between checkboxes and info messages 2024-08-10 11:40:20 +03:00
Maxim Prokhorov
5f500ffb1c webui: apply pure-menu-selected style after menu item click
- distinguish heading and selected menu item, apply menu item
  background color after panel item is selected
  for now, both heading and :first-child use a different color
- add x3 transition time to stall animation from hover & focus
  otherwise, background colors may linger between clicks
2024-08-09 22:03:00 +03:00
Maxim Prokhorov
1041bcb26e webui: correctly send NaN and compress numeric strings
convert NaN into "nan" string for remote, since JSON does not have NaN type
always -2bytes from quotes surrounding the numeric value
2024-08-09 14:53:24 +03:00
Maxim Prokhorov
29787143bf webui: expected emon app keys leaking into settings
disable on-change listener for webui-only inputs
also assuming input[readonly]s never needs to be commited
2024-08-09 14:25:19 +03:00
Maxim Prokhorov
c4c31fc5f0 sns: numeric settings are using fixed ids
Fixing inconsistent handling of group and non-group settings after rewrite.
Assuming most of the time template would be for group, manually reset
dataset field controlling automatic key${id} generation
2024-08-09 13:46:04 +03:00
Maxim Prokhorov
fc8ef5a298 sns: min & max threshold, revert zero threshold changes
- same as min & max delta, check the value itself before reporting
- refactor more of the report func, revert zero threshold to force the
  value to be zero. move condition check to the top, causing every other
  filter to check against zero.
- force zero threshold to be >= 0 in ui
2024-08-09 12:47:31 +03:00
Maxim Prokhorov
68892a0066 all: remove extra whitespace 2024-08-09 12:47:31 +03:00
Maxim Prokhorov
5ad894b915 tspk: naming, required fields 2024-08-09 12:46:10 +03:00
Maxim Prokhorov
ba067f726e rules: inline units 2024-08-09 12:46:10 +03:00
Maxim Prokhorov
80d5007cea mqtt: config required fields 2024-08-09 12:46:10 +03:00
Maxim Prokhorov
cbef053f69 light: inline units 2024-08-09 12:46:10 +03:00
Maxim Prokhorov
14b05e67eb idb: config required fields 2024-08-09 12:46:10 +03:00
Maxim Prokhorov
ca2f6ff083 ha: clarify prefix config, mention components 2024-08-09 12:46:10 +03:00
Maxim Prokhorov
458b3b9b6e ha: swap publish and clear colors 2024-08-09 12:46:10 +03:00
Maxim Prokhorov
1ca0dcc76b ntp: more settings in webui
sntp startup and update delays & dhcp toggle
2024-08-09 12:45:37 +03:00
Maxim Prokhorov
5ab317a9a0 sns: rework'ed report conditions, filter restart()
- preserve units for cached values, remove extra process() call for webui data
- reset magnitude filter state when value units change
- min & max delta checks only for report value, remove separate checks for read and report
- zero threshold only affects reports, amend ac993c7b4b
- pending BaseFilter::available() and BaseFilter::ready(), replacing BaseFilter::status()
  distinguish readiness between having *some* values and *enough* values
- pending BaseFilter::restart(), separate from BaseFilter::reset(), which
  should allow filter to drop existing value when it is not possible otherwise
  w/ just continuing normal BaseFilter::update()
2024-08-08 20:14:55 +03:00
Maxim Prokhorov
bc6af422ae sch: clarify location units 2024-08-06 15:30:42 +03:00
Maxim Prokhorov
e9497912e1 webui: duplicated error text 2024-08-06 13:28:09 +03:00
Maxim Prokhorov
08c4cdd3c0 webui: missing type="number" required
amend de2f96a7eb
2024-08-03 01:46:07 +03:00
Maxim Prokhorov
a0ed9b0e82 test: sync webui data 2024-08-03 01:31:45 +03:00
Maxim Prokhorov
af3f83841f emon: side-by-side current and expected values 2024-08-03 01:31:45 +03:00
Maxim Prokhorov
2c8470c11c sns: poll the remote until sensors are ready 2024-08-03 01:31:45 +03:00
Maxim Prokhorov
5f830c28ce sns: redundant code in units and energy ui
also fix template anonymous types warnings
2024-08-03 01:31:45 +03:00
Maxim Prokhorov
de2f96a7eb webui: disallow empty type[number]
...unless necessary, like with magnitude zero threshold
2024-08-03 01:31:45 +03:00
Maxim Prokhorov
8d8d60fb81 sns: nicer inputs and reworked units ws payload
send tuples per unit type, not per magnitude
fix label and span init order for magnitude settings
2024-08-03 01:31:45 +03:00
Maxim Prokhorov
4fda84082a setup: missing panel switch trigger
password panel should not show up on initial page load in normal mode
2024-08-03 01:30:53 +03:00
Maxim Prokhorov
8fcf4a842d webui: custom enumerable callback 2024-07-30 01:18:18 +03:00
Maxim Prokhorov
2e6389002f webui: numeric inputs and NaNs
allow empty numeric input
fix element setters sometimes forgetting to set the value
fix NaN equality comparison for element value getters
2024-07-30 00:37:29 +03:00
Maxim Prokhorov
4807a95627 test: extra condition check for #2613 2024-07-25 22:38:47 +03:00
Maxim Prokhorov
a2cd6857b1 webui: password pair validation fixes
move isChanged check to validator, always return both inputs for the given form
add assumeChanged?: boolean to opts, allowes forced check (similar to getData option)
small layout test for password and general forms, resolve #2613

attempt to make 'original' === undefined return consistent value
2024-07-25 22:01:58 +03:00
Maxim Prokhorov
6716780f1f rfb: no spellcheck for hex codes 2024-07-17 21:46:49 +03:00
Maxim Prokhorov
a12e734ee7 webui: show panel and elem when failing validation
expect regexp to validate length too
simplify hostname checks

more module shuffling, move ui ids into a separate one

amend 72fbdc2425
amend ed26dbda8b
2024-07-17 21:42:29 +03:00
Maxim Prokhorov
71d96ed316 webui: fix "listen to" naming, proper array usage 2024-07-15 15:56:43 +03:00
Maxim Prokhorov
18ce6690bf webui: typo 2024-07-13 11:22:53 +03:00
Maxim Prokhorov
d72c653483 webui: bump to pure-css 3.0.0
missed 2.0.5 release media queries for hi-res screens
mention side-menu layout css origin
2024-07-13 11:02:30 +03:00
Maxim Prokhorov
351ca62184 webui: dispatch event with urls payload
and just store as a dataset item on the button
2024-07-13 10:48:46 +03:00
Maxim Prokhorov
72fbdc2425 webui: password webmode as a panel 2024-07-12 20:55:09 +03:00