chore: replace components with core-ui, upgrade eslint
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import { DeleteOutlined, PaperClipOutlined } from '@ant-design/icons';
|
||||
import { AutoTooltip } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Tooltip } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import React from 'react';
|
||||
import '../style/file-list.less';
|
||||
|
||||
interface FileListProps {
|
||||
fileList: { text: string; name: string; uid: number | string }[];
|
||||
ghost?: boolean;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import RowTextarea from '@/components/seal-form/row-textarea';
|
||||
import { RowTextarea } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
|
||||
import '../style/input-list.less';
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import SimpleAudio from '@/components/audio-player/simple-audio';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import UploadAudio from '@/components/upload-audio';
|
||||
import HotKeys, { KeyMap } from '@/config/hotkeys';
|
||||
import {
|
||||
audioTypeMap,
|
||||
@@ -13,6 +10,7 @@ import {
|
||||
SendOutlined,
|
||||
SwapOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { IconFont, SimpleAudio, UploadAudio } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Checkbox, Divider, Input, Tooltip } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -241,7 +239,7 @@ const MessageInput: React.FC<MessageInputProps> = forwardRef(
|
||||
const imgPromises: Promise<string>[] = [];
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
let item = items[i];
|
||||
const item = items[i];
|
||||
|
||||
if (item.kind === 'file' && item.type.indexOf('image') !== -1) {
|
||||
const file = item.getAsFile();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { Select as SealSelect } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { StopOutlined } from '@ant-design/icons';
|
||||
import { IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button } from 'antd';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import CopyButton from '@/components/copy-button';
|
||||
import UploadAudio from '@/components/upload-audio';
|
||||
import {
|
||||
audioTypeMap,
|
||||
convertFileToBase64,
|
||||
@@ -10,6 +8,7 @@ import {
|
||||
EditOutlined,
|
||||
MinusCircleOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { CopyButton, UploadAudio } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Tooltip } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import SimpleAudio from '@/components/audio-player/simple-audio';
|
||||
import FullMarkdown from '@/components/markdown-viewer/full-markdown';
|
||||
import { FullMarkdown, SimpleAudio } from '@gpustack/core-ui';
|
||||
import { Input } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import _ from 'lodash';
|
||||
@@ -78,7 +77,7 @@ const MessageBody: React.FC<MessageBodyProps> = forwardRef(
|
||||
const imgPromises: Promise<string>[] = [];
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
let item = items[i];
|
||||
const item = items[i];
|
||||
|
||||
if (item.kind === 'file' && item.type.indexOf('image') !== -1) {
|
||||
const file = item.getAsFile();
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import OverlayScroller from '@/components/overlay-scroller';
|
||||
import BaseSelect from '@/components/seal-form/base/select';
|
||||
import {
|
||||
ClearOutlined,
|
||||
DeleteOutlined,
|
||||
MoreOutlined,
|
||||
SettingOutlined
|
||||
} from '@ant-design/icons';
|
||||
import {
|
||||
AutoTooltip,
|
||||
BaseSelect,
|
||||
IconFont,
|
||||
OverlayScroller
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Checkbox, Dropdown, Popover, Spin } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -38,7 +40,6 @@ import ReferenceParams from '../reference-params';
|
||||
import ViewCommonCode from '../view-common-code';
|
||||
import MessageContent from './message-content';
|
||||
import SystemMessage from './system-message';
|
||||
|
||||
interface ModelItemProps {
|
||||
model: string;
|
||||
modelList: ModelSelectionItem[];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import FullMarkdown from '@/components/markdown-viewer/full-markdown';
|
||||
import { FullMarkdown } from '@gpustack/core-ui';
|
||||
import React from 'react';
|
||||
import '../../style/think-content.less';
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ class ThinkParser {
|
||||
|
||||
parse(chunk: string) {
|
||||
while (this.lastCheckedIndex < chunk.length) {
|
||||
let startIndex = chunk.indexOf('<think>', this.lastCheckedIndex);
|
||||
let endIndex = chunk.indexOf('</think>', this.lastCheckedIndex);
|
||||
const startIndex = chunk.indexOf('<think>', this.lastCheckedIndex);
|
||||
const endIndex = chunk.indexOf('</think>', this.lastCheckedIndex);
|
||||
|
||||
if (!this.collecting) {
|
||||
if (endIndex !== -1 && (startIndex === -1 || endIndex < startIndex)) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import FieldComponent from '@/components/seal-form/field-component';
|
||||
import { FieldComponent } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import SingleImage from '@/components/auto-image/single-image';
|
||||
import { SingleImage } from '@gpustack/core-ui';
|
||||
import { Col, Row } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Space } from 'antd';
|
||||
import React from 'react';
|
||||
import IconFont from '../../../components/icon-font';
|
||||
|
||||
const ViewCodeButtons: React.FC<{
|
||||
handleViewCode: () => void;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { BulbOutlined } from '@ant-design/icons';
|
||||
import { CommandViewer } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Modal } from 'antd';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import CommandViewer from '../../_components/command-viewer';
|
||||
|
||||
type ViewModalProps = {
|
||||
title?: string;
|
||||
|
||||
Reference in New Issue
Block a user