Browse Source

Better webpage.h

Ayush Sharma 4 năm trước cách đây
mục cha
commit
2f3fa10358
2 tập tin đã thay đổi với 11 bổ sung2 xóa
  1. 3 0
      src/elegantWebpage.h
  2. 8 2
      ui/compress.js

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 3 - 0
src/elegantWebpage.h


+ 8 - 2
ui/compress.js

@@ -31,8 +31,14 @@ gzip(HTML, { numiterations: 15 }, (err, output) => {
     return console.error(err);
   }
 
-  const FILE = `const uint32_t ELEGANT_HTML_SIZE = ${output.length};
-const uint8_t ELEGANT_HTML[] PROGMEM = { ${output} };`;
+  const FILE = `#ifndef ElegantOTAWebpage_h
+#define ElegantOTAWebpage_h
+
+const uint32_t ELEGANT_HTML_SIZE = ${output.length};
+const uint8_t ELEGANT_HTML[] PROGMEM = { ${output} };
+
+#endif
+`;
 
   FS.writeFileSync(path.resolve(__dirname, '../src/elegantWebpage.h'), FILE);
   console.log(`[COMPRESS] Compressed Build Files to elegantWebpage.h: ${output.length} Bytes`);

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác