cloudcmd 17.2.1 → 17.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/ChangeLog +11 -0
  2. package/HELP.md +9 -5
  3. package/README.md +1 -1
  4. package/bin/cloudcmd.mjs +13 -6
  5. package/dist/cloudcmd.common.js +3 -3
  6. package/dist/cloudcmd.common.js.map +1 -1
  7. package/dist/cloudcmd.css +1 -1
  8. package/dist/cloudcmd.js +1 -1
  9. package/dist/cloudcmd.js.map +1 -1
  10. package/dist/index.html +1 -1
  11. package/dist/modules/cloud.js +1 -1
  12. package/dist/modules/cloud.js.map +1 -1
  13. package/dist/modules/command-line.js +1 -1
  14. package/dist/modules/command-line.js.map +1 -1
  15. package/dist/modules/config.js +1 -1
  16. package/dist/modules/config.js.map +1 -1
  17. package/dist/modules/contact.js +1 -1
  18. package/dist/modules/contact.js.map +1 -1
  19. package/dist/modules/edit-file-vim.js +1 -1
  20. package/dist/modules/edit-file-vim.js.map +1 -1
  21. package/dist/modules/edit-file.js +1 -1
  22. package/dist/modules/edit-file.js.map +1 -1
  23. package/dist/modules/edit-names-vim.js +1 -1
  24. package/dist/modules/edit-names-vim.js.map +1 -1
  25. package/dist/modules/edit-names.js +1 -1
  26. package/dist/modules/edit-names.js.map +1 -1
  27. package/dist/modules/edit.js +1 -1
  28. package/dist/modules/edit.js.map +1 -1
  29. package/dist/modules/help.js +1 -1
  30. package/dist/modules/help.js.map +1 -1
  31. package/dist/modules/konsole.js +1 -1
  32. package/dist/modules/konsole.js.map +1 -1
  33. package/dist/modules/markdown.js +1 -1
  34. package/dist/modules/markdown.js.map +1 -1
  35. package/dist/modules/menu.js +1 -1
  36. package/dist/modules/menu.js.map +1 -1
  37. package/dist/modules/operation.js +1 -1
  38. package/dist/modules/operation.js.map +1 -1
  39. package/dist/modules/polyfill.js +1 -1
  40. package/dist/modules/polyfill.js.map +1 -1
  41. package/dist/modules/terminal-run.js +1 -1
  42. package/dist/modules/terminal-run.js.map +1 -1
  43. package/dist/modules/terminal.js +1 -1
  44. package/dist/modules/terminal.js.map +1 -1
  45. package/dist/modules/upload.js +1 -1
  46. package/dist/modules/upload.js.map +1 -1
  47. package/dist/modules/user-menu.js +1 -1
  48. package/dist/modules/user-menu.js.map +1 -1
  49. package/dist/modules/view.js +1 -1
  50. package/dist/modules/view.js.map +1 -1
  51. package/dist/sw.js +4 -2
  52. package/dist/themes/dark.css +1 -0
  53. package/dist/themes/light.css +1 -0
  54. package/dist-dev/cloudcmd.css +2 -10
  55. package/dist-dev/cloudcmd.js +35 -1
  56. package/dist-dev/index.html +3 -0
  57. package/dist-dev/modules/config.js +1 -1
  58. package/dist-dev/sw.js +4 -2
  59. package/dist-dev/themes/dark.css +49 -0
  60. package/dist-dev/themes/light.css +9 -0
  61. package/json/config.json +1 -0
  62. package/json/help.json +1 -0
  63. package/man/cloudcmd.1 +1 -0
  64. package/package.json +1 -1
  65. package/server/cloudcmd.mjs +5 -5
  66. package/server/{columns.js → columns.mjs} +13 -12
  67. package/server/columns.spec.mjs +40 -0
  68. package/server/distribute/{export.js → export.mjs} +7 -12
  69. package/server/distribute/{import.js → import.mjs} +10 -12
  70. package/server/distribute/import.spec.mjs +2 -4
  71. package/server/distribute/log.mjs +52 -0
  72. package/server/distribute/log.spec.mjs +34 -0
  73. package/server/{route.js → route.mjs} +24 -23
  74. package/server/route.spec.mjs +1 -1
  75. package/server/theme.mjs +33 -0
  76. package/server/themes.spec.mjs +31 -0
  77. package/server/{validate.js → validate.mjs} +24 -10
  78. package/server/validate.spec.mjs +30 -1
  79. package/tmpl/config.hbs +7 -1
  80. package/server/distribute/index.js +0 -4
  81. package/server/distribute/log.js +0 -41
