@@ -17,12 +17,12 @@ export const createGraph = async (params: { graphName: string; nodes: any[]; edg
1717 description : '' ,
1818 schema : schemaJSON ,
1919 } ;
20- graphs = await GraphApiFactory ( undefined , location . origin ) . createGraph ( data ) ;
20+ graphs = await GraphApiFactory ( undefined , window . COORDINATOR_URL ) . createGraph ( data ) ;
2121 }
2222 /** groot 创建 */
2323 if ( GS_ENGINE_TYPE === 'groot' && graph_id ) {
2424 // const schemagrootJSON = transOptionsToGrootSchema(cloneDeep({ nodes: nodes, edges: edges }));
25- graphs = await GraphApiFactory ( undefined , location . origin )
25+ graphs = await GraphApiFactory ( undefined , window . COORDINATOR_URL )
2626 . importSchemaById ( graph_id , schemaJSON )
2727 . then ( res => {
2828 if ( res . status === 200 ) {
@@ -39,7 +39,7 @@ export const createGraph = async (params: { graphName: string; nodes: any[]; edg
3939} ;
4040/** upload file */
4141export const uploadFile = async ( file : File ) => {
42- return UtilsApiFactory ( undefined , location . origin )
42+ return UtilsApiFactory ( undefined , window . COORDINATOR_URL )
4343 . uploadFile ( file )
4444 . then ( res => {
4545 if ( res . status === 200 ) {
@@ -54,7 +54,7 @@ export const uploadFile = async (file: File) => {
5454export const getSchema = async ( graph_id : string ) => {
5555 let schema ;
5656 if ( window . GS_ENGINE_TYPE === 'interactive' || window . GS_ENGINE_TYPE === 'gart' ) {
57- schema = await GraphApiFactory ( undefined , location . origin )
57+ schema = await GraphApiFactory ( undefined , window . COORDINATOR_URL )
5858 . getGraphById ( graph_id )
5959 . then ( res => {
6060 if ( res . status === 200 ) {
@@ -68,7 +68,7 @@ export const getSchema = async (graph_id: string) => {
6868 } ) ;
6969 }
7070 if ( window . GS_ENGINE_TYPE === 'groot' ) {
71- schema = await GraphApiFactory ( undefined , location . origin )
71+ schema = await GraphApiFactory ( undefined , window . COORDINATOR_URL )
7272 . getSchemaById ( graph_id )
7373 . then ( res => {
7474 if ( res . status === 200 ) {
@@ -101,7 +101,7 @@ export const deleteVertexTypeOrEdgeType = async (
101101 const graph_id = getSearchParams ( 'graph_id' ) || '' ;
102102 if ( type === 'nodes' ) {
103103 try {
104- const res = await GraphApiFactory ( undefined , location . origin ) . deleteVertexTypeByName ( graph_id , label ) ;
104+ const res = await GraphApiFactory ( undefined , window . COORDINATOR_URL ) . deleteVertexTypeByName ( graph_id , label ) ;
105105 response = true ;
106106 notification ( 'success' , res . data ) ;
107107 } catch ( error ) {
@@ -110,7 +110,7 @@ export const deleteVertexTypeOrEdgeType = async (
110110 }
111111 if ( type === 'edges' && sourceVertexType && destinationVertexType ) {
112112 try {
113- const res = await GraphApiFactory ( undefined , location . origin ) . deleteEdgeTypeByName (
113+ const res = await GraphApiFactory ( undefined , window . COORDINATOR_URL ) . deleteEdgeTypeByName (
114114 graph_id ,
115115 label ,
116116 sourceVertexType ,
@@ -139,7 +139,7 @@ export const createVertexTypeOrEdgeType = async (
139139 //@ts -ignore
140140 const { vertex_types } = transOptionsToSchema ( { nodes : [ params ] , edges : [ ] } ) ;
141141 try {
142- const res = await GraphApiFactory ( undefined , location . origin ) . createVertexType ( graph_id , vertex_types [ 0 ] ) ;
142+ const res = await GraphApiFactory ( undefined , window . COORDINATOR_URL ) . createVertexType ( graph_id , vertex_types [ 0 ] ) ;
143143 notification ( 'success' , res . data ) ;
144144 response = true ;
145145 } catch ( error ) {
@@ -151,7 +151,7 @@ export const createVertexTypeOrEdgeType = async (
151151 const { edge_types } = transOptionsToSchema ( { nodes : nodes , edges : [ params ] } ) ;
152152 console . log ( 'edge_types' , edge_types , params ) ;
153153 try {
154- const res = await GraphApiFactory ( undefined , location . origin ) . createEdgeType ( graph_id , edge_types [ 0 ] ) ;
154+ const res = await GraphApiFactory ( undefined , window . COORDINATOR_URL ) . createEdgeType ( graph_id , edge_types [ 0 ] ) ;
155155 notification ( 'success' , res . data ) ;
156156 response = true ;
157157 } catch ( error ) {
0 commit comments