From 1e7a39c6312ece002d1e7d0c87b0ae31b61e2a46 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 23 Aug 2018 16:55:06 -0700 Subject: [PATCH] Added web app minifiy support --- meshcentral.js | 2 +- package.json | 2 +- public/commander.htm | 38861 +------------------------- public/compress.bat | 32 + public/compress.wcc | Bin 0 -> 2807 bytes views/default-min.handlebars | 1 + views/default-mobile-min.handlebars | 1 + views/default-mobile.handlebars | 122 +- views/default.handlebars | 67 +- views/login-min.handlebars | 1 + views/login-mobile-min.handlebars | 1 + views/login-mobile.handlebars | 8 +- views/login.handlebars | 8 +- webserver.js | 28 +- 14 files changed, 1314 insertions(+), 37820 deletions(-) create mode 100644 public/compress.bat create mode 100644 public/compress.wcc create mode 100644 views/default-min.handlebars create mode 100644 views/default-mobile-min.handlebars create mode 100644 views/login-min.handlebars create mode 100644 views/login-mobile-min.handlebars diff --git a/meshcentral.js b/meshcentral.js index eae34229..3d0ec8d2 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -79,7 +79,7 @@ function CreateMeshCentralServer(config, args) { try { require('./pass').hash('test', function () { }); } catch (e) { console.log('Old version of node, must upgrade.'); return; } // TODO: Not sure if this test works or not. // Check for invalid arguments - var validArguments = ['_', 'notls', 'user', 'port', 'aliasport', 'mpsport', 'mpsaliasport', 'redirport', 'cert', 'mpscert', 'deletedomain', 'deletedefaultdomain', 'showall', 'showusers', 'shownodes', 'showmeshes', 'showevents', 'showpower', 'clearpower', 'showiplocations', 'help', 'exactports', 'install', 'uninstall', 'start', 'stop', 'restart', 'debug', 'filespath', 'datapath', 'noagentupdate', 'launch', 'noserverbackup', 'mongodb', 'mongodbcol', 'wanonly', 'lanonly', 'nousers', 'mpsdebug', 'mpspass', 'ciralocalfqdn', 'dbexport', 'dbimport', 'selfupdate', 'tlsoffload', 'userallowedip', 'fastcert', 'swarmport', 'swarmdebug', 'logintoken', 'logintokenkey', 'logintokengen', 'logintokengen', 'mailtokengen', 'admin', 'unadmin', 'sessionkey', 'sessiontime']; + var validArguments = ['_', 'notls', 'user', 'port', 'aliasport', 'mpsport', 'mpsaliasport', 'redirport', 'cert', 'mpscert', 'deletedomain', 'deletedefaultdomain', 'showall', 'showusers', 'shownodes', 'showmeshes', 'showevents', 'showpower', 'clearpower', 'showiplocations', 'help', 'exactports', 'install', 'uninstall', 'start', 'stop', 'restart', 'debug', 'filespath', 'datapath', 'noagentupdate', 'launch', 'noserverbackup', 'mongodb', 'mongodbcol', 'wanonly', 'lanonly', 'nousers', 'mpsdebug', 'mpspass', 'ciralocalfqdn', 'dbexport', 'dbimport', 'selfupdate', 'tlsoffload', 'userallowedip', 'fastcert', 'swarmport', 'swarmdebug', 'logintoken', 'logintokenkey', 'logintokengen', 'logintokengen', 'mailtokengen', 'admin', 'unadmin', 'sessionkey', 'sessiontime', 'minify']; for (var arg in obj.args) { obj.args[arg.toLocaleLowerCase()] = obj.args[arg]; if (validArguments.indexOf(arg.toLocaleLowerCase()) == -1) { console.log('Invalid argument "' + arg + '", use --help.'); return; } } if (obj.args.mongodb == true) { console.log('Must specify: --mongodb [connectionstring] \r\nSee https://docs.mongodb.com/manual/reference/connection-string/ for MongoDB connection string.'); return; } for (var i in obj.config.settings) { obj.args[i] = obj.config.settings[i]; } // Place all settings into arguments, arguments have already been placed into settings so arguments take precedence. diff --git a/package.json b/package.json index 0fc4a91c..c4e017ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.1.9-n", + "version": "0.1.9-p", "keywords": [ "Remote Management", "Intel AMT", diff --git a/public/commander.htm b/public/commander.htm index 3a923358..9915314a 100644 --- a/public/commander.htm +++ b/public/commander.htm @@ -1,37752 +1,1109 @@ - - - - - - - - - - - - - - - - - - - -
- - - - -
-
-   -   -
-
-
-
-
-
-
- Disconnected -
- - - - - - \ No newline at end of file +
  
Disconnected
\ No newline at end of file diff --git a/public/compress.bat b/public/compress.bat new file mode 100644 index 00000000..eb11924b --- /dev/null +++ b/public/compress.bat @@ -0,0 +1,32 @@ +@ECHO OFF +REM *** default.handlebars +DEL ..\views\default-min.handlebars +COPY ..\views\default.handlebars index.html +..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c +COPY compress.htm ..\views\default-min.handlebars +DEL compress.htm +DEL index.html + +REM *** default-mobile.handlebars +DEL ..\views\default-mobile-min.handlebars +COPY ..\views\default-mobile.handlebars index.html +..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c +COPY compress.htm ..\views\default-mobile-min.handlebars +DEL compress.htm +DEL index.html + +REM *** login.handlebars +DEL ..\views\login-min.handlebars +COPY ..\views\login.handlebars index.html +..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c +COPY compress.htm ..\views\login-min.handlebars +DEL compress.htm +DEL index.html + +REM *** login-mobile.handlebars +DEL ..\views\login-mobile-min.handlebars +COPY ..\views\login-mobile.handlebars index.html +..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c +COPY compress.htm ..\views\login-mobile-min.handlebars +DEL compress.htm +DEL index.html \ No newline at end of file diff --git a/public/compress.wcc b/public/compress.wcc new file mode 100644 index 0000000000000000000000000000000000000000..501e44407d42cd1f225e369b5800c616fd8dca30 GIT binary patch literal 2807 zcmeGeYf}?3u+TQWqvhob#aC5)d?*$0Rh(g*&PnkEwbBD;qztClEo8{ub&{NlU;HzE z^%pq)BmaZ$*23UeW__MrtXVoT=?-13}S=qy*oHDAdIV zTyGiPkdQ%!fu)EyE8I7c%B+IY$YD8A(B=x%2yr@56RIkDDVm@xLe#_?NG-ySW~*Gr zpc9E?GLcSatzLV%yRs&FDB^x6|I^dby?3P5z-5GXKY=8I5t`+&vlN2tGicO=fhsp! zEKTGG-lHYjNr5H{W*9?krW~7S0YXN0W-Gu=tYArK!z@JPR=E=7g~vPqW+P^J;kjGg zCxs0ll0At{J2otf^HC=XTVgX-oE%vZ5*X<;G#@meNjiag35pFOF6V|)gy05z6Eqtl zu7|bSe&NH!Rh8VdA{BTFV1x|q*f@d{yI8#5jvG?=mPLU?V2|R+jvz=G(8eMw66`2~ zoZq#*xMc!%3^B{j-TI2gc-HSji^tLw@6Xp3y(iVlN3(9JlNWOkCy|&h6sTn20%|brV zex#&m6!P7Ko4Z+@qF*8Jpr#n4xe#JfqmZw5T!7i;McWY0HSXNuxBOeTr)O{6gsIZ( z`Z_s{ZD2A4I=!JWHLVSd0VM&ZfMwYykWK-io+7Q^Cx2XHFK$bCG4od~DD1jt{}KI{ z9{j@r`NQH4jxSO^_IG1>7^t5=Icw{9JjU=uPmZD8|3RgJ? zlo2iAb1Xe<95KV)0iC}I{nW2tUqbr1 zp7gRbph7Zh;y|8NZ+dE~Dq}sE%#fQqKBns{`Qb2af4$(_^fDMsrf4{H MeshCentral
{{{title}}}
{{{title2}}}