@@ -1 +1 @@
1
- {"version":3,"sources":["file://cloudcmd/modules/view.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","20","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","176","94","rendy","currify","wraptile","tryToCatch","load","modal","createElement","time","FS","isImage","isAudio","getType","Files","Events","Images","encode","assign","isArray","Array","lifo","fn","el","cb","series","a","f","isFn","addEvent","add","loadCSS","css","show","async","options","prefixURL","CloudCmd","Loading","bindKeys","addKey","listener","El","className","notAppend","tabIndex","append","open","initConfig","path","Info","raw","error","getData","hide","element","document","createTextNode","Config","config","title","viewFile","Markdown","viewHtml","names","files","map","DOM","getCurrentPath","filter","titles","href","split","pop","imageConfig","index","indexOf","autoSize","arrows","keys","helpers","viewImage","e","src","Error","check","template","TemplateAudio","is","innerHTML","type","getMediaElement","alert","allConfig","afterShow","querySelector","focus","viewMedia","createIframe","viewPDF","CurrentInfo","Key","beforeShow","unsetBind","beforeClose","rmKey","setBind","onOverlayClick","afterClose","width","height","addEventListener","contentWindow","_Config","init","DIR_DIST","loadAll","forEach","Overlay","_createIframe","_viewHtml","isConfig","Boolean","item","close","event","position","getCurrentByPosition","filesPassive","isFiles","includes","isFilesPassive","isCurrentFile","setCurrentFile","setCurrentByPosition","x","clientX","y","clientY","keyCode","ESC","_initConfig","98","extname","testRegExp","reg","test","getRegExp","ext","RegExp","some","detectType","headers","fetch","method","isVideo","isHTML","isMarkdown","_detectType"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAAS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,KAAK3K,GAMlC2D,eAAeqH,EAAWtG,GACxB,MAAMuG,QACJA,SACQC,MAAMxG,EAAM,CACpByG,OAAQ,SAEV,IAAK,MAAOnL,EAAMS,KAAUwK,EAC1B,GAAa,iBAATjL,EAAyB,MAAO,IAAIS,EAAMwF,MAAM,KAAKC,MAE3D,MAAO,GAlCTvG,EAAOD,QAAQ4C,QAAUqB,UAGvB,OAFY6G,EAAQ9F,KACVA,QAAasG,EAAWtG,IALjB,UAAUiG,KAMjBjG,GAAc,MACpBtC,EAAQsC,GAAc,QAWnBrC,EADQrC,EATH0E,IAgBd,SAAiB1E,GACf,MAAO,qBAAqB2K,KAAK3K,GAPToL,CAAQpL,GAVN,QAPbmD,IAAK,UAAUwH,KAAKxH,GAQ7BkI,CAAO3G,GAAc,OAPRvB,IAAK,SAASwH,KAAKxH,GAQhCmI,CAAW5G,GAAc,gBAA7B,EAVYvB,IAiBGnD,GALjBL,EAAOD,QAAQ0C,QAAUA,EAQzBzC,EAAOD,QAAQ2C,QAAUA,EAOzB1C,EAAOD,QAAQ6L,YAAcP","file":"./modules/view.js","sourceRoot":""}
1
+ {"version":3,"sources":["file://cloudcmd/modules/view.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","20","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","178","95","rendy","currify","wraptile","tryToCatch","load","modal","createElement","time","FS","isImage","isAudio","getType","Files","Events","Images","encode","assign","isArray","Array","lifo","fn","el","cb","series","a","f","isFn","addEvent","add","loadCSS","css","show","async","options","prefixURL","CloudCmd","Loading","bindKeys","addKey","listener","El","className","notAppend","tabIndex","append","open","initConfig","path","Info","raw","error","getData","hide","element","document","createTextNode","Config","config","title","viewFile","Markdown","viewHtml","names","files","map","DOM","getCurrentPath","filter","titles","href","split","pop","imageConfig","index","indexOf","autoSize","arrows","keys","helpers","viewImage","e","src","Error","check","template","TemplateAudio","is","innerHTML","type","getMediaElement","alert","allConfig","afterShow","querySelector","focus","viewMedia","createIframe","viewPDF","CurrentInfo","Key","beforeShow","unsetBind","beforeClose","rmKey","setBind","onOverlayClick","afterClose","width","height","addEventListener","contentWindow","_Config","init","DIR_DIST","loadAll","forEach","Overlay","_createIframe","_viewHtml","isConfig","Boolean","item","close","event","position","getCurrentByPosition","filesPassive","isFiles","includes","isFilesPassive","isCurrentFile","setCurrentFile","setCurrentByPosition","x","clientX","y","clientY","keyCode","ESC","_initConfig","99","extname","testRegExp","reg","test","getRegExp","ext","RegExp","some","detectType","headers","fetch","method","isVideo","isHTML","isMarkdown","_detectType"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDH,EAAQG,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCO,EAASC,QACdD,EAASS,OAATT,GAOD,OAHAU,EAAgBH,KAAKI,MAAMD,EAAiBZ,GAAkB,IAGvDc,IAER,SAASA,IAER,IADA,IAAIC,EACId,EAAI,EAAGA,EAAIW,EAAgBT,OAAQF,IAAK,CAG/C,IAFA,IAAIe,EAAiBJ,EAAgBX,GACjCgB,GAAY,EAC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BAAqB2K,KAAK3K,GAPToL,CAAQpL,GAVN,QAPbmD,IAAK,UAAUwH,KAAKxH,GAQ7BkI,CAAO3G,GAAc,OAPRvB,IAAK,SAASwH,KAAKxH,GAQhCmI,CAAW5G,GAAc,gBAA7B,EAVYvB,IAiBGnD,GALjBL,EAAOD,QAAQ0C,QAAUA,EAQzBzC,EAAOD,QAAQ2C,QAAUA,EAOzB1C,EAAOD,QAAQ6L,YAAcP","file":"./modules/view.js","sourceRoot":""}
package/dist/sw.js CHANGED
@@ -1,9 +1,11 @@
1
1
  var serviceWorkerOption = {
2
2
  "assets": [
3
3
  "/columns/name-size-date.css",
4
- "/columns/name-size.css"
4
+ "/columns/name-size.css",
5
+ "/themes/dark.css",
6
+ "/themes/light.css"
5
7
  ]
6
8
  };
7
9
 
8
- !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=n(3),u="development"===r.env.NODE_ENV,c=i((t,e)=>e.waitUntil(t())),s=i((t,e)=>{const{request:n}=e,{url:r}=n,o=a(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(o.startsWith("/api")||/^socket.io/.test(o)||e.respondWith(t(e)))}),a=t=>new URL(t).pathname,f="cloudcmd: Fri Mar 29 2024 10:32:51 GMT+0200 (Eastern European Standard Time)",l=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",c((async function(){console.info("cloudcmd: sw: install: "+f),await self.skipWaiting()}))),self.addEventListener("fetch",s((async function(t){const{request:e}=t,{url:n}=e,r=a(n),i=l(r,t.request),c=await caches.open(f),s=await c.match(e);if(!u&&s)return s;const[d,h]=await o(fetch,i,{credentials:"same-origin"});return d?new Response(d.message):(await async function(t,e){return(await caches.open(f)).put(t,e)}(e,h.clone()),h)}))),self.addEventListener("activate",c((async function(){console.info("cloudcmd: sw: activate: "+f),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))})))},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var s,a=[],f=!1,l=-1;function d(){f&&s&&(f=!1,s.length?a=s.concat(a):l=-1,a.length&&h())}function h(){if(!f){var t=c(d);f=!0;for(var e=a.length;e;){for(s=a,a=[];++l<e;)s&&s[l].run();l=-1,e=a.length}s=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];a.push(new p(t,e)),1!==a.length||f||c(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";t.exports=async(t,...e)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...e)]}catch(t){return[t]}}},function(t,e,n){"use strict";const r=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const n=(...n)=>r(t,...e,...n),o=t.length-e.length-1;return(t=>[function(e){return t(...arguments)},function(e,n){return t(...arguments)},function(e,n,r){return t(...arguments)},function(e,n,r,o){return t(...arguments)},function(e,n,r,o,i){return t(...arguments)}])(n)[o]||n};t.exports=r}]);
10
+ !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=n(3),u="development"===r.env.NODE_ENV,c=i((t,e)=>e.waitUntil(t())),s=i((t,e)=>{const{request:n}=e,{url:r}=n,o=a(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(o.startsWith("/api")||/^socket.io/.test(o)||e.respondWith(t(e)))}),a=t=>new URL(t).pathname,f="cloudcmd: Fri Mar 29 2024 15:03:06 GMT+0200 (Eastern European Standard Time)",l=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",c((async function(){console.info("cloudcmd: sw: install: "+f),await self.skipWaiting()}))),self.addEventListener("fetch",s((async function(t){const{request:e}=t,{url:n}=e,r=a(n),i=l(r,t.request),c=await caches.open(f),s=await c.match(e);if(!u&&s)return s;const[d,h]=await o(fetch,i,{credentials:"same-origin"});return d?new Response(d.message):(await async function(t,e){return(await caches.open(f)).put(t,e)}(e,h.clone()),h)}))),self.addEventListener("activate",c((async function(){console.info("cloudcmd: sw: activate: "+f),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))})))},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var s,a=[],f=!1,l=-1;function d(){f&&s&&(f=!1,s.length?a=s.concat(a):l=-1,a.length&&h())}function h(){if(!f){var t=c(d);f=!0;for(var e=a.length;e;){for(s=a,a=[];++l<e;)s&&s[l].run();l=-1,e=a.length}s=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];a.push(new p(t,e)),1!==a.length||f||c(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";t.exports=async(t,...e)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...e)]}catch(t){return[t]}}},function(t,e,n){"use strict";const r=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const n=(...n)=>r(t,...e,...n),o=t.length-e.length-1;return(t=>[function(e){return t(...arguments)},function(e,n){return t(...arguments)},function(e,n,r){return t(...arguments)},function(e,n,r,o){return t(...arguments)},function(e,n,r,o,i){return t(...arguments)}])(n)[o]||n};t.exports=r}]);
9
11
  //# sourceMappingURL=sw.js.map
