mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(cloudcmd) add --show-file-name to add file name title in view and edit (#183)
This commit is contained in:
parent
ce0938ea11
commit
f04808c709
9 changed files with 53 additions and 16 deletions
4
HELP.md
4
HELP.md
|
|
@ -74,6 +74,7 @@ Cloud Commander supports command line parameters:
|
|||
| `-p, --password` | set password
|
||||
| `-c, --config` | configuration file path
|
||||
| `--show-config` | show config values
|
||||
| `--show-file-name` | show file name in view and edit
|
||||
| `--editor` | set editor: "dword", "edward" or "deepword"
|
||||
| `--packer` | set packer: "tar" or "zip"
|
||||
| `--root` | set root directory
|
||||
|
|
@ -123,6 +124,7 @@ Cloud Commander supports command line parameters:
|
|||
| `--no-import` | disable import of config
|
||||
| `--no-import-listen` | disable listen on config updates from import server
|
||||
| `--no-log` | disable logging
|
||||
| `--no-show-file-name` | do not show file name in view and edit
|
||||
|
||||
If no parameters given Cloud Commander reads information from `~/.cloudcmd.json` and use
|
||||
port from it (`8000` default). if port variables `PORT` or `VCAP_APP_PORT` isn't exist.
|
||||
|
|
@ -386,6 +388,7 @@ Here is description of options:
|
|||
"confirmCopy" : true, /* confirm copy */
|
||||
"confirmMove" : true, /* confirm move */
|
||||
"showConfig" : false, /* show config at startap */
|
||||
"showFileName" : false /* do not show file name in view and edit */
|
||||
"contact" : true, /* enable contact */
|
||||
"configDialog" : true, /* enable config dialog */
|
||||
"console" : true, /* enable console */
|
||||
|
|
@ -426,6 +429,7 @@ Some config options can be overridden with `environment variables` such:
|
|||
- `CLOUDCMD_VIM` - enable vim hot keys
|
||||
- `CLOUDCMD_CONFIRM_COPY` - confirm copy
|
||||
- `CLOUDCMD_CONFIRM_MOVE` - confirm move
|
||||
- `CLOUDCMD_SHOW_FILE_NAME` - show file name in view and edit
|
||||
- `CLOUDCMD_EXPORT` - enable export of config through a server
|
||||
- `CLOUDCMD_EXPORT_TOKEN` - authorization token used by export server
|
||||
- `CLOUDCMD_IMPORT` - enable import of config
|
||||
|
|
|
|||
5
app.json
5
app.json
|
|
@ -112,6 +112,11 @@
|
|||
"value": "true",
|
||||
"required": false
|
||||
},
|
||||
"CLOUDCMD_SHOW_FILE_NAME": {
|
||||
"description": "show file name in view and edit",
|
||||
"value": "false",
|
||||
"required": false
|
||||
},
|
||||
"CLOUDCMD_EXPORT": {
|
||||
"description": "enable export of config through a server",
|
||||
"value": "false",
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ const args = require('minimist')(argv.slice(2), {
|
|||
'confirm-copy',
|
||||
'confirm-move',
|
||||
'show-config',
|
||||
'show-file-name',
|
||||
'vim',
|
||||
'keys-panel',
|
||||
'color',
|
||||
|
|
@ -90,6 +91,7 @@ const args = require('minimist')(argv.slice(2), {
|
|||
import : choose(env.bool('import'), config('import')),
|
||||
export : choose(env.bool('export'), config('export')),
|
||||
|
||||
'show-file-name': choose(env.bool('show_file_name'), config('showFileName')),
|
||||
'sync-console-path': choose(env.bool('sync_console_path'), config('syncConsolePath')),
|
||||
'config-dialog': choose(env.bool('config_dialog'), config('configDialog')),
|
||||
'terminal-path': env('terminal_path') || config('terminalPath'),
|
||||
|
|
@ -137,6 +139,7 @@ function main() {
|
|||
config('progress', args.progress);
|
||||
config('console', args.console);
|
||||
config('syncConsolePath', args['sync-console-path']);
|
||||
config('showFileName', args['show-file-name']);
|
||||
config('contact', args.contact);
|
||||
config('terminal', args.terminal);
|
||||
config('terminalPath', args['terminal-path']);
|
||||
|
|
|
|||
|
|
@ -53,11 +53,14 @@ module.exports.show = (options) => {
|
|||
if (isLoading())
|
||||
return;
|
||||
|
||||
const config = {
|
||||
const optionsEdit = {
|
||||
...ConfigView,
|
||||
...options,
|
||||
};
|
||||
|
||||
if (CloudCmd.config('showFileName'))
|
||||
optionsEdit.title = Info.name;
|
||||
|
||||
Images.show.load();
|
||||
|
||||
CloudCmd.Edit
|
||||
|
|
@ -79,7 +82,7 @@ module.exports.show = (options) => {
|
|||
.setModeForPath(name)
|
||||
.enableKey();
|
||||
|
||||
CloudCmd.Edit.show(config);
|
||||
CloudCmd.Edit.show(optionsEdit);
|
||||
});
|
||||
|
||||
return CloudCmd.Edit;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const basename = (a) => a.split('/').pop();
|
|||
let El, TemplateAudio, Overlay;
|
||||
|
||||
const Config = {
|
||||
beforeShow: (callback) => {
|
||||
beforeShow: function(callback) {
|
||||
Images.hide();
|
||||
Key.unsetBind();
|
||||
showOverlay();
|
||||
|
|
@ -72,7 +72,7 @@ const Config = {
|
|||
arrows : false,
|
||||
helpers : {
|
||||
overlay : null,
|
||||
title : null
|
||||
title : {},
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -126,16 +126,7 @@ function show(data, options) {
|
|||
|
||||
switch(type) {
|
||||
default:
|
||||
return Info.getData((error, data) => {
|
||||
if (error)
|
||||
return Images.hide();
|
||||
|
||||
const element = document.createTextNode(data);
|
||||
/* add margin only for view text documents */
|
||||
El.css('margin', '2%');
|
||||
|
||||
$.fancybox.open(El.append(element), Config);
|
||||
});
|
||||
return showFile();
|
||||
|
||||
case 'image':
|
||||
return showImage(path, prefixUrl);
|
||||
|
|
@ -169,6 +160,26 @@ function show(data, options) {
|
|||
}
|
||||
}
|
||||
|
||||
function showFile() {
|
||||
Info.getData((error, data) => {
|
||||
if (error)
|
||||
return Images.hide();
|
||||
|
||||
const element = document.createTextNode(data);
|
||||
/* add margin only for view text documents */
|
||||
El.css('margin', '2%');
|
||||
|
||||
const options = {
|
||||
...Config,
|
||||
};
|
||||
|
||||
if (CloudCmd.config('showFileName'))
|
||||
options.title = Info.name;
|
||||
|
||||
$.fancybox.open(El.append(element), options);
|
||||
});
|
||||
}
|
||||
|
||||
function initConfig(Config, options) {
|
||||
const config = Object.assign({}, Config);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
"terminal": false,
|
||||
"terminalPath": "",
|
||||
"showConfig": false,
|
||||
"showFileName": false,
|
||||
"vim": false,
|
||||
"columns": "name-size-date-owner-mode",
|
||||
"export": false,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
"-p, --password ": "set password",
|
||||
"-c, --config ": "configuration file path",
|
||||
"--show-config ": "show config values",
|
||||
"--show-file-name ": "show file name in view and edit",
|
||||
"--editor ": "set editor: \"dword\", \"edward\" or \"deepword\"",
|
||||
"--packer ": "set packer: \"tar\" or \"zip\"",
|
||||
"--root ": "set root directory",
|
||||
|
|
@ -57,5 +58,6 @@
|
|||
"--no-export ": "disable export config through a server",
|
||||
"--no-import ": "disable import of config",
|
||||
"--no-import-listen ": "disable listen on config updates from import server",
|
||||
"--no-log ": "disable logging"
|
||||
"--no-log ": "disable logging",
|
||||
"--no-show-file-name ": "do not show file name in view and edit"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ programs in browser from any computer, mobile or tablet device.
|
|||
-p, --password set password
|
||||
-c, --config configuration file path
|
||||
--show-config show config values
|
||||
--show-file-name show file name in view and edit modes
|
||||
--editor set editor: "dword", "edward" or "deepword"
|
||||
--packer set packer: "tar" or "zip"
|
||||
--root set root directory
|
||||
|
|
@ -81,6 +82,7 @@ programs in browser from any computer, mobile or tablet device.
|
|||
--no-import-url url of an import server
|
||||
--no-import-listen disable listen on config updates from import server
|
||||
--no-log disable logging
|
||||
--no-show-file-name do not show file name in view and edit modes
|
||||
|
||||
.SH RESOURCES AND DOCUMENTATION
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@
|
|||
class="form-control">
|
||||
</li>
|
||||
<li>
|
||||
<input
|
||||
<input
|
||||
data-name="js-port"
|
||||
min="0"
|
||||
max="65535"
|
||||
|
|
@ -129,6 +129,12 @@
|
|||
placeholder="Port"
|
||||
class="form-control">
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input data-name="js-showFileName" type="checkbox" {{ showFileName }}>
|
||||
Show File Name
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input data-name="js-confirmCopy" type="checkbox" {{ confirmCopy }}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue