-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
365 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Change the IP address to that of your ESP device to enable local development of the UI. | ||
# Remember to also enable CORS in platformio.ini before uploading the code to the device. | ||
# REACT_APP_ENDPOINT_ROOT=http://192.168.0.20/rest/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
REACT_APP_ENDPOINT_ROOT=/rest/ | ||
GENERATE_SOURCEMAP=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,3 +78,6 @@ typings/ | |
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# local build settings | ||
local.settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const ManifestPlugin = require('webpack-manifest-plugin'); | ||
const WorkboxWebpackPlugin = require('workbox-webpack-plugin'); | ||
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | ||
const CompressionPlugin = require('compression-webpack-plugin'); | ||
// const ProgmemGenerator = require('./progmem-generator.js'); | ||
|
||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
module.exports = function override(config, env) { | ||
if (env === "production") { | ||
// rename the ouput file, we need it's path to be short, for SPIFFS | ||
config.output.filename = 'js/[id].[chunkhash:4].js'; | ||
config.output.chunkFilename = 'js/[id].[chunkhash:4].js'; | ||
// shorten css filenames | ||
const miniCssExtractPlugin = config.plugins.find((plugin) => plugin instanceof MiniCssExtractPlugin); | ||
miniCssExtractPlugin.options.filename = "css/[id].[contenthash:4].css"; | ||
miniCssExtractPlugin.options.chunkFilename = "css/[id].[contenthash:4].c.css"; | ||
|
||
// take out the manifest and service worker plugins | ||
config.plugins = config.plugins.filter(plugin => !(plugin instanceof ManifestPlugin)); | ||
config.plugins = config.plugins.filter(plugin => !(plugin instanceof WorkboxWebpackPlugin.GenerateSW)); | ||
|
||
// build progmem data files | ||
// config.plugins.push(new ProgmemGenerator({ outputPath: "../lib/framework/WWWData.h", bytesPerLine: 20 })); | ||
|
||
// add compression plugin, compress javascript | ||
config.plugins.push(new CompressionPlugin({ | ||
filename: "[path].gz[query]", | ||
algorithm: "gzip", | ||
test: /\.(css|js|html|woff2|json|map)$/, | ||
deleteOriginalAssets: true | ||
})); | ||
} | ||
return config; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
REACT_APP_ENDPOINT_ROOT=http://192.168.1.5/rest/ | ||
SERVER_BUILD_PATH=/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export const AP_LIST_POPULATION_ERROR = 'Access Point list cannot be populated!' | ||
export const AP_LIST_RETRY_ERROR = 'Polling will retry in ' | ||
export const POLL_TIMEOUT = 300 | ||
// From ESP32 documentation: | ||
// https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/include/esp32/esp_wifi_types.h | ||
export const WIFI_AUTH_OPEN = 0 | ||
export const WIFI_AUTH_WEP = 1 | ||
export const WIFI_AUTH_WPA_PSK = 2 | ||
export const WIFI_AUTH_WPA2_PSK = 3 | ||
export const WIFI_AUTH_WPA_WPA2_PSK = 4 | ||
export const WIFI_AUTH_WPA2_ENTERPRISE = 5 | ||
// Translate to readable strings | ||
export const getEncryptionType = encryptionType => { | ||
switch (encryptionType) { | ||
case (WIFI_AUTH_OPEN): | ||
return "Open" | ||
case (WIFI_AUTH_WEP): | ||
return "WEP" | ||
case (WIFI_AUTH_WPA_PSK): | ||
return "WPA_PSK" | ||
case (WIFI_AUTH_WPA2_PSK): | ||
return "WPA2_PSK" | ||
case (WIFI_AUTH_WPA_WPA2_PSK): | ||
return "WPA_WPA2_PSK" | ||
case (WIFI_AUTH_WPA2_ENTERPRISE): | ||
return "WPA2_ENTERPRISE" | ||
default: | ||
return "Undefined" | ||
} | ||
} |
Oops, something went wrong.