Skip to content

Commit 867f653

Browse files
author
Oussama Hansal
committed
small comments
1 parent bb29dc8 commit 867f653

2 files changed

Lines changed: 8 additions & 18 deletions

File tree

docs-site/astro.config.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import { defineConfig } from 'astro/config';
22
import starlight from '@astrojs/starlight';
33
import react from '@astrojs/react';
44

5-
// `site` and `base` together determine the public URL.
6-
// For the upstream awslabs project page: site='https://awslabs.github.io', base='/graphrag-toolkit'
7-
// For a fork's project page: site='https://<user>.github.io', base='/<repo-name>'
85
export default defineConfig({
96
site: 'https://awslabs.github.io',
107
base: '/graphrag-toolkit',

docs-site/src/components/StoreUrlBuilder.tsx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState } from 'react';
22

33
type Backend =
4-
| { kind: 'neptune-db'; cluster: string; region: string }
4+
| { kind: 'neptune-db'; clusterUrl: string }
55
| { kind: 'neptune-graph'; graphId: string }
66
| { kind: 'neo4j'; host: string; port: string }
77
| { kind: 'falkordb'; host: string; port: string };
@@ -16,7 +16,7 @@ const backends = [
1616
function buildUrl(b: Backend): string {
1717
switch (b.kind) {
1818
case 'neptune-db':
19-
return `neptune-db://${b.cluster}.cluster-xxxxxxxx.${b.region}.neptune.amazonaws.com`;
19+
return `neptune-db://${b.clusterUrl}`;
2020
case 'neptune-graph':
2121
return `neptune-graph://${b.graphId}`;
2222
case 'neo4j':
@@ -48,14 +48,13 @@ const labelStyle: React.CSSProperties = {
4848

4949
export default function StoreUrlBuilder() {
5050
const [kind, setKind] = useState<Backend['kind']>('neptune-db');
51-
const [cluster, setCluster] = useState('my-graph');
52-
const [region, setRegion] = useState('us-east-1');
51+
const [clusterUrl, setClusterUrl] = useState('my-graph.cluster-xxxxxxxx.us-east-1.neptune.amazonaws.com');
5352
const [graphId, setGraphId] = useState('g-abc123def456');
5453
const [host, setHost] = useState('localhost');
5554
const [port, setPort] = useState('7687');
5655

5756
let backend: Backend;
58-
if (kind === 'neptune-db') backend = { kind, cluster, region };
57+
if (kind === 'neptune-db') backend = { kind, clusterUrl };
5958
else if (kind === 'neptune-graph') backend = { kind, graphId };
6059
else if (kind === 'neo4j') backend = { kind, host, port };
6160
else backend = { kind, host, port };
@@ -106,16 +105,10 @@ export default function StoreUrlBuilder() {
106105
}}
107106
>
108107
{kind === 'neptune-db' && (
109-
<>
110-
<div>
111-
<label style={labelStyle}>Cluster name</label>
112-
<input style={inputStyle} value={cluster} onChange={(e) => setCluster(e.target.value)} />
113-
</div>
114-
<div>
115-
<label style={labelStyle}>Region</label>
116-
<input style={inputStyle} value={region} onChange={(e) => setRegion(e.target.value)} />
117-
</div>
118-
</>
108+
<div>
109+
<label style={labelStyle}>Cluster URL</label>
110+
<input style={inputStyle} value={clusterUrl} onChange={(e) => setClusterUrl(e.target.value)} />
111+
</div>
119112
)}
120113
{kind === 'neptune-graph' && (
121114
<div>

0 commit comments

Comments
 (0)