feature(cloudcmd) showKeysPanel -> keysPanel

This commit is contained in:
coderaiser 2017-07-26 18:05:05 +03:00
parent ab83db8059
commit 745e9b732c
9 changed files with 28 additions and 7 deletions

View file

@ -93,6 +93,7 @@ Cloud Commander supports command line parameters:
| `--terminal` | enable terminal
| `--terminal-path` | set terminal path
| `--vim` | enable vim hot keys
| `--keys-panel` | show keys panel
| `--columns` | set visible columns
| `--no-server` | do not start server
| `--no-auth` | disable authorization
@ -110,6 +111,7 @@ Cloud Commander supports command line parameters:
| `--no-sync-console-path` | do not sync console path
| `--no-terminal` | disable terminal
| `--no-vim` | disable vim hot keys
| `--no-keys-panel` | hide keys panel
| `--no-columns` | set visible default columns
If no parameters given Cloud Commander reads information from `~/.cloudcmd.json` and use
@ -364,7 +366,7 @@ Here is description of options:
"online" : true, /* load js files from cdn or local path */
"open" : false /* open web browser when server started */
"cache" : true, /* add cache-control */
"showKeysPanel" : true, /* show classic panel with buttons of keys */
"keysPanel" : true, /* show classic panel with buttons of keys */
"port" : 8000, /* http port */
"ip" : null, /* ip or null(default) */
"root" : "/", /* root directory */
@ -399,6 +401,8 @@ Some config options can be overridden with `environment variables` such:
- `CLOUDCMD_SYNC_CONSOLE_PATH` - sync console path
- `CLOUDCMD_TERMINAL` - enable terminal
- `CLOUDCMD_TERMINAL_PATH` - set terminal path
- `CLOUDCMD_CONFIG_DIALOG` - enable config dialog
- `CLOUDCMD_KEYS_PANEL` - show keys panel
- `CLOUDCMD_AUTH` - enable authentication
- `CLOUDCMD_USERNAME` - set username
- `CLOUDCMD_PASSWORD` - set password

View file

@ -52,6 +52,16 @@
"value": "gritty",
"required": false
},
"CLOUDCMD_CONFIG_DIALOG": {
"description": "show config dialog",
"value": "false",
"required": false
},
"CLOUDCMD_KEYS_PANEL": {
"description": "show keys panel",
"value": "true",
"required": false
},
"CLOUDCMD_NAME": {
"description": "set tab name in web browser",
"value": "",

View file

@ -50,6 +50,7 @@ const args = require('minimist')(argv.slice(2), {
'html-dialogs',
'show-config',
'vim',
'keys-panel',
],
default: {
server : true,
@ -78,6 +79,7 @@ const args = require('minimist')(argv.slice(2), {
'html-dialogs': config('htmlDialogs'),
'vim': choose(env.bool('vim'), config('vim')),
'columns': env('columns') || config('columns') || '',
'keys-panel': env.bool('keys_panel') || config('keysPanel'),
},
alias: {
v: 'version',
@ -130,6 +132,7 @@ function main() {
config('confirmMove', args['confirm-move']);
config('onePanelMode', args['one-panel-mode']);
config('configDialog', args['config-dialog']);
config('keysPanel', args['keys-panel']);
readConfig(args.config);

View file

@ -14,7 +14,7 @@
"online": true,
"open": false,
"cache": true,
"showKeysPanel": true,
"keysPanel": true,
"port": 8000,
"ip": null,
"root": "/",

View file

@ -28,6 +28,7 @@
"--terminal-path ": "set terminal path",
"--vim ": "enable vim hot keys",
"--columns ": "set visible columns",
"--keys-panel ": "show keys panel",
"--no-server ": "do not start server",
"--no-auth ": "disable authorization",
"--no-online ": "load scripts from local server",
@ -44,5 +45,6 @@
"--no-contact ": "disable contact",
"--no-terminal ": "disable terminal",
"--no-vim ": "disable vim hot keys",
"--no-keys-panel ": "hide keys panel",
"--no-columns ": "set default visible columns"
}

View file

@ -51,6 +51,7 @@ programs in browser from any computer, mobile or tablet device.
--terminal-path set terminal path
--vim enable vim hot keys
--columns set visible columns
--keys-panel show keys panel
--no-auth disable authorization
--no-server do not start server
--no-online load scripts from local server
@ -68,6 +69,7 @@ programs in browser from any computer, mobile or tablet device.
--no-terminal disable terminal
--no-vim disable vim hot keys
--no-columns set visible default columns
--no-keys-panel hide keys panel
.SH RESOURCES AND DOCUMENTATION

View file

@ -49,7 +49,7 @@ function indexProcessing(options) {
let data = options.data;
if (!config('showKeysPanel'))
if (!config('keysPanel'))
data = hideKeysPanel(data);
if (isOnePanel)

View file

@ -157,7 +157,7 @@ test('cloudcmd: route: buttons: one panel mode: move', (t) => {
test('cloudcmd: route: keys panel: hide', (t) => {
const config = {
showKeysPanel: false
keysPanel: false
};
before({config}, (port, after) => {
@ -172,7 +172,7 @@ test('cloudcmd: route: keys panel: hide', (t) => {
test('cloudcmd: route: keys panel', (t) => {
const config = {
showKeysPanel: true
keysPanel: true
};
before({config}, (port, after) => {

View file

@ -107,8 +107,8 @@
</li>
<li>
<label>
<input data-name="js-showKeysPanel" type="checkbox" {{ showKeysPanel }}>
Show keys panel
<input data-name="js-keysPanel" type="checkbox" {{ keysPanel }}>
Keys panel
</label>
</li>
<li>