Skip to content

Commit

Permalink
start index from browser
Browse files Browse the repository at this point in the history
  • Loading branch information
sin-bufan committed Feb 2, 2024
1 parent 932735c commit 29c68c9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
70 changes: 35 additions & 35 deletions packages/client/dashboard/src/api/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,42 +212,42 @@ export function getModelSDK({
})
}

export function startIndexModel({
network,
modelId,
didSession,
}: {
network: Network
modelId: string
didSession?: string
}): AxiosPromise<ApiResp<null>> {
return axios({
url: `${APP_API_URL}/models/indexing?network=${network.toUpperCase()}&model=${modelId}`,
method: 'post',
headers: {
'did-session': didSession || '',
},
})
}
// export function startIndexModel({
// network,
// modelId,
// didSession,
// }: {
// network: Network
// modelId: string
// didSession?: string
// }): AxiosPromise<ApiResp<null>> {
// return axios({
// url: `${APP_API_URL}/models/indexing?network=${network.toUpperCase()}&model=${modelId}`,
// method: 'post',
// headers: {
// 'did-session': didSession || '',
// },
// })
// }

export function startIndexModels({
modelIds,
network,
didSession,
}:{
didSession: string,
modelIds: string[],
network: Network }) {
if (!modelIds || modelIds.length===0) return Promise.reject()
const resp = Promise.all(modelIds.map((modelId: string) => {
return startIndexModel({
modelId,
network,
didSession
})
}))
return resp
}
// export function startIndexModels({
// modelIds,
// network,
// didSession,
// }:{
// didSession: string,
// modelIds: string[],
// network: Network }) {
// if (!modelIds || modelIds.length===0) return Promise.reject()
// const resp = Promise.all(modelIds.map((modelId: string) => {
// return startIndexModel({
// modelId,
// network,
// didSession
// })
// }))
// return resp
// }

export function getStreamsCountWithModels({
network,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ export const extraScalars: Record<string, ScalarWithTitle> = {
...getGraphQLScalarSchema<JSONSchema.String>('date'),
maxLength: 100,
},
DateTime: {
...getGraphQLScalarSchema<JSONSchema.String>('datetime'),
maxLength: 100,
},
// DateTime: {
// ...getGraphQLScalarSchema<JSONSchema.String>('datetime'),
// maxLength: 100,
// },
DID: { ...getGraphQLScalarSchema<JSONSchema.String>('did'), maxLength: 100 },
Latitude: getGraphQLScalarSchema('latitude'),
LocalDate: {
Expand Down

0 comments on commit 29c68c9

Please sign in to comment.