浏览代码

NVS ui fine-tuning, site icon now works

Sebastien 3 年之前
父节点
当前提交
45f480d948
共有 27 个文件被更改,包括 83 次插入73 次删除
  1. 3 2
      components/wifi-manager/webapp/src/index.ejs
  2. 1 1
      components/wifi-manager/webapp/src/index.ts
  3. 8 6
      components/wifi-manager/webapp/src/sass/utils/_style.css
  4. 3 3
      components/wifi-manager/webapp/webapp.cmake
  5. 17 17
      components/wifi-manager/webapp/webpack.c
  6. 24 24
      components/wifi-manager/webapp/webpack.h
  7. 二进制
      components/wifi-manager/webapp/webpack/dist/favicon-32x32.png
  8. 0 0
      components/wifi-manager/webapp/webpack/dist/index.html
  9. 二进制
      components/wifi-manager/webapp/webpack/dist/index.html.br
  10. 二进制
      components/wifi-manager/webapp/webpack/dist/index.html.gz
  11. 0 0
      components/wifi-manager/webapp/webpack/dist/js/index.18c3b7.bundle.js
  12. 二进制
      components/wifi-manager/webapp/webpack/dist/js/index.18c3b7.bundle.js.br
  13. 二进制
      components/wifi-manager/webapp/webpack/dist/js/index.18c3b7.bundle.js.gz
  14. 二进制
      components/wifi-manager/webapp/webpack/dist/js/index.abeafc.bundle.js.br
  15. 二进制
      components/wifi-manager/webapp/webpack/dist/js/index.abeafc.bundle.js.gz
  16. 0 0
      components/wifi-manager/webapp/webpack/dist/js/node-modules.18c3b7.bundle.js
  17. 二进制
      components/wifi-manager/webapp/webpack/dist/js/node-modules.18c3b7.bundle.js.br
  18. 二进制
      components/wifi-manager/webapp/webpack/dist/js/node-modules.18c3b7.bundle.js.gz
  19. 二进制
      components/wifi-manager/webapp/webpack/dist/js/node-modules.abeafc.bundle.js.br
  20. 二进制
      components/wifi-manager/webapp/webpack/dist/js/node-modules.abeafc.bundle.js.gz
  21. 0 0
      components/wifi-manager/webapp/webpack/dist/js/runtime.18c3b7.bundle.js
  22. 0 0
      components/wifi-manager/webapp/webpack/dist/js/runtime.18c3b7.bundle.js.br
  23. 0 0
      components/wifi-manager/webapp/webpack/dist/js/runtime.18c3b7.bundle.js.gz
  24. 二进制
      components/wifi-manager/webapp/webpack/dist/sprite.svg.br
  25. 22 2
      components/wifi-manager/webapp/webpack/webpack.common.js
  26. 3 18
      components/wifi-manager/webapp/webpack/webpack.prod.js
  27. 2 0
      components/wifi-manager/wifi_manager_http_server.c

+ 3 - 2
components/wifi-manager/webapp/src/index.ejs

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

+ 1 - 1
components/wifi-manager/webapp/src/index.ts

@@ -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/System/lock-fill.svg';
 import '../node_modules/remixicon/icons/System/lock-unlock-fill.svg';
-
+import './assets/images/favicon-32x32.png';
 import './js/custom.js'; 
 // <%= `<svg><use xlink:href="#${htmlWebpackPlugin.files.sprites.svg.defs.symbol[s].id}"></use></svg>` %>

+ 8 - 6
components/wifi-manager/webapp/src/sass/utils/_style.css

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

+ 3 - 3
components/wifi-manager/webapp/webapp.cmake

@@ -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/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/node-modules.abeafc.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/index.18c3b7.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.18c3b7.bundle.js.gz BINARY)

+ 17 - 17
components/wifi-manager/webapp/webpack.c

