diff --git a/packages/canyon-platform/package.json b/packages/canyon-platform/package.json index 5b3e59d0..6f165dc1 100644 --- a/packages/canyon-platform/package.json +++ b/packages/canyon-platform/package.json @@ -16,7 +16,6 @@ "@apollo/client": "^3.10.8", "@graphql-typed-document-node/core": "^3.2.0", "@monaco-editor/react": "^4.6.0", - "@paralleldrive/cuid2": "^2.2.2", "ahooks": "^3.8.0", "antd": "5.14.1", "axios": "^1.7.2", @@ -27,7 +26,6 @@ "echarts": "^5.5.1", "echarts-for-react": "^3.0.2", "graphql": "^16.9.0", - "highlight.js": "^11.9.0", "i18next": "^23.11.5", "i18next-browser-languagedetector": "^7.2.1", "monaco-themes": "^0.4.4", diff --git a/packages/canyon-platform/src/components/app/CopyCode.tsx b/packages/canyon-platform/src/components/app/CopyCode.tsx index b4140902..8fccf7d5 100755 --- a/packages/canyon-platform/src/components/app/CopyCode.tsx +++ b/packages/canyon-platform/src/components/app/CopyCode.tsx @@ -1,31 +1,36 @@ -import 'highlight.js/styles/atom-one-dark.css'; import './CopyCode.css'; import { CopyOutlined } from '@ant-design/icons'; -import hljs from 'highlight.js'; import { FC, useEffect } from 'react'; // @ts-ignore import { CopyToClipboard } from 'react-copy-to-clipboard'; +import { codeToHtml } from 'shiki'; const CopyCode: FC<{ code: string }> = ({ code }) => { const fileContent = code; + const [content, setContent] = useState(''); + useEffect(() => { if (fileContent) { - hljs.highlightAll(); + codeToHtml(fileContent, { + lang: 'json', + theme: 'tokyo-night', + }).then((r) => { + setContent(r); + }); } }, [fileContent]); return ( -
+
-
-        
-          {fileContent}
-        
-      
+ +
+
+
); }; diff --git a/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/TagTable.tsx b/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/TagTable.tsx index 38aba5b8..4d132c03 100644 --- a/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/TagTable.tsx +++ b/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/TagTable.tsx @@ -1,6 +1,5 @@ -import { ExperimentOutlined, PlusOutlined, TagOutlined } from '@ant-design/icons'; +import { PlusOutlined, TagOutlined } from '@ant-design/icons'; import { useMutation } from '@apollo/client'; -import { createId } from '@paralleldrive/cuid2'; import { useParams } from 'react-router-dom'; import { UpdateProjectDocument } from '../../../../../../helpers/backend/gen/graphql.ts'; @@ -170,12 +169,11 @@ const TagTable = ({ tags }) => { variables: { projectID: prm.id as string, coverage: '__null__', - tag: '__null__', description: '__null__', defaultBranch: '__null__', tags: dataSource, }, - }).then((r) => { + }).then(() => { message.success('保存成功'); }); }} @@ -187,7 +185,7 @@ const TagTable = ({ tags }) => { onClick={() => { setDataSource( dataSource.concat({ - id: createId(), + id: String(Math.random()), name: 'tagname', link: '', color: '#0071c2', @@ -211,15 +209,7 @@ const TagTable = ({ tags }) => { form.submit(); }} > -
{ - // return i.id === activeID; - // })} - onFinish={onFinish} - > + label='ID' name='id'>