From 0f3e389034dc69f6be3b8b030e4cf67f6d249880 Mon Sep 17 00:00:00 2001 From: patrikx3 Date: Tue, 5 Mar 2024 10:47:08 +0100 Subject: [PATCH] r0b08x [chore] 3/5/2024, 10:47:08 AM --- README.md | 4 ++-- artifacts/cluster.md | 2 +- package.json | 6 +++--- src/lib/cli.js | 27 +++++++++++++++++---------- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 06d976c..3e925e4 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ https://corifeus.com/redis-ui --- -# 🏍️ The p3x-redis-ui-server package motor that is connected to the p3x-redis-ui-material web user interface v2024.4.122 +# 🏍️ The p3x-redis-ui-server package motor that is connected to the p3x-redis-ui-material web user interface v2024.4.123 @@ -114,7 +114,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https:// --- -[**P3X-REDIS-UI-SERVER**](https://corifeus.com/redis-ui-server) Build v2024.4.122 +[**P3X-REDIS-UI-SERVER**](https://corifeus.com/redis-ui-server) Build v2024.4.123 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) diff --git a/artifacts/cluster.md b/artifacts/cluster.md index 907d10e..01493cb 100644 --- a/artifacts/cluster.md +++ b/artifacts/cluster.md @@ -25,7 +25,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https:// --- -[**P3X-REDIS-UI-SERVER**](https://corifeus.com/redis-ui-server) Build v2024.4.122 +[**P3X-REDIS-UI-SERVER**](https://corifeus.com/redis-ui-server) Build v2024.4.123 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) diff --git a/package.json b/package.json index 3729ca7..2f94902 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p3x-redis-ui-server", - "version": "2024.4.122", + "version": "2024.4.123", "description": "🏍️ The p3x-redis-ui-server package motor that is connected to the p3x-redis-ui-material web user interface", "corifeus": { "icon": "fas fa-flag-checkered", @@ -47,7 +47,7 @@ "author": "Patrik Laszlo ", "license": "MIT", "devDependencies": { - "corifeus-builder": "^2024.4.108", + "corifeus-builder": "^2024.4.109", "nodemon": "^3.1.0" }, "dependencies-saved": { @@ -57,7 +57,7 @@ "dependencies": { "chalk": "^4.1.2", "commander": "^12.0.0", - "corifeus-utils": "^2024.4.108", + "corifeus-utils": "^2024.4.109", "ioredis": "^5.3.2", "koa": "^2.15.0", "koa-send": "^5.0.1", diff --git a/src/lib/cli.js b/src/lib/cli.js index 16c1d2c..1e81ef5 100644 --- a/src/lib/cli.js +++ b/src/lib/cli.js @@ -5,18 +5,19 @@ const fs = require('fs') const cli = () => { const pkg = require('../../package') - if (!process.versions.hasOwnProperty('electron') && !process.env.hasOwnProperty('P3XRS_DOCKER_HOME')) { - const program = require('commander').program + const program = require('commander').program + + program + .version(pkg.version) + .option('-c, --config [config]', 'Set the p3xr.json p3x-redis-ui-server configuration, see more help in https://github.com/patrikx3/redis-ui-server') + .option('-r, --readonly-connections', 'Set the connections to be readonly, no adding, saving or delete a connection') + .option('-n, --connections-file-name [filename]', 'Set the connections file name, overrides default .p3xrs-conns.json') + .parse(process.argv); - program - .version(pkg.version) - .option('-c, --config [config]', 'Set the p3xr.json p3x-redis-ui-server configuration, see more help in https://github.com/patrikx3/redis-ui-server') - .option('-r, --readonly-connections', 'Set the connections to be readonly, no adding, saving or delete a connection') - .option('-n, --connections-file-name [filename]', 'Set the connections file name, overrides default .p3xrs-conns.json') - .parse(process.argv); + const programOptions = program.opts(); - const programOptions = program.opts(); + if (!process.versions.hasOwnProperty('electron') && !process.env.hasOwnProperty('P3XRS_DOCKER_HOME')) { if (!programOptions.config) { @@ -66,7 +67,13 @@ const cli = () => { "@" ] } - p3xrs.cfg.readonlyConnections = false + if (programOptions.readonlyConnections) { + // console.warn(programOptions.readonlyConnections) + p3xrs.cfg.readonlyConnections = true + //console.warn(p3xrs.cfg.readonlyConnections === true) + } else { + p3xrs.cfg.readonlyConnections = false + } } if (p3xrs.cfg.connectionsFileName === undefined) {