From 3ef9bacef50da978b9ee4ab679e9f06410ad36f5 Mon Sep 17 00:00:00 2001 From: Alex Ramsdell Date: Tue, 14 Nov 2023 12:17:18 -0500 Subject: [PATCH 1/4] remove localhost clustering restriction. --- .../replication/manage/InstanceManager.js | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/components/instance/replication/manage/InstanceManager.js b/src/components/instance/replication/manage/InstanceManager.js index 31a9d0042..c4b6d5aba 100644 --- a/src/components/instance/replication/manage/InstanceManager.js +++ b/src/components/instance/replication/manage/InstanceManager.js @@ -27,24 +27,20 @@ function InstanceManager({ items, itemType, setShowModal, loading, setLoading, r const handleAddNode = useCallback( async (payload) => { setLoading(payload.compute_stack_id); - if (payload.instance_host === 'localhost') { - alert.error("External instances cannot reach that instance's URL"); - } else { - const result = - clusterEngine === 'nats' - ? await clusterSetRoutes({ auth, url, routes: [{ host: payload.instance_host, port: payload.clusterPort }] }) - : await addNode({ ...payload, auth, url, is_local, customer_id }); + const result = + clusterEngine === 'nats' + ? await clusterSetRoutes({ auth, url, routes: [{ host: payload.instance_host, port: payload.clusterPort }] }) + : await addNode({ ...payload, auth, url, is_local, customer_id }); - if (result.error) { - // TODO: review our policy about connecting to localhost instances. - alert.error(payload.instance_host === 'localhost' ? "External instances cannot reach that instance's URL" : result.message); - setLoading(false); - } else { - if (clusterEngine === 'nats') { - await restartService({ auth, url, service: 'clustering config' }); - } - await refreshNetwork(); + if (result.error) { + // TODO: review our policy about connecting to localhost instances. + alert.error(payload.instance_host === 'localhost' ? "External instances cannot reach that instance's URL" : result.message); + setLoading(false); + } else { + if (clusterEngine === 'nats') { + await restartService({ auth, url, service: 'clustering config' }); } + await refreshNetwork(); } setLoading(false); }, From 3b8d3fb24b27c709d432d0684e6ec08109e8b45c Mon Sep 17 00:00:00 2001 From: Alex Ramsdell Date: Tue, 14 Nov 2023 12:18:21 -0500 Subject: [PATCH 2/4] fix spelling error. --- src/components/instance/browse/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/instance/browse/index.js b/src/components/instance/browse/index.js index 197a4020d..1bdc2aea3 100644 --- a/src/components/instance/browse/index.js +++ b/src/components/instance/browse/index.js @@ -39,7 +39,7 @@ function NoPrimaryKeyMessage({ table }) { No Primary Key - The table { `'${table}'` } does not have a primary key. The HarperDB Studio does not currently support tables wihtout a primary key defined. Please see the HarperDB documention to see the standard HarperDB querying options. + The table { `'${table}'` } does not have a primary key. The HarperDB Studio does not currently support tables without a primary key defined. Please see the HarperDB documention to see the standard HarperDB querying options. From 71a0f3131b068cdc19a99042aefb97384c1258ae Mon Sep 17 00:00:00 2001 From: Alex Ramsdell Date: Wed, 15 Nov 2023 11:00:38 -0500 Subject: [PATCH 3/4] refactor no primary key check. --- src/components/instance/browse/index.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/components/instance/browse/index.js b/src/components/instance/browse/index.js index 1bdc2aea3..540f8dbe5 100644 --- a/src/components/instance/browse/index.js +++ b/src/components/instance/browse/index.js @@ -92,7 +92,7 @@ function BrowseIndex() { * FIXME: There is a fair amount of logic scattered throughout this * page that could be put in a router-level validation function. * - * Splitting the browse endpoint into /schema/ and /schema/table heirarchy + * Splitting the browse endpoint into /schema/ and /schema/table hierarchy * might ease this. * */ @@ -162,18 +162,16 @@ function BrowseIndex() { onError={(error, componentStack) => addError({ error: { message: error.message, componentStack } })} FallbackComponent={ErrorFallback}> { - hasHashAttr ? ( - schema && table && action === 'csv' && entities.activeTable ? ( - - ) : schema && table && action && entities.activeTable ? ( - - ) : schema && table && entities.activeTable ? ( - - ) : ( - } /> - ) + schema && table && action === 'csv' && entities.activeTable ? ( + + ) : schema && table && action && entities.activeTable ? ( + + ) : schema && table && entities.activeTable ? ( + + ) : schema && table && !hasHashAttr ? ( + ) : - + } /> } From 82406681459adcb735deeed0a76834392f1d9c1d Mon Sep 17 00:00:00 2001 From: Alex Ramsdell Date: Wed, 15 Nov 2023 11:14:51 -0500 Subject: [PATCH 4/4] v4.3.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c3ef90f3e..323a8d4e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "harperdb-studio", - "version": "4.3.4", + "version": "4.3.5", "description": "A UI for HarperDB", "deploymentUrl": "studio.harperdb.io", "private": true,