Commit Graph

47 Commits

Author SHA1 Message Date
Maxim Prokhorov
7260ec833a all: fix typos, spelling, phrasing
resolve #2645 w/ some extra corrections
2025-06-03 21:25:44 +03:00
Maxim Prokhorov
e7acf9fb6a webui(build): rollup circular dependency
avoid sharing utility funcs through the main module
2025-04-14 04:08:48 +03:00
Maxim Prokhorov
a593009fbd webui(settings): clarify dataset[...] and query for data-... 2025-03-31 19:55:13 +03:00
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
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
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
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
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
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
71d96ed316 webui: fix "listen to" naming, proper array usage 2024-07-15 15:56:43 +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
Maxim Prokhorov
ed26dbda8b webui: more annoying group input/select
revert set:/del: merge, do not allow to miss key pruning

allow certain fields to have 'unset' state via 'required' attribute
ensure 'unset' fields cannot be added to data payload

generate ui tooltip when 'unset' field is created in a group or erased by user

ref. #2612
2024-07-12 18:27:42 +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
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
c3e587d6fd webui: attempt to reduce wifi element searches 2024-07-03 02:09:34 +03:00
Maxim Prokhorov
0157a62f69 webui: fix empty actions, typings for connection and errors 2024-07-03 01:18:08 +03:00
Maxim Prokhorov
937a51d0d4 webui: missing type="range" in input setter 2024-07-02 18:43:07 +03:00
Maxim Prokhorov
3a2da6341e webui: group element indexing typo 2024-07-02 18:42:43 +03:00
Maxim Prokhorov
41e8360e25 webui: pending changes canceling out 2024-07-02 18:41:59 +03:00
Maxim Prokhorov
585efd2cba webui: more handlers typings 2024-07-02 18:41:29 +03:00
Maxim Prokhorov
28c748e393 webui: types for templates, clean-up consumers 2024-07-01 23:24:22 +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
b286859d7a webui: select value list as stringify func input 2024-07-01 19:42:52 +03:00
Maxim Prokhorov
7926c44b9c webui: keep save button green with pending changes
change event handler should not apply style without checking settings 'changed' property first
export extra func to determine whether element 'changed' attribute itself was changed
2024-07-01 16:12:48 +03:00
Maxim Prokhorov
efd2da6269 webui: enumerables getter cannot return undefined 2024-07-01 16:10:39 +03:00
Maxim Prokhorov
f5b0340cea webui: bogus original update when setting select 2024-07-01 16:10:15 +03:00
Maxim Prokhorov
7870972492 webui: select setter always replaces the value 2024-07-01 16:09:42 +03:00
Maxim Prokhorov
10d93daf69 webui: span value replacement and argument fixes
separate span and input,select handling in kvs updater
ensure array value can be passed into the handler
ensure value is converted into a string before string operations happen
2024-06-30 17:33:52 +03:00
Maxim Prokhorov
1b58c24e7f webui: boolean.toString(), typeof is an expression 2024-06-30 17:28:01 +03:00
Maxim Prokhorov
bf85dc7aed webui: data attribute for pre= and post= 2024-06-30 17:28:01 +03:00
Maxim Prokhorov
cca45a69be webui: getGata fixes
inverse logic for 'get everything' agrument (currently, only external use)
search specific forms vs. all document when performing cleanup
more explicit types, allow imports
2024-06-30 17:28:01 +03:00
Maxim Prokhorov
764ff09116 webui: settings-group-add unused payload 2024-06-29 02:01:07 +03:00
Maxim Prokhorov
c442d0f3a2 webui: stricter types for events 2024-06-29 02:00:33 +03:00
Maxim Prokhorov
d9e3774f17 webui: typo 2024-06-29 01:52:08 +03:00
Maxim Prokhorov
300c9b64b3 webui: initial clean-up
trying to streamline get/set for element data
switch on actual type instead of tag, since ts seems to like that more
2024-06-29 01:51:14 +03:00
Maxim Prokhorov
4f520a8798 webui: consistent settingsMax check
remove leftover manual template merge, idForContainer() should just use template-id data key
group add event now checks that instead, raising alert when number is greater than max

ref. #2610
2024-06-24 22:43:19 +03:00
Maxim Prokhorov
ce5ada9d32 webui: type filter for element setters 2024-06-24 22:43:19 +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