feature(cloudcmd) add --terminal-auto-restart

This commit is contained in:
coderaiser 2018-09-28 11:19:54 +03:00
parent 91ab03c0ed
commit 3ef7ba9fdf
5 changed files with 51 additions and 40 deletions

84
HELP.md
View file

@ -96,6 +96,7 @@ Cloud Commander supports command line parameters:
| `--terminal` | enable terminal
| `--terminal-path` | set terminal path
| `--terminal-command` | set command to run in terminal (shell by default)
| `--terminal-auto-restart` | restart command on exit
| `--vim` | enable vim hot keys
| `--columns` | set visible columns
| `--export` | enable export of config through a server
@ -122,6 +123,7 @@ Cloud Commander supports command line parameters:
| `--no-contact` | disable contact
| `--no-terminal` | disable terminal
| `--no-terminal-command` | set default shell to run in terminal
| `--no-terminal-auto-restart` | do not restart command on exit
| `--no-vim` | disable vim hot keys
| `--no-columns` | set default visible columns
| `--no-export` | disable export config through a server
@ -369,46 +371,47 @@ Here is description of options:
```js
{
"name" : "", /* set tab name in web browser */
"auth" : false, /* enable http authentication */
"username" : "root", /* username for authentication */
   "password"         : "toor",   /* password hash for authentication */
"algo" : "sha512WithRSAEncryption", /* cryptographic algorithm */
"editor" : "edward", /* default, could be "dword" or "edward" */
"packer" : "tar", /* default, could be "tar" or "zip" */
"diff" : true, /* when save - send patch, not whole file */
"zip" : true, /* zip text before send / unzip before save */
"buffer" : true, /* buffer for copying files */
"dirStorage" : true, /* store directory listing */
"online" : false, /* do not load js files from cdn */
"open" : true, /* open web browser when server started */
"oneFilePanel" : false, /* show one file panel */
"keysPanel" : true, /* show classic panel with buttons of keys */
"port" : 8000, /* http port */
"ip" : null, /* ip or null(default) */
"root" : "/", /* root directory */
"prefix" : "", /* url prefix */
"progress" : true, /* show progress of file operations */
"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 */
"syncConsolePath" : false /* do not sync console path */
"terminal" : false, /* disable terminal */
"terminalPath" : '', /* path of a terminal */
"terminalCommand" : '', /* set command to run in terminal */
"vim" : false, /* disable vim hot keys */
"columns" : "name-size-date-owner-mode", /* set visible columns */
"export" : false, /* enable export of config through a server */
"exportToken" : "root", /* token used by export server */
"import" : false, /* enable import of config */
"import-url" : "http://localhost:8000", /* url of an export server */
"importToken" : "root", /* token used to connect to export server */
"importListen" : false, /* listen on config updates */
"log" : true /* logging */
"name" : "", /* set tab name in web browser */
"auth" : false, /* enable http authentication */
"username" : "root", /* username for authentication */
   "password"         : "toor",   /* password hash for authentication */
"algo" : "sha512WithRSAEncryption", /* cryptographic algorithm */
"editor" : "edward", /* default, could be "dword" or "edward" */
"packer" : "tar", /* default, could be "tar" or "zip" */
"diff" : true, /* when save - send patch, not whole file */
"zip" : true, /* zip text before send / unzip before save */
"buffer" : true, /* buffer for copying files */
"dirStorage" : true, /* store directory listing */
"online" : false, /* do not load js files from cdn */
"open" : true, /* open web browser when server started */
"oneFilePanel" : false, /* show one file panel */
"keysPanel" : true, /* show classic panel with buttons of keys */
"port" : 8000, /* http port */
"ip" : null, /* ip or null(default) */
"root" : "/", /* root directory */
"prefix" : "", /* url prefix */
"progress" : true, /* show progress of file operations */
"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 */
"syncConsolePath" : false /* do not sync console path */
"terminal" : false, /* disable terminal */
"terminalPath" : '', /* path of a terminal */
"terminalCommand" : '', /* set command to run in terminal */
"terminalAutoRestart" : true, /* restart command on exit */
"vim" : false, /* disable vim hot keys */
"columns" : "name-size-date-owner-mode", /* set visible columns */
"export" : false, /* enable export of config through a server */
"exportToken" : "root", /* token used by export server */
"import" : false, /* enable import of config */
"import-url" : "http://localhost:8000", /* url of an export server */
"importToken" : "root", /* token used to connect to export server */
"importListen" : false, /* listen on config updates */
"log" : true /* logging */
}
```
@ -426,6 +429,7 @@ Some config options can be overridden with `environment variables` such:
- `CLOUDCMD_TERMINAL` - enable terminal
- `CLOUDCMD_TERMINAL_PATH` - set terminal path
- `CLOUDCMD_TERMINAL_COMMAND` - set command to run in terminal (shell by default)
- `CLOUDCMD_TERMINAL_AUTO_RESTART` - restart command on exit
- `CLOUDCMD_KEYS_PANEL` - show keys panel
- `CLOUDCMD_ONE_FILE_PANEL` - show one file panel
- `CLOUDCMD_AUTH` - enable authentication

View file

@ -53,6 +53,7 @@ const args = require('minimist')(argv.slice(2), {
'sync-console-path',
'contact',
'terminal',
'terminal-auto-restart',
'one-file-panel',
'confirm-copy',
'confirm-move',
@ -97,6 +98,7 @@ const args = require('minimist')(argv.slice(2), {
'config-dialog': choose(env.bool('config_dialog'), config('configDialog')),
'terminal-path': env('terminal_path') || config('terminalPath'),
'terminal-command': env('terminal_command') || config('terminalCommand'),
'terminal-auto-restart': choose(env.bool('terminal_auto_restart'), config('terminalAutoRestart')),
'one-file-panel': choose(env.bool('one_file_panel'), config('oneFilePanel')),
'confirm-copy': choose(env.bool('confirm_copy'), config('confirmCopy')),
'confirm-move': choose(env.bool('confirm_move'), config('confirmMove')),
@ -146,6 +148,7 @@ function main() {
config('terminal', args.terminal);
config('terminalPath', args['terminal-path']);
config('terminalCommand', args['terminal-command']);
config('terminalAutoRestart', args['terminal-auto-restart']);
config('editor', args.editor);
config('prefix', args.prefix);
config('root', args.root);

View file

@ -28,6 +28,7 @@
"terminal": false,
"terminalPath": "",
"terminalCommand": "",
"terminalAutoRestart": true,
"showConfig": false,
"showFileName": false,
"vim": false,

View file

@ -51,6 +51,7 @@ programs in browser from any computer, mobile or tablet device.
--terminal enable terminal
--terminal-path set terminal path
--terminal-command set command to run in terminal (shell by default)
--terminal-auto-restart restart command on exit
--vim enable vim hot keys
--columns set visible columns
--export enable export of config through a server
@ -77,6 +78,7 @@ programs in browser from any computer, mobile or tablet device.
--no-sync-console-path do not sync console path
--no-terminal disable terminal
--no-terminal-command set default shell to run in terminal
--no-terminal-auto-restart do not restart command on exit
--no-vim disable vim hot keys
--no-columns set visible default columns
--no-export disable export of config through a server

View file

@ -150,6 +150,7 @@ function listen(prefix, socket) {
auth,
prefix: prefix + '/gritty',
command: config('terminalCommand'),
autoRestart: config('terminalAutoRestart'),
});
distribute.export(socket);