ESPTerm web interface submodule, separated to make testing and development easier
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
Ondřej Hruška f729d91651
minor updates in about.php
6 yıl önce
fontello Import canvas version from old ESPTerm repo 7 yıl önce
img Added content from old ESPTerm repo @ b8ed46cbea0b88730a2a6bad8375790158110910 7 yıl önce
js Stop using weird transforms for double-width 7 yıl önce
lang added a help section about GPIO API, update DE translations 6 yıl önce
out updated build script 7 yıl önce
pages minor updates in about.php 6 yıl önce
sass Merge branch 'fancy-debug' into work 7 yıl önce
.babelrc term_conf refactor, add color pickers 7 yıl önce
.eslintignore term_conf refactor, add color pickers 7 yıl önce
.eslintrc new parser, may be a bit buggy 7 yıl önce
.gitignore Use webpack to load locale data 7 yıl önce
LICENSE.txt Added MPL license file 7 yıl önce
README.md Restructuring 7 yıl önce
_build_assets.sh split build script for easier use with phpstorm file watchers 7 yıl önce
_build_common.sh add lang to css and js output filename to bust cache when changing localized images 7 yıl önce
_build_css.sh add lang to css and js output filename to bust cache when changing localized images 7 yıl önce
_build_html.sh Pass build arguments to build_html and build_js 7 yıl önce
_build_js.sh [lang] Use a PHP script instead of parsing PHP 7 yıl önce
_debug_replacements.php add a form for configuring GPIOs 2, 4, 5 6 yıl önce
_dev_router.php Restructuring 7 yıl önce
_env.php.example Added content from old ESPTerm repo @ b8ed46cbea0b88730a2a6bad8375790158110910 7 yıl önce
_pages.php form to backup and restore 7 yıl önce
base.php use html minifier from npm, optimize help page size 7 yıl önce
build.sh Pass build arguments to build_html and build_js 7 yıl önce
compile_html.php remove line len limit from html minifier 7 yıl önce
favicon.ico Added content from old ESPTerm repo @ b8ed46cbea0b88730a2a6bad8375790158110910 7 yıl önce
index.php Added content from old ESPTerm repo @ b8ed46cbea0b88730a2a6bad8375790158110910 7 yıl önce
package.json upgrade node packages so build works again, compat w node 10 6 yıl önce
server.sh fix server.sh 7 yıl önce
webpack.config.js Fix demo being loaded regardless of ESP_PROD 7 yıl önce
yarn.lock upgrade node packages so build works again, compat w node 10 6 yıl önce

README.md

ESPTerm web interface

This repository contains the ESPTerm web interface source files.

Installation

Run yarn install (if a yarn.lock file is present) to set up the build tools used for JS and SASS. (Otherwise, globally install sass.)

You also need PHP installed (preferably version >= 7, but older may work too). PHP is used to build the HTML files and apply substitutions.

Development

JavaScript source files can be found in the js/ folder, SASS files in the sass/ folder.

Fontello (icon font) is maintained in the fontello/ folder. To update Fontello, replace the fontello.zip file and run unpack.sh in the same folder. This will extract the needed CSS from the zip file and put them into the sass/ folder to be included with the other styles.

To test you changes (after building JS and CSS), run a PHP local server in the project directory using the server.sh script or by a command like php -S 0.0.0.0:2000 _dev_router.php. Template substitutions (that are normally done by the ESPTerm's webserver) applied to the files fior testing can be defined in _debug_replacements.php.

Template strings

Template strings are used to embed substitutions dynamically when serving the web page. They have the format %key%, %j:key% or %h:key%, the prefix j: and h: causes the value to be HTML- or JS-escaped.

HTML escape turns '"<> into HTML entities. JS escape turns '"\<>\r\n into the corresponding JS-string escape sequences (<> use \u003C and \u003E).

macOS Notes

To run unpack.sh and unpack Fontello icons on macOS, you must first install the GNU grep and sed and add them to your path, instead of using the pre-installed BSD versions.

Building

To build the final JS and CSS files, run build.sh. This script also puts static versions of the HTML files in the out/ folder to be retrieved by the ESPTerm's firmware build script.

Files with template substitutions use the .tpl suffix. This ensures they are not pre-gzipped when building the ESPTerm firmware, as .html files are sent to the browser already compressed to save file size and substitutions would not be possible.

Demo build

If the env variable ESP_DEMO is set when running build.sh, those static HTML files will be altered for use in the ESPTerm web demo (i.e. the JS will make no attempts to communicate with the back-end and use dummy values instead).

All files use the .html suffix in a demo build and have replacements applied using _debug_replacements.php.