feat: 完成算力中心、系统日志模块mock数据,模型部署模块新增查看联调完成,初始化预览yaml或者json文件

develop2
donghao 11 months ago
parent 9f81eed868
commit b55530aa51

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-03-27 14:56:27
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-07 13:53:32
* @LastEditTime: 2024-06-12 14:04:24
* @FilePath: \general-ai-manage\config\routes.ts
* @Description:
*/
@ -208,13 +208,18 @@ export default [
routes: [
{
path: '/admin',
redirect: '/admin/sub-page',
redirect: '/admin/index',
},
{
path: '/admin/sub-page',
name: 'sub-page',
path: '/admin/index',
name: 'admin-index',
component: './Admin',
},
{
path: '/admin/previewFile',
name: 'admin-preview-file',
component: './Admin/previewFile',
},
],
},
];

@ -0,0 +1,129 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-06-11 14:24:07
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-11 14:59:27
* @FilePath: \general-ai-platform-web\mock\pools\serverLogData.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export const mockGetServerLogList = {
data: {
count: 15,
data: [
{
accountName: 'user123',
ipAddress: '192.168.1.1',
timestamp: 1625190000,
action: '新建用户',
logContent:
'用户user123在系统中创建了一个新的用户账号用户名为newUser001。操作成功权限为普通用户。',
},
{
accountName: 'admin456',
ipAddress: '192.168.1.2',
timestamp: 1625193600,
action: '编辑文件',
logContent:
'管理员admin456对文件document_v2.0进行了编辑,修改了文件中的部分内容,并保存了更改。',
},
{
accountName: 'user789',
ipAddress: '192.168.1.3',
timestamp: 1625197200,
action: '删除记录',
logContent:
'用户user789从数据库中删除了一条记录记录ID为10023。删除操作已确认无法恢复。',
},
{
accountName: 'guest001',
ipAddress: '192.168.1.4',
timestamp: 1625200800,
action: '新建项目',
logContent: '游客guest001在系统中创建了一个新项目项目名称为Project_A。项目描述已填写。',
},
{
accountName: 'dev002',
ipAddress: '192.168.1.5',
timestamp: 1625204400,
action: '编辑配置',
logContent:
'开发人员dev002对系统配置进行了编辑调整了参数设置并重新启动了服务以应用更改。',
},
{
accountName: 'user111',
ipAddress: '192.168.1.6',
timestamp: 1625208000,
action: '新建文档',
logContent: "用户user111创建了一个新文档文档标题为'周报_202106',并添加了初步内容。",
},
{
accountName: 'admin222',
ipAddress: '192.168.1.7',
timestamp: 1625211600,
action: '编辑配置',
logContent: '管理员admin222对系统网络配置进行了编辑更新了路由表并保存了新配置。',
},
{
accountName: 'user333',
ipAddress: '192.168.1.8',
timestamp: 1625215200,
action: '删除用户',
logContent: '用户user333删除了系统中的一个用户账号用户名为oldUser999操作已完成。',
},
{
accountName: 'guest444',
ipAddress: '192.168.1.9',
timestamp: 1625218800,
action: '新建任务',
logContent:
"游客guest444在项目管理系统中创建了一项新任务任务名称为'Task_XYZ',并指派给相关人员。",
},
{
accountName: 'dev555',
ipAddress: '192.168.1.10',
timestamp: 1625222400,
action: '编辑日志',
logContent: '开发人员dev555编辑了系统日志添加了新的调试信息并保存了更新后的日志文件。',
},
{
accountName: 'user666',
ipAddress: '192.168.1.11',
timestamp: 1625226000,
action: '新建活动',
logContent: "用户user666在系统中创建了一项新活动活动名称为'年度庆典',并添加了活动详情。",
},
{
accountName: 'admin777',
ipAddress: '192.168.1.12',
timestamp: 1625229600,
action: '编辑权限',
logContent:
'管理员admin777修改了用户组的权限设置增加了对部分资源的访问权限并应用了更改。',
},
{
accountName: 'user888',
ipAddress: '192.168.1.13',
timestamp: 1625233200,
action: '删除文件',
logContent:
"用户user888从系统中删除了一份旧的报告文件文件名称为'report_old_2020',操作已确认。",
},
{
accountName: 'guest999',
ipAddress: '192.168.1.14',
timestamp: 1625236800,
action: '新建讨论',
logContent:
"游客guest999在讨论区发起了一场新讨论讨论主题为'项目进展',并邀请相关成员参与。",
},
{
accountName: 'dev000',
ipAddress: '192.168.1.15',
timestamp: 1625240400,
action: '编辑代码',
logContent:
'开发人员dev000对项目代码进行了编辑修复了一处已知的bug并提交了更新至版本控制系统。',
},
],
},
};

@ -0,0 +1,25 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-25 15:45:17
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-11 14:56:15
* @FilePath: \general-ai-platform-web\mock\serverLog.ts
* @Description: mock
*/
import { mockGetServerLogList } from './pools/serverLogData';
import { successMockApiProps } from './typing';
import { fetchCurrPageByList } from './utils/apiMock';
export default {
// 系统日志列表
'POST /api/v1/serverLog/list': async (req: Request, res: Response) => {
const { pageNo, pageSize } = req.body;
const resData: successMockApiProps = {
...fetchCurrPageByList({
...mockGetServerLogList,
data: { ...mockGetServerLogList.data, pageNo, pageSize: pageSize || 10 },
}),
};
res.send(resData);
},
};

@ -207,6 +207,14 @@
border-radius: 2px;
padding-inline: 8px;
}
.active_tag {
height: 24px;
color: #154ddd;
line-height: 22px;
border: 1px solid #154ddd;
border-radius: 2px;
padding-inline: 8px;
}
.ant-form-item .ant-form-item-label > label {
color: #333333;
}

