Skip to content

Commit e08fb7f

Browse files
committed
feat: add gart type
1 parent 7383354 commit e08fb7f

File tree

4 files changed

+4
-38
lines changed

4 files changed

+4
-38
lines changed

packages/studio-website/src/pages/importing/services.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const submitDataloadingJob = async (graph_id: string, graphSchema: any, l
7373

7474
export const getSchema = async (graph_id: string) => {
7575
let schema;
76-
if (window.GS_ENGINE_TYPE === 'interactive') {
76+
if (window.GS_ENGINE_TYPE === 'interactive' || window.GS_ENGINE_TYPE === 'gart') {
7777
schema = await GraphApiFactory(undefined, location.origin)
7878
.getGraphById(graph_id)
7979
.then(res => {
@@ -121,7 +121,7 @@ export const queryPrimitiveTypes = () => {
121121
return { label: item, value: item };
122122
});
123123
}
124-
if (GS_ENGINE_TYPE === 'interactive') {
124+
if (GS_ENGINE_TYPE === 'interactive' || GS_ENGINE_TYPE === 'gart') {
125125
return ['DT_SIGNED_INT32', 'DT_SIGNED_INT64', 'DT_DOUBLE', 'DT_STRING'].map(item => {
126126
return { label: item, value: item };
127127
});

packages/studio-website/src/pages/modeling/services.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const uploadFile = async (file: File) => {
5252

5353
export const getSchema = async (graph_id: string) => {
5454
let schema;
55-
if (window.GS_ENGINE_TYPE === 'interactive') {
55+
if (window.GS_ENGINE_TYPE === 'interactive' || window.GS_ENGINE_TYPE === 'gart') {
5656
schema = await GraphApiFactory(undefined, location.origin)
5757
.getGraphById(graph_id)
5858
.then(res => {

packages/studio-website/src/pages/query/app.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
import React, { useCallback, useEffect, useState } from 'react';
22
import StudioQuery from '@graphscope/studio-query';
33
import { transformGraphNodes, transformEdges, transSchemaToOptions } from '@graphscope/studio-importor';
4-
import {
5-
queryGraphData,
6-
queryGraphSchema,
7-
queryInfo,
8-
queryStatements,
9-
deleteStatements,
10-
createStatements,
11-
} from './services';
4+
import { queryGraphData, queryGraphSchema, queryStatements, deleteStatements, createStatements } from './services';
125
import { useContext } from '../../layouts/useContext';
136
import NoEndpointCase from './no-endpoint-case';
147
import StoppedServiceCase from './stopped-service-case';
@@ -119,8 +112,6 @@ const QueryModule = () => {
119112
/** 查询类型 */
120113
globalScript={globalScript}
121114
language={language as 'cypher' | 'gremlin'}
122-
//@ts-ignore
123-
queryInfo={queryInfo}
124115
/** 语句服务 */
125116
queryStatements={queryStatements}
126117
createStatements={createStatements}

packages/studio-website/src/pages/query/services.tsx

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -136,31 +136,6 @@ export const createStatements: IStudioQueryProps['createStatements'] = async (ty
136136
return false;
137137
};
138138

139-
const driver_config: Record<string, any> = {};
140-
141-
export const getDriver = async (language: 'cypher' | 'gremlin' = 'cypher') => {
142-
if (Object.keys(driver_config).length === 0) {
143-
const { cypher_endpoint, gremlin_endpoint } = await queryEndpoint();
144-
driver_config.cypher_endpoint = cypher_endpoint;
145-
driver_config.gremlin_endpoint = gremlin_endpoint;
146-
}
147-
const { gremlin_endpoint, cypher_endpoint, gremlin_driver, cypher_driver } = driver_config;
148-
149-
if (cypher_endpoint === 'mock' && gremlin_endpoint === 'mock') {
150-
return;
151-
}
152-
if (cypher_endpoint && !cypher_driver) {
153-
driver_config.cypher_driver = new CypherDriver(cypher_endpoint);
154-
}
155-
if (gremlin_endpoint && !gremlin_driver) {
156-
driver_config.gremlin_driver = new GremlinDriver(gremlin_endpoint);
157-
}
158-
if (language === 'cypher') {
159-
return driver_config.cypher_driver;
160-
}
161-
return driver_config.gremlin_driver;
162-
};
163-
164139
export const queryGraphData = async (params: IStatement) => {
165140
createStatements('history', params);
166141

0 commit comments

Comments
 (0)