NVS ui fine-tuning, site icon now works

This commit is contained in:
Sebastien
2021-04-21 13:27:32 -04:00
parent 8904ec1afd
commit 45f480d948
27 changed files with 88 additions and 78 deletions

View File

@@ -217,8 +217,9 @@
<tbody id="nvsTable"> <tbody id="nvsTable">
</tbody> </tbody>
</table> </table>
<div class="d-flex justify-content-between "> <div class="buttons">
<button button id="reboot-button" class="btn btn-primary" type="submit" onclick="handleReboot('reboot');" >Reboot</button> <button button id="reboot-button" class="btn btn-primary" style="float:right" type="submit" onclick="handleReboot('reboot');" >Reboot</button>
<input id="save-nvs" type="button" class="btn btn-success" value="Commit"> <input id="save-nvs" type="button" class="btn btn-success" value="Commit">
<input id="save-as-nvs" type="button" class="btn btn-success" value="Download config"> <input id="save-as-nvs" type="button" class="btn btn-success" value="Download config">
<input id="load-nvs" type="button" class="btn btn-success" value="Load File"> <input id="load-nvs" type="button" class="btn btn-success" value="Load File">

View File

@@ -19,6 +19,6 @@ import '../node_modules/remixicon/icons/Media/play-circle-fill.svg';
import '../node_modules/remixicon/icons/Media/pause-circle-fill.svg'; import '../node_modules/remixicon/icons/Media/pause-circle-fill.svg';
import '../node_modules/remixicon/icons/System/lock-fill.svg'; import '../node_modules/remixicon/icons/System/lock-fill.svg';
import '../node_modules/remixicon/icons/System/lock-unlock-fill.svg'; import '../node_modules/remixicon/icons/System/lock-unlock-fill.svg';
import './assets/images/favicon-32x32.png';
import './js/custom.js'; import './js/custom.js';
// <%= `<svg><use xlink:href="#${htmlWebpackPlugin.files.sprites.svg.defs.symbol[s].id}"></use></svg>` %> // <%= `<svg><use xlink:href="#${htmlWebpackPlugin.files.sprites.svg.defs.symbol[s].id}"></use></svg>` %>

View File