@ -242,6 +242,15 @@
padding-inline: 8px;
}
.active_tag {
height: 24px;
color: @primary_color;
line-height: 22px;
border: 1px solid @primary_color;
border-radius: 2px;
padding-inline: 8px;
}
// 通用表单
.ant-form-item {
.ant-form-item-label > label {

@ -2,10 +2,12 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-06-04 15:13:34
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-04 15:25:13
* @LastEditTime: 2024-06-12 14:14:52
* @FilePath: \general-ai-platform-web\src\components\UploadFile\index.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import proFormUploadDraggerToken from './src/formUploadDraggerToken';
import uploadFileForView from './src/uploadFileForView';
export const FormUploadDraggerToken = proFormUploadDraggerToken;
export const UploadFileForView = uploadFileForView;

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-06-04 15:14:27
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-07 17:27:54
* @LastEditTime: 2024-06-12 14:40:40
* @FilePath: \general-ai-platform-web\src\components\UploadFile\src\FormUploadDraggerToken.tsx
* @Description:
* // TODO 需要支持多文件上传
@ -10,12 +10,12 @@
import { apiFileDelete, apiFileUpload } from '@/services/business/file';
import { useIntl } from '@umijs/max';
import { RcFile, UploadChangeParam, UploadFile, message } from 'antd';
// import localCacha from '@/utils/localCacha';
import { isSuccessApi } from '@/utils/forApi';
import { ProFormUploadDragger } from '@ant-design/pro-components';
import React, { useState } from 'react';
import { FormUploadDraggerTokenProps } from '../typing';
import UploadFileForView from './uploadFileForView';
// import { ProFormUploadDragger, type ProFormUploadDraggerProps } from '@ant-design/pro-components';
// import type { RcFile, UploadChangeParam, UploadFile } from 'antd/es/upload';
@ -26,6 +26,7 @@ const FormUploadDraggerToken: React.FC<FormUploadDraggerTokenProps> = (props) =>
const [fileList, setFileList] = useState([
{ status: 'done', url: '/file/' + props.fileValues?.id, ...props.fileValues },
]);
const [previewFile, setPreviewFile] = useState(null);
/**
*
@ -60,6 +61,7 @@ const FormUploadDraggerToken: React.FC<FormUploadDraggerTokenProps> = (props) =>
fileId: resp?.data?.result,
},
]);
setPreviewFile(file);
props.afterUploadFile({ resp, file, fileList });
}
console.log(resp, 'apiFileUpload_resp');
@ -85,6 +87,7 @@ const FormUploadDraggerToken: React.FC<FormUploadDraggerTokenProps> = (props) =>
const resp = await apiFileDelete({ file_md5: currFile?.fileId });
console.log(resp, 'apiFileDelete_resp');
props.afterRemoveFile(resp, file);
setPreviewFile(null);
if (isSuccessApi(resp)) {
message.success(`${file.name} 删除成功`);
} else {
@ -121,6 +124,7 @@ const FormUploadDraggerToken: React.FC<FormUploadDraggerTokenProps> = (props) =>
beforeUpload: beforeUploadFile,
}}
/>
{props?.openPreviewFile && <UploadFileForView file={previewFile} />}
</>
);
};

@ -0,0 +1,83 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-06-12 14:12:24
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-12 16:30:14
* @FilePath: \general-ai-platform-web\src\components\UploadFile\src\uploadFileForView.tsx
* @Description:
*/
// src/components/UploadFileForView.js
import { message } from 'antd';
import YAML from 'js-yaml';
import React, { useEffect, useState } from 'react';
import { UploadFileForViewProps } from '../typing';
const UploadFileForView: React.FC<UploadFileForViewProps> = (props) => {
const [fileContent, setFileContent] = useState(null);
// const [fileName, setFileName] = useState('');
const handleFileUpload = (file) => {
const reader = new FileReader();
reader.onload = (e) => {
const content = e.target.result;
let parsedContent;
try {
if (file.type === 'application/json') {
parsedContent = JSON.parse(content);
} else if (
file.type === 'application/x-yaml' ||
file.type === 'text/yaml' ||
file.name.endsWith('.yaml') ||
file.name.endsWith('.yml')
) {
parsedContent = YAML.load(content);
} else {
message.error('不支持的文件类型');
return;
}
setFileContent(parsedContent);
// setFileName(file.name);
} catch (error) {
message.error('文件解析失败');
}
};
reader.readAsText(file);
return false; // 阻止自动上传
};
// const uploadProps = {
// beforeUpload: handleFileUpload,
// showUploadList: false,
// };
useEffect(() => {
if (props?.file) {
handleFileUpload(props.file);
} else {
setFileContent('');
}
}, [props.file]);
return (
<div>
{/* <Upload {...uploadProps}>
<Button icon={<UploadOutlined />}></Button>
</Upload> */}
{fileContent && (
<div className="mt-[16px]">
<div className="head4 pb-[12px]"></div>
<div className="max-h-[300px] overflow-scroll">
<pre style={{ padding: '16px', backgroundColor: '#f5f5f5', borderRadius: 4 }}>
{JSON.stringify(fileContent, null, 2)}
</pre>
</div>
</div>
)}
</div>
);
};
export default UploadFileForView;

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-26 11:09:49
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-05 14:50:40
* @LastEditTime: 2024-06-12 14:22:59
* @FilePath: \general-ai-platform-web\src\components\UploadFile\typing.ts
* @Description:
*/
@ -12,4 +12,10 @@ export interface FormUploadDraggerTokenProps extends ProFormUploadDraggerProps {
afterRemoveFile?: (file: UploadFile<R<string>>) => void; // 删除开始
requestDelFile?: (status: boolean) => void;
nextText?: string | React.ReactNode;
openPreviewFile?: boolean;
}
export interface UploadFileForViewProps {
beforeUpload?: (data: any) => void; // 上传完成后
file?: any;
}

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-05-09 15:21:03
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-14 17:04:43
* @LastEditTime: 2024-06-11 14:52:12
* @FilePath: \general-ai-platform-web\src\locales\zh-CN\server.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@ -28,3 +28,12 @@ export const server_state: { [key: string]: string } = {
'server_state.table.detail.title.info': '硬件信息',
'server_state.table.detail.title.task': '当前任务',
};
// 服务器日志
export const server_log: { [key: string]: string } = {
'server_log.table.list.name': '账号',
'server_log.table.list.ip': 'IP地址',
'server_log.table.list.updateTime': '操作时间',
'server_log.table.list.action': '动作',
'server_log.table.list.remark': '操作日志',
};

@ -1,3 +1,11 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-06-12 14:02:46
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-12 14:02:53
* @FilePath: \general-ai-platform-web\src\pages\Admin\index.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { HeartTwoTone, SmileTwoTone } from '@ant-design/icons';
import { PageContainer } from '@ant-design/pro-components';
import { useIntl } from '@umijs/max';

@ -0,0 +1,57 @@
// src/components/PreviewFile.js
import { UploadOutlined } from '@ant-design/icons';
import { Button, Card, Upload, message } from 'antd';
import YAML from 'js-yaml';
import { useState } from 'react';
const PreviewFile = () => {
const [fileContent, setFileContent] = useState(null);
const [fileName, setFileName] = useState('');
const handleFileUpload = (file) => {
const reader = new FileReader();
reader.onload = (e) => {
const content = e.target.result;
let parsedContent;
try {
if (file.type === 'application/json') {
parsedContent = JSON.parse(content);
} else if (file.type === 'application/x-yaml' || file.type === 'text/yaml') {
parsedContent = YAML.load(content);
}
setFileContent(parsedContent);
setFileName(file.name);
} catch (error) {
message.error('文件解析失败');
}
};
reader.readAsText(file);
return false; // 阻止自动上传
};
const uploadProps = {
beforeUpload: handleFileUpload,
showUploadList: false,
};
return (
<Card title="上传并预览文件" bordered={false} style={{ width: '100%' }}>
<Upload {...uploadProps}>
<Button icon={<UploadOutlined />}></Button>
</Upload>
{fileContent && (
<div style={{ marginTop: 20 }}>
<h3>: {fileName}</h3>
<pre style={{ padding: 10, backgroundColor: '#f5f5f5', borderRadius: 4 }}>
{JSON.stringify(fileContent, null, 2)}
</pre>
</div>
)}
</Card>
);
};
export default PreviewFile;

@ -10,7 +10,7 @@ import {
StepsForm,
} from '@ant-design/pro-components';
import { FormattedMessage, useIntl } from '@umijs/max';
import { Modal, Transfer, Tree } from 'antd';
import { Modal, Transfer, Tree, message } from 'antd';
import React, { useEffect, useRef, useState } from 'react';
import {
proFormMaxItemStyleProps,
@ -35,9 +35,7 @@ const waitTime = (time: number = 100) => {
}, time);
});
};
// interface ProjectConfig {
// params: Array<object>;
// }
const CreateForm: React.FC<CreateFormProps> = (props) => {
const intl = useIntl();
// state

@ -0,0 +1,85 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-06-11 13:33:07
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-12 16:30:51
* @FilePath: \general-ai-platform-web\src\pages\Business\BusinessModel\components\detailCard.tsx
* @Description:
*/
import { isArrayAndNotEmpty } from '@/utils/is';
import { ProCard } from '@ant-design/pro-components';
import { Modal } from 'antd';
import { useEffect, useState } from 'react';
import { proFormSmallModelWidth } from '../../../../../config/defaultForm';
type DetailCardProps = {
info: Record<string, any>;
detailModalOpen: boolean;
handleModal: () => void;
};
const DetailCard: React.FC<DetailCardProps> = (props) => {
/**state */
// const intl = useIntl();
const [setForceRender] = useState<boolean>(false);
useEffect(() => {
setForceRender(props.detailModalOpen);
}, [props.detailModalOpen]);
return (
<Modal
width={proFormSmallModelWidth}
title={props.info?.name}
open={props.detailModalOpen}
onCancel={props.handleModal}
footer={null}
afterVisibleChange={(isVisible) => {
if (!isVisible) {
setForceRender(false); // Modal 关闭时重置状态
}
}}
>
<ProCard className="gn_card_wrap" bodyStyle={{ padding: 0 }}>
<ul className="p1">
<li className="pt-[16px]">
<span className="text2"></span>
<span>{props.info?.name}</span>
</li>
<li className="pt-[16px]">
<span className="text2">: </span>
<span>{props.info?.comment}</span>
</li>
<li className="pt-[16px] flex">
<span className="text2">: </span>
<ul className="flex flex-wrap flex-1">
{isArrayAndNotEmpty(props.info?.basemodel_list) &&
props.info?.basemodel_list.map((item) => {
return (
<li key={item?.id} className="ml-[8px] mb-[8px] active_tag">
{item?.name}
</li>
);
})}
</ul>
</li>
<li className="pt-[8px] flex">
<span className="text2">: </span>
<ul className="flex flex-wrap flex-1">
{isArrayAndNotEmpty(props.info?.link_node_list) &&
props.info?.link_node_list.map((item) => {
return (
<li key={item?.node_id} className="ml-[8px] mb-[8px] active_tag">
{item?.node_name}
</li>
);
})}
</ul>
</li>
</ul>
</ProCard>
</Modal>
);
};
export default DetailCard;

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-22 15:23:36
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-07 14:44:06
* @LastEditTime: 2024-06-11 14:18:34
* @FilePath: \general-ai-platform-web\src\pages\Node\BusinessModel\index.tsx
* @Description:
* @
@ -13,48 +13,60 @@
import TableActionCard from '@/components/TableActionCard';
import IsDelete from '@/components/TableActionCard/isDelete';
import { useBusinessInfo } from '@/hooks/useBusinessInfo';
import { apiModelDeploymentList } from '@/services/business/model';
import {
apiModelDeploymentDelete,
apiModelDeploymentInfo,
apiModelDeploymentList,
} from '@/services/business/model';
import { isSuccessApi } from '@/utils/forApi';
import { ExclamationCircleFilled } from '@ant-design/icons';
import type { ActionType, ProColumns } from '@ant-design/pro-components';
import { ProCard, ProTable } from '@ant-design/pro-components';
import { FormattedMessage } from '@umijs/max';
import { Button } from 'antd';
import { FormattedMessage, useIntl } from '@umijs/max';
import { Button, message } from 'antd';
import { useRef, useState } from 'react';
import { proTablePaginationOptions } from '../../../../config/defaultTable';
import CreateForm from './components/createForm';
import DetailCard from './components/detailCard';
const BusinessModel: React.FC = () => {
// const intl = useIntl();
const intl = useIntl();
const { getStoreBusinessInfo } = useBusinessInfo();
const actionRef = useRef<ActionType>();
const [commInfo] = useState<Record<string, any>>({ ...getStoreBusinessInfo() }); // 通用信息
const [createModalOpen, setCreateModalOpen] = useState<boolean>(false);
// const [categoryFkIdIds, setCategoryFkIdIds] = useState([]);
// const [updateModalOpen, setUpdateModalOpen] = useState<boolean>(false);
const [detailModalOpen, setDetailModalOpen] = useState<boolean>(false); // 编辑窗口是否打开
const [currentRow, setCurrentRow] = useState<Record<string, any>>({});
// 动态设置每页数量
const [currentPageSize, setCurrentPageSize] = useState<number>(10);
// const [currentRow, setCurrentRow] = useState<Record<string, any>>({});
/**
* @en-US The pop-up window of the distribution update window
* @zh-CN
* */
// const [updateModalOpen, setUpdateModalOpen] = useState<boolean>(false);
// const [showDetail, setShowDetail] = useState<boolean>(false);
/**新增 编辑 删除 */
/**新增 编辑 详情 删除 */
// 新增
const handleCreateModal = () => {
if (createModalOpen) {
setCreateModalOpen(false);
} else {
setCreateModalOpen(true);
}
setCreateModalOpen(!createModalOpen);
};
// 编辑
// const handleUpdateModal = () => {
// setUpdateModalOpen(!updateModalOpen);
// };
// 详情
const handleDetailModal = () => {
setDetailModalOpen(!detailModalOpen);
};
// 设备节点信息
async function loadDetail(record) {
const resp = await apiModelDeploymentInfo({ id: record?.model_id });
if (isSuccessApi(resp) && resp?.data) {
setCurrentRow({ ...resp?.data, id: record?.model_id });
}
}
function reloadList() {
actionRef.current?.reload();
}
@ -97,24 +109,39 @@ const BusinessModel: React.FC = () => {
type="link"
size="small"
onClick={() => {
// TODO 编辑在新增联调后实现
// setCurrentRow(record);
// history.push('/home/model-detail');
// doToDetail(record);
// setShowDetail(true);
// setUpdateModalOpen(true);
loadDetail(record);
setDetailModalOpen(true);
}}
>
<FormattedMessage id="pages.searchTable.updateDetail" defaultMessage="查看" />
</Button>
),
},
// TODO 编辑接口在新建交互完善后对接
{
key: 'destroy',
renderDom: (
<IsDelete
deleteApi={() => {
handleDestroy(record).then(() => {});
deleteApi={async () => {
console.log('删除成功');
const resp = apiModelDeploymentDelete({ id: record.id });
if (isSuccessApi(resp)) {
reloadList();
message.success(
intl.formatMessage({
id: 'common.action.success',
defaultMessage: '$$$',
}),
);
} else {
message.error(
resp?.meta?.message ||
intl.formatMessage({
id: 'common.action.failure',
defaultMessage: '$$$',
}),
);
}
}}
></IsDelete>
),
@ -183,6 +210,7 @@ const BusinessModel: React.FC = () => {
const { current, ...rest } = params;
const reqParams = {
pageNo: current,
entity_id: commInfo.id,
...rest,
};
let resp = await apiModelDeploymentList({ ...reqParams });
@ -207,6 +235,11 @@ const BusinessModel: React.FC = () => {
commInfo={commInfo}
reload={reloadList}
/>
<DetailCard
info={currentRow}
detailModalOpen={detailModalOpen}
handleModal={handleDetailModal}
/>
</div>
);
};

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-30 10:02:29
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-30 15:28:00
* @LastEditTime: 2024-06-12 10:08:58
* @FilePath: \general-ai-platform-web\src\pages\Business\DeviceGroup\components\modelDeploy.tsx
* @Description:
* @
@ -47,7 +47,7 @@ const ModelDeploy: React.FC<ModelDeployProps> = (props) => {
const columns: ProColumns<Record<string, any>>[] = [
{
title: <FormattedMessage id="business_model.table.list.name" defaultMessage="业务模型名称" />,
dataIndex: 'name',
dataIndex: 'busi_model_name',
hideInSearch: true,
key: 'fixedName',
fixed: 'left',
@ -86,7 +86,7 @@ const ModelDeploy: React.FC<ModelDeployProps> = (props) => {
title: (
<FormattedMessage id="business_model.table.list.createTime" defaultMessage="创建时间" />
),
dataIndex: 'createTime',
dataIndex: 'create_time',
hideInSearch: true,
valueType: 'dateTime',
},

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-30 10:02:29
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-30 15:06:39
* @LastEditTime: 2024-06-12 10:04:30
* @FilePath: \general-ai-platform-web\src\pages\Business\DeviceGroup\components\modelSetting.tsx
* @Description:
* @

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-22 15:23:36
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-30 16:08:28
* @LastEditTime: 2024-06-11 13:30:14
* @FilePath: \general-ai-platform-web\src\pages\Business\DeviceGroup\index.tsx
* @Description: deviceGroupdg
* @

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-03-11 16:48:04
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-07 09:40:10
* @LastEditTime: 2024-06-11 17:56:15
* @FilePath: \general-ai-platform-web\src\pages\ComputePowerAllocation\components\computePowerCube.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@ -27,16 +27,10 @@ const ComputePowerCube: React.FC<ComputePowerCubeProps> = (props) => {
item.value = Math.floor((item.proportion / 100) * totalWidth);
return item;
});
setListData(() => finalList.reverse());
setListData(() => finalList);
}, [cubeBoxRefs, props.list]);
return (
<div className="computePowerCube_wrap">
<div className="flex justify-start des_wrap pb-[16px]">
<div className="tip_icon"></div>
<p className="tip_text">
</p>
</div>
<div className="cube_body">
<ul className="flex cube_info" ref={cubeBoxRefs}>
{listData.map((v, k) => {

@ -1,3 +1,11 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-06-07 17:58:41
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-11 17:07:15
* @FilePath: \general-ai-platform-web\src\pages\ComputePowerCenter\components\computePowerType.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { ComputePowerPoolItem } from '../typing';
export type ComputePowerTypeProps = {
// alarmStatusModalOpen: boolean;
@ -8,16 +16,16 @@ export type ComputePowerTypeProps = {
const ComputePowerType: React.FC<ComputePowerTypeProps> = (props) => {
return (
<div className="flex computePowerType_wrap">
<div className="flex computePowerType_wrap items-center">
<div className="bg_square_box">
<div className="bg_square" style={{ background: props.info.bgColor }} />
</div>
<div className="flex items-center type_info">
<p className="pf-1">{props.info.name}</p>
<p className="pf-1">{props.info.proportion}%</p>
{!!props.info.pretreatmentEfficiency && (
<p className="pl8px pf-2">: {props.info.pretreatmentEfficiency}/</p>
)}
<div className="flex items-center type_info p1">
<div className="text1">{props.info.name}</div>
<p className="text1">{props.info.proportion}%</p>
{/* {!!props.info.pretreatmentEfficiency && (
<p className=" text1">: {props.info.pretreatmentEfficiency}/</p>
)} */}
</div>
</div>
);

@ -1,60 +1,13 @@
.pf-1 {
color: #333;
font-family: "PingFang SC";
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 22px;
/* 157.143% */
}
.pf-2 {
color: #666;
font-family: "PingFang SC";
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 22px;
}
.flex {
display: flex;
}
.justify-between {
justify-content: space-between;
}
.items-center {
align-items: center;
}
.flex-wrap {
flex-wrap: wrap;
}
.mr16px {
margin-right: 16px;
}
.mt16px {
margin-top: 16px;
}
.mb16px {
margin-bottom: 16px;
}
.px16px {
padding: 0 16px;
}
.pl8px {
padding-left: 8px;
}
.font-bold {
font-weight: 700;
}
.computePowerAllocation_body {
/* header */
/* banner */
/* footer */
}
.computePowerAllocation_body h3 {
font-weight: bold;
font-size: 16px;
color: #333333;
line-height: 19px;
.computePowerAllocation_body .head_box {
margin-top: 16px;
padding: 12px 16px;
background: #ebf3ff;
border: 1px solid rgba(21, 77, 221, 0.1);
border-radius: 4px 4px 4px 4px;
}
.computePowerAllocation_body .head_info .bg_header_logo {
width: 80px;
@ -63,83 +16,77 @@
.computePowerAllocation_body .head_info .head_info_item {
margin-left: 12px;
}
.computePowerAllocation_body .banner_group {
padding-top: 24px;
}
.computePowerAllocation_body .banner_group > li {
width: 24%;
height: 88px;
background-color: rgba(255, 255, 255, 0.1);
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
border-radius: 8px 8px 8px 8px;
.computePowerAllocation_body .ant-pro-checkcard {
position: relative;
display: flex;
height: 88px;
overflow: hidden;
background-color: rgba(255, 255, 255, 0.1);
border: 1px solid #154ddd !important;
border-radius: 4px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1) !important;
}
.computePowerAllocation_body .ant-pro-checkcard .ant-pro-checkcard-body {
width: 100%;
height: 100%;
}
.computePowerAllocation_body .banner_group > li .cp_label {
.computePowerAllocation_body .ant-pro-checkcard .cp_label {
width: 100%;
padding-left: 12px;
}
.computePowerAllocation_body .banner_group > li .cp_bg_logo_icon {
.computePowerAllocation_body .ant-pro-checkcard .cp_bg_logo_icon {
min-width: 24px;
height: 26px;
background: url('/images/computePowerCenter/type1.svg') no-repeat 0 0;
}
.computePowerAllocation_body .banner_group > li .cp_bg_logo_icon_0 {
.computePowerAllocation_body .ant-pro-checkcard .cp_bg_logo_icon_0 {
width: 44px;
height: 16px;
background: url('/images/computePowerCenter/ruiyinweilogo1.svg') no-repeat 0 0;
}
.computePowerAllocation_body .banner_group > li .bg_banner_group_logo {
.computePowerAllocation_body .ant-pro-checkcard .baner_group_content {
position: absolute;
width: 100%;
height: 88px;
}
.computePowerAllocation_body .ant-pro-checkcard .bg_banner_group_logo {
position: absolute;
width: 100%;
height: 88px;
background: url('/images/computePowerCenter/guoqi.svg') no-repeat 100% 0%;
background-size: cover;
opacity: 0.1;
}
.computePowerAllocation_body .banner_group > li .bg_banner_group_logo_1 {
.computePowerAllocation_body .ant-pro-checkcard .bg_banner_group_logo_1 {
background: url('/images/computePowerCenter/NVIDIA.svg') no-repeat 100% 0%;
}
.computePowerAllocation_body .computePower_footer li {
/* footer */
.computePower_footer li {
margin-right: 16px;
margin-bottom: 8px;
margin-bottom: 12px;
}
.computePowerCube_wrap {
position: relative;
overflow: hidden;
}
.computePowerCube_wrap .tip_icon {
width: 20px;
height: 20px;
background-size: cover;
}
.computePowerCube_wrap .bg_body_logo {
/* width: 358.886px;
height: 343.026px;
bottom: 0;
position: absolute;
left: -48px;
background: url("@/assets/computePower/bgLogo.svg") no-repeat 50% 50%;
opacity: 0.02; */
}
.computePowerCube_wrap .cube_info {
position: relative;
margin: 0 auto;
width: 100%;
border-radius: 2px;
margin: 0 auto;
/* background-color: red; */
border: 2px solid rgba(21, 77, 221, 0.4);
border-radius: 2px;
}
.computePowerCube_wrap .cube_info > li .bg_cube {
height: 100%;
position: relative;
height: 100%;
}
.computePowerCube_wrap .cube_info_line {
position: absolute;
left: 18px;
bottom: 14px;
height: 4px;
left: 18px;
width: calc(100% - 36px);
height: 4px;
/* height: 401px; */
background: #ffffff;
filter: blur(4px);
@ -151,15 +98,14 @@
border-radius: 6px;
}
.computePowerCube_wrap .bg_line {
height: 56px;
width: 2px;
height: 56px;
background-color: black;
}
.computePowerType_wrap {
position: relative;
}
.computePowerType_wrap .bg_square_box {
padding-top: 6px;
padding-right: 8px;
}
.computePowerType_wrap .bg_square {

@ -1,64 +1,12 @@
@web_font1: #333;
@web_font2: #666;
// TODO 整体向tainwind合并
.pf-1 {
color: @web_font1;
font-weight: 400;
font-size: 14px;
font-family: 'PingFang SC';
font-style: normal;
line-height: 22px;
/* 157.143% */
}
.pf-2 {
color: @web_font2;
font-weight: 400;
font-size: 14px;
font-family: 'PingFang SC';
font-style: normal;
line-height: 22px;
}
.flex {
display: flex;
}
.justify-between {
justify-content: space-between;
}
.items-center {
align-items: center;
}
.flex-wrap {
flex-wrap: wrap;
}
.mr16px {
margin-right: 16px;
}
.mt16px {
margin-top: 16px;
}
.mb16px {
margin-bottom: 16px;
}
.px16px {
padding: 0 16px;
}
.pl8px {
padding-left: 8px;
}
.font-bold {
font-weight: 700;
}
.computePowerAllocation_body {
h3 {
color: #333333;
font-weight: bold;
font-size: 16px;
line-height: 19px;
.head_box {
margin-top: 16px;
padding: 12px 16px;
background: #ebf3ff;
border: 1px solid rgba(21, 77, 221, 0.1);
border-radius: 4px 4px 4px 4px;
}
/* header */
.head_info {
// font-size: 28px;
@ -71,74 +19,68 @@
}
}
/* banner */
.banner_group {
padding-top: 24px;
& > li {
position: relative;
width: 24%;
// .banner_group {
// background-color: red;
.ant-pro-checkcard {
.ant-pro-checkcard-body {
width: 100%;
height: 100%;
}
position: relative;
display: flex;
height: 88px;
overflow: hidden;
background-color: rgba(256, 256, 256, 0.1);
border: 1px solid #154ddd !important;
border-radius: 4px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1) !important;
.cp_label {
width: 100%;
padding-left: 12px;
}
.cp_bg_logo_icon {
min-width: 24px;
height: 26px;
background: url('/images/computePowerCenter/type1.svg') no-repeat 0 0;
}
.cp_bg_logo_icon_0 {
width: 44px;
height: 16px;
background: url('/images/computePowerCenter/ruiyinweilogo1.svg') no-repeat 0 0;
}
.baner_group_content {
position: absolute;
width: 100%;
height: 88px;
overflow: hidden;
background-color: rgba(256, 256, 256, 0.1);
border-radius: 8px 8px 8px 8px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
.cp_label {
width: 100%;
padding-left: 12px;
}
.cp_bg_logo_icon {
min-width: 24px;
height: 26px;
background: url('/images/computePowerCenter/type1.svg') no-repeat 0 0;
}
.cp_bg_logo_icon_0 {
width: 44px;
height: 16px;
background: url('/images/computePowerCenter/ruiyinweilogo1.svg') no-repeat 0 0;
}
}
.bg_banner_group_logo {
position: absolute;
width: 100%;
height: 88px;
background: url('/images/computePowerCenter/guoqi.svg') no-repeat 100% 0%;
background-size: cover;
opacity: 0.1;
}
.bg_banner_group_logo_1 {
background: url('/images/computePowerCenter/NVIDIA.svg') no-repeat 100% 0%;
}
.bg_banner_group_logo {
position: absolute;
width: 100%;
height: 88px;
// background: red;
background: url('/images/computePowerCenter/guoqi.svg') no-repeat 100% 0%;
background-size: cover;
opacity: 0.1;
}
}
/* footer */
.computePower_footer {
li {
margin-right: 16px;
margin-bottom: 8px;
.bg_banner_group_logo_1 {
background: url('/images/computePowerCenter/NVIDIA.svg') no-repeat 100% 0%;
}
}
}
/* footer */
.computePower_footer {
li {
margin-right: 16px;
margin-bottom: 12px;
}
}
// }
.computePowerCube_wrap {
position: relative;
overflow: hidden;
.tip_icon {
width: 20px;
height: 20px;
// background: url("@/assets/computePower/tipIcon.svg") no-repeat;
background-size: cover;
// tipIcon.svg
}
.bg_body_logo {
/* width: 358.886px;
height: 343.026px;
bottom: 0;
position: absolute;
left: -48px;
background: url("@/assets/computePower/bgLogo.svg") no-repeat 50% 50%;
opacity: 0.02; */
}
.cube_info {
position: relative;
width: 100%;
@ -180,7 +122,6 @@
.computePowerType_wrap {
position: relative;
.bg_square_box {
padding-top: 6px;
padding-right: 8px;
}
.bg_square {

@ -1,12 +1,13 @@
/* eslint-disable eqeqeq */
/* eslint-disable react/no-unknown-property */
import { isSuccessApi } from '@/utils/forApi';
import { ProCard } from '@ant-design/pro-components';
import { ProCard, ProList } from '@ant-design/pro-components';
import { Image } from 'antd';
import React, { useEffect, useState } from 'react';
// type
import { postPowerGroup, postPowerPoolsList } from '@/services/testApi/computePower';
import { isArrayAndNotEmpty } from '@/utils/is';
import ComputePowerCube from './components/computePowerCube';
import ComputePowerType from './components/computePowerType';
import './index.less';
@ -20,6 +21,24 @@ const ComputePowerAllocation: React.FC = () => {
const [groupList, setGroupList] = useState([]);
// const [showEdit, setShowEdit] = useState(false);
// 将数据组装成reactDom
function toListDomByData(record) {
let startList = [...record];
let finalList = startList.map((v) => ({
content: (
<div>
<div className="flex items-center baner_group_content px-[16px]">
<div className={`cp_bg_logo_icon cp_bg_logo_icon_${v.type}`} />
<span className="cp_label p1 two-line">{v.label}</span>
</div>
<div className={`bg_banner_group_logo bg_banner_group_logo_${v.type}`} />
</div>
),
}));
setGroupList(finalList);
console.log(finalList, 'toListDomByData_finalList');
}
async function fetchPowerData() {
const resp = await postPowerPoolsList();
if (isSuccessApi(resp) && resp?.data) {
@ -32,7 +51,7 @@ const ComputePowerAllocation: React.FC = () => {
const resp = await postPowerGroup();
if (isSuccessApi(resp) && resp?.data) {
console.log('fetchGroupData_res', resp);
setGroupList(resp.data.splice(0, 4));
toListDomByData(resp.data.splice(0, 5));
}
}
@ -49,83 +68,97 @@ const ComputePowerAllocation: React.FC = () => {
return (
<div className="home_container computePowerCenterIndex_page">
<ProCard
title="算力资源池"
style={{ background: 'white' }}
headStyle={{ padding: 20, borderBottom: '1px solid #E0E0E0' }}
bodyStyle={{
paddingLeft: 20,
paddingRight: 20,
paddingTop: 0,
paddingBottom: 0,
margin: 0,
}}
gutter={24}
wrap
ghost
>
{/* 占比信息 */}
<ul className="computePowerAllocation_body">
<li>
<div className="flex items-center head_info mt16px">
<div className="bg_header_logo">
<Image
width={80}
src={'/images/computePowerCenter/banner.png'}
placeholder={
<Image
preview={false}
src={'/images/computePowerCenter/banner.png'}
width={80}
/>
}
/>
<div className="gn_head_card">
<ProCard
className="gn_card_wrap"
title={<span className="head2"></span>}
style={{ background: 'white' }}
headStyle={{ padding: 20, borderBottom: '1px solid #E0E0E0' }}
bodyStyle={{
paddingLeft: 20,
paddingRight: 20,
paddingTop: 0,
paddingBottom: 0,
margin: 0,
}}
gutter={24}
wrap
ghost
>
{/* 占比信息 */}
<ul className="computePowerAllocation_body">
<li className="head_box">
<div className="flex items-center head_info">
<div className="bg_header_logo">
<Image
width={80}
height={80}
src={'/images/computePowerCenter/banner.png'}
placeholder={
<Image
preview={false}
src={'/images/computePowerCenter/banner.png'}
width={80}
/>
}
/>
</div>
<div className="head_info_item">
<span className="head3"></span>
<div className="p1 pt-[8px]">999Tops</div>
</div>
</div>
<div className="head_info_item">
<h6 className="font-bold pf-1"></h6>
<p className="pf-2">999Tops</p>
</div>
</div>
</li>
<li className="mt16px">
<h3></h3>
{/* // TODO 重新设计*/}
<ul className="flex justify-between banner_group">
{groupList.map((v, k) => {
return (
<li key={k} className="flex items-center mb16px">
<div className="flex items-center px16px">
<div className={`cp_bg_logo_icon cp_bg_logo_icon_${v.type}`} />
<span className="cp_label pf-2 two-line">{v.label}</span>
</div>
<div className={`bg_banner_group_logo bg_banner_group_logo_${v.type}`} />
</li>
);
})}
</ul>
</li>
<li className="mt16px">
<h3></h3>
<div className="mt16px">
<ComputePowerCube list={poolsData} />
<ul className="flex flex-wrap items-center computePower_footer mt16px">
{poolsData.map((v, k) => {
return (
<li key={k} className="flex items-center justify-center">
<ComputePowerType info={v} />
</li>
);
})}
</ul>
</div>
{/* <div>
</li>
<li className="mt-[16px]">
<div className="head3 mb-[12px]"></div>
<ProList<any>
className="gn_pro_list"
ghost={true}
rowKey={'id'}
itemCardProps={{
ghost: true,
bodyStyle: { padding: 0, margin: 0 },
}}
cardProps={{
bodyStyle: {
background: 'transparent',
margin: '-4px 0',
},
}}
rowSelection={false}
grid={{ gutter: 16, xs: 1, md: 2, lg: 3, xl: 4, xxl: 5 }}
metas={{
content: {},
}}
dataSource={groupList}
/>
</li>
<li className="pb-[16px]">
<div className="head3"></div>
{isArrayAndNotEmpty(poolsData) && (
<div className="mt-[12px]">
<ComputePowerCube list={poolsData} />
<ul className="flex flex-wrap items-center computePower_footer mt-[12px]">
{poolsData.map((v, k) => {
return (
<li key={k} className="flex items-center justify-center">
<ComputePowerType info={v} />
</li>
);
})}
</ul>
</div>
)}
{/* <div>
<Button type="primary" onClick={editComputePower}>
</Button>
</div> */}
</li>
</ul>
</ProCard>
</li>
</ul>
</ProCard>
</div>
{/* <UpdatePowerForm modalOpen={showEdit} poolsData={poolsData}></UpdatePowerForm> */}
</div>
);

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-07 14:02:00
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-07 13:57:07
* @LastEditTime: 2024-06-11 17:41:25
* @FilePath: \general-ai-manage\src\pages\Log\index.tsx
* @Description:
* @
@ -10,15 +10,21 @@
*
*/
import { CommButton } from '@/components/Button';
import { apiModelList } from '@/services/business/model';
import { isSuccessApi } from '@/utils/forApi';
import { ReactComponent as ResetIcon } from '/public/home/reset_icon.svg';
import { ReactComponent as SearchIcon } from '/public/home/search_icon.svg';
import { SearchOutlined } from '@ant-design/icons';
import { getServerLogList } from '@/services/testApi/serverLog';
import type { ActionType, ProColumns } from '@ant-design/pro-components';
import { ProCard, ProForm, ProFormText, ProTable } from '@ant-design/pro-components';
import {
ProCard,
ProForm,
ProFormDateRangePicker,
ProFormSelect,
ProTable,
} from '@ant-design/pro-components';
import { FormattedMessage } from '@umijs/max';
import { Tooltip } from 'antd';
import React, { useEffect, useRef, useState } from 'react';
import { proTableCommonOptions, proTablePaginationOptions } from '../../../config/defaultTable';
@ -40,52 +46,40 @@ const LogIndex: React.FC = () => {
// const [showDetail, setShowDetail] = useState<boolean>(false);
const columns: ProColumns<Record<string, any>>[] = [
{
title: <FormattedMessage id="model_index.table.list.name" defaultMessage="$$$" />,
dataIndex: 'name',
title: <FormattedMessage id="server_log.table.list.name" defaultMessage="$$$" />,
dataIndex: 'accountName',
hideInSearch: true,
key: 'fixedName',
fixed: 'left',
},
{
title: <FormattedMessage id="model_index.table.list.type" defaultMessage="$$$" />,
dataIndex: 'model_type',
title: <FormattedMessage id="server_log.table.list.ip" defaultMessage="$$$" />,
dataIndex: 'ipAddress',
hideInSearch: true,
render: (dom, record) => {
let activeName = 'active_primary';
switch (record.model_type) {
case '机器学习':
activeName = 'active3';
break;
default:
activeName = 'active_primary';
break;
}
return (
<div className={`gn_list_type_tag flex items-center justify-center ${activeName}`}>
<span className="dot"></span>
<span>{dom}</span>
</div>
);
},
},
{
title: <FormattedMessage id="model_index.table.list.industry" defaultMessage="$$$" />,
dataIndex: 'classification_name',
title: <FormattedMessage id="server_log.table.list.updateTime" defaultMessage="$$$" />,
dataIndex: 'timestamp',
hideInSearch: true,
valueType: 'dateTime',
},
{
title: (
<FormattedMessage id="model_index.table.list.defaultVersionFkId" defaultMessage="$$$" />
),
dataIndex: 'default_version',
title: <FormattedMessage id="server_log.table.list.action" defaultMessage="$$$" />,
dataIndex: 'action',
hideInSearch: true,
},
{
title: <FormattedMessage id="model_index.table.list.updateTime" defaultMessage="$$$" />,
dataIndex: 'update_time',
title: <FormattedMessage id="server_log.table.list.remark" defaultMessage="$$$" />,
dataIndex: 'logContent',
hideInSearch: true,
valueType: 'dateTime',
render: (dom) => {
return (
<Tooltip title={dom} trigger="hover">
<div className="cursor-pointer single_line">{dom}</div>;
</Tooltip>
);
},
},
];
@ -139,9 +133,43 @@ const LogIndex: React.FC = () => {
return true;
}}
>
<ProFormText
<ProFormSelect
label={<FormattedMessage id="server_log.table.list.name" defaultMessage="账号" />}
mode="multiple"
name="name"
debounceTime={1000}
fieldProps={{
style: {
width: 280,
},
}}
request={async () => {
// const resp = await postCurrentIP();
const resp = ['用户A', '用户B', '用户C'];
return resp?.map((v: any) => {
return {
label: v,
value: v,
};
});
}}
/>
<ProForm.Item style={{ marginLeft: '12px' }}>
<ProFormDateRangePicker
style={{ marginLeft: '16px' }} // 设置左侧间距为16px
name="dateRange"
label="日期"
fieldProps={{
style: {
width: 280,
},
}}
/>
</ProForm.Item>
{/* <ProFormText
label={
<FormattedMessage id="model_index.table.list.name" defaultMessage="模型名称" />
<FormattedMessage id="server_log.table.list.name" defaultMessage="模型名称" />
}
labelClassName="label_set_1"
fieldProps={{
@ -152,7 +180,7 @@ const LogIndex: React.FC = () => {
}}
name="name"
placeholder="请输入模型名称"
/>
/> */}
</ProForm>
</div>
}
@ -199,7 +227,8 @@ const LogIndex: React.FC = () => {
let sort_select = sort[reqParams.orderKey];
reqParams.desc = sort_select === 'descend';
}
let resp = await apiModelList({ ...reqParams, ...querysData });
let resp = await getServerLogList({ ...reqParams, ...querysData });
console.log(resp, 'getServerLogList_resp');
if (!isSuccessApi(resp)) {
return { data: [], success: true };
}

@ -17,6 +17,7 @@ import {
proFormSmallModelWidth,
proFormStepsFormProps,
} from '../../../../../config/defaultForm';
// import {beforeUploadFile} from "@/utils/common";
// @ts-ignore
@ -314,6 +315,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
return { ...data, config_file: '' };
});
}}
openPreviewFile={true}
/>
{/* <ProFormUploadDragger
width={proFormSmallItemStyleProps.width}

@ -89,7 +89,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
config_str: JSON.stringify(values.config_str_arr),
model_file: currFormData?.model_file,
version_id: currFormData?.version_id,
config_file: '',
config_file: currFormData?.config_file,
});
if (isSuccessApi(resp)) {
message.success(
@ -359,6 +359,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
return { ...data, config_file: '' };
});
}}
openPreviewFile={true}
/>
{/* <ProFormUploadDragger
width={proFormSmallItemStyleProps.width}

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-05-23 13:50:50
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-06 15:39:10
* @LastEditTime: 2024-06-12 10:04:45
* @FilePath: \general-ai-platform-web\src\services\Business\entity.ts
* @Description: api
*/
@ -351,7 +351,7 @@ export async function apiEntityNodesBusimodelDeploy(body: any, options?: { [key:
// 企业节点,节点信息 -> 设备列表 -> 基础模型配置 -> 模型列表
export async function apiEntityNodesDeviceModels(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/entity/nodes/device/models`,
`/api/v1/enterprise/entity/nodes/device/basemodel/list`,
{
method: 'POST',
headers: {

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-05-24 17:57:19
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-06 15:44:20
* @LastEditTime: 2024-06-11 13:59:11
* @FilePath: \general-ai-platform-web\src\services\business\model.ts
* @Description: api
*/
@ -75,20 +75,20 @@ export async function apiModelDeploymentList(body: any, options?: { [key: string
);
}
// // 删除企业部署的业务模型
// export async function apiModelDeploymentDelete(body: any, options?: { [key: string]: any }) {
// return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
// `/api/v1/enterprise/model/deployment/delete`,
// {
// method: 'POST',
// headers: {
// // 'Content-Type': 'application/json',
// // "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
// },
// data: body,
// ...(options || {}),
// },
// );
// }
export async function apiModelDeploymentDelete(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/model/deployment/delete`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 企业部署的业务模型信息
export async function apiModelDeploymentInfo(body: any, options?: { [key: string]: any }) {

@ -0,0 +1,25 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-10 16:58:27
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-11 14:58:42
* @FilePath: \general-ai-manage\src\services\testApi\serverLog.ts
* @Description:
*/
// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
// 模型列表分页
export async function getServerLogList(
body: Record<string, any>, //
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.PageResult; msg?: string }>(`/api/v1/serverLog/list`, {
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
Loading…
Cancel
Save