diff --git a/lib/connections.js b/lib/connections.js index c6b4ff2a..fa63f186 100644 --- a/lib/connections.js +++ b/lib/connections.js @@ -326,7 +326,7 @@ class ConnectionWrapper { } // check if it is a standalone or cluster setup if not started as explicit cluster (auto-detect) - if (p[2] && typeof p[2].value === 'string') { + if (typeof p[2].value === 'string') { const matchAnswer = p[2].value.match(/cluster_enabled:(\d)/) if (matchAnswer) { if (matchAnswer[1] === "1") { @@ -340,7 +340,8 @@ class ConnectionWrapper { password: redisConnection.options.password, foldingChar: redisConnection.options.foldingChar, label: redisConnection.label, - connectionName: redisConnection.options.connectionName + connectionName: redisConnection.options.connectionName, + tls: redisConnection.options.tls }; redisConnection.disconnect(); const client = myUtils.createRedisClient(newConnection); @@ -350,7 +351,7 @@ class ConnectionWrapper { } } // must exclude "null" as this promise is optional, only for standalone server - else if (p[2] !== null) { + else if (!(p[2].status === 'fulfilled' && p[2].value === null)) { console.log(`Redis "info cluster" not supported, cannot auto-detect cluster mode on ${redisConnection.options.connectionId}`); } }); diff --git a/lib/redisCommands/redisCore.js b/lib/redisCommands/redisCore.js index 6c36ef2a..0db3a15f 100644 --- a/lib/redisCommands/redisCore.js +++ b/lib/redisCommands/redisCore.js @@ -1,6 +1,6 @@ 'use strict'; -// first start - my be reworked to use 'COMMANDS' or 'COMMAND INFO' command if available (redis >=2.8.13) +// first start - may be reworked to use 'COMMANDS' or 'COMMAND INFO' command if available (redis >=2.8.13) // but this will be fallback if they are not working (for whatever reason) const _readCmdsV3 = [ 'REFRESH', diff --git a/lib/routes/apiv1.js b/lib/routes/apiv1.js index 24d901b4..272778d2 100644 --- a/lib/routes/apiv1.js +++ b/lib/routes/apiv1.js @@ -214,7 +214,6 @@ function getClusterNodes (req, res, next) { if (res.locals.connection) { // only one server requested clusterNodes(res.locals.connection, function(err, nodeInfo) { - let retList = []; if (err) { console.error(`Error checking cluster info for a connection: ${res.locals.connectionId} - ${JSON.stringify(err)}`); return res.json({error: "error reading cluster node info from server"}); diff --git a/web/static/scripts/redisCommander.js b/web/static/scripts/redisCommander.js index 459b667f..b67b1676 100644 --- a/web/static/scripts/redisCommander.js +++ b/web/static/scripts/redisCommander.js @@ -894,16 +894,12 @@ function decodeKey (connectionId, key) { }); } -function clusterNodes (connectionId, key) { +function clusterNodes (connectionId) { if (typeof(connectionId) === 'object') { // context menu click const node = getKeyTree().get_node(connectionId.reference[0]); connectionId = getRootConnection(node); const foldingChar = connections.findById(connectionId).foldingChar - key = getFullKeyPath(node); - if (key.length > 0 && !key.endsWith(foldingChar)) { - key = key + foldingChar; - } } $.get('apiv2/server/' + encodeURIComponent(connectionId) + '/cluster/nodes', function (data) { if (data.error) { @@ -1614,6 +1610,7 @@ function selectNewServerDbs() { }); } + function loadConfig (callback) { $.get('config', function (data) { if (data) { diff --git a/web/static/templates/serverInfo.ejs b/web/static/templates/serverInfo.ejs index 2480083f..dc128efd 100644 --- a/web/static/templates/serverInfo.ejs +++ b/web/static/templates/serverInfo.ejs @@ -3,6 +3,9 @@ <% } %> + <% if (connectionId.startsWith('C')) { %> + + <% } %>