Commit Graph

17 Commits

Author SHA1 Message Date
Maxim Prokhorov
1d2503a19e webui(settings): enumerables for both datalist & select
generalize <options> handlers, providing same entrypoint for both
2025-03-19 04:40:05 +03:00
Maxim Prokhorov
f2153f4a38 webui(settings): allow string id mapping in enumerables
store names as {id: name, ...}, not [{id, name}, ...]
entries appear the same way, and js stores keys in the insertion order

fixup numbers converted to strings
fixup select options typing to accept [string, string] instead of [number, string]
2025-03-19 04:38:39 +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
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
8c40476ab8 webui: event-based name updates
enumerable key:entries[] delivered as events
update span / label as well as select
2024-07-12 18:05:32 +03:00
Maxim Prokhorov
3c4bae2007 webui: filter panel click by data-panel 2024-07-07 08:20:50 +03:00
Maxim Prokhorov
6e07b92b21 webui: type typos, more dynamic checkboxes ignore, local mode 2024-07-05 00:50:48 +03:00
Maxim Prokhorov
53dc51ff41 webui: more typings, clean-up sensor units init 2024-07-04 07:30:50 +03:00
Maxim Prokhorov
585efd2cba webui: more handlers typings 2024-07-02 18:41:29 +03:00
Maxim Prokhorov
a47764c80c webui: separate originals setter for node and list of elems
'FromValuesForNode' is never referencing 'node' when list of elems is provided
'FromValues' with '[]' would simply do nothing

prefer either an explicit list, or a root to perform default query 'input,select'
2024-07-01 19:46:57 +03:00
Maxim Prokhorov
289fea4f3d webui: separate sources per module
* migrate to esbuild from terser, since now js source needs bundling
* (temporary?) hijack inline-source object handling to inline html files
* get rid of legacy removeIf comments in source in favour of explicit
  removal either through bundling tree-shaking and / or manual module-*
  class element removal w/ jsdom
* get rid of multi-layered custom checkboxes in favour of
  `appearance: none` directly styling the `input` elem
  also removes scripting part that was supposed to adjust for=... labels
* update to html-minifier-terser, up-to-date html-minifier fork
* update to iro.js 5.5.x, using npm to manage dependencies
* build script can now update resulting html output
  (called after bundling stage, before minification)
2024-06-22 19:49:59 +03:00