mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-03 06:54:16 +01:00
Refactor WebUI: - remove jquery dependency from the base custom.js and use vanilla JS - remove jquery + jquery-datatables dependency from the RFM69 module - replace jquery-datatables handlers with pure-css table + some basic cell filtering (may be incomplete, but tbh it is not worth additional 50Kb to the .bin size) - introduce a common way to notify about the app errors, show small text notification at the top of the page instead of relying on user to find out about errors by using the Web Developer Tools - replace <span name=...> with <span data-settings-key=...> - replace <div> templates with <template>, disallowing modification without an explicit DOM clone - run `eslint` on html/custom.js and `html-validate` on html/index.html, and fix issues detected by both tools Streamline settings group handling in custom.js & index.html - drop module-specific button-add-... in favour of button-add-settings-group - only enforce data-settings-max requirement when the property actually exists - re-create label for=... and input id=... when settings group is modified, so checkboxes refer to the correct element - introduce additional data-... properties to generalize settings group additions - introduce Enumerable object to track some common list elements for <select>, allow to re-create <option> list when messages come in different order Minor fixes that also came with this: - fix relay code incorrectly parsing the payload, causing no relay names to be displayed in the SWITCHES panel - fix scheduler code accidentally combining keys b/c of the way C parses string literals on separate lines, without any commas in-between - thermostat should not reference tmpUnit directly in the webui, replace with module-specific thermostatUnit that is handled on the device itself - fix index.html initial setup invalid adminPass ids - fix index.html layout when removing specific schedules
36 lines
761 B
Bash
Executable File
36 lines
761 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -x -e -v
|
|
|
|
cd code
|
|
|
|
case "$1" in
|
|
("host")
|
|
# runs PIO unit tests, using the host compiler
|
|
# (see https://github.com/ThrowTheSwitch/Unity)
|
|
pushd test
|
|
pio test
|
|
popd
|
|
;;
|
|
("webui")
|
|
# TODO: both can only parse one file at a time
|
|
npx eslint html/custom.js
|
|
npx html-validate html/index.html
|
|
# checks whether the webui can be built
|
|
./build.sh -f environments
|
|
git --no-pager diff --stat
|
|
;;
|
|
("build")
|
|
# run generic build test with the specified environment as base
|
|
scripts/test_build.py -e $2
|
|
;;
|
|
("release")
|
|
# TODO: pending removal in favour of code/scripts/generate_release_sh.py
|
|
./build.sh -r
|
|
;;
|
|
(*)
|
|
echo -e "\e[1;33mUnknown stage name, exiting!\e[0m"
|
|
exit 1
|
|
;;
|
|
esac
|