783 Commits

Author SHA1 Message Date
Maxim Prokhorov
d49b33def3 webui(settings): default to step="any" for generic number inputs
per. https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/step implicit default is step="1"
> If not explicitly included, step defaults to 1 for number and range, and 1 unit type (minute, week, month, day) for the date/time input types.
> The value must be a positive number - integer or float — or the special value any, which means no stepping is implied and any value is allowed
> (barring other constraints, such as min and max)
>
> Only values which are a whole number of steps from the step base are valid.

.checkValidity()/.reportValidity() enforce the rule, making these values
impossible to set (besides manually setting the kv through console)

also clean-up any defaults & suspicious use in specific modules

resolve #2651
2025-08-29 18:06:20 +03:00
Maxim Prokhorov
61c5cd7651 webui(build): remove mistakenly set src/*.html binary attribute 2025-08-29 18:05:56 +03:00
Maxim Prokhorov
82feb95daa test(build): configurable paths & .gitignore test caches
add one more level of directories for build config & its cache
replace test/pio_cache w/ test/build/cache
2025-06-08 22:07:56 +03:00
Maxim Prokhorov
7260ec833a all: fix typos, spelling, phrasing
resolve #2645 w/ some extra corrections
2025-06-03 21:25:44 +03:00
Maxim Prokhorov
b2fa614c39 webui(build): un-vendor clone-stats & bump deps
amends 9ccef13050
fixed in vinyl-fs 4.0.1
2025-06-01 05:57:55 +03:00
Maxim Prokhorov
43eefd6124 webui(build): sync dependencies
build output is the same as before, no need to recreate blobs
attempt to fix clone-stats-node22 name field sometimes appearing in lockfile
2025-05-06 01:08:09 +03:00
Maxim Prokhorov
b41a20aa86 webui(build): support type=...;base64
in case there are any unquotable or binary sources

SCRIPT is an odd one per the spec, ignore type=...
as it is describing how minification & bundling is done
2025-04-15 20:43:01 +03:00
Maxim Prokhorov
fc5a5f4d40 webui(preset): .env unused 2025-04-14 05:18:25 +03:00
Maxim Prokhorov
4b624a2e99 webui(lib): missing file 2025-04-14 04:56:15 +03:00
Maxim Prokhorov
68631fbbcd webui(build): gulp html modifications should not happen in parallel
Promise.all() does not handle array members in sequence
2025-04-14 04:47:00 +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
e0cc18b4e9 webui(doc): preset configuration & files 2025-04-14 04:08:48 +03:00
Maxim Prokhorov
0853a8e346 webui(build): .ico -> .svg favicon
initial generation via https://picsvg.com/
> Created by potrace 1.10, written by Peter Selinger 2001-2011

compressed via https://jakearchibald.github.io/svgomg/
2025-04-14 01:14:13 +03:00
Maxim Prokhorov
9dc57878c1 webui(build): build params & vite dev support
- experimental vite dev server support
- gulp webui_build & webui_PRESET -> build
- gulp task params for build and dev server
- bundle sources using rollup in both gulp and vite
- PRESET lib to manage available modules and their constants
  replacing 'define' method of .js code treeshaking
2025-04-14 01:14:13 +03:00
Maxim Prokhorov
cbd28d26e4 webui(build): separate stylesheet files per module 2025-04-05 00:24:38 +03:00
Maxim Prokhorov
5152dc9958 webui(template): missing password-reveal click handler 2025-04-04 18:50:57 +03:00
Maxim Prokhorov
70b9843288 webui(debug): local cmdoutput instance & dev log output
avoid awkward `... | null` for the console text elem member var
update handlers to also clear up oldest lines when pushing new ones
2025-04-04 17:13:43 +03:00
Maxim Prokhorov
1697f0193f webui(local): do not attach network event handlers 2025-04-04 17:12:37 +03:00
Maxim Prokhorov
60ace03ef3 webui(menu): status highlighted inconsistently 2025-04-03 16:17:00 +03:00
Maxim Prokhorov
db84cdda5e webui(ws): try to contain wsSend to the queue callback
- 'log' payload nesting reduced, just one element (for now)
- move terminal and ws logger into ws helper classes
- 'manual' callback mode to simply allow for ws send window
  by using slightly more complicated loop w/ queue checks, though
2025-04-02 23:03:32 +03:00
Maxim Prokhorov
00c3df0954 webui(build): group test & build 2025-04-01 03:00:12 +03:00
Maxim Prokhorov
e890b0be76 webui(build): allow both gzip and br in the builder
- switch to 'br' by default. convert relevant file references in the web.cpp
  .h -> .ipp and drop compression type from the filename
  'webui_content_encoding' string to help out the server
- build options now include both minification and compression type
- make sure output file syntax is valid when opening it standalone
2025-04-01 03:00:08 +03:00
Maxim Prokhorov
9ccef13050 webui(build): vendor clone-stats & bump deps 2025-03-31 20:54:12 +03:00
Maxim Prokhorov
5c0c20d046 webui(build): cleanup ci & mention tools in the readme
no need to manually invoke things when gulpfile already does it
c/p commands into the readme to handle any other use case
2025-03-31 19:55:14 +03:00
Maxim Prokhorov
181c12d719 webui(build): include vitest runner 2025-03-31 19:55:14 +03:00
Maxim Prokhorov
151b2bcebc webui(build): clarify gulp commands and tasks tree 2025-03-31 19:55:14 +03:00
Maxim Prokhorov
f98565e528 webui(build): missing builder readme.md 2025-03-31 19:55:13 +03:00
Maxim Prokhorov
108ee655fe webui(build): pipeline instead of pipe
ref.
https://github.com/gulpjs/gulp/issues/2812
https://nodejs.org/en/learn/modules/how-to-use-streams#how-to-operate-with-streams
https://nodejs.org/en/learn/modules/how-to-use-streams#pipeline

while the gulp issue refers to this as a workaround, this is actually the
proper way to handle streams, merging streams and applying transformations

webserver code still spawns the pipe(line) unconditionally, though
2025-03-31 19:55:13 +03:00
Maxim Prokhorov
a593009fbd webui(settings): clarify dataset[...] and query for data-... 2025-03-31 19:55:13 +03:00
Maxim Prokhorov
0e4ae21368 webui(lint): explicit file patterns
eslint v9 replaces empty pattern list with a ['.']

ignore known directories when running locally
explicit paths for eslint in the ci script
2025-03-19 23:56:03 +03:00
Maxim Prokhorov
efffead793 webui(settings): datalist enumerable for ntp timezones
making use of the feature to programatically generate offset options
additionally, saves 38bytes in the resulting blob
2025-03-19 04:41:06 +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
d7af980bdf test(webui): enumerables spec extended
minimum viable checks for ranges and manually created entries
listen to and trigger events for span & select enumerable elements
2025-03-19 00:05:16 +03:00
Maxim Prokhorov
fa5af86d0e webui: lint eqeqeq 2024-12-07 11:50:26 +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
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