Skip to content

Commit 331bb24

Browse files
authored
Merge pull request #359 from HarperDB/STUDIO-115
remove localhost clustering restriction
2 parents 8240668 + 47f0b0f commit 331bb24

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

src/components/instance/replication/manage/InstanceManager.js

+12-16
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,20 @@ function InstanceManager({ items, itemType, setShowModal, loading, setLoading, r
2727
const handleAddNode = useCallback(
2828
async (payload) => {
2929
setLoading(payload.compute_stack_id);
30-
if (payload.instance_host === 'localhost') {
31-
alert.error("External instances cannot reach that instance's URL");
32-
} else {
33-
const result =
34-
clusterEngine === 'nats'
35-
? await clusterSetRoutes({ auth, url, routes: [{ host: payload.instance_host, port: payload.clusterPort }] })
36-
: await addNode({ ...payload, auth, url, is_local, customer_id });
30+
const result =
31+
clusterEngine === 'nats'
32+
? await clusterSetRoutes({ auth, url, routes: [{ host: payload.instance_host, port: payload.clusterPort }] })
33+
: await addNode({ ...payload, auth, url, is_local, customer_id });
3734

38-
if (result.error) {
39-
// TODO: review our policy about connecting to localhost instances.
40-
alert.error(payload.instance_host === 'localhost' ? "External instances cannot reach that instance's URL" : result.message);
41-
setLoading(false);
42-
} else {
43-
if (clusterEngine === 'nats') {
44-
await restartService({ auth, url, service: 'clustering config' });
45-
}
46-
await refreshNetwork();
35+
if (result.error) {
36+
// TODO: review our policy about connecting to localhost instances.
37+
alert.error(payload.instance_host === 'localhost' ? "External instances cannot reach that instance's URL" : result.message);
38+
setLoading(false);
39+
} else {
40+
if (clusterEngine === 'nats') {
41+
await restartService({ auth, url, service: 'clustering config' });
4742
}
43+
await refreshNetwork();
4844
}
4945
setLoading(false);
5046
},

0 commit comments

Comments
 (0)