@@ -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 _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_abeafc_bundle_js_gz_start[] asm("_binary_index_abeafc_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 _node_modules_abeafc_bundle_js_gz_start[] asm("_binary_node_modules_abeafc_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 _runtime_abeafc_bundle_js_gz_start[] asm("_binary_runtime_abeafc_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 _index_18c3b7_bundle_js_gz_start[] asm("_binary_index_18c3b7_bundle_js_gz_start");
+extern const uint8_t _index_18c3b7_bundle_js_gz_end[] asm("_binary_index_18c3b7_bundle_js_gz_end");
+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_18c3b7_bundle_js_gz_end[] asm("_binary_node_modules_18c3b7_bundle_js_gz_end");
+extern const uint8_t _runtime_18c3b7_bundle_js_gz_start[] asm("_binary_runtime_18c3b7_bundle_js_gz_start");
+extern const uint8_t _runtime_18c3b7_bundle_js_gz_end[] asm("_binary_runtime_18c3b7_bundle_js_gz_end");
 const char * resource_lookups[] = {
-	"/dist/favicon-32x32.png",
-	"/dist/index.html.gz",
-	"/js/index.abeafc.bundle.js.gz",
-	"/js/node-modules.abeafc.bundle.js.gz",
-	"/js/runtime.abeafc.bundle.js.gz",
+	"/favicon-32x32.png",
+	"/index.html.gz",
+	"/js/index.18c3b7.bundle.js.gz",
+	"/js/node-modules.18c3b7.bundle.js.gz",
+	"/js/runtime.18c3b7.bundle.js.gz",
 ""
 };
 const uint8_t * resource_map_start[] = {
 	_favicon_32x32_png_start,
 	_index_html_gz_start,
-	_index_abeafc_bundle_js_gz_start,
-	_node_modules_abeafc_bundle_js_gz_start,
-	_runtime_abeafc_bundle_js_gz_start
+	_index_18c3b7_bundle_js_gz_start,
+	_node_modules_18c3b7_bundle_js_gz_start,
+	_runtime_18c3b7_bundle_js_gz_start
 };
 const uint8_t * resource_map_end[] = {
 	_favicon_32x32_png_end,
 	_index_html_gz_end,
-	_index_abeafc_bundle_js_gz_end,
-	_node_modules_abeafc_bundle_js_gz_end,
-	_runtime_abeafc_bundle_js_gz_end
+	_index_18c3b7_bundle_js_gz_end,
+	_node_modules_18c3b7_bundle_js_gz_end,
+	_runtime_18c3b7_bundle_js_gz_end
 };

+ 24 - 24
components/wifi-manager/webapp/webpack.h

@@ -1,26 +1,26 @@
 /***********************************
 webpack_headers
-Hash: abeafc790ab5fbef1c83
+Hash: 18c3b78fe9dd6db2c31d
 Version: webpack 4.46.0
-Time: 7893ms
-Built at: 2021-04-14 21 h 06 min 20 s
+Time: 8782ms
+Built at: 2021-04-21 12 h 01 min 40 s
                                 Asset       Size  Chunks                                Chunk Names
-          ./js/index.abeafc.bundle.js    231 KiB       0  [emitted] [immutable]         index
-       ./js/index.abeafc.bundle.js.br     32 KiB          [emitted]                     
-       ./js/index.abeafc.bundle.js.gz   41.2 KiB          [emitted]                     
-   ./js/node-modules.abeafc.bundle.js    266 KiB       1  [emitted] [immutable]  [big]  node-modules
-./js/node-modules.abeafc.bundle.js.br   76.3 KiB          [emitted]                     
-./js/node-modules.abeafc.bundle.js.gz   88.7 KiB          [emitted]                     
-        ./js/runtime.abeafc.bundle.js   1.46 KiB       2  [emitted] [immutable]         runtime
-     ./js/runtime.abeafc.bundle.js.br  644 bytes          [emitted]                     
-     ./js/runtime.abeafc.bundle.js.gz  722 bytes          [emitted]                     
-                    favicon-32x32.png  578 bytes          [emitted]                     
+          ./js/index.18c3b7.bundle.js    232 KiB       0  [emitted] [immutable]         index
+       ./js/index.18c3b7.bundle.js.br   32.5 KiB          [emitted]                     
+       ./js/index.18c3b7.bundle.js.gz   41.9 KiB          [emitted]                     
+   ./js/node-modules.18c3b7.bundle.js    266 KiB       1  [emitted] [immutable]  [big]  node-modules
+./js/node-modules.18c3b7.bundle.js.br   76.3 KiB          [emitted]                     
+./js/node-modules.18c3b7.bundle.js.gz   88.7 KiB          [emitted]                     
+        ./js/runtime.18c3b7.bundle.js   1.46 KiB       2  [emitted] [immutable]         runtime
+     ./js/runtime.18c3b7.bundle.js.br  644 bytes          [emitted]                     
+     ./js/runtime.18c3b7.bundle.js.gz  722 bytes          [emitted]                     
+                    favicon-32x32.png  634 bytes          [emitted]                     
                            index.html   21.7 KiB          [emitted]                     
-                        index.html.br   4.75 KiB          [emitted]                     
-                        index.html.gz   5.76 KiB          [emitted]                     
+                        index.html.br   4.74 KiB          [emitted]                     
+                        index.html.gz   5.75 KiB          [emitted]                     
                            sprite.svg    4.4 KiB          [emitted]                     
-                        sprite.svg.br  912 bytes          [emitted]                     
-Entrypoint index [big] = ./js/runtime.abeafc.bundle.js ./js/node-modules.abeafc.bundle.js ./js/index.abeafc.bundle.js
+                        sprite.svg.br  898 bytes          [emitted]                     
+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]
 [11] ./src/sass/main.scss 1.55 KiB {0} [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]
 [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]
-[37] ./src/index.ts + 1 modules 62.5 KiB {0} [built]
-     | ./src/index.ts 1.36 KiB [built]
+[38] ./src/index.ts + 1 modules 62.5 KiB {0} [built]
+     | ./src/index.ts 1.4 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).
 This can impact web performance.
 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.
 Entrypoints:
   index (499 KiB)
-      ./js/runtime.abeafc.bundle.js
-      ./js/node-modules.abeafc.bundle.js
-      ./js/index.abeafc.bundle.js
+      ./js/runtime.18c3b7.bundle.js
+      ./js/node-modules.18c3b7.bundle.js
+      ./js/index.18c3b7.bundle.js
 
 
 WARNING in webpack performance recommendations: 

二进制
components/wifi-manager/webapp/webpack/dist/favicon-32x32.png


文件差异内容过多而无法显示
+ 0 - 0
components/wifi-manager/webapp/webpack/dist/index.html


二进制
components/wifi-manager/webapp/webpack/dist/index.html.br


二进制
components/wifi-manager/webapp/webpack/dist/index.html.gz


文件差异内容过多而无法显示
+ 0 - 0
components/wifi-manager/webapp/webpack/dist/js/index.18c3b7.bundle.js


二进制
components/wifi-manager/webapp/webpack/dist/js/index.18c3b7.bundle.js.br


二进制
components/wifi-manager/webapp/webpack/dist/js/index.18c3b7.bundle.js.gz


二进制
components/wifi-manager/webapp/webpack/dist/js/index.abeafc.bundle.js.br


二进制
components/wifi-manager/webapp/webpack/dist/js/index.abeafc.bundle.js.gz


文件差异内容过多而无法显示
+ 0 - 0
components/wifi-manager/webapp/webpack/dist/js/node-modules.18c3b7.bundle.js


二进制
components/wifi-manager/webapp/webpack/dist/js/node-modules.18c3b7.bundle.js.br


二进制
components/wifi-manager/webapp/webpack/dist/js/node-modules.18c3b7.bundle.js.gz


二进制
components/wifi-manager/webapp/webpack/dist/js/node-modules.abeafc.bundle.js.br


二进制
components/wifi-manager/webapp/webpack/dist/js/node-modules.abeafc.bundle.js.gz


+ 0 - 0
components/wifi-manager/webapp/webpack/dist/js/runtime.abeafc.bundle.js → components/wifi-manager/webapp/webpack/dist/js/runtime.18c3b7.bundle.js


+ 0 - 0
components/wifi-manager/webapp/webpack/dist/js/runtime.abeafc.bundle.js.br → components/wifi-manager/webapp/webpack/dist/js/runtime.18c3b7.bundle.js.br


+ 0 - 0
components/wifi-manager/webapp/webpack/dist/js/runtime.abeafc.bundle.js.gz → components/wifi-manager/webapp/webpack/dist/js/runtime.18c3b7.bundle.js.gz


二进制
components/wifi-manager/webapp/webpack/dist/sprite.svg.br


+ 22 - 2
components/wifi-manager/webapp/webpack/webpack.common.js

@@ -11,6 +11,8 @@ const ESLintPlugin = require('eslint-webpack-plugin');
 const SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
 // Linting
 const TSLintPlugin = require('tslint-webpack-plugin');
+const ImageminPlugin = require('imagemin-webpack-plugin').default;
+const imageminMozjpeg = require('imagemin-mozjpeg');
 
 
 module.exports = {
@@ -97,9 +99,10 @@ module.exports = {
                         loader: 'url-loader',
                         options: {
                            // publicPath: '../',
-                            name: './assets/images/' + '[name].[ext]',
+                            //name: './assets/images/' + '[name].[ext]',
                             limit: 10000,
-                            publicPath: '../'
+                            //limit:false,
+                            //publicPath: '../'
                         }
 
                     },
@@ -177,6 +180,22 @@ module.exports = {
 
     plugins: [
       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({
             cache: true,
             ignore: true,
@@ -203,6 +222,7 @@ module.exports = {
               useShortDoctype                : true
             },
             favicon: "./src/assets/images/favicon-32x32.png",
+            
             excludeChunks: ['test'],
         }),
         

+ 3 - 18
components/wifi-manager/webapp/webpack/webpack.prod.js

@@ -11,8 +11,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
 const TerserPlugin = require('terser-webpack-plugin');
 const OptimizeCSSAssetsPlugin = require('optimize-css-assets-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 glob = require('glob');
 var WebpackOnBuildPlugin = require('on-build-webpack');
@@ -83,21 +82,7 @@ module.exports = merge(common, {
             threshold: 100,
             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({
         //     // Your source logo
         //     logo: './src/assets/images/200px-ControllerAppIcon.png',
@@ -152,7 +137,7 @@ module.exports = merge(common, {
                     console.log('Error', err);
                 } else {
                     const regex = /^(.*\/)([^\/]*)$/
-                    const relativeRegex = /(\w+\/[^\/]*)$/
+                    const relativeRegex = /((\w+(?<!dist)\/){0,1}[^\/]*)$/
                     const makePathRegex = /([^\.].*)$/
                     let exportDefHead=
                     '/***********************************\n'+

+ 2 - 0
components/wifi-manager/wifi_manager_http_server.c

@@ -44,6 +44,8 @@ void register_common_handlers(httpd_handle_t server){
 	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_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){

部分文件因为文件数量过多而无法显示