@@ -16,6 +16,12 @@ tr.hide {
.rebooting { .rebooting {
display: none; display: none;
} }
td.value {
width: 80%;
}
#boot-div {
float: right;
}
/* body { /* body {
border: 0; border: 0;
margin: 0; margin: 0;
@@ -378,13 +384,9 @@ ul#navbar {
background-color: #3c0505; background-color: #3c0505;
} }
td.value {
width: 80%;
}
#boot-div {
float: right;
}
div#message { div#message {
display: none; display: none;
color: #000; color: #000;

View File

@@ -1,5 +1,5 @@
target_add_binary_data( __idf_wifi-manager ./webapp/webpack/dist/favicon-32x32.png BINARY) target_add_binary_data( __idf_wifi-manager ./webapp/webpack/dist/favicon-32x32.png BINARY)
target_add_binary_data( __idf_wifi-manager ./webapp/webpack/dist/index.html.gz BINARY) target_add_binary_data( __idf_wifi-manager ./webapp/webpack/dist/index.html.gz BINARY)
target_add_binary_data( __idf_wifi-manager ./webapp/webpack/dist/js/index.abeafc.bundle.js.gz BINARY) target_add_binary_data( __idf_wifi-manager ./webapp/webpack/dist/js/index.18c3b7.bundle.js.gz BINARY)
target_add_binary_data( __idf_wifi-manager ./webapp/webpack/dist/js/node-modules.abeafc.bundle.js.gz BINARY) target_add_binary_data( __idf_wifi-manager ./webapp/webpack/dist/js/node-modules.18c3b7.bundle.js.gz BINARY)
target_add_binary_data( __idf_wifi-manager ./webapp/webpack/dist/js/runtime.abeafc.bundle.js.gz BINARY) target_add_binary_data( __idf_wifi-manager ./webapp/webpack/dist/js/runtime.18c3b7.bundle.js.gz BINARY)

View File

@@ -4,31 +4,31 @@ extern const uint8_t _favicon_32x32_png_start[] asm("_binary_favicon_32x32_png_s
extern const uint8_t _favicon_32x32_png_end[] asm("_binary_favicon_32x32_png_end"); extern const uint8_t _favicon_32x32_png_end[] asm("_binary_favicon_32x32_png_end");
extern const uint8_t _index_html_gz_start[] asm("_binary_index_html_gz_start"); extern const uint8_t _index_html_gz_start[] asm("_binary_index_html_gz_start");
extern const uint8_t _index_html_gz_end[] asm("_binary_index_html_gz_end"); extern const uint8_t _index_html_gz_end[] asm("_binary_index_html_gz_end");
extern const uint8_t _index_abeafc_bundle_js_gz_start[] asm("_binary_index_abeafc_bundle_js_gz_start"); extern const uint8_t _index_18c3b7_bundle_js_gz_start[] asm("_binary_index_18c3b7_bundle_js_gz_start");
extern const uint8_t _index_abeafc_bundle_js_gz_end[] asm("_binary_index_abeafc_bundle_js_gz_end"); extern const uint8_t _index_18c3b7_bundle_js_gz_end[] asm("_binary_index_18c3b7_bundle_js_gz_end");
extern const uint8_t _node_modules_abeafc_bundle_js_gz_start[] asm("_binary_node_modules_abeafc_bundle_js_gz_start"); extern const uint8_t _node_modules_18c3b7_bundle_js_gz_start[] asm("_binary_node_modules_18c3b7_bundle_js_gz_start");
extern const uint8_t _node_modules_abeafc_bundle_js_gz_end[] asm("_binary_node_modules_abeafc_bundle_js_gz_end"); extern const uint8_t _node_modules_18c3b7_bundle_js_gz_end[] asm("_binary_node_modules_18c3b7_bundle_js_gz_end");
extern const uint8_t _runtime_abeafc_bundle_js_gz_start[] asm("_binary_runtime_abeafc_bundle_js_gz_start"); extern const uint8_t _runtime_18c3b7_bundle_js_gz_start[] asm("_binary_runtime_18c3b7_bundle_js_gz_start");
extern const uint8_t _runtime_abeafc_bundle_js_gz_end[] asm("_binary_runtime_abeafc_bundle_js_gz_end"); extern const uint8_t _runtime_18c3b7_bundle_js_gz_end[] asm("_binary_runtime_18c3b7_bundle_js_gz_end");
const char * resource_lookups[] = { const char * resource_lookups[] = {
"/dist/favicon-32x32.png", "/favicon-32x32.png",
"/dist/index.html.gz", "/index.html.gz",
"/js/index.abeafc.bundle.js.gz", "/js/index.18c3b7.bundle.js.gz",
"/js/node-modules.abeafc.bundle.js.gz", "/js/node-modules.18c3b7.bundle.js.gz",
"/js/runtime.abeafc.bundle.js.gz", "/js/runtime.18c3b7.bundle.js.gz",
"" ""
}; };
const uint8_t * resource_map_start[] = { const uint8_t * resource_map_start[] = {
_favicon_32x32_png_start, _favicon_32x32_png_start,
_index_html_gz_start, _index_html_gz_start,
_index_abeafc_bundle_js_gz_start, _index_18c3b7_bundle_js_gz_start,
_node_modules_abeafc_bundle_js_gz_start, _node_modules_18c3b7_bundle_js_gz_start,
_runtime_abeafc_bundle_js_gz_start _runtime_18c3b7_bundle_js_gz_start
}; };
const uint8_t * resource_map_end[] = { const uint8_t * resource_map_end[] = {
_favicon_32x32_png_end, _favicon_32x32_png_end,
_index_html_gz_end, _index_html_gz_end,
_index_abeafc_bundle_js_gz_end, _index_18c3b7_bundle_js_gz_end,
_node_modules_abeafc_bundle_js_gz_end, _node_modules_18c3b7_bundle_js_gz_end,
_runtime_abeafc_bundle_js_gz_end _runtime_18c3b7_bundle_js_gz_end
}; };

View File

@@ -1,26 +1,26 @@
/*********************************** /***********************************
webpack_headers webpack_headers
Hash: abeafc790ab5fbef1c83 Hash: 18c3b78fe9dd6db2c31d
Version: webpack 4.46.0 Version: webpack 4.46.0
Time: 7893ms Time: 8782ms
Built at: 2021-04-14 21 h 06 min 20 s Built at: 2021-04-21 12 h 01 min 40 s
Asset Size Chunks Chunk Names Asset Size Chunks Chunk Names
./js/index.abeafc.bundle.js 231 KiB 0 [emitted] [immutable] index ./js/index.18c3b7.bundle.js 232 KiB 0 [emitted] [immutable] index
./js/index.abeafc.bundle.js.br 32 KiB [emitted] ./js/index.18c3b7.bundle.js.br 32.5 KiB [emitted]
./js/index.abeafc.bundle.js.gz 41.2 KiB [emitted] ./js/index.18c3b7.bundle.js.gz 41.9 KiB [emitted]
./js/node-modules.abeafc.bundle.js 266 KiB 1 [emitted] [immutable] [big] node-modules ./js/node-modules.18c3b7.bundle.js 266 KiB 1 [emitted] [immutable] [big] node-modules
./js/node-modules.abeafc.bundle.js.br 76.3 KiB [emitted] ./js/node-modules.18c3b7.bundle.js.br 76.3 KiB [emitted]
./js/node-modules.abeafc.bundle.js.gz 88.7 KiB [emitted] ./js/node-modules.18c3b7.bundle.js.gz 88.7 KiB [emitted]
./js/runtime.abeafc.bundle.js 1.46 KiB 2 [emitted] [immutable] runtime ./js/runtime.18c3b7.bundle.js 1.46 KiB 2 [emitted] [immutable] runtime
./js/runtime.abeafc.bundle.js.br 644 bytes [emitted] ./js/runtime.18c3b7.bundle.js.br 644 bytes [emitted]
./js/runtime.abeafc.bundle.js.gz 722 bytes [emitted] ./js/runtime.18c3b7.bundle.js.gz 722 bytes [emitted]
favicon-32x32.png 578 bytes [emitted] favicon-32x32.png 634 bytes [emitted]
index.html 21.7 KiB [emitted] index.html 21.7 KiB [emitted]
index.html.br 4.75 KiB [emitted] index.html.br 4.74 KiB [emitted]
index.html.gz 5.76 KiB [emitted] index.html.gz 5.75 KiB [emitted]
sprite.svg 4.4 KiB [emitted] sprite.svg 4.4 KiB [emitted]
sprite.svg.br 912 bytes [emitted] sprite.svg.br 898 bytes [emitted]
Entrypoint index [big] = ./js/runtime.abeafc.bundle.js ./js/node-modules.abeafc.bundle.js ./js/index.abeafc.bundle.js Entrypoint index [big] = ./js/runtime.18c3b7.bundle.js ./js/node-modules.18c3b7.bundle.js ./js/index.18c3b7.bundle.js
[6] ./node_modules/bootstrap/dist/js/bootstrap-exposed.js 437 bytes {1} [built] [6] ./node_modules/bootstrap/dist/js/bootstrap-exposed.js 437 bytes {1} [built]
[11] ./src/sass/main.scss 1.55 KiB {0} [built] [11] ./src/sass/main.scss 1.55 KiB {0} [built]
[16] ./node_modules/remixicon/icons/Device/signal-wifi-fill.svg 340 bytes {1} [built] [16] ./node_modules/remixicon/icons/Device/signal-wifi-fill.svg 340 bytes {1} [built]
@@ -35,22 +35,22 @@ Entrypoint index [big] = ./js/runtime.abeafc.bundle.js ./js/node-modules.abeafc.
[25] ./node_modules/remixicon/icons/Device/device-recover-fill.svg 346 bytes {1} [built] [25] ./node_modules/remixicon/icons/Device/device-recover-fill.svg 346 bytes {1} [built]
[26] ./node_modules/remixicon/icons/Device/bluetooth-fill.svg 336 bytes {1} [built] [26] ./node_modules/remixicon/icons/Device/bluetooth-fill.svg 336 bytes {1} [built]
[27] ./node_modules/remixicon/icons/Device/bluetooth-connect-fill.svg 352 bytes {1} [built] [27] ./node_modules/remixicon/icons/Device/bluetooth-connect-fill.svg 352 bytes {1} [built]
[37] ./src/index.ts + 1 modules 62.5 KiB {0} [built] [38] ./src/index.ts + 1 modules 62.5 KiB {0} [built]
| ./src/index.ts 1.36 KiB [built] | ./src/index.ts 1.4 KiB [built]
| ./src/js/custom.js 61 KiB [built] | ./src/js/custom.js 61 KiB [built]
+ 23 hidden modules + 24 hidden modules
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance. This can impact web performance.
Assets: Assets:
./js/node-modules.abeafc.bundle.js (266 KiB) ./js/node-modules.18c3b7.bundle.js (266 KiB)
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints: Entrypoints:
index (499 KiB) index (499 KiB)
./js/runtime.abeafc.bundle.js ./js/runtime.18c3b7.bundle.js
./js/node-modules.abeafc.bundle.js ./js/node-modules.18c3b7.bundle.js
./js/index.abeafc.bundle.js ./js/index.18c3b7.bundle.js
WARNING in webpack performance recommendations: WARNING in webpack performance recommendations:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 B

After

Width:  |  Height:  |  Size: 634 B

File diff suppressed because one or more lines are too long

View File

@@ -11,6 +11,8 @@ const ESLintPlugin = require('eslint-webpack-plugin');
const SpriteLoaderPlugin = require('svg-sprite-loader/plugin'); const SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
// Linting // Linting
const TSLintPlugin = require('tslint-webpack-plugin'); const TSLintPlugin = require('tslint-webpack-plugin');
const ImageminPlugin = require('imagemin-webpack-plugin').default;
const imageminMozjpeg = require('imagemin-mozjpeg');
module.exports = { module.exports = {
@@ -97,9 +99,10 @@ module.exports = {
loader: 'url-loader', loader: 'url-loader',
options: { options: {
// publicPath: '../', // publicPath: '../',
name: './assets/images/' + '[name].[ext]', //name: './assets/images/' + '[name].[ext]',
limit: 10000, limit: 10000,
publicPath: '../' //limit:false,
//publicPath: '../'
} }
}, },
@@ -177,6 +180,22 @@ module.exports = {
plugins: [ plugins: [
new CleanWebpackPlugin(), new CleanWebpackPlugin(),
new ImageminPlugin({
test: /\.(jpe?g|png|gif|svg)$/i,
// lossLess gif compressor
gifsicle: {
optimizationLevel: 9
},
// lossy png compressor, remove for default lossLess
pngquant: ({
quality: '75'
}),
// lossy jpg compressor
plugins: [imageminMozjpeg({
quality: '75'
})],
destination: './webpack',
}),
new ESLintPlugin({ new ESLintPlugin({
cache: true, cache: true,
ignore: true, ignore: true,
@@ -203,6 +222,7 @@ module.exports = {
useShortDoctype : true useShortDoctype : true
}, },
favicon: "./src/assets/images/favicon-32x32.png", favicon: "./src/assets/images/favicon-32x32.png",
excludeChunks: ['test'], excludeChunks: ['test'],
}), }),

View File

@@ -11,8 +11,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserPlugin = require('terser-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin'); const CompressionPlugin = require('compression-webpack-plugin');
const ImageminPlugin = require('imagemin-webpack-plugin').default;
const imageminMozjpeg = require('imagemin-mozjpeg');
const fs = require('fs'); const fs = require('fs');
const glob = require('glob'); const glob = require('glob');
var WebpackOnBuildPlugin = require('on-build-webpack'); var WebpackOnBuildPlugin = require('on-build-webpack');
@@ -83,21 +82,7 @@ module.exports = merge(common, {
threshold: 100, threshold: 100,
minRatio: 0.8, minRatio: 0.8,
}), }),
new ImageminPlugin({
test: /\.(jpe?g|png|gif|svg)$/i,
// lossLess gif compressor
gifsicle: {
optimizationLevel: 9
},
// lossy png compressor, remove for default lossLess
pngquant: ({
quality: '75'
}),
// lossy jpg compressor
plugins: [imageminMozjpeg({
quality: '75'
})]
}),
// new FaviconsWebpackPlugin({ // new FaviconsWebpackPlugin({
// // Your source logo // // Your source logo
// logo: './src/assets/images/200px-ControllerAppIcon.png', // logo: './src/assets/images/200px-ControllerAppIcon.png',
@@ -152,7 +137,7 @@ module.exports = merge(common, {
console.log('Error', err); console.log('Error', err);
} else { } else {
const regex = /^(.*\/)([^\/]*)$/ const regex = /^(.*\/)([^\/]*)$/
const relativeRegex = /(\w+\/[^\/]*)$/ const relativeRegex = /((\w+(?<!dist)\/){0,1}[^\/]*)$/
const makePathRegex = /([^\.].*)$/ const makePathRegex = /([^\.].*)$/
let exportDefHead= let exportDefHead=
'/***********************************\n'+ '/***********************************\n'+

View File

@@ -44,6 +44,8 @@ void register_common_handlers(httpd_handle_t server){
httpd_register_uri_handler(server, &js_get); httpd_register_uri_handler(server, &js_get);
httpd_uri_t icon_get = { .uri = "/icons*", .method = HTTP_GET, .handler = resource_filehandler, .user_ctx = rest_context }; httpd_uri_t icon_get = { .uri = "/icons*", .method = HTTP_GET, .handler = resource_filehandler, .user_ctx = rest_context };
httpd_register_uri_handler(server, &icon_get); httpd_register_uri_handler(server, &icon_get);
httpd_uri_t png_get = { .uri = "/favicon*", .method = HTTP_GET, .handler = resource_filehandler, .user_ctx = rest_context };
httpd_register_uri_handler(server, &png_get);
} }
void register_regular_handlers(httpd_handle_t server){ void register_regular_handlers(httpd_handle_t server){