@@ -0,0 +1 @@
1
+ :root{--link-color:#317bf9;--border-color:rgba(49,123,249,0.4);--background:#22272e;--column-color:#727e8c;--icon-color:#478be6;--button-background:#22272e;--internal-background:#373e47}.view{background:var(--internal-background)!important;color:var(--column-color)!important}.view a{color:var(--link-color)!important}.smalltalk .button-strip button,.smalltalk .page,.smalltalk header,.smalltalk input{background:var(--internal-background)!important;color:var(--link-color)!important;text-shadow:none!important}.cloudcmd-user-menu,.cloudcmd-user-menu-button{background:var(--internal-background)!important;color:var(--link-color)!important}.jqconsole{background:#373e47!important}.jqconsole-prompt,.log-msg{color:var(--column-color)!important}.menu{color:var(--link-color)!important;background:var(--internal-background)!important}
@@ -0,0 +1 @@
1
+ :root{--link-color:#00f;--selected-menu-item-color:#317bf9;--border-color:rgba(49,123,249,0.4);--background:#fff;--column-color:#000;--icon-color:#222;--button-background:#fff}
@@ -1,12 +1,3 @@
1
- :root {
2
- --link-color: blue;
3
- --selected-menu-item-color: #317bf9;
4
- --border-color: rgb(49 123 249 / 40%);
5
- --background: white;
6
- --column-color: black;
7
- --icon-color: #222;
8
- --button-background: white;
9
- }
10
1
  /*
11
2
  @import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono);
12
3
  */
@@ -135,6 +126,7 @@ code {
135
126
  -ms-user-select: initial;
136
127
  -o-user-select: initial;
137
128
  user-select: text;
129
+ color: var(--column-color);
138
130
  }
139
131
 
140
132
  .panel,
@@ -763,4 +755,4 @@ a:active {
763
755
  overflow-y: hidden;
764
756
  }
765
757
  }
766
- /* @import url(./themes/dark.css); */
758
+
@@ -175,7 +175,19 @@ eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modul
175
175
  /***/ (function(module, exports, __webpack_require__) {
176
176
 
177
177
  "use strict";
178
- eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n__webpack_require__(/*! ../css/main.css */ \"./css/main.css\");\n__webpack_require__(/*! ../css/nojs.css */ \"./css/nojs.css\");\n__webpack_require__(/*! ../css/columns/name-size-date.css */ \"./css/columns/name-size-date.css\");\n__webpack_require__(/*! ../css/columns/name-size.css */ \"./css/columns/name-size.css\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n registerSW,\n listenSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nmodule.exports = window.CloudCmd = async config => {\n window.Util = __webpack_require__(/*! ../common/util */ \"./common/util.js\");\n window.CloudFunc = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\n window.DOM = __webpack_require__(/*! ./dom */ \"./client/dom/index.js\");\n window.CloudCmd = __webpack_require__(/*! ./client */ \"./client/client.js\");\n await register(config);\n __webpack_require__(/*! ./listeners */ \"./client/listeners/index.js\");\n __webpack_require__(/*! ./key */ \"./client/key/index.js\");\n __webpack_require__(/*! ./sort */ \"./client/sort.js\");\n const prefix = getPrefix(config.prefix);\n window.CloudCmd.init(prefix, config);\n};\nfunction getPrefix(prefix) {\n if (!prefix) return '';\n if (!prefix.indexOf('/')) return prefix;\n return `/${prefix}`;\n}\nconst onUpdateFound = wraptile(async config => {\n if (isDev) return;\n const {\n DOM\n } = window;\n const prefix = getPrefix(config.prefix);\n await load.js(`${prefix}/dist/cloudcmd.common.js`);\n await load.js(`${prefix}/dist/cloudcmd.js`);\n console.log('cloudcmd: sw: updated');\n DOM.Events.removeAll();\n window.CloudCmd(config);\n});\nasync function register(config) {\n const {\n prefix\n } = config;\n const sw = await registerSW(prefix);\n listenSW(sw, 'updatefound', onUpdateFound(config));\n}\n\n//# sourceURL=file://cloudcmd/client/cloudcmd.js");
178
+ eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n__webpack_require__(/*! ./css */ \"./client/css.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n registerSW,\n listenSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nmodule.exports = window.CloudCmd = async config => {\n window.Util = __webpack_require__(/*! ../common/util */ \"./common/util.js\");\n window.CloudFunc = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\n window.DOM = __webpack_require__(/*! ./dom */ \"./client/dom/index.js\");\n window.CloudCmd = __webpack_require__(/*! ./client */ \"./client/client.js\");\n await register(config);\n __webpack_require__(/*! ./listeners */ \"./client/listeners/index.js\");\n __webpack_require__(/*! ./key */ \"./client/key/index.js\");\n __webpack_require__(/*! ./sort */ \"./client/sort.js\");\n const prefix = getPrefix(config.prefix);\n window.CloudCmd.init(prefix, config);\n};\nfunction getPrefix(prefix) {\n if (!prefix) return '';\n if (!prefix.indexOf('/')) return prefix;\n return `/${prefix}`;\n}\nconst onUpdateFound = wraptile(async config => {\n if (isDev) return;\n const {\n DOM\n } = window;\n const prefix = getPrefix(config.prefix);\n await load.js(`${prefix}/dist/cloudcmd.common.js`);\n await load.js(`${prefix}/dist/cloudcmd.js`);\n console.log('cloudcmd: sw: updated');\n DOM.Events.removeAll();\n window.CloudCmd(config);\n});\nasync function register(config) {\n const {\n prefix\n } = config;\n const sw = await registerSW(prefix);\n listenSW(sw, 'updatefound', onUpdateFound(config));\n}\n\n//# sourceURL=file://cloudcmd/client/cloudcmd.js");
179
+
180
+ /***/ }),
181
+
182
+ /***/ "./client/css.js":
183
+ /*!***********************!*\
184
+ !*** ./client/css.js ***!
185
+ \***********************/
186
+ /*! no static exports found */
187
+ /***/ (function(module, exports, __webpack_require__) {
188
+
189
+ "use strict";
190
+ eval("\n\n__webpack_require__(/*! ../css/main.css */ \"./css/main.css\");\n__webpack_require__(/*! ../css/nojs.css */ \"./css/nojs.css\");\n__webpack_require__(/*! ../css/columns/name-size-date.css */ \"./css/columns/name-size-date.css\");\n__webpack_require__(/*! ../css/columns/name-size.css */ \"./css/columns/name-size.css\");\n__webpack_require__(/*! ../css/themes/light.css */ \"./css/themes/light.css\");\n__webpack_require__(/*! ../css/themes/dark.css */ \"./css/themes/dark.css\");\n\n//# sourceURL=file://cloudcmd/client/css.js");
179
191
 
180
192
  /***/ }),
181
193
 
@@ -389,6 +401,28 @@ eval("// removed by extract-text-webpack-plugin\n\n//# sourceURL=file://cloudcmd
389
401
 
390
402
  eval("// removed by extract-text-webpack-plugin\n\n//# sourceURL=file://cloudcmd/css/nojs.css");
391
403
 
404
+ /***/ }),
405
+
406
+ /***/ "./css/themes/dark.css":
407
+ /*!*****************************!*\
408
+ !*** ./css/themes/dark.css ***!
409
+ \*****************************/
410
+ /*! no static exports found */
411
+ /***/ (function(module, exports) {
412
+
413
+ eval("// removed by extract-text-webpack-plugin\n\n//# sourceURL=file://cloudcmd/css/themes/dark.css");
414
+
415
+ /***/ }),
416
+
417
+ /***/ "./css/themes/light.css":
418
+ /*!******************************!*\
419
+ !*** ./css/themes/light.css ***!
420
+ \******************************/
421
+ /*! no static exports found */
422
+ /***/ (function(module, exports) {
423
+
424
+ eval("// removed by extract-text-webpack-plugin\n\n//# sourceURL=file://cloudcmd/css/themes/light.css");
425
+
392
426
  /***/ })