{{{logoutControl}}}


\ No newline at end of file diff --git a/views/default-mobile-min.handlebars b/views/default-mobile-min.handlebars new file mode 100644 index 00000000..03beab2e --- /dev/null +++ b/views/default-mobile-min.handlebars @@ -0,0 +1 @@ + MeshCentral - Login
{{{title}}}
{{{title2}}}
\ No newline at end of file diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index 332116f7..7e3129c2 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -17,22 +17,97 @@ - + MeshCentral - Login MeshCentral - Login
{{{title}}}
{{{title2}}}

Welcome

Connect to your home or office devices from anywhere in the world using MeshCentral, the remote monitoring and management web site. You will need to download and install a special management agent on your computers. Once installed, each mesh enabled computer will show up in the "My Devices" section of this web site and you will be able to monitor them, power them on and off and take control of them.


\ No newline at end of file diff --git a/views/login-mobile-min.handlebars b/views/login-mobile-min.handlebars new file mode 100644 index 00000000..3594a124 --- /dev/null +++ b/views/login-mobile-min.handlebars @@ -0,0 +1 @@ + MeshCentral - Login
{{{title}}}
{{{title2}}}
\ No newline at end of file diff --git a/views/login-mobile.handlebars b/views/login-mobile.handlebars index cf679b30..b636679f 100644 --- a/views/login-mobile.handlebars +++ b/views/login-mobile.handlebars @@ -175,9 +175,9 @@