diff --git a/src/pages/dashboard/components/usage-inner/index.tsx b/src/pages/dashboard/components/usage-inner/index.tsx
index 9d6f9bc6..7dcee0cf 100644
--- a/src/pages/dashboard/components/usage-inner/index.tsx
+++ b/src/pages/dashboard/components/usage-inner/index.tsx
@@ -1,7 +1,5 @@
-import PageTools from '@/components/page-tools';
-import { ExportOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
-import { Button, Col, DatePicker, Row, Select } from 'antd';
+import { Col, DatePicker, Row, Select } from 'antd';
import { FC, memo, useContext, useState } from 'react';
import styled from 'styled-components';
import { DashboardContext } from '../../config/dashboard-context';
@@ -51,7 +49,6 @@ const UsageInner: FC<{ paddingRight: string }> = ({ paddingRight }) => {
return (
-
= ({ paddingRight }) => {
md={24}
lg={24}
xl={16}
- style={{ paddingRight: paddingRight }}
+ style={{ paddingRight: paddingRight, marginTop: 12 }}
>
= ({ paddingRight }) => {
{intl.formatMessage({ id: 'dashboard.usage' })}
- }
- onClick={handleExport}
- >
- {intl.formatMessage({ id: 'common.button.export' })}
-
= ({ paddingRight }) => {
-
+
{intl.formatMessage({ id: 'dashboard.topusers' })}
diff --git a/src/pages/dashboard/components/usage-inner/request-token-inner.tsx b/src/pages/dashboard/components/usage-inner/request-token-inner.tsx
index cfe3a314..aa8066b6 100644
--- a/src/pages/dashboard/components/usage-inner/request-token-inner.tsx
+++ b/src/pages/dashboard/components/usage-inner/request-token-inner.tsx
@@ -1,11 +1,23 @@
import CardWrapper from '@/components/card-wrapper';
import { SimpleCard } from '@/components/card-wrapper/simple-card';
import MixLineBar from '@/components/echarts/mix-line-bar';
+import { ExportOutlined } from '@ant-design/icons';
+import { useIntl } from '@umijs/max';
+import { Button } from 'antd';
import dayjs from 'dayjs';
import React from 'react';
+import styled from 'styled-components';
import { baseColorMap } from '../../config';
+const DownloadButton = styled(Button)`
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ z-index: 10;
+`;
+
interface RequestTokenInnerProps {
+ onExport?: () => void;
requestData: {
name: string;
color: string;
@@ -50,10 +62,19 @@ const legendData = [
];
const RequestTokenInner: React.FC = (props) => {
- const { requestData, tokenData, xAxisData } = props;
+ const { requestData, tokenData, xAxisData, onExport } = props;
+ const intl = useIntl();
return (
-
+
+ }
+ size="small"
+ onClick={onExport}
+ >
+ {intl.formatMessage({ id: 'common.button.export' })}
+
= (props) => {
* unitl the evaluate result is ready
*/
form.current?.setFieldsValue?.({
- file_name: item.fakeName,
...modelInfo,
+ file_name: item.fakeName,
categories: getCategory(item)
});
@@ -233,9 +233,9 @@ const AddModal: FC = (props) => {
form.current?.getFieldValue?.('backend_parameters') || [];
form.current?.setFieldsValue?.({
- file_name: item.fakeName,
...defaultSpec,
...modelInfo,
+ file_name: item.fakeName,
backend_parameters:
formBackendParameters.length > 0
? formBackendParameters
diff --git a/src/pages/llmodels/components/hf-model-file.tsx b/src/pages/llmodels/components/hf-model-file.tsx
index 624a2661..a7614086 100644
--- a/src/pages/llmodels/components/hf-model-file.tsx
+++ b/src/pages/llmodels/components/hf-model-file.tsx
@@ -41,10 +41,6 @@ interface HFModelFileProps {
ref: any;
gpuOptions?: any[];
onSelectFile?: (file: any, evaluate?: boolean) => void;
- displayEvaluateStatus?: (data: {
- show?: boolean;
- flag: Record;
- }) => void;
}
const pattern = /^(.*)-(\d+)-of-(\d+)\.(.*)$/;
@@ -54,7 +50,7 @@ const includeReg = /\.(safetensors|gguf)$/i;
const filterRegGGUF = /\.(gguf)$/i;
const HFModelFile: React.FC = forwardRef((props, ref) => {
- const { collapsed, modelSource, isDownload, displayEvaluateStatus } = props;
+ const { collapsed, modelSource, isDownload } = props;
const intl = useIntl();
const [isEvaluating, setIsEvaluating] = useState(false);
const [dataSource, setDataSource] = useState({
@@ -260,12 +256,7 @@ const HFModelFile: React.FC = forwardRef((props, ref) => {
resultList,
(item: any) => item.path === currentPathRef.current
);
- displayEvaluateStatus?.({
- show: false,
- flag: {
- file: false
- }
- });
+
if (currentItem) {
handleSelectModelFile(currentItem, true);
}
@@ -273,12 +264,6 @@ const HFModelFile: React.FC = forwardRef((props, ref) => {
setIsEvaluating(false);
} catch (error) {
setIsEvaluating(false);
- displayEvaluateStatus?.({
- show: false,
- flag: {
- file: false
- }
- });
}
};
diff --git a/src/pages/llmodels/hooks/index.ts b/src/pages/llmodels/hooks/index.ts
index db2df3a0..060a6413 100644
--- a/src/pages/llmodels/hooks/index.ts
+++ b/src/pages/llmodels/hooks/index.ts
@@ -630,6 +630,7 @@ export const useSelectModel = (data: { gpuOptions: any[] }) => {
return {
repo_id: selectModel.name,
+ file_name: '',
name: name,
backend: backend
};