cloudcmd 19.7.0 → 19.8.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 +13 -0
- package/HELP.md +3 -1
- package/README.md +1 -1
- package/bin/cloudcmd.js +2 -2
- package/common/cloudfunc.js +6 -1
- package/dist/cloudcmd.common.css +1 -1
- package/dist/cloudcmd.common.css.map +1 -1
- package/dist/cloudcmd.common.js +11 -2
- package/dist/cloudcmd.common.js.map +1 -1
- package/dist/columns/name-size-date-time.css +2 -0
- package/dist/columns/name-size-date-time.css.map +1 -0
- package/dist/columns/name-size-date-time.js +7 -0
- package/dist/columns/name-size-date-time.js.map +1 -0
- package/dist/columns/name-size-date.css +1 -1
- package/dist/columns/name-size-date.css.map +1 -1
- package/dist/columns/name-size.css +1 -1
- package/dist/columns/name-size.css.map +1 -1
- package/dist/sw.js +1 -1
- package/dist-dev/cloudcmd.common.css +5 -0
- package/dist-dev/cloudcmd.common.js +2 -2
- package/dist-dev/columns/name-size-date-time.css +30 -0
- package/dist-dev/columns/name-size-date-time.js +49 -0
- package/dist-dev/columns/name-size-date.css +5 -0
- package/dist-dev/columns/name-size.css +5 -0
- package/dist-dev/sw.js +1 -1
- package/package.json +2 -2
- package/tmpl/config.hbs +1 -0
- package/tmpl/fs/file.hbs +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columns/name-size-date-time.css","mappings":"AAAA,MACI,SACJ,CAEA,MACI,UACJ,CAMA,aACI,YACJ,CAOA,YAJI,WAAY,CACZ,SAOJ,CAJA,MACI,cAGJ","sources":["file://cloudcmd//Users/coderaiser/cloudcmd/css/columns/name-size-date-time.css"],"sourcesContent":[".name {\n width: 40%;\n}\n\n.size {\n float: none;\n}\n\n.owner {\n display: none;\n}\n\n.mode {\n display: none;\n}\n\n.date {\n float: right;\n width: 20%;\n}\n\n.time {\n display: inline;\n float: right;\n width: 20%;\n}\n"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columns/name-size-date-time.js","mappings":";;AAAA","sources":["webpack://cloudcmd/./css/columns/name-size-date-time.css?8664"],"sourcesContent":["// extracted by mini-css-extract-plugin\nexport {};"],"names":[],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.name{width:55%}.size{float:none}.mode,.owner{display:none}.date{float:right;width:19%}
|
|
1
|
+
.name{width:55%}.size{float:none}.mode,.owner{display:none}.date{float:right;width:19%}.time{display:none}
|
|
2
2
|
/*# sourceMappingURL=name-size-date.css.map*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns/name-size-date.css","mappings":"AAAA,MACI,SACJ,CAEA,MACI,UACJ,CAMA,aACI,YACJ,CAEA,MACI,WAAY,CACZ,SACJ","sources":["file://cloudcmd//Users/coderaiser/cloudcmd/css/columns/name-size-date.css"],"sourcesContent":[".name {\n width: 55%;\n}\n\n.size {\n float: none;\n}\n\n.owner {\n display: none;\n}\n\n.mode {\n display: none;\n}\n\n.date {\n float: right;\n width: 19%;\n}\n"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"columns/name-size-date.css","mappings":"AAAA,MACI,SACJ,CAEA,MACI,UACJ,CAMA,aACI,YACJ,CAEA,MACI,WAAY,CACZ,SACJ,CAEA,MACI,YACJ","sources":["file://cloudcmd//Users/coderaiser/cloudcmd/css/columns/name-size-date.css"],"sourcesContent":[".name {\n width: 55%;\n}\n\n.size {\n float: none;\n}\n\n.owner {\n display: none;\n}\n\n.mode {\n display: none;\n}\n\n.date {\n float: right;\n width: 19%;\n}\n\n.time {\n display: none;\n}\n\n"],"names":[],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.name{width:77%}.size{float:none;margin-right:0}.date,.mode,.owner{display:none}
|
|
1
|
+
.name{width:77%}.size{float:none;margin-right:0}.date,.mode,.owner,.time{display:none}
|
|
2
2
|
/*# sourceMappingURL=name-size.css.map*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns/name-size.css","mappings":"AAAA,MACI,SACJ,CAEA,MACI,UAAW,CACX,cACJ,
|
|
1
|
+
{"version":3,"file":"columns/name-size.css","mappings":"AAAA,MACI,SACJ,CAEA,MACI,UAAW,CACX,cACJ,CAcA,yBACI,YACJ","sources":["file://cloudcmd//Users/coderaiser/cloudcmd/css/columns/name-size.css"],"sourcesContent":[".name {\n width: 77%;\n}\n\n.size {\n float: none;\n margin-right: 0;\n}\n\n.owner {\n display: none;\n}\n\n.mode {\n display: none;\n}\n\n.date {\n display: none;\n}\n\n.time {\n display: none;\n}\n\n"],"names":[],"sourceRoot":""}
|
package/dist/sw.js
CHANGED
|
@@ -311,7 +311,7 @@ const respondWith = currify((f, e) => {
|
|
|
311
311
|
e.respondWith(f(e));
|
|
312
312
|
});
|
|
313
313
|
const getPathName = url => new URL(url).pathname;
|
|
314
|
-
const date = "
|
|
314
|
+
const date = "Fri Mar 20 2026 17:55:18 GMT+0200 (Eastern European Standard Time)";
|
|
315
315
|
const NAME = `cloudcmd: ${date}`;
|
|
316
316
|
const createRequest = a => new Request(a, {
|
|
317
317
|
credentials: 'same-origin'
|
|
@@ -1547,7 +1547,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
1547
1547
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1548
1548
|
|
|
1549
1549
|
"use strict";
|
|
1550
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var _css_config_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css/config.css */ \"./css/config.css\");\n/* harmony import */ var rendy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n/* harmony import */ var wraptile__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n/* harmony import */ var squad__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! squad */ \"./node_modules/squad/lib/squad.js\");\n/* harmony import */ var es6_promisify__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var load_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\n/* harmony import */ var _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n/* harmony import */ var _dom_events__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! #dom/events */ \"./client/dom/events/index.js\");\n/* harmony import */ var _dom_files__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! #dom/files */ \"./client/dom/files.js\");\n/* harmony import */ var _common_cloudfunc__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! #common/cloudfunc */ \"./common/cloudfunc.js\");\n/* harmony import */ var _dom_images__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! #dom/images */ \"./client/dom/images.js\");\n/* harmony import */ var _input_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./input.js */ \"./client/modules/config/input.js\");\n
|
|
1550
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var _css_config_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css/config.css */ \"./css/config.css\");\n/* harmony import */ var rendy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n/* harmony import */ var wraptile__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n/* harmony import */ var squad__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! squad */ \"./node_modules/squad/lib/squad.js\");\n/* harmony import */ var es6_promisify__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var load_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\n/* harmony import */ var _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n/* harmony import */ var _dom_events__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! #dom/events */ \"./client/dom/events/index.js\");\n/* harmony import */ var _dom_files__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! #dom/files */ \"./client/dom/files.js\");\n/* harmony import */ var _common_cloudfunc__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! #common/cloudfunc */ \"./common/cloudfunc.js\");\n/* harmony import */ var _dom_images__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! #dom/images */ \"./client/dom/images.js\");\n/* harmony import */ var _input_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./input.js */ \"./client/modules/config/input.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst {\n CloudCmd,\n DOM\n} = globalThis;\nconst {\n Dialog,\n setTitle\n} = DOM;\nconst Name = 'Config';\nconst loadSocket = (0,es6_promisify__WEBPACK_IMPORTED_MODULE_5__.promisify)(DOM.loadSocket);\nconst showLoad = () => {\n _dom_images__WEBPACK_IMPORTED_MODULE_12__.show.load('top');\n};\nconst addKey = currify__WEBPACK_IMPORTED_MODULE_2__((fn, input) => {\n _dom_events__WEBPACK_IMPORTED_MODULE_9__.addKey(input, fn);\n return input;\n});\nconst addChange = currify__WEBPACK_IMPORTED_MODULE_2__((fn, input) => {\n _dom_events__WEBPACK_IMPORTED_MODULE_9__.add('change', input, fn);\n return input;\n});\nconst Config = {};\nlet Template;\nconst loadCSS = load_js__WEBPACK_IMPORTED_MODULE_7__.css;\nasync function init() {\n if (!CloudCmd.config('configDialog')) return;\n showLoad();\n const {\n DIR_DIST\n } = CloudCmd;\n [Template] = await Promise.all([_dom_files__WEBPACK_IMPORTED_MODULE_10__.get('config-tmpl'), loadSocket(), loadCSS(`${DIR_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 = globalThis.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__WEBPACK_IMPORTED_MODULE_3__(Dialog.alert, 'Wrong credentials!'));\n}\nConfig.save = saveHttp;\nasync function show() {\n if (!CloudCmd.config('configDialog')) return;\n await fillTemplate();\n}\nasync function fillTemplate() {\n const [error, config] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_6__.tryToCatch)(_dom_files__WEBPACK_IMPORTED_MODULE_10__.get, 'config');\n if (error) return Dialog.alert('Could not load config!');\n const {\n editor,\n menu,\n packer,\n columns,\n theme,\n configAuth,\n ...obj\n } = _input_js__WEBPACK_IMPORTED_MODULE_13__.convert(config);\n obj[`${menu}-selected`] = 'selected';\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 = (0,rendy__WEBPACK_IMPORTED_MODULE_1__.rendy)(Template, obj);\n Element = _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_8__('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__WEBPACK_IMPORTED_MODULE_4__(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}\nfunction hide() {\n CloudCmd.View.hide();\n}\nasync function onChange(el) {\n const obj = {};\n const name = _input_js__WEBPACK_IMPORTED_MODULE_13__.getName(el);\n const data = _input_js__WEBPACK_IMPORTED_MODULE_13__.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_js__WEBPACK_IMPORTED_MODULE_13__.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_js__WEBPACK_IMPORTED_MODULE_13__.getElementByName('username', Element);\n const elPassword = _input_js__WEBPACK_IMPORTED_MODULE_13__.getElementByName('password', Element);\n elUsername.disabled = !checked;\n elPassword.disabled = !checked;\n}\nfunction onNameChange(name) {\n setTitle((0,_common_cloudfunc__WEBPACK_IMPORTED_MODULE_11__.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}\nCloudCmd[Name] = {\n init,\n show,\n hide\n};\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/config/index.js\n}");
|
|
1551
1551
|
|
|
1552
1552
|
/***/ },
|
|
1553
1553
|
|
|
@@ -1899,7 +1899,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
1899
1899
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1900
1900
|
|
|
1901
1901
|
"use strict";
|
|
1902
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FS: () => (/* binding */ FS),\n/* harmony export */ MAX_FILE_SIZE: () => (/* binding */ MAX_FILE_SIZE),\n/* harmony export */ _getDataName: () => (/* binding */ _getDataName),\n/* harmony export */ _getSize: () => (/* binding */ _getSize),\n/* harmony export */ apiURL: () => (/* binding */ apiURL),\n/* harmony export */ buildFromJSON: () => (/* binding */ buildFromJSON),\n/* harmony export */ dateFormatter: () => (/* binding */ dateFormatter),\n/* harmony export */ formatMsg: () => (/* binding */ formatMsg),\n/* harmony export */ getDotDot: () => (/* binding */ getDotDot),\n/* harmony export */ getHeaderField: () => (/* binding */ getHeaderField),\n/* harmony export */ getPathLink: () => (/* binding */ getPathLink),\n/* harmony export */ getTitle: () => (/* binding */ getTitle)\n/* harmony export */ });\n/* harmony import */ var rendy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var _common_entity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #common/entity */ \"./common/entity.js\");\n\n\n\n\nconst id = a => a;\nconst dateFormatter = (0,fullstore__WEBPACK_IMPORTED_MODULE_2__.fullstore)(id);\nconst getHeaderField = currify__WEBPACK_IMPORTED_MODULE_1__(_getHeaderField);\nconst NAME = 'Cloud Commander';\nconst FS = '/fs';\nconst Path = (0,fullstore__WEBPACK_IMPORTED_MODULE_2__.fullstore)();\nPath('/');\nconst filterOutDotFiles = ({\n showDotFiles\n}) => ({\n name\n}) => {\n if (showDotFiles) return true;\n return !name.startsWith('.');\n};\nconst apiURL = '/api/v1';\nconst MAX_FILE_SIZE = 500 * 1024;\nconst formatMsg = (msg, name, status) => {\n status = status || 'ok';\n name = name || '';\n if (name) name = `(\"${name}\")`;\n return `${msg}: ${status}${name}`;\n};\n\n/**\n * Функция возвращает заголовок веб страницы\n * @path\n */\nconst getTitle = options => {\n options = options || {};\n const {\n path = Path(),\n name\n } = options;\n const array = [name || NAME, path];\n return array.filter(Boolean).join(' - ');\n};\n\n/** Функция получает адреса каждого каталога в пути\n * возвращаеться массив каталогов\n * @param url - адрес каталога\n */\nfunction getPathLink(url, prefix, template) {\n if (!url) throw Error('url could not be empty!');\n if (!template) throw Error('template could not be empty!');\n const names = url.split('/').slice(1, -1);\n const allNames = ['/', ...names];\n const lines = [];\n const n = allNames.length;\n let path = '/';\n for (let i = 0; i < n; i++) {\n const name = allNames[i];\n const isLast = i === n - 1;\n if (i) path += `${name}/`;\n if (i && isLast) {\n lines.push(`${name}/`);\n continue;\n }\n const slash = i ? '/' : '';\n lines.push((0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template, {\n path,\n name,\n slash,\n prefix\n }));\n }\n return lines.join('');\n}\nfunction _getDataName(name) {\n const encoded = btoa(encodeURI(name));\n return `data-name=\"js-file-${encoded}\" `;\n}\n\n/**\n * Функция строит таблицу файлв из JSON-информации о файлах\n * @param params - информация о файлах\n *\n */\nconst buildFromJSON = params => {\n const {\n prefix,\n template,\n sort = 'name',\n order = 'asc',\n showDotFiles\n } = params;\n const formatDate = dateFormatter();\n const templateFile = template.file;\n const templateLink = template.link;\n const json = params.data;\n const path = (0,_common_entity__WEBPACK_IMPORTED_MODULE_3__.encode)(json.path);\n const {\n files\n } = json;\n\n /*\n * Строим путь каталога в котором мы находимся\n * со всеми подкаталогами\n */\n const htmlPath = getPathLink(path, prefix, template.pathLink);\n let fileTable = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.path, {\n link: prefix + FS + path,\n fullPath: path,\n path: htmlPath\n });\n const owner = 'owner';\n const mode = 'mode';\n const getFieldName = getHeaderField(sort, order);\n const name = getFieldName('name');\n const size = getFieldName('size');\n const date = getFieldName('date');\n const header = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateFile, {\n tag: 'div',\n attribute: 'data-name=\"js-fm-header\" ',\n className: 'fm-header',\n type: '',\n name,\n size,\n date,\n owner,\n mode\n });\n\n /* сохраняем путь */\n Path(path);\n fileTable += `${header}<ul data-name=\"js-files\" class=\"files\">`;\n\n /* Если мы не в корне */\n if (path !== '/') {\n const dotDot = getDotDot(path);\n const link = prefix + FS + dotDot;\n const linkResult = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.link, {\n link,\n title: '..',\n name: '..'\n });\n const dataName = _getDataName('..');\n const attribute = `draggable=\"true\" ${dataName}`;\n\n /* Сохраняем путь к каталогу верхнего уровня*/\n fileTable += (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.file, {\n tag: 'li',\n attribute,\n className: '',\n type: 'directory',\n name: linkResult,\n size: '<dir>',\n date: '--.--.----',\n owner: '.',\n mode: '--- --- ---'\n });\n }\n fileTable += files.filter(filterOutDotFiles({\n showDotFiles\n })).map(updateField).map(file => {\n const name = (0,_common_entity__WEBPACK_IMPORTED_MODULE_3__.encode)(file.name);\n const link = prefix + FS + path + name;\n const {\n type,\n mode,\n date,\n owner,\n size\n } = file;\n const linkResult = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateLink, {\n link,\n title: name,\n name,\n attribute: getAttribute(file.type)\n });\n const dataName = _getDataName(file.name);\n const attribute = `draggable=\"true\" ${dataName}`;\n return (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateFile, {\n tag: 'li',\n attribute,\n className: '',\n type,\n name: linkResult,\n size,\n date: formatDate(date),\n owner,\n mode\n });\n }).join('');\n fileTable += '</ul>';\n return fileTable;\n};\nconst updateField = file => ({\n ...file,\n date: file.date || '--.--.----',\n owner: file.owner || 'root',\n size: getSize(file)\n});\nfunction getAttribute(type) {\n if (type === 'directory') return '';\n return 'target=\"_blank\" ';\n}\nconst _getSize = getSize;\nfunction getSize({\n size,\n type\n}) {\n if (type === 'directory') return '<dir>';\n if (/link/.test(type)) return '<link>';\n return size;\n}\nfunction _getHeaderField(sort, order, name) {\n const arrow = order === 'asc' ? '↑' : '↓';\n if (sort !== name) return name;\n if (sort === 'name' && order === 'asc') return name;\n return `${name}${arrow}`;\n}\nfunction getDotDot(path) {\n // убираем последний слеш и каталог в котором мы сейчас находимся\n const lastSlash = path.substr(path, path.lastIndexOf('/'));\n const dotDot = lastSlash.substr(lastSlash, lastSlash.lastIndexOf('/'));\n if (!dotDot) return '/';\n return dotDot;\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/common/cloudfunc.js\n}");
|
|
1902
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FS: () => (/* binding */ FS),\n/* harmony export */ MAX_FILE_SIZE: () => (/* binding */ MAX_FILE_SIZE),\n/* harmony export */ _getDataName: () => (/* binding */ _getDataName),\n/* harmony export */ _getSize: () => (/* binding */ _getSize),\n/* harmony export */ apiURL: () => (/* binding */ apiURL),\n/* harmony export */ buildFromJSON: () => (/* binding */ buildFromJSON),\n/* harmony export */ dateFormatter: () => (/* binding */ dateFormatter),\n/* harmony export */ formatMsg: () => (/* binding */ formatMsg),\n/* harmony export */ getDotDot: () => (/* binding */ getDotDot),\n/* harmony export */ getHeaderField: () => (/* binding */ getHeaderField),\n/* harmony export */ getPathLink: () => (/* binding */ getPathLink),\n/* harmony export */ getTitle: () => (/* binding */ getTitle)\n/* harmony export */ });\n/* harmony import */ var rendy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var _common_entity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #common/entity */ \"./common/entity.js\");\n\n\n\n\nconst id = a => a;\nconst dateFormatter = (0,fullstore__WEBPACK_IMPORTED_MODULE_2__.fullstore)(id);\nconst getHeaderField = currify__WEBPACK_IMPORTED_MODULE_1__(_getHeaderField);\nconst NAME = 'Cloud Commander';\nconst FS = '/fs';\nconst Path = (0,fullstore__WEBPACK_IMPORTED_MODULE_2__.fullstore)();\nPath('/');\nconst filterOutDotFiles = ({\n showDotFiles\n}) => ({\n name\n}) => {\n if (showDotFiles) return true;\n return !name.startsWith('.');\n};\nconst apiURL = '/api/v1';\nconst MAX_FILE_SIZE = 500 * 1024;\nconst formatMsg = (msg, name, status) => {\n status = status || 'ok';\n name = name || '';\n if (name) name = `(\"${name}\")`;\n return `${msg}: ${status}${name}`;\n};\n\n/**\n * Функция возвращает заголовок веб страницы\n * @path\n */\nconst getTitle = options => {\n options = options || {};\n const {\n path = Path(),\n name\n } = options;\n const array = [name || NAME, path];\n return array.filter(Boolean).join(' - ');\n};\n\n/** Функция получает адреса каждого каталога в пути\n * возвращаеться массив каталогов\n * @param url - адрес каталога\n */\nfunction getPathLink(url, prefix, template) {\n if (!url) throw Error('url could not be empty!');\n if (!template) throw Error('template could not be empty!');\n const names = url.split('/').slice(1, -1);\n const allNames = ['/', ...names];\n const lines = [];\n const n = allNames.length;\n let path = '/';\n for (let i = 0; i < n; i++) {\n const name = allNames[i];\n const isLast = i === n - 1;\n if (i) path += `${name}/`;\n if (i && isLast) {\n lines.push(`${name}/`);\n continue;\n }\n const slash = i ? '/' : '';\n lines.push((0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template, {\n path,\n name,\n slash,\n prefix\n }));\n }\n return lines.join('');\n}\nfunction _getDataName(name) {\n const encoded = btoa(encodeURI(name));\n return `data-name=\"js-file-${encoded}\" `;\n}\n\n/**\n * Функция строит таблицу файлв из JSON-информации о файлах\n * @param params - информация о файлах\n *\n */\nconst buildFromJSON = params => {\n const {\n prefix,\n template,\n sort = 'name',\n order = 'asc',\n showDotFiles\n } = params;\n const formatDate = dateFormatter();\n const templateFile = template.file;\n const templateLink = template.link;\n const json = params.data;\n const path = (0,_common_entity__WEBPACK_IMPORTED_MODULE_3__.encode)(json.path);\n const {\n files\n } = json;\n\n /*\n * Строим путь каталога в котором мы находимся\n * со всеми подкаталогами\n */\n const htmlPath = getPathLink(path, prefix, template.pathLink);\n let fileTable = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.path, {\n link: prefix + FS + path,\n fullPath: path,\n path: htmlPath\n });\n const owner = 'owner';\n const mode = 'mode';\n const getFieldName = getHeaderField(sort, order);\n const name = getFieldName('name');\n const size = getFieldName('size');\n const date = getFieldName('date');\n const time = getFieldName('time');\n const header = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateFile, {\n tag: 'div',\n attribute: 'data-name=\"js-fm-header\" ',\n className: 'fm-header',\n type: '',\n name,\n size,\n date,\n time,\n owner,\n mode\n });\n\n /* сохраняем путь */\n Path(path);\n fileTable += `${header}<ul data-name=\"js-files\" class=\"files\">`;\n\n /* Если мы не в корне */\n if (path !== '/') {\n const dotDot = getDotDot(path);\n const link = prefix + FS + dotDot;\n const linkResult = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.link, {\n link,\n title: '..',\n name: '..'\n });\n const dataName = _getDataName('..');\n const attribute = `draggable=\"true\" ${dataName}`;\n\n /* Сохраняем путь к каталогу верхнего уровня*/\n fileTable += (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(template.file, {\n tag: 'li',\n attribute,\n className: '',\n type: 'directory',\n name: linkResult,\n size: '<dir>',\n date: '--.--.----',\n time: '--.--.----',\n owner: '.',\n mode: '--- --- ---'\n });\n }\n fileTable += files.filter(filterOutDotFiles({\n showDotFiles\n })).map(updateField).map(file => {\n const name = (0,_common_entity__WEBPACK_IMPORTED_MODULE_3__.encode)(file.name);\n const link = prefix + FS + path + name;\n const {\n type,\n mode,\n date,\n time,\n owner,\n size\n } = file;\n const linkResult = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateLink, {\n link,\n title: name,\n name,\n attribute: getAttribute(file.type)\n });\n const dataName = _getDataName(file.name);\n const attribute = `draggable=\"true\" ${dataName}`;\n return (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(templateFile, {\n tag: 'li',\n attribute,\n className: '',\n type,\n name: linkResult,\n size,\n date: formatDate(date),\n time,\n owner,\n mode\n });\n }).join('');\n fileTable += '</ul>';\n return fileTable;\n};\nconst updateField = file => ({\n ...file,\n date: file.date || '--.--.----',\n time: file.time || '--.--.----',\n owner: file.owner || 'root',\n size: getSize(file)\n});\nfunction getAttribute(type) {\n if (type === 'directory') return '';\n return 'target=\"_blank\" ';\n}\nconst _getSize = getSize;\nfunction getSize({\n size,\n type\n}) {\n if (type === 'directory') return '<dir>';\n if (/link/.test(type)) return '<link>';\n return size;\n}\nfunction _getHeaderField(sort, order, name) {\n const arrow = order === 'asc' ? '↑' : '↓';\n if (sort !== name) return name;\n if (sort === 'name' && order === 'asc') return name;\n return `${name}${arrow}`;\n}\nfunction getDotDot(path) {\n // убираем последний слеш и каталог в котором мы сейчас находимся\n const lastSlash = path.substr(path, path.lastIndexOf('/'));\n const dotDot = lastSlash.substr(lastSlash, lastSlash.lastIndexOf('/'));\n if (!dotDot) return '/';\n return dotDot;\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/common/cloudfunc.js\n}");
|
|
1903
1903
|
|
|
1904
1904
|
/***/ },
|
|
1905
1905
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!*******************************************************************************************************************!*\
|
|
2
|
+
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./css/columns/name-size-date-time.css ***!
|
|
3
|
+
\*******************************************************************************************************************/
|
|
4
|
+
.name {
|
|
5
|
+
width: 40%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.size {
|
|
9
|
+
float: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.owner {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.mode {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.date {
|
|
21
|
+
float: right;
|
|
22
|
+
width: 20%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.time {
|
|
26
|
+
display: inline;
|
|
27
|
+
float: right;
|
|
28
|
+
width: 20%;
|
|
29
|
+
}
|
|
30
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
3
|
+
* This devtool is neither made for production nor for readable output files.
|
|
4
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
5
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
6
|
+
* or disable the default devtool with "devtool: false".
|
|
7
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
8
|
+
*/
|
|
9
|
+
/******/ (() => { // webpackBootstrap
|
|
10
|
+
/******/ "use strict";
|
|
11
|
+
/******/ var __webpack_modules__ = ({
|
|
12
|
+
|
|
13
|
+
/***/ "./css/columns/name-size-date-time.css"
|
|
14
|
+
/*!*********************************************!*\
|
|
15
|
+
!*** ./css/columns/name-size-date-time.css ***!
|
|
16
|
+
\*********************************************/
|
|
17
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
18
|
+
|
|
19
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/css/columns/name-size-date-time.css\n}");
|
|
20
|
+
|
|
21
|
+
/***/ }
|
|
22
|
+
|
|
23
|
+
/******/ });
|
|
24
|
+
/************************************************************************/
|
|
25
|
+
/******/ // The require scope
|
|
26
|
+
/******/ var __webpack_require__ = {};
|
|
27
|
+
/******/
|
|
28
|
+
/************************************************************************/
|
|
29
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
30
|
+
/******/ (() => {
|
|
31
|
+
/******/ // define __esModule on exports
|
|
32
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
33
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
34
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
35
|
+
/******/ }
|
|
36
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
37
|
+
/******/ };
|
|
38
|
+
/******/ })();
|
|
39
|
+
/******/
|
|
40
|
+
/************************************************************************/
|
|
41
|
+
/******/
|
|
42
|
+
/******/ // startup
|
|
43
|
+
/******/ // Load entry module and return exports
|
|
44
|
+
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
45
|
+
/******/ var __webpack_exports__ = {};
|
|
46
|
+
/******/ __webpack_modules__["./css/columns/name-size-date-time.css"](0,__webpack_exports__,__webpack_require__);
|
|
47
|
+
/******/
|
|
48
|
+
/******/ })()
|
|
49
|
+
;
|
package/dist-dev/sw.js
CHANGED
|
@@ -37,7 +37,7 @@ eval("{// shim for using process in browser\nvar process = module.exports = {};\
|
|
|
37
37
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
38
38
|
|
|
39
39
|
"use strict";
|
|
40
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_2__((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 = \"
|
|
40
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_2__((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 20 2026 17:55:20 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};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.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 globalThis.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 (0,try_to_catch__WEBPACK_IMPORTED_MODULE_1__.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//Users/coderaiser/cloudcmd/client/sw/sw.js\n}");
|
|
41
41
|
|
|
42
42
|
/***/ },
|
|
43
43
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcmd",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "File manager for the web with console and editor",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"@babel/plugin-transform-optional-chaining": "^7.21.0",
|
|
88
88
|
"@cloudcmd/dropbox": "^5.0.1",
|
|
89
|
-
"@cloudcmd/fileop": "^9.0.
|
|
89
|
+
"@cloudcmd/fileop": "^9.0.7",
|
|
90
90
|
"@cloudcmd/move-files": "^8.0.0",
|
|
91
91
|
"@cloudcmd/read-files-sync": "^2.0.0",
|
|
92
92
|
"@putout/cli-validate-args": "^2.0.0",
|
package/tmpl/config.hbs
CHANGED
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
<li title="Visible Columns">
|
|
53
53
|
<select data-name="js-columns" class="form-control full-width" title="Visible Columns">
|
|
54
54
|
<option {{ name-size-date-owner-mode-selected }}>name-size-date-owner-mode</option>
|
|
55
|
+
<option {{ name-size-date-time-selected }}>name-size-date-time</option>
|
|
55
56
|
<option {{ name-size-date-selected }}>name-size-date</option>
|
|
56
57
|
<option {{ name-size-selected }}>name-size</option>
|
|
57
58
|
</select>
|
package/tmpl/fs/file.hbs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<span data-name="js-type" class="mini-icon {{ type }}"></span>
|
|
3
3
|
<span data-name="js-name" class="name reduce-text">{{ name }}</span>
|
|
4
4
|
<span data-name="js-size" class="size reduce-text">{{ size }}</span>
|
|
5
|
+
<span data-name="js-time" class="time reduce-text">{{ time }}</span>
|
|
5
6
|
<span data-name="js-date" class="date reduce-text">{{ date }}</span>
|
|
6
7
|
<span data-name="js-owner" class="owner reduce-text">{{ owner }}</span>
|
|
7
8
|
<span data-name="js-mode" class="mode reduce-text">{{ mode }}</span>
|