From fce6749cddaee7ac743d2bce4bc0b640f99cfd2f Mon Sep 17 00:00:00 2001
From: Kadxy <2230318258@qq.com>
Date: Wed, 11 Sep 2024 10:56:56 +0800
Subject: [PATCH] feat(pricing):add model icon
---
app/pages/Pricing.tsx | 195 +++++++++++++++++++++++-------------------
next.config.mjs | 2 +-
package.json | 3 +-
yarn.lock | 13 +--
4 files changed, 113 insertions(+), 100 deletions(-)
diff --git a/app/pages/Pricing.tsx b/app/pages/Pricing.tsx
index f90c172..f22e43c 100644
--- a/app/pages/Pricing.tsx
+++ b/app/pages/Pricing.tsx
@@ -1,105 +1,124 @@
-import {Row, Typography} from "antd";
+import {Image, Row, Typography} from "antd";
import {SCROLL_STYLE} from "@/constant";
import {modelHub} from "ai-model-hub";
-import {ProCard, ProTable} from "@ant-design/pro-components";
+import {ProCard, ProTable, WaterMark} from "@ant-design/pro-components";
const {Text} = Typography;
export function PricingPage() {
return (
-
- <>
- {modelHub.getAll().map((provider) => {
- return (
-
- {record.name}
- },
- {
- title: "发布时间",
- dataIndex: "release_time",
- width: "10%",
- render: (_, record) => {
- try {
- const timestamp = Number(record.release_time) * 1000;
- if (isNaN(timestamp) || timestamp < 0) {
+
+ <>
+ {modelHub.getAll().map((provider) => {
+ return (
+
+ {provider.provider}>
+ :
+ provider.provider
+ }
+ key={provider.provider}
+ bordered
+ headerBordered
+ >
+ {record.name}
+ },
+ {
+ title: "发布时间",
+ dataIndex: "release_time",
+ width: "11%",
+ render: (_, record) => {
+ try {
+ const timestamp = Number(record.release_time) * 1000;
+ if (isNaN(timestamp) || timestamp < 0) {
+ return -
+ } else {
+ const date = {
+ year: new Date(timestamp).getFullYear(),
+ month: new Date(timestamp).getMonth() + 1,
+ day: new Date(timestamp).getDate(),
+ };
+ return {date.year}-{(date.month).toString().padStart(2, "0")}-{(date.day).toString().padStart(2, "0")}
+ }
+ } catch (e) {
return -
- } else {
- const date = {
- year: new Date(timestamp).getFullYear(),
- month: new Date(timestamp).getMonth() + 1,
- day: new Date(timestamp).getDate(),
- };
- return {date.year}-{(date.month).toString().padStart(2, "0")}-{(date.day).toString().padStart(2, "0")}
}
- } catch (e) {
- return -
- }
+ },
+ },
+ {
+ title: "模型介绍",
+ dataIndex: "description",
+ width: "38%",
+ ellipsis: true,
},
- },
- {
- title: "模型介绍",
- dataIndex: "description",
- width: "50%",
- ellipsis: true,
- },
- {
- title: "价格(输入)",
- render: (_, record) => {
- const price = record?.price?.[0]?.input;
- const isFree = price === 0;
- return (
- price ? isFree ? 免费 :
- ${price} / 1M tokens :
- 暂无
- )
+ {
+ title: "价格(输入)",
+ render: (_, record) => {
+ const price = record?.price?.[0]?.input;
+ const isFree = price === 0;
+ return (
+ price ? isFree ? 免费 :
+ ${price} / 1M tokens :
+ 暂无
+ )
+ },
+ width: "15%",
},
- width: "10%",
- },
- {
- title: "价格(输出)",
- render: (_, record) => {
- const price = record?.price?.[0]?.output;
- const isFree = price === 0;
- return (
- price ? isFree ? 免费 :
- ${price} / 1M tokens :
- 暂无
- )
+ {
+ title: "价格(输出)",
+ render: (_, record) => {
+ const price = record?.price?.[0]?.output;
+ const isFree = price === 0;
+ return (
+ price ? isFree ? 免费 :
+ ${price} / 1M tokens :
+ 暂无
+ )
+ },
+ width: "15%",
},
- width: "10%",
- },
- ]}
- />
-
- );
- })}
-
- You can view the update records of model information, submit feedback or suggestions in
- our GitHub Repository.
-
- >
-
+ ]}
+ scroll={{x: 950}}
+ />
+
+ );
+ })}
+
+ You can view the update records of model information, submit feedback or suggestions in
+ our GitHub Repository.
+
+ >
+
+
);
}
diff --git a/next.config.mjs b/next.config.mjs
index 7d4408f..72e7a41 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -28,7 +28,7 @@ const nextConfig = {
return config;
},
- transpilePackages: ['@lobehub/icons'],
+ // transpilePackages: [],
output: mode,
reactStrictMode: false,
images: {
diff --git a/package.json b/package.json
index ef5e4be..fef4ab9 100644
--- a/package.json
+++ b/package.json
@@ -17,9 +17,8 @@
"@ant-design/nextjs-registry": "^1.0.0",
"@ant-design/pro-components": "^2.7.9",
"@fortaine/fetch-event-source": "^3.0.6",
- "@lobehub/icons": "^1.22.1",
"@types/file-saver": "^2.0.7",
- "ai-model-hub": "^1.1.3",
+ "ai-model-hub": "^1.2.1",
"ajv": "8.14.0",
"ali-oss": "^6.20.0",
"antd": "^5.17.4",
diff --git a/yarn.lock b/yarn.lock
index 8bc09db..f9c6ba7 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1609,11 +1609,6 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"
-"@lobehub/icons@^1.22.1":
- version "1.33.2"
- resolved "https://registry.yarnpkg.com/@lobehub/icons/-/icons-1.33.2.tgz#bad5f0e2a30d4122b92b9b661f0db8062bdc0951"
- integrity sha512-+zjI3ysaHoxZLtRW2FJtS9SYv0/hIBAllnZDuFc+PWGYOTV6E7SUFVMzjkN3XesadAXgvggLkgTM9eeZAiEPIw==
-
"@next/env@14.2.9":
version "14.2.9"
resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.9.tgz#f7fed48efa51b069cfc611082ad0101756df4c6a"
@@ -2318,10 +2313,10 @@ agentkeepalive@^3.4.1:
dependencies:
humanize-ms "^1.2.1"
-ai-model-hub@^1.1.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/ai-model-hub/-/ai-model-hub-1.1.3.tgz#80375e9da32899c5f0d50a768df7e7f32685951a"
- integrity sha512-M40FE191n8hOpgysXbh2o9N0AexXQnEiS5P6+k5TJXGRPx4HfQNkzKhPFNpz1hI2kpPFSrH5Ciq+BzsxvelBrw==
+ai-model-hub@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/ai-model-hub/-/ai-model-hub-1.2.1.tgz#767fb4af124dc6435768978bcbad1d73d6af137a"
+ integrity sha512-pc5bvFdfJcr63opAhGxB4zDm8pMtPANojcsdtteLxM2IVPcDDO8yEXREuJXnJHdRnP/spkC7RV1wt/5lNS/I9w==
ajv-keywords@^3.5.2:
version "3.5.2"