393
427
 
394
428
  /******/ });
@@ -15,6 +15,9 @@
15
15
  <style data-name="columns">
16
16
  {{ columns }}
17
17
  </style>
18
+ <style data-name="themes">
19
+ {{ themes }}
20
+ </style>
18
21
  </head>
19
22
  <body>
20
23
  <div class="fm">{{ fm }}</div>
@@ -163,7 +163,7 @@
163
163
  /***/ (function(module, exports, __webpack_require__) {
164
164
 
165
165
  "use strict";
166
- eval("\n\n/* global CloudCmd, DOM, io */\n__webpack_require__(/*! ../../../css/config.css */ \"./css/config.css\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst squad = __webpack_require__(/*! squad */ \"./node_modules/squad/lib/squad.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst input = __webpack_require__(/*! ./input */ \"./client/modules/config/input.js\");\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\nconst Events = __webpack_require__(/*! ../../dom/events */ \"./client/dom/events/index.js\");\nconst Files = __webpack_require__(/*! ../../dom/files */ \"./client/dom/files.js\");\nconst {\n getTitle\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n Dialog,\n setTitle\n} = DOM;\nconst Name = 'Config';\nCloudCmd[Name] = module.exports;\nconst loadSocket = promisify(DOM.loadSocket);\nconst showLoad = () => {\n Images.show.load('top');\n};\nconst addKey = currify((fn, input) => {\n Events.addKey(input, fn);\n return input;\n});\nconst addChange = currify((fn, input) => {\n Events.add('change', input, fn);\n return input;\n});\nconst Config = {};\nlet Template;\nconst loadCSS = load.css;\nmodule.exports.init = async () => {\n if (!CloudCmd.config('configDialog')) return;\n showLoad();\n const {\n prefix\n } = CloudCmd;\n [Template] = await Promise.all([Files.get('config-tmpl'), loadSocket(), loadCSS(`${prefix}/dist/config.css`), CloudCmd.View()]);\n initSocket();\n};\nconst {\n config,\n Key\n} = CloudCmd;\nlet Element;\nfunction getHost() {\n const {\n host,\n origin,\n protocol\n } = location;\n return origin || `${protocol}//${host}`;\n}\nfunction initSocket() {\n const href = getHost();\n const {\n prefixSocket,\n prefix\n } = CloudCmd;\n const ONE_MINUTE = 60 * 1000;\n const socket = io.connect(href + prefixSocket + '/config', {\n reconnectionAttempts: Infinity,\n reconnectionDelay: ONE_MINUTE,\n path: `${prefix}/socket.io`\n });\n const save = data => {\n onSave(data);\n socket.send(data);\n };\n authCheck(socket);\n socket.on('connect', () => {\n Config.save = save;\n });\n socket.on('message', onSave);\n socket.on('log', CloudCmd.log);\n socket.on('disconnect', () => {\n Config.save = saveHttp;\n });\n socket.on('err', Dialog.alert);\n}\nfunction authCheck(socket) {\n socket.emit('auth', config('username'), config('password'));\n socket.on('reject', wraptile(Dialog.alert, 'Wrong credentials!'));\n}\nConfig.save = saveHttp;\nmodule.exports.show = show;\nasync function show() {\n if (!CloudCmd.config('configDialog')) return;\n await fillTemplate();\n}\nasync function fillTemplate() {\n const [error, config] = await tryToCatch(Files.get, 'config');\n if (error) return Dialog.alert('Could not load config!');\n const {\n editor,\n packer,\n columns,\n configAuth,\n ...obj\n } = input.convert(config);\n obj[`${editor}-selected`] = 'selected';\n obj[`${packer}-selected`] = 'selected';\n obj[`${columns}-selected`] = 'selected';\n obj.configAuth = configAuth ? '' : 'hidden';\n const innerHTML = rendy(Template, obj);\n Element = createElement('form', {\n className: 'config',\n innerHTML\n });\n const inputs = document.querySelectorAll('input, select', Element);\n const [inputFirst] = inputs;\n let afterShow;\n if (inputFirst) {\n onAuthChange(inputFirst.checked);\n afterShow = inputFirst.focus.bind(inputFirst);\n }\n const getTarget = ({\n target\n }) => target;\n const handleChange = squad(onChange, getTarget);\n Array.from(inputs).map(addKey(onKey)).map(addChange(handleChange));\n const autoSize = true;\n CloudCmd.View.show(Element, {\n autoSize,\n afterShow\n });\n}\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nasync function onChange(el) {\n const obj = {};\n const name = input.getName(el);\n const data = input.getValue(name, Element);\n if (name === 'name') onNameChange(data);else if (name === 'auth') onAuthChange(data);\n obj[name] = data;\n await Config.save(obj);\n}\nfunction onSave(obj) {\n for (const name of Object.keys(obj)) {\n const data = obj[name];\n CloudCmd._config(name, data);\n input.setValue(name, data, Element);\n }\n}\nasync function saveHttp(obj) {\n const {\n RESTful\n } = DOM;\n const [e] = await RESTful.Config.write(obj);\n if (e) return;\n onSave(obj);\n}\nfunction onAuthChange(checked) {\n const elUsername = input.getElementByName('username', Element);\n const elPassword = input.getElementByName('password', Element);\n elUsername.disabled = elPassword.disabled = !checked;\n}\nfunction onNameChange(name) {\n setTitle(getTitle({\n name\n }));\n}\nasync function onKey({\n keyCode,\n target\n}) {\n switch (keyCode) {\n case Key.ESC:\n return hide();\n case Key.ENTER:\n return await onChange(target);\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/config/index.js");
166
+ eval("\n\n/* global CloudCmd, DOM, io */\n__webpack_require__(/*! ../../../css/config.css */ \"./css/config.css\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst squad = __webpack_require__(/*! squad */ \"./node_modules/squad/lib/squad.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst input = __webpack_require__(/*! ./input */ \"./client/modules/config/input.js\");\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\nconst Events = __webpack_require__(/*! ../../dom/events */ \"./client/dom/events/index.js\");\nconst Files = __webpack_require__(/*! ../../dom/files */ \"./client/dom/files.js\");\nconst {\n getTitle\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n Dialog,\n setTitle\n} = DOM;\nconst Name = 'Config';\nCloudCmd[Name] = module.exports;\nconst loadSocket = promisify(DOM.loadSocket);\nconst showLoad = () => {\n Images.show.load('top');\n};\nconst addKey = currify((fn, input) => {\n Events.addKey(input, fn);\n return input;\n});\nconst addChange = currify((fn, input) => {\n Events.add('change', input, fn);\n return input;\n});\nconst Config = {};\nlet Template;\nconst loadCSS = load.css;\nmodule.exports.init = async () => {\n if (!CloudCmd.config('configDialog')) return;\n showLoad();\n const {\n prefix\n } = CloudCmd;\n [Template] = await Promise.all([Files.get('config-tmpl'), loadSocket(), loadCSS(`${prefix}/dist/config.css`), CloudCmd.View()]);\n initSocket();\n};\nconst {\n config,\n Key\n} = CloudCmd;\nlet Element;\nfunction getHost() {\n const {\n host,\n origin,\n protocol\n } = location;\n return origin || `${protocol}//${host}`;\n}\nfunction initSocket() {\n const href = getHost();\n const {\n prefixSocket,\n prefix\n } = CloudCmd;\n const ONE_MINUTE = 60 * 1000;\n const socket = io.connect(href + prefixSocket + '/config', {\n reconnectionAttempts: Infinity,\n reconnectionDelay: ONE_MINUTE,\n path: `${prefix}/socket.io`\n });\n const save = data => {\n onSave(data);\n socket.send(data);\n };\n authCheck(socket);\n socket.on('connect', () => {\n Config.save = save;\n });\n socket.on('message', onSave);\n socket.on('log', CloudCmd.log);\n socket.on('disconnect', () => {\n Config.save = saveHttp;\n });\n socket.on('err', Dialog.alert);\n}\nfunction authCheck(socket) {\n socket.emit('auth', config('username'), config('password'));\n socket.on('reject', wraptile(Dialog.alert, 'Wrong credentials!'));\n}\nConfig.save = saveHttp;\nmodule.exports.show = show;\nasync function show() {\n if (!CloudCmd.config('configDialog')) return;\n await fillTemplate();\n}\nasync function fillTemplate() {\n const [error, config] = await tryToCatch(Files.get, 'config');\n if (error) return Dialog.alert('Could not load config!');\n const {\n editor,\n packer,\n columns,\n theme,\n configAuth,\n ...obj\n } = input.convert(config);\n obj[`${editor}-selected`] = 'selected';\n obj[`${packer}-selected`] = 'selected';\n obj[`${columns}-selected`] = 'selected';\n obj[`${theme}-selected`] = 'selected';\n obj.configAuth = configAuth ? '' : 'hidden';\n const innerHTML = rendy(Template, obj);\n Element = createElement('form', {\n className: 'config',\n innerHTML\n });\n const inputs = document.querySelectorAll('input, select', Element);\n const [inputFirst] = inputs;\n let afterShow;\n if (inputFirst) {\n onAuthChange(inputFirst.checked);\n afterShow = inputFirst.focus.bind(inputFirst);\n }\n const getTarget = ({\n target\n }) => target;\n const handleChange = squad(onChange, getTarget);\n Array.from(inputs).map(addKey(onKey)).map(addChange(handleChange));\n const autoSize = true;\n CloudCmd.View.show(Element, {\n autoSize,\n afterShow\n });\n}\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nasync function onChange(el) {\n const obj = {};\n const name = input.getName(el);\n const data = input.getValue(name, Element);\n if (name === 'name') onNameChange(data);else if (name === 'auth') onAuthChange(data);\n obj[name] = data;\n await Config.save(obj);\n}\nfunction onSave(obj) {\n for (const name of Object.keys(obj)) {\n const data = obj[name];\n CloudCmd._config(name, data);\n input.setValue(name, data, Element);\n }\n}\nasync function saveHttp(obj) {\n const {\n RESTful\n } = DOM;\n const [e] = await RESTful.Config.write(obj);\n if (e) return;\n onSave(obj);\n}\nfunction onAuthChange(checked) {\n const elUsername = input.getElementByName('username', Element);\n const elPassword = input.getElementByName('password', Element);\n elUsername.disabled = elPassword.disabled = !checked;\n}\nfunction onNameChange(name) {\n setTitle(getTitle({\n name\n }));\n}\nasync function onKey({\n keyCode,\n target\n}) {\n switch (keyCode) {\n case Key.ESC:\n return hide();\n case Key.ENTER:\n return await onChange(target);\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/config/index.js");
167
167
 
168
168
  /***/ }),
