Skip to content

Commit

Permalink
fix: doc&eslint (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
mizy authored Dec 4, 2023
1 parent f0265fc commit 1bc9b95
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
"@typescript-eslint/consistent-type-definitions": "warn",
"react-hooks/exhaustive-deps": "off"
}
}
}
6 changes: 3 additions & 3 deletions app/pages/Import/AIImport/Create.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useStore } from '@app/stores';
import { useI18n } from '@vesoft-inc/i18n';
import { Button, Form, Input, Modal, Radio, Select, Tabs, message } from 'antd';
import { Button, Form, Input, Modal, Radio, Select, message } from 'antd';
import { observer } from 'mobx-react-lite';
import styles from './index.module.less';
import Icon from '@app/components/Icon';
import { useEffect, useMemo, useState } from 'react';
import { llmImportTask, llmImportPrompt } from '@app/stores/llm';
import { llmImportPrompt } from '@app/stores/llm';
import { getByteLength } from '@app/utils/function';
import { post } from '@app/utils/http';

Expand Down Expand Up @@ -35,7 +35,7 @@ const Create = observer((props: { visible: boolean; onCancel: () => void }) => {
}, [props.visible]);

const onNext = () => {
form.validateFields().then((values) => {
form.validateFields().then(() => {
setStep(1);
});
};
Expand Down
8 changes: 1 addition & 7 deletions app/pages/Import/TaskList/TaskItem/AIImportItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { getFileSize } from '@app/utils/file';
import Icon from '@app/components/Icon';
import { useI18n } from '@vesoft-inc/i18n';
import { observer } from 'mobx-react-lite';
import { useStore } from '@app/stores';
import styles from './index.module.less';
import { _delete, post } from '@app/utils/http';
import React from 'react';
Expand Down Expand Up @@ -50,16 +49,11 @@ const COLOR_MAP = {
const loadingStatus = [ILLMStatus.Running, ILLMStatus.Pending];
const AIImportItem = observer((props: IProps) => {
const {
data: { createTime, space, llmJob, id },
data: { createTime, space, llmJob },
onViewLog,
} = props;
const { intl } = useI18n();
const {
dataImport: { downloadTaskConfig },
moduleConfiguration,
} = useStore();
const [rerunLoading, setRerunLoading] = React.useState(false);
const { disableConfigDownload } = moduleConfiguration.dataImport;

const progressStatus = llmStatusMap[llmJob.status];

Expand Down
2 changes: 1 addition & 1 deletion app/pages/LLMBot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styles from './index.module.less';
import Chat from './chat';
import Icon from '@app/components/Icon';
import { observer } from 'mobx-react-lite';
import rootStore, { useStore } from '@app/stores';
import { useStore } from '@app/stores';
// float llm bot window
function LLMBot() {
const { global, llm } = useStore();
Expand Down
2 changes: 1 addition & 1 deletion app/stores/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ please extract relationship data from the text below, referring to the schema of
"edges":[{ "src":"","dst":"","edgeType":"","props":{} }]
}
The schema of the graph is: {spaceSchema}
The text is: {text}
The text is: {text}
The result is:
`;
export const llmImportTask = `please excute the task below,and return the result,dont' explain,just return the result directly.
Expand Down
1 change: 1 addition & 0 deletions app/utils/doc.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion app/utils/ngql.json

This file was deleted.

2 changes: 1 addition & 1 deletion app/utils/ngql.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ngqlJson from './ngql.json';
import ngqlJson from './doc.json';

const urlTransformerMap = {
FETCH: 'FETCHProps',
Expand Down
8 changes: 4 additions & 4 deletions scripts/getDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ async function getDocIndex(host = 'https://docs.nebula-graph.io') {
try {
// if (link.indexOf('ngql-guide') >= 0 || link.indexOf('FAQ') >= 0) {
// name = 'ngql';
// if (!res[name]) {
// res[name] = []
// }
// console.log("get:", link)
// } else {
// console.log("skip:", link)
// continue;
// }
if (!res[name]) {
res[name] = []
}
const data = await axios.get(href);
const html = data.data;
const $ = cheerio.load(html);
Expand All @@ -60,7 +60,7 @@ async function getDocIndex(host = 'https://docs.nebula-graph.io') {
const object = {
title: title,
content: finalContent,
url: href.replaceAll(host + '/3.ngql-guide/', ''),
url: href.replace(host, ''),
type: 'doc'
}
console.log(`update:[${++now}/${length}]`, object.title);
Expand Down

0 comments on commit 1bc9b95

Please sign in to comment.