Skip to content

Commit e915385

Browse files
committed
feat: add gart type
1 parent b0eecab commit e915385

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
interface Window {
2-
GS_ENGINE_TYPE: 'groot' | 'interactive';
2+
GS_ENGINE_TYPE: 'groot' | 'interactive' | 'gart';
33
}

packages/studio-website/src/layouts/index.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ export default function StudioLayout() {
6060
}
6161
});
6262
};
63+
const setQueryConfig = () => {
64+
const { GS_ENGINE_TYPE } = window;
65+
66+
if (GS_ENGINE_TYPE === 'groot') {
67+
Utils.storage.set('query_language', 'gremlin');
68+
Utils.storage.set('query_initiation', 'Server');
69+
}
70+
};
6371
useEffect(() => {
6472
(async () => {
6573
const engineType = (await depolymentInfo()) as 'interactive' | 'groot';
@@ -71,6 +79,8 @@ export default function StudioLayout() {
7179
};
7280
});
7381
window.GS_ENGINE_TYPE = engineType;
82+
83+
setQueryConfig();
7484
/**接着校验可用的graphId */
7585
const checkedRes = await checkGraphId();
7686
if (checkedRes) {

packages/studio-website/src/layouts/useContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const initialStore = {
3434
graphId: Utils.searchParamOf('graph_id'),
3535
draftGraph: Utils.storage.get('DRAFT_GRAPH') || {},
3636
draftId: 'DRAFT_GRAPH',
37-
displaySidebarType: Utils.storage.get<'Sidebar' | 'Segmented'>('displaySidebarType') || 'Sidebar',
37+
displaySidebarType: Utils.storage.get<'Sidebar' | 'Segmented'>('displaySidebarType') || 'Segmented',
3838
displaySidebarPosition: Utils.storage.get<'left' | 'right'>('displaySidebarPosition') || 'left',
3939
isReady: false,
4040
};

0 commit comments

Comments
 (0)