cloudcmd 17.2.0 → 17.3.0
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.
- package/ChangeLog +16 -0
- package/HELP.md +7 -5
- package/README.md +1 -1
- package/bin/cloudcmd.mjs +11 -4
- package/dist/cloudcmd.common.js +3 -3
- package/dist/cloudcmd.common.js.map +1 -1
- package/dist/cloudcmd.css +1 -1
- package/dist/cloudcmd.js +1 -1
- package/dist/cloudcmd.js.map +1 -1
- package/dist/config.css +1 -1
- package/dist/index.html +1 -1
- package/dist/modules/cloud.js +1 -1
- package/dist/modules/cloud.js.map +1 -1
- package/dist/modules/command-line.js +1 -1
- package/dist/modules/command-line.js.map +1 -1
- package/dist/modules/config.js +1 -1
- package/dist/modules/config.js.map +1 -1
- package/dist/modules/contact.js +1 -1
- package/dist/modules/contact.js.map +1 -1
- package/dist/modules/edit-file-vim.js +1 -1
- package/dist/modules/edit-file-vim.js.map +1 -1
- package/dist/modules/edit-file.js +1 -1
- package/dist/modules/edit-file.js.map +1 -1
- package/dist/modules/edit-names-vim.js +1 -1
- package/dist/modules/edit-names-vim.js.map +1 -1
- package/dist/modules/edit-names.js +1 -1
- package/dist/modules/edit-names.js.map +1 -1
- package/dist/modules/edit.js +1 -1
- package/dist/modules/edit.js.map +1 -1
- package/dist/modules/help.js +1 -1
- package/dist/modules/help.js.map +1 -1
- package/dist/modules/konsole.js +1 -1
- package/dist/modules/konsole.js.map +1 -1
- package/dist/modules/markdown.js +1 -1
- package/dist/modules/markdown.js.map +1 -1
- package/dist/modules/menu.js +1 -1
- package/dist/modules/menu.js.map +1 -1
- package/dist/modules/operation.js +1 -1
- package/dist/modules/operation.js.map +1 -1
- package/dist/modules/polyfill.js +1 -1
- package/dist/modules/polyfill.js.map +1 -1
- package/dist/modules/terminal-run.js +1 -1
- package/dist/modules/terminal-run.js.map +1 -1
- package/dist/modules/terminal.js +1 -1
- package/dist/modules/terminal.js.map +1 -1
- package/dist/modules/upload.js +1 -1
- package/dist/modules/upload.js.map +1 -1
- package/dist/modules/user-menu.js +1 -1
- package/dist/modules/user-menu.js.map +1 -1
- package/dist/modules/view.js +1 -1
- package/dist/modules/view.js.map +1 -1
- package/dist/sw.js +4 -2
- package/dist/themes/dark.css +1 -0
- package/dist/themes/light.css +1 -0
- package/dist/user-menu.css +1 -1
- package/dist-dev/cloudcmd.css +28 -23
- package/dist-dev/cloudcmd.js +36 -2
- package/dist-dev/config.css +2 -1
- package/dist-dev/index.html +3 -0
- package/dist-dev/modules/config.js +1 -1
- package/dist-dev/sw.js +4 -2
- package/dist-dev/themes/dark.css +49 -0
- package/dist-dev/themes/light.css +9 -0
- package/dist-dev/user-menu.css +1 -1
- package/json/config.json +1 -0
- package/json/help.json +1 -0
- package/man/cloudcmd.1 +1 -0
- package/package.json +1 -1
- package/server/cloudcmd.mjs +3 -3
- package/server/{columns.js → columns.mjs} +13 -12
- package/server/columns.spec.mjs +40 -0
- package/server/{route.js → route.mjs} +24 -23
- package/server/route.spec.mjs +2 -2
- package/server/theme.mjs +33 -0
- package/server/themes.spec.mjs +31 -0
- package/server/{validate.js → validate.mjs} +24 -10
- package/server/validate.spec.mjs +30 -1
- package/tmpl/config.hbs +7 -1
package/dist/modules/view.js.map
CHANGED
|
@@ -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","
|
|
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,E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,IAAIiF,GAAWG,KAAKN,EAAWzK,IAM/C,SAASqC,EAAQrC,GACf,MAAO,oBAAoB2K,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":""}
|
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
|
|
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 13:28:34 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}
|
package/dist/user-menu.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cloudcmd-user-menu{font-size:16px;font-family:Droid Sans Mono,Ubuntu Mono,Consolas,monospace;border:0}.cloudcmd-user-menu:focus{outline:0}.cloudcmd-user-menu>option:checked{box-shadow:20px -20px 0 2px var(--color) inset}.cloudcmd-user-menu-button{display:block;width:100%;font-size:16px;padding:2px;-webkit-appearance:none;border:0;overflow:auto}
|
|
1
|
+
.cloudcmd-user-menu{font-size:16px;font-family:Droid Sans Mono,Ubuntu Mono,Consolas,monospace;border:0}.cloudcmd-user-menu:focus{outline:0}.cloudcmd-user-menu>option:checked{box-shadow:20px -20px 0 2px var(--selected-menu-item-color) inset}.cloudcmd-user-menu-button{display:block;width:100%;font-size:16px;padding:2px;-webkit-appearance:none;border:0;overflow:auto}
|
package/dist-dev/cloudcmd.css
CHANGED
|
@@ -83,11 +83,6 @@ html {
|
|
|
83
83
|
body {
|
|
84
84
|
margin: 0;
|
|
85
85
|
}
|
|
86
|
-
:root {
|
|
87
|
-
--color: rgb(49 123 249);
|
|
88
|
-
--color-transparent: rgb(49 123 249 / 40%);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
86
|
html {
|
|
92
87
|
height: 94%;
|
|
93
88
|
}
|
|
@@ -96,7 +91,7 @@ body {
|
|
|
96
91
|
width: 100%;
|
|
97
92
|
height: 95%;
|
|
98
93
|
overflow: hidden;
|
|
99
|
-
background-color:
|
|
94
|
+
background-color: var(--background);
|
|
100
95
|
}
|
|
101
96
|
|
|
102
97
|
body,
|
|
@@ -131,12 +126,13 @@ code {
|
|
|
131
126
|
-ms-user-select: initial;
|
|
132
127
|
-o-user-select: initial;
|
|
133
128
|
user-select: text;
|
|
129
|
+
color: var(--column-color);
|
|
134
130
|
}
|
|
135
131
|
|
|
136
132
|
.panel,
|
|
137
133
|
.cmd-button {
|
|
138
134
|
border: 1px solid;
|
|
139
|
-
border-color: var(--color
|
|
135
|
+
border-color: var(--border-color);
|
|
140
136
|
}
|
|
141
137
|
|
|
142
138
|
.icon {
|
|
@@ -150,7 +146,7 @@ code {
|
|
|
150
146
|
|
|
151
147
|
.path-icon {
|
|
152
148
|
position: relative;
|
|
153
|
-
color:
|
|
149
|
+
color: var(--icon-color);
|
|
154
150
|
}
|
|
155
151
|
|
|
156
152
|
.path-icon:active {
|
|
@@ -183,7 +179,7 @@ code {
|
|
|
183
179
|
bottom: 5px;
|
|
184
180
|
left: 16px;
|
|
185
181
|
font-size: 10px;
|
|
186
|
-
color: var(--color);
|
|
182
|
+
color: var(--link-color);
|
|
187
183
|
content: attr(data-progress);
|
|
188
184
|
}
|
|
189
185
|
|
|
@@ -191,8 +187,8 @@ code {
|
|
|
191
187
|
width: 5%;
|
|
192
188
|
height: 30px;
|
|
193
189
|
margin: 20px 2px 0;
|
|
194
|
-
color:
|
|
195
|
-
background-color:
|
|
190
|
+
color: var(--icon-color);
|
|
191
|
+
background-color: var(--button-background);
|
|
196
192
|
transition: ease 0.1s;
|
|
197
193
|
}
|
|
198
194
|
|
|
@@ -203,7 +199,7 @@ code {
|
|
|
203
199
|
|
|
204
200
|
.cmd-button:active {
|
|
205
201
|
color: white;
|
|
206
|
-
background-color: var(--color);
|
|
202
|
+
background-color: var(--link-color);
|
|
207
203
|
transition: ease 0.1s;
|
|
208
204
|
}
|
|
209
205
|
|
|
@@ -247,6 +243,7 @@ a:active {
|
|
|
247
243
|
|
|
248
244
|
.fm-header {
|
|
249
245
|
font-weight: bold;
|
|
246
|
+
color: var(--column-color);
|
|
250
247
|
}
|
|
251
248
|
|
|
252
249
|
.panel-left {
|
|
@@ -254,13 +251,26 @@ a:active {
|
|
|
254
251
|
}
|
|
255
252
|
|
|
256
253
|
.current-file {
|
|
257
|
-
box-shadow: 0 0 0 1px var(--color
|
|
254
|
+
box-shadow: 0 0 0 1px var(--border-color) inset;
|
|
258
255
|
}
|
|
259
256
|
|
|
260
257
|
.cut-file {
|
|
261
258
|
opacity: 0.7;
|
|
262
259
|
}
|
|
263
260
|
|
|
261
|
+
.name {
|
|
262
|
+
float: left;
|
|
263
|
+
width: 26%;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.name a {
|
|
267
|
+
color: var(--link-color);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.name a:hover {
|
|
271
|
+
cursor: default;
|
|
272
|
+
}
|
|
273
|
+
|
|
264
274
|
.selected-file,
|
|
265
275
|
.selected-file .name > a {
|
|
266
276
|
color: rgb(254 159 224);
|
|
@@ -288,25 +298,18 @@ a:active {
|
|
|
288
298
|
text-align: center;
|
|
289
299
|
}
|
|
290
300
|
|
|
291
|
-
.name {
|
|
292
|
-
float: left;
|
|
293
|
-
width: 26%;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.name a:hover {
|
|
297
|
-
cursor: default;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
301
|
.size {
|
|
301
302
|
float: left;
|
|
302
303
|
width: 12%;
|
|
303
304
|
margin-right: 27px;
|
|
304
305
|
text-align: right;
|
|
306
|
+
color: var(--column-color);
|
|
305
307
|
}
|
|
306
308
|
|
|
307
309
|
.date {
|
|
308
310
|
float: left;
|
|
309
311
|
width: 19%;
|
|
312
|
+
color: var(--column-color);
|
|
310
313
|
}
|
|
311
314
|
|
|
312
315
|
.owner {
|
|
@@ -318,11 +321,13 @@ a:active {
|
|
|
318
321
|
* spaces behind lines
|
|
319
322
|
*/
|
|
320
323
|
vertical-align: top;
|
|
324
|
+
color: var(--column-color);
|
|
321
325
|
}
|
|
322
326
|
|
|
323
327
|
.mode {
|
|
324
328
|
float: right;
|
|
325
329
|
width: 18%;
|
|
330
|
+
color: var(--column-color);
|
|
326
331
|
}
|
|
327
332
|
|
|
328
333
|
.reduce-text {
|
|
@@ -617,7 +622,7 @@ a:active {
|
|
|
617
622
|
|
|
618
623
|
/* текущий файл под курсором */
|
|
619
624
|
.current-file {
|
|
620
|
-
background-color: var(--color
|
|
625
|
+
background-color: var(--border-color);
|
|
621
626
|
color: white;
|
|
622
627
|
}
|
|
623
628
|
/* делаем иконки под курсом белыми */
|
package/dist-dev/cloudcmd.js
CHANGED
|
@@ -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__(/*!
|
|
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
|
|
|
@@ -271,7 +283,7 @@ eval("\n\n/* global DOM */\nmodule.exports.selectFileNotParent = selectFileNotPa
|
|
|
271
283
|
/***/ (function(module, exports, __webpack_require__) {
|
|
272
284
|
|
|
273
285
|
"use strict";
|
|
274
|
-
eval("\n\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst store = fullstore('');\nconst visual = fullstore(false);\nconst stopVisual = () => {\n visual(false);\n};\nconst end = () => {\n store('');\n};\nconst rmFirst = a => {\n return a.split('').slice(1).join('');\n};\nconst noop = () => {};\nmodule.exports = (key, operations) => {\n const prevStore = store();\n const isVisual = visual();\n const value = store(prevStore.concat(key));\n const {\n escape = noop,\n moveNext = noop,\n movePrevious = noop,\n remove = noop,\n copy = noop,\n paste = noop,\n select = noop,\n find = noop,\n findNext = noop,\n findPrevious = noop,\n makeFile = noop,\n makeDirectory = noop,\n terminal = noop,\n edit = noop\n } = operations;\n if (key === 'Enter') return end();\n if (key === 'Escape') {\n visual(false);\n escape();\n return end();\n }\n if (key === 'j' || key === 'w') {\n const {\n count,\n isDelete,\n isVisual\n } = handleDelete(prevStore);\n !isNaN(count) && moveNext({\n count,\n isVisual,\n isDelete\n });\n return end();\n }\n if (key === 'k' || key === 'b') {\n const {\n count,\n isDelete,\n isVisual\n } = handleDelete(prevStore);\n !isNaN(count) && movePrevious({\n count,\n isVisual,\n isDelete\n });\n return end();\n }\n if (value === 'gg' || key === '^') {\n const {\n isDelete,\n isVisual\n } = handleDelete(prevStore);\n movePrevious({\n count: Infinity,\n isVisual,\n isDelete\n });\n return end();\n }\n if (value === 'md') {\n makeDirectory();\n return end();\n }\n if (value === 'tt') {\n terminal();\n return end();\n }\n if (value === 'e') {\n edit();\n return end();\n }\n if (value === 'mf') {\n makeFile();\n return end();\n }\n if (key === 'd' && (visual() || prevStore === 'd')) {\n stopVisual();\n remove();\n return end();\n }\n if (key === 'G' || key === '$') {\n moveNext({\n count: Infinity,\n isVisual\n });\n return end();\n }\n if (key === 'y') {\n if (!visual()) return end();\n stopVisual();\n copy();\n return end();\n }\n if (/^p$/i.test(key)) {\n paste();\n return end();\n }\n if (/^v$/i.test(key)) {\n visual(!visual());\n select();\n return end();\n }\n if (key === '/') {\n find();\n return end();\n }\n if (key === 'n') {\n findNext();\n return end();\n }\n if (key === 'N') {\n findPrevious();\n return end();\n }\n};\nfunction handleDelete(prevStore) {\n const isDelete = prevStore[0] === 'd';\n if (isDelete) {\n visual(true);\n prevStore = rmFirst(prevStore);\n }\n const count = getNumber(prevStore);\n const isVisual = visual();\n return {\n count,\n isDelete,\n isVisual\n };\n}\nfunction getNumber(value) {\n if (!value) return 1;\n if (value === 'g') return 1;\n return parseInt(value);\n}\n\n//# sourceURL=file://cloudcmd/client/key/vim/vim.js");
|
|
286
|
+
eval("\n\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst store = fullstore('');\nconst visual = fullstore(false);\nconst stopVisual = () => {\n visual(false);\n};\nconst end = () => {\n store('');\n};\nconst rmFirst = a => {\n return a.split('').slice(1).join('');\n};\nconst noop = () => {};\nmodule.exports = (key, operations = {}) => {\n const prevStore = store();\n const isVisual = visual();\n const value = store(prevStore.concat(key));\n const {\n escape = noop,\n moveNext = noop,\n movePrevious = noop,\n remove = noop,\n copy = noop,\n paste = noop,\n select = noop,\n find = noop,\n findNext = noop,\n findPrevious = noop,\n makeFile = noop,\n makeDirectory = noop,\n terminal = noop,\n edit = noop\n } = operations;\n if (key === 'Enter') return end();\n if (key === 'Escape') {\n visual(false);\n escape();\n return end();\n }\n if (key === 'j' || key === 'w') {\n const {\n count,\n isDelete,\n isVisual\n } = handleDelete(prevStore);\n !isNaN(count) && moveNext({\n count,\n isVisual,\n isDelete\n });\n return end();\n }\n if (key === 'k' || key === 'b') {\n const {\n count,\n isDelete,\n isVisual\n } = handleDelete(prevStore);\n !isNaN(count) && movePrevious({\n count,\n isVisual,\n isDelete\n });\n return end();\n }\n if (value === 'gg' || key === '^') {\n const {\n isDelete,\n isVisual\n } = handleDelete(prevStore);\n movePrevious({\n count: Infinity,\n isVisual,\n isDelete\n });\n return end();\n }\n if (value === 'md') {\n makeDirectory();\n return end();\n }\n if (value === 'tt') {\n terminal();\n return end();\n }\n if (value === 'e') {\n edit();\n return end();\n }\n if (value === 'mf') {\n makeFile();\n return end();\n }\n if (key === 'd' && (visual() || prevStore === 'd')) {\n stopVisual();\n remove();\n return end();\n }\n if (key === 'G' || key === '$') {\n moveNext({\n count: Infinity,\n isVisual\n });\n return end();\n }\n if (key === 'y') {\n if (!visual()) return end();\n stopVisual();\n copy();\n return end();\n }\n if (/^p$/i.test(key)) {\n paste();\n return end();\n }\n if (/^v$/i.test(key)) {\n visual(!visual());\n select();\n return end();\n }\n if (key === '/') {\n find();\n return end();\n }\n if (key === 'n') {\n findNext();\n return end();\n }\n if (key === 'N') {\n findPrevious();\n return end();\n }\n if (key === ' ') return end();\n};\nfunction handleDelete(prevStore) {\n const isDelete = prevStore[0] === 'd';\n if (isDelete) {\n visual(true);\n prevStore = rmFirst(prevStore);\n }\n const count = getNumber(prevStore);\n const isVisual = visual();\n return {\n count,\n isDelete,\n isVisual\n };\n}\nfunction getNumber(value) {\n if (!value) return 1;\n if (value === 'g') return 1;\n return parseInt(value);\n}\n\n//# sourceURL=file://cloudcmd/client/key/vim/vim.js");
|
|
275
287
|
|
|
276
288
|
/***/ }),
|
|
277
289
|
|
|
@@ -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
|
/******/ });
|
package/dist-dev/config.css
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
padding: 0 12px;
|
|
19
19
|
font-size: 16px;
|
|
20
20
|
line-height: 1.5;
|
|
21
|
-
color:
|
|
21
|
+
color: var(--column-color);
|
|
22
|
+
background: var(--internal-background);
|
|
22
23
|
border: 1px solid #ccc;
|
|
23
24
|
-webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%);
|
|
24
25
|
-moz-box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%);
|
package/dist-dev/index.html
CHANGED
|
@@ -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
|
|
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 13:28:49 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
|
+
}
|
package/dist-dev/user-menu.css
CHANGED
package/json/config.json
CHANGED
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
package/server/cloudcmd.mjs
CHANGED
|
@@ -20,8 +20,8 @@ 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.
|
|
24
|
-
import validate from './validate.
|
|
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
27
|
import distribute from './distribute/index.js';
|
|
@@ -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|
|
|
67
|
+
if (/editor|packer|themes/.test(name))
|
|
68
68
|
validate[name](value);
|
|
69
69
|
|
|
70
70
|
if (/prefix/.test(name))
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
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
|
-
|
|
23
|
+
export const isDev = _isDev;
|
|
23
24
|
|
|
24
|
-
|
|
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
|
+
});
|