diff --git a/HELP.md b/HELP.md index 03fc0401..379479f6 100644 --- a/HELP.md +++ b/HELP.md @@ -77,6 +77,7 @@ Cloud Commander supports command line parameters: | `--open` | open web browser when server started | `--one-panel-mode` | set one panel mode `--config-dialog` | enable config dialog + `--console` | enable console | `--no-server` | do not start server | `--no-auth` | disable authorization | `--no-online` | load scripts from local server @@ -85,6 +86,7 @@ Cloud Commander supports command line parameters: | `--no-progress` | do not show progress of file operations | `--no-one-panel-mode` | unset one panel mode | `--no-config-dialog` | disable config dialog +| `--no-console` | disable console 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. @@ -233,7 +235,8 @@ Here is description of options: "prefix" : "", /* url prefix */ "progress" : true, /* show progress of file operations */ "onePanelMode" : false, /* set one panel mode */ - "configDialog" : true /* enable config dialog */ + "configDialog" : true, /* enable config dialog */ + "console" : true /* enable console */ } ``` diff --git a/bin/cloudcmd.js b/bin/cloudcmd.js index 8fadc07e..0403e36b 100755 --- a/bin/cloudcmd.js +++ b/bin/cloudcmd.js @@ -32,6 +32,7 @@ var Info = require('../package'), 'open', 'minify', 'progress', + 'console', 'config-dialog', 'one-panel-mode' ], @@ -47,6 +48,7 @@ var Info = require('../package'), root : config('root') || '/', prefix : config('prefix') || '', progress : config('progress'), + console : defaultTrue(config('console')), 'config-dialog': defaultTrue(config('configDialog')), 'one-panel-mode': config('onePanelMode'), @@ -84,6 +86,7 @@ if (args.version) { config('minify', args.minify); config('username', args.username); config('progress', args.progress); + config('console', args.console); config('prefix', args.prefix); config('root', args.root); config('onePanelMode', args['one-panel-mode']); diff --git a/json/config.json b/json/config.json index 230cce4a..9f1bdb94 100644 --- a/json/config.json +++ b/json/config.json @@ -21,5 +21,7 @@ "prefix": "", "progress": true, "onePanelMode": false, - "configDialog": true + "configDialog": true, + "console": true } + diff --git a/json/help.json b/json/help.json index e4448886..eb61533e 100644 --- a/json/help.json +++ b/json/help.json @@ -15,6 +15,7 @@ "--progress ": "show progress of file operations", "--one-panel-mode ": "set one panel mode", "--config-dialog ": "enable config dialog", + "--console ": "enable console", "--open ": "open web browser when server started", "--no-server ": "do not start server", "--no-auth ": "disable authorization", @@ -23,5 +24,6 @@ "--no-minify ": "disable minification", "--no-progress ": "do not show progress of file operations", "--no-one-panel-mode ": "unset one panel mode", - "--no-config-dialog ": "disable config dialog" + "--no-config-dialog ": "disable config dialog", + "--no-console ": "disable console" } diff --git a/lib/client/key.js b/lib/client/key.js index e51c4bbe..0c86f3c8 100644 --- a/lib/client/key.js +++ b/lib/client/key.js @@ -333,13 +333,11 @@ var CloudCmd, Util, DOM; break; case Key.TRA: - DOM.Images.show.load('top'); CloudCmd.Konsole.show(); event.preventDefault(); break; case KEY.BRACKET_CLOSE: - DOM.Images.show.load('top'); CloudCmd.Konsole.show(); event.preventDefault(); break; diff --git a/lib/client/konsole.js b/lib/client/konsole.js index 0627826e..5e0d9482 100644 --- a/lib/client/konsole.js +++ b/lib/client/konsole.js @@ -110,7 +110,15 @@ Util.time(Name + ' load'); } - init(); + DOM.Files.get('config', function(error, config) { + if (error) + return Dialog.alert(TITLE, error); + + if (!config.console) + return; + + init(); + }); } })(CloudCmd, Util, DOM); diff --git a/lib/cloudcmd.js b/lib/cloudcmd.js index 38bea7c2..e4f56180 100644 --- a/lib/cloudcmd.js +++ b/lib/cloudcmd.js @@ -108,12 +108,6 @@ function listen(prefix, socket) { config.listen(socket, authCheck); - webconsole({ - prefix: prefix + '/console', - socket: socket, - authCheck: authCheck - }); - edward.listen(socket, { size: size, root: root, @@ -152,6 +146,12 @@ function listen(prefix, socket) { prefix: prefix + '/ishtar', authCheck: authCheck }); + + config('console') && webconsole({ + prefix: prefix + '/console', + socket: socket, + authCheck: authCheck + }); } function cloudcmd(prefix) { diff --git a/lib/server/route.js b/lib/server/route.js index 92bac8c0..fea34365 100644 --- a/lib/server/route.js +++ b/lib/server/route.js @@ -64,7 +64,8 @@ function indexProcessing(options) { right = '', keysPanel = '