169
169
 
package/dist-dev/sw.js CHANGED
@@ -1,7 +1,9 @@
1
1
  var serviceWorkerOption = {
2
2
  "assets": [
3
3
  "/columns/name-size-date.css",
4
- "/columns/name-size.css"
4
+ "/columns/name-size.css",
5
+ "/themes/dark.css",
6
+ "/themes/light.css"
5
7
  ]
6
8
  };
7
9
 
@@ -101,7 +103,7 @@ var serviceWorkerOption = {
101
103
  /***/ (function(module, exports, __webpack_require__) {
102
104
 
103
105
  "use strict";
104
- eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Fri Mar 29 2024 10:33:02 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/sw.js");
106
+ eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Fri Mar 29 2024 15:03:14 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/sw.js");
105
107
 
106
108
  /***/ }),
107
109
 
@@ -0,0 +1,49 @@
1
+ :root {
2
+ --link-color: #317bf9;
3
+ --border-color: rgb(49 123 249 / 40%);
4
+ --background: #22272e;
5
+ --column-color: #727e8c;
6
+ --icon-color: #478be6;
7
+ --button-background: #22272e;
8
+ --internal-background: #373e47;
9
+ }
10
+
11
+ .view {
12
+ background: var(--internal-background) !important;
13
+ color: var(--column-color) !important;
14
+ }
15
+ .view a {
16
+ color: var(--link-color) !important;
17
+ }
18
+
19
+ .smalltalk .page,
20
+ .smalltalk header,
21
+ .smalltalk .button-strip button,
22
+ .smalltalk input {
23
+ background: var(--internal-background) !important;
24
+ color: var(--link-color) !important;
25
+ text-shadow: none !important;
26
+ }
27
+
28
+ .cloudcmd-user-menu,
29
+ .cloudcmd-user-menu-button {
30
+ background: var(--internal-background) !important;
31
+ color: var(--link-color) !important;
32
+ }
33
+
34
+ .jqconsole {
35
+ background: #373e47 !important;
36
+ }
37
+
38
+ .jqconsole-prompt {
39
+ color: var(--column-color) !important;
40
+ }
41
+
42
+ .log-msg {
43
+ color: var(--column-color) !important;
44
+ }
45
+
46
+ .menu {
47
+ color: var(--link-color) !important;
48
+ background: var(--internal-background) !important;
49
+ }
@@ -0,0 +1,9 @@
1
+ :root {
2
+ --link-color: blue;
3
+ --selected-menu-item-color: #317bf9;
4
+ --border-color: rgb(49 123 249 / 40%);
5
+ --background: white;
6
+ --column-color: black;
7
+ --icon-color: #222;
8
+ --button-background: white;
9
+ }
package/json/config.json CHANGED
@@ -34,6 +34,7 @@
34
34
  "showFileName": false,
35
35
  "vim": false,
36
36
  "columns": "name-size-date-owner-mode",
37
+ "theme": "light",
37
38
  "export": false,
38
39
  "exportToken": "root",
39
40
  "import": false,
package/json/help.json CHANGED
@@ -32,6 +32,7 @@
32
32
  "--terminal-auto-restart ": "restart command on exit",
33
33
  "--vim ": "enable vim hot keys",
34
34
  "--columns ": "set visible columns",
35
+ "--theme ": "set theme 'light' or 'dark'",
35
36
  "--export ": "enable export of config through a server",
36
37
  "--export-token ": "authorization token used by export server",
37
38
  "--import ": "enable import of config",
package/man/cloudcmd.1 CHANGED
@@ -55,6 +55,7 @@ programs in browser from any computer, mobile or tablet device.
55
55
  --terminal-auto-restart restart command on exit
56
56
  --vim enable vim hot keys
57
57
  --columns set visible columns
58
+ --theme set theme 'light' or 'dark'
58
59
  --export enable export of config through a server
59
60
  --export-token authorization token used by export server
60
61
  --import enable import of config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "17.2.1",
3
+ "version": "17.3.1",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "File manager for the web with console and editor",
@@ -20,11 +20,11 @@ import {createConfig, configPath} from './config.js';
20
20
  import modulas from './modulas.js';
21
21
  import userMenu from './user-menu.mjs';
22
22
  import rest from './rest/index.js';
23
- import route from './route.js';
24
- import validate from './validate.js';
23
+ import route from './route.mjs';
24
+ import * as validate from './validate.mjs';
25
25
  import prefixer from './prefixer.js';
26
26
  import terminal from './terminal.js';
27
- import distribute from './distribute/index.js';
27
+ import {distributeExport} from './distribute/export.mjs';
28
28
  import {createDepStore} from './depstore.js';
29
29
 
30
30
  const __filename = fileURLToPath(import.meta.url);
@@ -64,7 +64,7 @@ function cloudcmd(params) {
64
64
  if (/root/.test(name))
65
65
  validate.root(value, config);
66
66
 
67
- if (/editor|packer|columns/.test(name))
67
+ if (/editor|packer|themes/.test(name))
68
68
  validate[name](value);
69
69
 
70
70
  if (/prefix/.test(name))
@@ -175,7 +175,7 @@ function listen({prefixSocket, socket, config}) {
175
175
  autoRestart: config('terminalAutoRestart'),
176
176
  });
177
177
 
178
- distribute.export(config, socket);
178
+ distributeExport(config, socket);
179
179
  }
