Skip to content

Commit 10488a6

Browse files
authored
Merge pull request #207 from APIParkLab/feature/1.5-cx
Feature/1.5 cx
2 parents 3b1c9d9 + bd4ad2b commit 10488a6

21 files changed

Lines changed: 528 additions & 192 deletions

File tree

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"react-dom": "^18.2.0",
4444
"react-i18next": "^15.0.1",
4545
"react-joyride": "^2.8.2",
46-
"react-router-dom": "^6.20.0",
46+
"react-router-dom": "6.20.0",
4747
"swagger-ui-react": "^5.17.14",
4848
"tailwindcss": "^3.3.5",
4949
"uuid": "^9.0.1",

frontend/packages/common/src/components/aoplatform/BasicLayout.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ function BasicLayout({ project = 'core' }: { project: string }) {
241241
headerTitleRender={() => (
242242
<div className="w-[192px] flex items-center">
243243
<img className="h-[20px] cursor-pointer " src={Logo} onClick={() => navigator(mainPage)} />
244+
<a className="align-text-top" href="https://github.com/APIParkLab/APIPark" target="_blank" className="ml-[5px] h-[25px] relative">
245+
<img src="https://img.shields.io/github/stars/APIParkLab/APIPark?style=social" className='absolute top-[6px]' width={75} alt="" />
246+
</a>
244247
</div>
245248
)}
246249
logo={Logo}
@@ -280,9 +283,9 @@ function BasicLayout({ project = 'core' }: { project: string }) {
280283
collapsedButtonRender={false}
281284
>
282285
<div
283-
className={`w-full h-calc-100vh-minus-navbar pl-PAGE_INSIDE_X pt-PAGE_INSIDE_T ${
286+
className={`w-full h-calc-100vh-minus-navbar ${
284287
currentUrl.startsWith('/role/list') ? 'overflow-auto' : 'overflow-hidden'
285-
}`}
288+
} ${currentUrl.startsWith('/guide/page') ? '' : 'pl-PAGE_INSIDE_X pt-PAGE_INSIDE_T'}`}
286289
>
287290
<Outlet />
288291
</div>

frontend/packages/common/src/components/aoplatform/InsidePage.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class InsidePageProps {
2222
headerClassName?: string = ''
2323
/** 整个页面滚动 */
2424
scrollPage?: boolean = true
25+
customPadding?: boolean
2526
customBtn?: ReactNode
2627
}
2728

@@ -41,6 +42,7 @@ const InsidePage: FC<InsidePageProps> = ({
4142
contentClassName = '',
4243
headerClassName = '',
4344
scrollPage = true,
45+
customPadding = false,
4446
customBtn
4547
}) => {
4648
const navigate = useNavigate()
@@ -57,7 +59,7 @@ const InsidePage: FC<InsidePageProps> = ({
5759
{!pageTitle && !description && !backUrl && !customBtn ? (
5860
<></>
5961
) : (
60-
<div className="mb-[30px]">
62+
<div className={customPadding ? '' : 'mb-[30px]'}>
6163
{backUrl && (
6264
<div className="text-[18px] leading-[25px] mb-[12px]">
6365
<Button type="text" onClick={goBack}>

frontend/packages/common/src/components/aoplatform/PageList.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ interface PageListProps<T> extends ProTableProps<T, unknown>, RefAttributes<Acti
4141
beforeSearchNode?: React.ReactNode[]
4242
onSearchWordChange?: (e: ChangeEvent<HTMLInputElement>) => void
4343
afterNewBtn?: React.ReactNode[]
44+
beforeNewBtn?: React.ReactNode[]
4445
dragSortKey?: string
4546
onDragSortEnd?: (beforeIndex: number, afterIndex: number, newDataSource: T[]) => void | Promise<void>
4647
tableTitle?: string
@@ -56,7 +57,8 @@ interface PageListProps<T> extends ProTableProps<T, unknown>, RefAttributes<Acti
5657
delayLoading?: boolean
5758
noScroll?: boolean
5859
/* 前端分页的表格,需要传入该字段以支持后端搜索 */
59-
manualReloadTable?: () => void
60+
manualReloadTable?: () => void,
61+
customEmptyRender?: () => React.ReactNode
6062
}
6163

6264
const PageList = <T extends Record<string, unknown>>(
@@ -80,6 +82,7 @@ const PageList = <T extends Record<string, unknown>>(
8082
onSearchWordChange,
8183
manualReloadTable,
8284
afterNewBtn,
85+
beforeNewBtn,
8386
dragSortKey,
8487
onDragSortEnd,
8588
tableTitle,
@@ -94,7 +97,8 @@ const PageList = <T extends Record<string, unknown>>(
9497
tableTitleClass,
9598
delayLoading = true,
9699
besidesTableHeight,
97-
noScroll
100+
noScroll,
101+
customEmptyRender
98102
} = props
99103
const parentRef = useRef<HTMLDivElement>(null)
100104
const [tableHeight, setTableHeight] = useState(minVirtualHeight || window.innerHeight)
@@ -190,6 +194,7 @@ const PageList = <T extends Record<string, unknown>>(
190194
const headerTitle = () => {
191195
return (
192196
<>
197+
{beforeNewBtn ? (beforeNewBtn as React.ReactNode[]) : undefined}
193198
{tableTitle ? (
194199
<span className={`text-[30px] leading-[42px] my-mbase pl-[20px] ${tableTitleClass}`}>{tableTitle}</span>
195200
) : addNewBtnTitle ? (
@@ -345,6 +350,11 @@ const PageList = <T extends Record<string, unknown>>(
345350
)
346351
onChange?.(pagination, filters, sorter, extra)
347352
}}
353+
locale={{
354+
emptyText: customEmptyRender ? customEmptyRender?.() : undefined
355+
}}
356+
style={customEmptyRender ? { height: '100%' } : undefined}
357+
bodyStyle={customEmptyRender ? { height: '100%' } : undefined}
348358
rowKey={primaryKey}
349359
dataSource={dataSource}
350360
search={false}

frontend/packages/common/src/contexts/GlobalStateContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ const mockData = [
148148
access: 'system.settings.ai_provider.view'
149149
},
150150
{
151-
name: 'APIKey 资源池',
151+
name: 'API Key 负载',
152152
key: 'aiKeys',
153153
path: '/keysetting',
154154
icon: 'ic:baseline-key',
@@ -162,7 +162,7 @@ const mockData = [
162162
access: 'system.settings.ai_api.view'
163163
},
164164
{
165-
name: '负载均衡',
165+
name: '模型灾备',
166166
key: 'loadBalancing',
167167
path: '/loadBalancing',
168168
icon: 'ph:network-x',

frontend/packages/common/src/locales/scan/en-US.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,5 +850,25 @@
850850
"Kbe98ba9e": "Private Service",
851851
"K24540de": "Stop",
852852
"Kd85b3f64": "Continue Waiting",
853-
"K1400a1fc": "As a prefix for all APIs within the service, such as host/{service_name}/{api_path}. This has a significant impact, so modify with caution"
853+
"K1400a1fc": "As a prefix for all APIs within the service, such as host/{service_name}/{api_path}. This has a significant impact, so modify with caution",
854+
"Kb8185132": "OR",
855+
"K83829a3b": "Model Exception",
856+
"Kb92fb02b": "Deployment Failed",
857+
"Kcf8e3b18": "Tags",
858+
"K9ae48909": "API Key Balancing",
859+
"K437724fc": "Supports creating multiple API Keys for intelligent load balancing under a single API model provider",
860+
"K7d17707e": "Model Fallback",
861+
"Kc007db4a": "Only .png, .jpg, .jpeg, .svg image files are supported",
862+
"Kacf10c44": "Ollama Endpoint",
863+
"K8d4f5b44": "Input example: https://www.apipark.com",
864+
"K481442d3": "Configure Ollama Service",
865+
"Kf9b341e3": "How to deploy Ollama?",
866+
"K8632bef2": "Model deployment service not configured",
867+
"Kbbd8ce81": "Configure Service",
868+
"K39a8d392": "Import OpenAPI documents to publish existing system APIs to APIPark.",
869+
"Ka742e079": "Add API Key for public cloud AI models to call public cloud AI models via APIPark.",
870+
"K8097d6be": "is an open-source AI Gateway and API Portal that unifies access to OpenAI, DeepSeek, and other AI models. With enterprise-grade security features and real-time monitoring, it helps teams safely manage and share their AI APIs through a unified gateway.",
871+
"Kf1ce5b3": "✨ We'd love your support on Github! Leave us a star or share your feedback. ",
872+
"K3af90490": "⚡ You can quickly open the API for everyone to use via the following methods:",
873+
"K6b99dce8": "address"
854874
}

frontend/packages/common/src/locales/scan/ja-JP.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,5 +872,25 @@
872872
"Kbe98ba9e": "プライベートサービス",
873873
"K24540de": "停止",
874874
"Kd85b3f64": "引き続き待機",
875-
"K1400a1fc": "サービス内のすべてのAPIのプレフィックスとして使用されます。例えば host/{service_name}/{api_path} のように、大きな影響を与えるため、慎重に変更してください。"
875+
"K1400a1fc": "サービス内のすべてのAPIのプレフィックスとして使用されます。例えば host/{service_name}/{api_path} のように、大きな影響を与えるため、慎重に変更してください。",
876+
"Kb8185132": "または",
877+
"K83829a3b": "モデル異常",
878+
"Kb92fb02b": "デプロイ失敗",
879+
"Kcf8e3b18": "タグ",
880+
"K9ae48909": "APIキーのペイロード",
881+
"K437724fc": "1つのAPIモデルプロバイダーで複数のAPIキーを作成し、インテリジェント負荷分散をサポート",
882+
"K7d17707e": "モデルフォールバック",
883+
"Kc007db4a": "画像ファイルは .png, .jpg, .jpeg, .svg 形式のみサポートされています",
884+
"Kacf10c44": "Ollama エンドポイント",
885+
"K8d4f5b44": "入力例:https://www.apipark.com",
886+
"K481442d3": "Ollama サービスの設定",
887+
"Kf9b341e3": "Ollamaのデプロイ方法は?",
888+
"K8632bef2": "モデルデプロイサービスが設定されていません",
889+
"Kbbd8ce81": "サービスの設定",
890+
"K39a8d392": "OpenAPIドキュメントをインポートし、既存のシステムのAPIをAPIParkに公開します。",
891+
"Ka742e079": "パブリッククラウドAIモデルのAPIキーを追加し、APIParkを介してパブリッククラウドのAIモデルを統一的に呼び出します。",
892+
"K8097d6be": "OpenAIやDeepSeekなどのさまざまなAIモデルに迅速にアクセスできるオープンソースのワンストップAIゲートウェイおよびAPIポータルです。統一されたリクエスト形式を使用して、モデルの切り替えによるビジネスへの影響を回避し、企業レベルのAPIセキュリティ(認証/レート制限/センシティブワードフィルタリング)とリアルタイムの使用量監視を提供します。チーム内でのAPI共有やコラボレーションをサポートし、インターフェースのサブスクリプション認証を管理してAPIのセキュリティを確保します。",
893+
"Kf1ce5b3": "✨ Githubでスターを付けていただくか、製品フィードバックをお寄せください。",
894+
"K3af90490": "⚡ 以下の方法で、APIをすぐに公開して皆さんに利用してもらえます:",
895+
"K6b99dce8": "Ollama アドレス"
876896
}

frontend/packages/common/src/locales/scan/zh-CN.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,5 +803,25 @@
803803
"Kbe98ba9e": "私有服务",
804804
"K24540de": "停止",
805805
"Kd85b3f64": "继续等待",
806-
"K1400a1fc": "作为服务内所有API的前缀,比如host/{service_name}/{api_path},影响较大,谨慎修改"
806+
"K1400a1fc": "作为服务内所有API的前缀,比如host/{service_name}/{api_path},影响较大,谨慎修改",
807+
"Kb8185132": "",
808+
"K83829a3b": "模型异常",
809+
"Kb92fb02b": "部署失败",
810+
"Kcf8e3b18": "Tags",
811+
"K9ae48909": "API Key 负载",
812+
"K437724fc": "支持单个 API 模型供应商下创建多个 API Key 进行智能负载均衡",
813+
"K7d17707e": "模型灾备",
814+
"Kc007db4a": "仅支持 .png .jpg .jpeg .svg 格式的图片文件",
815+
"Kacf10c44": "Ollama 端点",
816+
"K8d4f5b44": "输入例如:https://www.apipark.com",
817+
"K481442d3": "配置 Ollama 服务",
818+
"Kf9b341e3": "如何部署 Ollama?",
819+
"K8632bef2": "模型部署服务未配置",
820+
"Kbbd8ce81": "配置服务",
821+
"K39a8d392": "导入OpenAPI文档,将现有系统的API发布到APIPark。",
822+
"Ka742e079": "添加公有云AI模型的 API Key,通过APIPark 统一调用公有云的AI模型。",
823+
"K8097d6be": "是开源的一站式 AI 网关与 API 门户,可快速接入 OpenAI/DeepSeek 等各类 AI 模型,通过统一请求格式避免模型切换对业务造成影响,提供企业级 API 安全防护(鉴权/限流/敏感词过滤)与实时用量监控,支持团队内 API 共享协作,管理接口订阅授权并保证您的API安全。",
824+
"Kf1ce5b3": "✨ 欢迎在 Github 为我们 Star 或提供产品反馈意见。",
825+
"K3af90490": "⚡您可快速通过以下方式开放API供大家使用:",
826+
"K6b99dce8": "Ollama 地址"
807827
}

frontend/packages/common/src/locales/scan/zh-TW.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,5 +872,25 @@
872872
"Kbe98ba9e": "私有服務",
873873
"K24540de": "停止",
874874
"Kd85b3f64": "繼續等待",
875-
"K1400a1fc": "作為服務內所有 API 的前綴,例如 host/{service_name}/{api_path},這會產生較大的影響,請謹慎修改"
875+
"K1400a1fc": "作為服務內所有 API 的前綴,例如 host/{service_name}/{api_path},這會產生較大的影響,請謹慎修改",
876+
"Kb8185132": "",
877+
"K83829a3b": "模型異常",
878+
"Kb92fb02b": "部署失敗",
879+
"Kcf8e3b18": "標籤",
880+
"K9ae48909": "API Key 負載",
881+
"K437724fc": "支持在單個 API 模型供應商下創建多個 API Key 進行智能負載均衡",
882+
"K7d17707e": "模型災備",
883+
"Kc007db4a": "僅支持 .png, .jpg, .jpeg, .svg 格式的圖片文件",
884+
"Kacf10c44": "Ollama 端點",
885+
"K8d4f5b44": "輸入範例:https://www.apipark.com",
886+
"K481442d3": "配置 Ollama 服務",
887+
"Kf9b341e3": "如何部署 Ollama?",
888+
"K8632bef2": "模型部署服務未配置",
889+
"Kbbd8ce81": "配置服務",
890+
"K39a8d392": "導入 OpenAPI 文件,將現有系統的 API 發佈到 APIPark。",
891+
"Ka742e079": "添加公有雲 AI 模型的 API Key,通過 APIPark 統一調用公有雲的 AI 模型。",
892+
"K8097d6be": "是一個開源的一站式 AI 閘道和 API 入口網站,可快速接入 OpenAI/DeepSeek 等各類 AI 模型,通過統一的請求格式避免模型切換對業務造成影響,提供企業級 API 安全防護(鑑權/限流/敏感詞過濾)與實時用量監控,支持團隊內 API 共享協作,管理介面訂閱授權並保證您的 API 安全。",
893+
"Kf1ce5b3": "✨ 歡迎在 Github 為我們 Star 或提供產品反饋意見。",
894+
"K3af90490": "⚡ 您可以快速通過以下方式開放 API 供大家使用:",
895+
"K6b99dce8": "Ollama 地址"
876896
}

frontend/packages/core/src/const/ai-service/type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export type AiServiceConfigFieldType = {
99
name?: string;
1010
id?: string;
1111
provider?:string
12+
model?:string
1213
prefix?:string;
1314
logo?:string;
1415
logoFile?:UploadFile;

0 commit comments

Comments
 (0)