You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
General-AI-Platform-Web-Client/mock/pools/serverListData.ts

204 lines
6.1 KiB
TypeScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-03-01 16:34:06
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-03-07 17:07:56
* @FilePath: \General-AI-Platform-Web-Client\mock\pools\serverListData.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const generateRandomTwoDecimal = () => {
// 生成一个在 [0, 1) 范围内的随机数
const randomFraction = Math.random();
// 乘以一个倍数,例如 100以增加小数位数
const multipliedValue = randomFraction * 100;
// 使用 Math.round() 进行四舍五入,并将结果除以倍数,得到两位小数
return Math.round(multipliedValue) / 100;
};
const progressData = () => {
const finalArr = [
{
label: "CPU",
percent: generateRandomTwoDecimal(),
strokeColor: "rgb(243,48,5)"
},
{
label: "内存",
percent: (15 + Math.floor(Math.random() * 85)) / 100,
strokeColor: "rgb(33,169,122)"
},
{
label: "存储",
percent: (15 + Math.floor(Math.random() * 85)) / 100,
strokeColor: "rgb(33,169,122)"
},
{
label: "GPU",
percent: (85 + Math.floor(Math.random() * 15)) / 100,
strokeColor: "rgb(250,173,20)"
}
];
return finalArr;
};
const serverList = [
{
index: 1,
isEnabled: true,
type: 4,
banner: "https://tdesign.gtimg.com/tdesign-pro/cloud-server.jpg",
deviceSort: "服务器1",
state: "在线",
description:
"SSL证书又叫服务器证书腾讯云为您提供证书的一站式服务包括免费、付费证书的申请、管理及部",
progressData
},
{
index: 2,
isEnabled: false,
type: 4,
banner: "https://tdesign.gtimg.com/tdesign-pro/t-sec.jpg",
deviceSort: "服务器2",
state: "在线",
description:
"SSL证书又叫服务器证书腾讯云为您提供证书的一站式服务包括免费、付费证书的申请、管理及部",
progressData
},
{
index: 3,
isEnabled: false,
type: 5,
banner: "https://tdesign.gtimg.com/tdesign-pro/ssl.jpg",
deviceSort: "服务器3",
state: "在线",
description:
"云硬盘为您提供用于CVM的持久性数据块级存储服务。云硬盘中的数据自动地可用区内以多副本冗",
progressData
},
{
index: 4,
isEnabled: false,
type: 2,
banner: "https://tdesign.gtimg.com/tdesign-pro/ssl.jpg",
deviceSort: "服务器4",
state: "离线",
description:
"云数据库MySQL为用户提供安全可靠性能卓越、易于维护的企业级云数据库服务。",
progressData
},
{
index: 5,
isEnabled: true,
type: 3,
banner: "https://tdesign.gtimg.com/tdesign-pro/face-recognition.jpg",
deviceSort: "服务器4",
state: "在线",
description:
"云数据库MySQL为用户提供安全可靠性能卓越、易于维护的企业级云数据库服务。",
progressData
},
{
index: 6,
isEnabled: true,
type: 3,
banner: "https://tdesign.gtimg.com/tdesign-pro/ssl.jpg",
deviceSort: "服务器5",
state: "在线",
description:
"腾讯安全云防火墙产品是腾讯云安全团队结合云原生的优势自主研发的SaaS化防火墙产品无需客无需客无需客无需客无需客无需客无需客",
progressData
},
{
index: 7,
isEnabled: false,
type: 1,
banner: "https://tdesign.gtimg.com/tdesign-pro/t-sec.jpg",
deviceSort: "服务器6",
state: "离线",
description:
"腾讯安全云防火墙产品是腾讯云安全团队结合云原生的优势自主研发的SaaS化防火墙产品无需客无需客无需客无需客无需客无需客无需客",
progressData
},
{
index: 8,
isEnabled: true,
type: 3,
banner: "https://tdesign.gtimg.com/tdesign-pro/t-sec.jpg",
deviceSort: "服务器7",
state: "在线",
description:
"云硬盘为您提供用于CVM的持久性数据块级存储服务。云硬盘中的数据自动地可用区内以多副本冗",
progressData
},
{
index: 9,
isEnabled: false,
type: 1,
banner: "https://tdesign.gtimg.com/tdesign-pro/cloud-server.jpg",
deviceSort: "服务器8",
state: "离线",
description:
"腾讯安全云防火墙产品是腾讯云安全团队结合云原生的优势自主研发的SaaS化防火墙产品无需客无需客无需客无需客无需客无需客无需客",
progressData
},
{
index: 10,
isEnabled: true,
type: 4,
banner: "https://tdesign.gtimg.com/tdesign-pro/ssl.jpg",
deviceSort: "服务器9",
state: "在线",
description:
"云数据库MySQL为用户提供安全可靠性能卓越、易于维护的企业级云数据库服务。",
progressData
},
{
index: 11,
isEnabled: true,
type: 5,
banner: "https://tdesign.gtimg.com/tdesign-pro/t-sec.jpg",
deviceSort: "服务器10",
state: "在线",
description:
"SSL证书又叫服务器证书腾讯云为您提供证书的一站式服务包括免费、付费证书的申请、管理及部",
progressData
},
{
index: 12,
isEnabled: true,
type: 2,
banner: "https://tdesign.gtimg.com/tdesign-pro/t-sec.jpg",
deviceSort: "服务器11",
state: "在线",
description:
"SSL证书又叫服务器证书腾讯云为您提供证书的一站式服务包括免费、付费证书的申请、管理及部",
progressData
},
{
index: 13,
isEnabled: true,
type: 3,
banner: "https://tdesign.gtimg.com/tdesign-pro/cloud-db.jpg",
deviceSort: "服务器12",
state: "在线",
description:
"腾讯安全云防火墙产品是腾讯云安全团队结合云原生的优势自主研发的SaaS化防火墙产品无需客无需客无需客无需客无需客无需客无需客",
progressData
}
];
export const serverListData = {
data: {
list: serverList,
total: serverList.length,
page: 1,
pageSize: 10
}
};
export const serverParamsListData = {
data: progressData
};