180
180
 
181
181
  function cloudcmdMiddle({modules, config}) {
@@ -1,13 +1,14 @@
1
- 'use strict';
2
-
3
- const fullstore = require('fullstore');
4
- const process = require('node:process');
5
- const path = require('node:path');
6
- const fs = require('node:fs');
7
-
8
- const {nanomemoize} = require('nano-memoize');
9
- const readFilesSync = require('@cloudcmd/read-files-sync');
10
-
1
+ import path, {dirname} from 'node:path';
2
+ import {fileURLToPath} from 'node:url';
3
+ import process from 'node:process';
4
+ import fs from 'node:fs';
5
+ import fullstore from 'fullstore';
6
+ import nanomemoizeDefault from 'nano-memoize';
7
+ import readFilesSync from '@cloudcmd/read-files-sync';
8
+
9
+ const {nanomemoize} = nanomemoizeDefault;
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
11
12
  const isMap = (a) => /\.map$/.test(a);
12
13
  const not = (fn) => (a) => !fn(a);
13
14
 
@@ -19,9 +20,9 @@ const defaultColumns = {
19
20
  const _isDev = fullstore(process.env.NODE_ENV === 'development');
20
21
  const getDist = (isDev) => isDev ? 'dist-dev' : 'dist';
21
22
 
22
- module.exports.isDev = _isDev;
23
+ export const isDev = _isDev;
23
24
 
24
- module.exports.getColumns = ({isDev = _isDev()} = {}) => {
25
+ export const getColumns = ({isDev = _isDev()} = {}) => {
25
26
  const columns = readFilesSyncMemo(isDev);
26
27
 
27
28
  return {
@@ -0,0 +1,40 @@
1
+ import {dirname} from 'node:path';
2
+ import {fileURLToPath} from 'node:url';
3
+ import test from 'supertape';
4
+ import fs from 'node:fs';
5
+ import {getColumns, isDev} from './columns.mjs';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+
10
+ test('columns: prod', (t) => {
11
+ const columns = getColumns({
12
+ isDev: false,
13
+ });
14
+
15
+ t.equal(columns[''], '');
16
+ t.end();
17
+ });
18
+
19
+ test('columns: dev', (t) => {
20
+ const columns = getColumns({
21
+ isDev: true,
22
+ });
23
+
24
+ const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
25
+
26
+ t.equal(columns['name-size-date'], css);
27
+ t.end();
28
+ });
29
+
30
+ test('columns: no args', (t) => {
31
+ const currentIsDev = isDev();
32
+ isDev(true);
33
+ const columns = getColumns();
34
+
35
+ const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
36
+ isDev(currentIsDev);
37
+
38
+ t.equal(columns['name-size-date'], css);
39
+ t.end();
40
+ });
@@ -1,13 +1,8 @@
1
- 'use strict';
2
-
3
- const currify = require('currify');
4
- const wraptile = require('wraptile');
5
- const squad = require('squad');
6
- const omit = require('object.omit');
7
-
8
- const log = require('./log');
9
-
10
- const {
1
+ import currify from 'currify';
2
+ import wraptile from 'wraptile';
3
+ import squad from 'squad';
4
+ import omit from 'object.omit';
5
+ import log, {
11
6
  exportStr,
12
7
  connectedStr,
13
8
  disconnectedStr,
@@ -16,7 +11,7 @@ const {
16
11
  getMessage,
17
12
  getDescription,
18
13
  logWraped,
19
- } = log;
14
+ } from './log.mjs';
20
15
 
21
16
  const omitList = [
22
17
  'auth',
@@ -38,7 +33,7 @@ const omitList = [
38
33
 
39
34
  const omitConfig = (config) => omit(config, omitList);
40
35
 
41
- module.exports = (config, socket) => {
36
+ export const distributeExport = (config, socket) => {
42
37
  if (!config('export'))
43
38
  return;
44
39
 
@@ -1,16 +1,14 @@
1
- 'use strict';
1
+ import currify from 'currify';
2
+ import wraptile from 'wraptile';
3
+ import squad from 'squad';
4
+ import fullstore from 'fullstore';
5
+ import io from 'socket.io-client';
6
+ import log from './log.mjs';
7
+ import env from '../env.js';
8
+ import _forEachKey from 'for-each-key';
2
9
 
3
- const currify = require('currify');
4
- const wraptile = require('wraptile');
5
- const squad = require('squad');
6
- const fullstore = require('fullstore');
7
-
8
- const io = require('socket.io-client');
9
- const log = require('./log');
10
-
11
- const env = require('../env');
12
10
  const noop = () => {};
13
- const forEachKey = currify(require('for-each-key'));
11
+ const forEachKey = currify(_forEachKey);
14
12
 
15
13
  const {
16
14
  importStr,
@@ -67,7 +65,7 @@ const updateConfig = currify((config, data) => {
67
65
  }
68
66
  });
69
67
 
70
- module.exports = (config, options, fn) => {
68
+ export const distributeImport = (config, options, fn) => {
71
69
  fn = fn || options;
72
70
 
73
71
  if (!config('import'))
@@ -1,15 +1,13 @@
1
- import {createRequire} from 'node:module';
2
1
  import process from 'node:process';
3
2
  import test from 'supertape';
4
3
  import {promisify} from 'node:util';
5
4
  import tryToCatch from 'try-to-catch';
6
5
  import {connect} from '../../test/before.mjs';
7
6
  import {createConfigManager} from '../cloudcmd.mjs';
8
-
9
- const require = createRequire(import.meta.url);
7
+ import {distributeImport} from './import.mjs';
10
8
 
11
9
  const distribute = {
12
- import: promisify(require('./import')),
10
+ import: promisify(distributeImport),
13
11
  };
14
12
 
15
13
  const config = createConfigManager();
@@ -0,0 +1,52 @@
1
+ import wraptile from 'wraptile';
2
+ import chalk from 'chalk';
3
+ import datetime from '../../common/datetime.js';
4
+
5
+ const {assign} = Object;
6
+
7
+ const log = (isLog, name, msg) => isLog && console.log(`${datetime()} -> ${name}: ${msg}`);
8
+
9
+ export const makeColor = (a) => chalk.blue(a);
10
+ export const getMessage = (e) => e.message || e;
11
+ export const getDescription = (e) => e.message;
12
+
13
+ export default log;
14
+
15
+ export const logWraped = wraptile(log);
16
+
17
+ export const importStr = 'import';
18
+ export const exportStr = 'export';
19
+ export const connectedStr = chalk.green('connected');
20
+ export const disconnectedStr = chalk.red('disconnected');
21
+ export const tokenRejectedStr = chalk.red('token rejected');
22
+ export const authTryStr = chalk.yellow('try to auth');
23
+
24
+ export function stringToRGB(a) {
25
+ return [
26
+ a.charCodeAt(0),
27
+ a.length,
28
+ crc(a),
29
+ ];
30
+ }
31
+
32
+ const add = (a, b) => a + b.charCodeAt(0);
33
+
34
+ function crc(a) {
35
+ return a
36
+ .split('')
37
+ .reduce(add, 0);
38
+ }
39
+
40
+ assign(log, {
41
+ getMessage,
42
+ makeColor,
43
+ getDescription,
44
+ authTryStr,
45
+ stringToRGB,
46
+ logWraped,
47
+ importStr,
48
+ exportStr,
49
+ connectedStr,
50
+ disconnectedStr,
51
+ tokenRejectedStr,
52
+ });