mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(config) add ability to remove auth change from config with help of --config-auth flag
This commit is contained in:
parent
c73e4f1e29
commit
8379a4a9bf
9 changed files with 32 additions and 13 deletions
|
|
@ -26,6 +26,7 @@
|
|||
"Termux",
|
||||
"Zalitok",
|
||||
"WebSocket",
|
||||
"auth",
|
||||
"cd",
|
||||
"cloudcmd",
|
||||
"coderaiser",
|
||||
|
|
|
|||
4
HELP.md
4
HELP.md
|
|
@ -91,6 +91,7 @@ Cloud Commander supports command line parameters:
|
|||
| `--keys-panel` | show keys panel
|
||||
| `--contact` | enable contact
|
||||
| `--config-dialog` | enable config dialog
|
||||
| `--config-auth` | enable auth change in config dialog
|
||||
| `--console` | enable console
|
||||
| `--sync-console-path` | sync console path
|
||||
| `--terminal` | enable terminal
|
||||
|
|
@ -118,6 +119,7 @@ Cloud Commander supports command line parameters:
|
|||
| `--no-confirm-copy` | do not confirm copy
|
||||
| `--no-confirm-move` | do not confirm move
|
||||
| `--no-config-dialog` | disable config dialog
|
||||
| `--no-config-auth` | disable auth change in config dialog
|
||||
| `--no-console` | disable console
|
||||
| `--no-sync-console-path` | do not sync console path
|
||||
| `--no-contact` | disable contact
|
||||
|
|
@ -397,6 +399,7 @@ Here is description of options:
|
|||
"showFileName" : false /* do not show file name in view and edit */
|
||||
"contact" : true, /* enable contact */
|
||||
"configDialog" : true, /* enable config dialog */
|
||||
"configAuth" : true, /* enable auth change in config dialog */
|
||||
"console" : true, /* enable console */
|
||||
"syncConsolePath" : false /* do not sync console path */
|
||||
"terminal" : false, /* disable terminal */
|
||||
|
|
@ -425,6 +428,7 @@ Some config options can be overridden with `environment variables` such:
|
|||
- `CLOUDCMD_COLUMNS` - set visible columns
|
||||
- `CLOUDCMD_CONTACT` - enable contact
|
||||
- `CLOUDCMD_CONFIG_DIALOG` - enable config dialog
|
||||
- `CLOUDCMD_CONFIG_AUTH` - enable auth change in config dialog
|
||||
- `CLOUDCMD_CONSOLE` - enable console
|
||||
- `CLOUDCMD_SYNC_CONSOLE_PATH` - sync console path
|
||||
- `CLOUDCMD_TERMINAL` - enable terminal
|
||||
|
|
|
|||
5
app.json
5
app.json
|
|
@ -32,6 +32,11 @@
|
|||
"value": "false",
|
||||
"required": false
|
||||
},
|
||||
"CLOUDCMD_CONFIG_AUTH": {
|
||||
"description": "disable auth change in config dialog",
|
||||
"value": "false",
|
||||
"required": false
|
||||
},
|
||||
"CLOUDCMD_CONSOLE": {
|
||||
"description": "enable console",
|
||||
"value": "true",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ const args = require('minimist')(argv.slice(2), {
|
|||
'open',
|
||||
'progress',
|
||||
'config-dialog',
|
||||
'config-auth',
|
||||
'console',
|
||||
'sync-console-path',
|
||||
'contact',
|
||||
|
|
@ -99,6 +100,7 @@ const args = require('minimist')(argv.slice(2), {
|
|||
'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')),
|
||||
'config-auth': choose(env.bool('config_auth'), config('configAuth')),
|
||||
'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')),
|
||||
|
|
@ -162,6 +164,7 @@ function main() {
|
|||
config('confirmMove', args['confirm-move']);
|
||||
config('oneFilePanel', args['one-file-panel']);
|
||||
config('configDialog', args['config-dialog']);
|
||||
config('configAuth', args['config-auth']);
|
||||
config('keysPanel', args['keys-panel']);
|
||||
config('export', args.export);
|
||||
config('exportToken', args['export-token']);
|
||||
|
|
|
|||
|
|
@ -137,16 +137,18 @@ function fillTemplate(error, template) {
|
|||
if (error)
|
||||
return alert('Could not load config!');
|
||||
|
||||
const obj = input.convert(config);
|
||||
const {
|
||||
editor,
|
||||
packer,
|
||||
columns,
|
||||
configAuth,
|
||||
...obj
|
||||
} = input.convert(config);
|
||||
|
||||
obj[obj.editor + '-selected'] = 'selected';
|
||||
delete obj.editor;
|
||||
|
||||
obj[obj.packer + '-selected'] = 'selected';
|
||||
delete obj.packer;
|
||||
|
||||
obj[obj.columns + '-selected'] = 'selected';
|
||||
delete obj.columns;
|
||||
obj[editor + '-selected'] = 'selected';
|
||||
obj[packer + '-selected'] = 'selected';
|
||||
obj[columns + '-selected'] = 'selected';
|
||||
obj.configAuth = configAuth ? '' : 'hidden';
|
||||
|
||||
const innerHTML = rendy(Template, obj);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
"confirmCopy": true,
|
||||
"confirmMove": true,
|
||||
"configDialog": true,
|
||||
"configAuth": true,
|
||||
"oneFilePanel": false,
|
||||
"console": true,
|
||||
"syncConsolePath": false,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
"--one-file-panel ": "show one file panel",
|
||||
"--keys-panel ": "show keys panel",
|
||||
"--config-dialog ": "enable config dialog",
|
||||
"--config-auth ": "enable auth change in config dialog",
|
||||
"--console ": "enable console",
|
||||
"--sync-console-path ": "sync console path",
|
||||
"--contact ": "enable contact",
|
||||
|
|
@ -50,6 +51,7 @@
|
|||
"--no-confirm-copy ": "do not confirm copy",
|
||||
"--no-confirm-move ": "do not confirm move",
|
||||
"--no-config-dialog ": "disable config dialog",
|
||||
"--no-config-auth ": "disable auth change in config dialog",
|
||||
"--no-console ": "disable console",
|
||||
"--no-sync-console-path ": "do not sync console path",
|
||||
"--no-contact ": "disable contact",
|
||||
|
|
|
|||
3
now.json
3
now.json
|
|
@ -2,7 +2,8 @@
|
|||
"type": "npm",
|
||||
"alias": "cloudcmd",
|
||||
"env": {
|
||||
"cloudcmd_config_dialog": "false",
|
||||
"cloudcmd_config_dialog": "true",
|
||||
"cloudcmd_config_auth": "false",
|
||||
"cloudcmd_terminal": "true",
|
||||
"cloudcmd_terminal_path": "gritty",
|
||||
"cloudcmd_import": "true",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<ul class="list">
|
||||
<li>
|
||||
<li {{ configAuth }}>
|
||||
<label>
|
||||
<input data-name="js-auth" type="checkbox" {{ auth }} >
|
||||
Auth
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<li {{ configAuth }}>
|
||||
<input
|
||||
data-name="js-username"
|
||||
type="text"
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
title="Username"
|
||||
autocomplete="username">
|
||||
</li>
|
||||
<li>
|
||||
<li {{ configAuth }}>
|
||||
<input
|
||||
data-name="js-password"
|
||||
type="password"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue