mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-26 16:01:56 +08:00
Merge branch 'feature/1.8-cx' into 'main'
feature/1.8-Improve system observability See merge request apipark/APIPark!337
This commit is contained in:
@@ -22,8 +22,10 @@ export const BreadcrumbProvider = ({ children }: unknown) => {
|
||||
<BreadcrumbContext.Provider
|
||||
value={{
|
||||
setBreadcrumb: (newItems) => {
|
||||
newItems.slice(0, newItems.length - 1).forEach((item) => {
|
||||
item.title = <span className="cursor-pointer hover:text-theme">{item.title}</span>
|
||||
newItems.forEach((item) => {
|
||||
item.title = (
|
||||
<span className={`${item.onClick ? 'cursor-pointer hover:text-theme' : ''}`}>{item.title}</span>
|
||||
)
|
||||
})
|
||||
setBreadcrumb(newItems)
|
||||
},
|
||||
|
||||
@@ -350,13 +350,13 @@
|
||||
"重置": "K50d471b2",
|
||||
"查询": "Kee8ae330",
|
||||
"请输入 APIURL 搜索": "Kf8187c33",
|
||||
"服务": "Kb58e0c3f",
|
||||
"使用说明": "Kdefa9caa",
|
||||
"最近一次更新者": "K617f34f1",
|
||||
"最近一次更新时间": "K6ebca204",
|
||||
"保存": "Kabfe9512",
|
||||
"服务": "Kb58e0c3f",
|
||||
"API 路由": "K51d1eb5d",
|
||||
"API 文档": "Ka2b6d281",
|
||||
"API 路由文档": "K1639a17a",
|
||||
"使用说明": "Kdefa9caa",
|
||||
"服务策略": "K52f72551",
|
||||
"发布": "K36856e71",
|
||||
"订阅管理": "K6382bbfd",
|
||||
@@ -369,9 +369,6 @@
|
||||
"手动添加": "K18307d56",
|
||||
"订阅申请": "K705fe9f5",
|
||||
"订阅方": "K3a67ea90",
|
||||
"API": "K3ba29a85",
|
||||
"编辑 API": "Ke93388fd",
|
||||
"添加 API": "K84aabfd4",
|
||||
"AI 路由设置": "Kefa2a4cf",
|
||||
"路由名称": "K66060758",
|
||||
"请求路径": "K5582ac8",
|
||||
@@ -382,7 +379,6 @@
|
||||
"拦截接口": "Kee4139c2",
|
||||
"开启拦截后,网关会拦截所有该路径的请求。": "K3e38ea",
|
||||
"模型配置": "K8a35059b",
|
||||
"路由": "Kf9dcef3a",
|
||||
"添加路由": "K6134bbe8",
|
||||
"输入 URL 查找路由": "Kf85b83a0",
|
||||
"线上模型": "K84b2cf2d",
|
||||
@@ -633,8 +629,6 @@
|
||||
"处理日志": "Ke429194e",
|
||||
"脱敏前": "K8c34c02f",
|
||||
"脱敏后": "K8e3d388d",
|
||||
"编辑服务策略": "Kf06f6737",
|
||||
"添加服务策略": "K205971e1",
|
||||
"编辑策略": "Kc82b8374",
|
||||
"策略类型": "K4b34a5e5",
|
||||
"匹配条件": "K57f0fee8",
|
||||
@@ -678,13 +672,13 @@
|
||||
"API 使用排名": "Kbee2340",
|
||||
"消费者使用排名": "Kf6af1f40",
|
||||
"请求数": "K318a7519",
|
||||
"Token": "K9ef68e3f",
|
||||
"平均 Token/s 统计": "K6c016898",
|
||||
"平均请求数": "K652843b0",
|
||||
"平均 Token/订阅者统计": "Kf5eeb9c5",
|
||||
"流量": "K53eb7414",
|
||||
"平均响应时间": "K7c8d5c23",
|
||||
"平均请求数": "K652843b0",
|
||||
"平均流量": "K8158a6e4",
|
||||
"Token": "K9ef68e3f",
|
||||
"平均 Token/s 统计": "K6c016898",
|
||||
"平均 Token/订阅者统计": "Kf5eeb9c5",
|
||||
"单位:ms,最小值:1": "K2a16c93b",
|
||||
"API 路由设置": "Ka945cfb1",
|
||||
"API 基础信息": "K2e050340",
|
||||
@@ -861,6 +855,7 @@
|
||||
"请确认是否取消订阅申请?": "K1856c229",
|
||||
"搜索服务": "K66ea2f0",
|
||||
"审核中": "K8adf7f8b",
|
||||
"API 文档": "Ka2b6d281",
|
||||
"添加消费者": "K84c4dc71",
|
||||
"暂无消费者描述": "Kc3b7bfa8",
|
||||
"创建并管理自己的消费者实体,每个消费者可以订阅多个API服务,确保在调用之前已获得相应权限。你可以为消费者生成 API 密钥等鉴权方式,用于安全地调用 API 服务": "K5c4e2865",
|
||||
@@ -873,6 +868,7 @@
|
||||
"版本": "K81634069",
|
||||
"更新时间": "Keefda53d",
|
||||
"介绍": "K59cdbec3",
|
||||
"API": "K3ba29a85",
|
||||
"无标签": "K96a2f1c8",
|
||||
"分类": "Kb32f0afe",
|
||||
"服务市场": "K370a3eb2",
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
"K617f34f1": "Updated By",
|
||||
"K6ebca204": "Update Time",
|
||||
"Kabfe9512": "Save",
|
||||
"K51d1eb5d": "API",
|
||||
"K51d1eb5d": "API Routes",
|
||||
"Ka2b6d281": "API Docs",
|
||||
"Kdefa9caa": "Usage Instructions",
|
||||
"K36856e71": "Publish",
|
||||
@@ -210,7 +210,7 @@
|
||||
"K469e475a": "Max Retry Times",
|
||||
"K8a35059b": "Model Settings",
|
||||
"Kf9dcef3a": "API",
|
||||
"K6134bbe8": "Add API",
|
||||
"K6134bbe8": "Add API Route",
|
||||
"Kf85b83a0": "Enter URL to Search",
|
||||
"Kcf9f90b8": "Model Provider",
|
||||
"Kfede1c7c": "Model",
|
||||
@@ -956,5 +956,6 @@
|
||||
"K8158a6e4": "Avg Traffic per Subscriber",
|
||||
"K6b882d4a": "Avg Token per Subscriber",
|
||||
"K6c2d93b6": "Failed to load data, please try again",
|
||||
"Kf5eeb9c5": "Avg Token per Subscriber"
|
||||
"Kf5eeb9c5": "Avg Token per Subscriber",
|
||||
"K1639a17a": "API Route Docs"
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
"K617f34f1": "更新者",
|
||||
"K6ebca204": "更新日時",
|
||||
"Kabfe9512": "保存",
|
||||
"K51d1eb5d": "API",
|
||||
"K51d1eb5d": "APIルート",
|
||||
"Ka2b6d281": "API ドキュメント",
|
||||
"Kdefa9caa": "説明ドキュメント",
|
||||
"K36856e71": "公開",
|
||||
@@ -213,7 +213,7 @@
|
||||
"K469e475a": "リトライ回数",
|
||||
"K8a35059b": "モデル設定",
|
||||
"Kf9dcef3a": "API",
|
||||
"K6134bbe8": "API を追加",
|
||||
"K6134bbe8": "APIルートを追加する",
|
||||
"Kf85b83a0": "URL を入力して検索",
|
||||
"Kcf9f90b8": "モデルプロバイダー",
|
||||
"Kfede1c7c": "モデル",
|
||||
@@ -978,5 +978,6 @@
|
||||
"K8158a6e4": "平均トラフィック",
|
||||
"K6b882d4a": "平均トークン/加入者",
|
||||
"K6c2d93b6": "データの読み込みに失敗しました。もう一度お試しください",
|
||||
"Kf5eeb9c5": "平均トークン/加入者 統計"
|
||||
"Kf5eeb9c5": "平均トークン/加入者 統計",
|
||||
"K1639a17a": "APIルートのドキュメント"
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
"K617f34f1": "更新者",
|
||||
"K6ebca204": "更新时间",
|
||||
"Kabfe9512": "保存",
|
||||
"K51d1eb5d": "API",
|
||||
"K51d1eb5d": "API 路由",
|
||||
"Ka2b6d281": "API 文档",
|
||||
"Kdefa9caa": "说明文档",
|
||||
"K36856e71": "发布",
|
||||
@@ -213,7 +213,7 @@
|
||||
"K469e475a": "最大重试次数",
|
||||
"K8a35059b": "模型设置",
|
||||
"Kf9dcef3a": "API",
|
||||
"K6134bbe8": "添加 API",
|
||||
"K6134bbe8": "添加 API 路由",
|
||||
"Kf85b83a0": "输入 URL 查找",
|
||||
"Kcf9f90b8": "模型供应商",
|
||||
"Kfede1c7c": "模型",
|
||||
@@ -907,5 +907,6 @@
|
||||
"K652843b0": "平均请求数",
|
||||
"K8158a6e4": "平均流量",
|
||||
"K6c2d93b6": "加载数据失败,请重试",
|
||||
"Kf5eeb9c5": "平均 Token/订阅者统计"
|
||||
"Kf5eeb9c5": "平均 Token/订阅者统计",
|
||||
"K1639a17a": "API 路由文档"
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
"K617f34f1": "更新者",
|
||||
"K6ebca204": "更新時間",
|
||||
"Kabfe9512": "保存",
|
||||
"K51d1eb5d": "API",
|
||||
"K51d1eb5d": "API 路由",
|
||||
"Ka2b6d281": "API 文檔",
|
||||
"Kdefa9caa": "說明文檔",
|
||||
"K36856e71": "發布",
|
||||
@@ -213,7 +213,7 @@
|
||||
"K469e475a": "最大重試次數",
|
||||
"K8a35059b": "模型設置",
|
||||
"Kf9dcef3a": "API",
|
||||
"K6134bbe8": "添加 API",
|
||||
"K6134bbe8": "添加 API 路由",
|
||||
"Kf85b83a0": "輸入 URL 查找",
|
||||
"Kcf9f90b8": "模型供應商",
|
||||
"Kfede1c7c": "模型",
|
||||
@@ -978,5 +978,6 @@
|
||||
"K8158a6e4": "平均流量",
|
||||
"K6b882d4a": "每位訂閱者平均 Token",
|
||||
"K6c2d93b6": "載入資料失敗,請重試",
|
||||
"Kf5eeb9c5": "每位訂閱者平均 Token 統計"
|
||||
"Kf5eeb9c5": "每位訂閱者平均 Token 統計",
|
||||
"K1639a17a": "API 路由文件"
|
||||
}
|
||||
|
||||
@@ -6,17 +6,18 @@ import { AiServiceRouterTableListItem, VariableItems } from './type'
|
||||
import { PageProColumns } from '@common/components/aoplatform/PageList'
|
||||
|
||||
export const AI_SERVICE_ROUTER_TABLE_COLUMNS: PageProColumns<AiServiceRouterTableListItem>[] = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
width: 200,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: 'URL',
|
||||
dataIndex: 'requestPath',
|
||||
ellipsis: true,
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '模型',
|
||||
dataIndex: ['model', 'name'],
|
||||
|
||||
@@ -242,6 +242,12 @@ export const MATCH_CONFIG: ConfigField<MatchItem>[] = [
|
||||
]
|
||||
|
||||
export const SYSTEM_API_TABLE_COLUMNS: PageProColumns<SystemApiTableListItem>[] = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
width: 200,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: 'URL',
|
||||
dataIndex: 'requestPath',
|
||||
|
||||
@@ -97,6 +97,7 @@ export type SystemApiProxyType = {
|
||||
export type SystemApiProxyFieldType = {
|
||||
protocols: string[];
|
||||
id:string;
|
||||
name:string
|
||||
description?:string;
|
||||
disable:boolean;
|
||||
path:string;
|
||||
|
||||
@@ -8,9 +8,8 @@ import { App, Button } from 'antd'
|
||||
import { EntityItem } from '@common/const/type.ts'
|
||||
import WithPermission from '@common/components/aoplatform/WithPermission.tsx'
|
||||
import { RouterParams } from '@core/components/aoplatform/RenderRoutes'
|
||||
import { useNavigate, useParams } from 'react-router-dom'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { $t } from '@common/locales'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext'
|
||||
const ServiceInsideDocument = () => {
|
||||
const { message } = App.useApp()
|
||||
const [updater, setUpdater] = useState<string>()
|
||||
@@ -19,8 +18,6 @@ const ServiceInsideDocument = () => {
|
||||
const [doc, setDoc] = useState<string>()
|
||||
const { fetchData } = useFetch()
|
||||
const { serviceId, teamId } = useParams<RouterParams>()
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const navigator = useNavigate()
|
||||
|
||||
const save = () => {
|
||||
fetchData<
|
||||
@@ -80,15 +77,6 @@ const ServiceInsideDocument = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('使用说明')
|
||||
}
|
||||
])
|
||||
getServiceDoc()
|
||||
}, [])
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import { cloneDeep } from 'lodash-es'
|
||||
import { FC, useEffect, useMemo, useState } from 'react'
|
||||
import { Link, Outlet, useLocation, useNavigate, useParams } from 'react-router-dom'
|
||||
import { useAiServiceContext } from '../../contexts/AiServiceContext.tsx'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext.tsx'
|
||||
const APP_MODE = import.meta.env.VITE_APP_MODE
|
||||
|
||||
const AiServiceInsidePage: FC = () => {
|
||||
@@ -27,6 +28,7 @@ const AiServiceInsidePage: FC = () => {
|
||||
const [activeMenu, setActiveMenu] = useState<string>()
|
||||
const navigateTo = useNavigate()
|
||||
const [showMenu, setShowMenu] = useState<boolean>(false)
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
|
||||
const getAiServiceInfo = () => {
|
||||
fetchData<BasicResponse<{ service: AiServiceConfigFieldType }>>('service/info', {
|
||||
@@ -77,7 +79,7 @@ const AiServiceInsidePage: FC = () => {
|
||||
'team.service.router.view'
|
||||
),
|
||||
getItem(
|
||||
<Link to="./api">{$t('API 文档')}</Link>,
|
||||
<Link to="./api">{$t('API 路由文档')}</Link>,
|
||||
'api',
|
||||
undefined,
|
||||
undefined,
|
||||
@@ -215,10 +217,19 @@ const AiServiceInsidePage: FC = () => {
|
||||
}, [accessData])
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigateTo('/service/list')
|
||||
},
|
||||
{
|
||||
title: aiServiceInfo?.name || ''
|
||||
}
|
||||
])
|
||||
if (activeMenu && serviceId === currentUrl.split('/')[currentUrl.split('/').length - 1]) {
|
||||
navigateTo(`/service/${teamId}/aiInside/${serviceId}/${activeMenu}`)
|
||||
}
|
||||
}, [activeMenu])
|
||||
}, [activeMenu, state.language, aiServiceInfo])
|
||||
|
||||
useEffect(() => {
|
||||
serviceId && getAiServiceInfo()
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import {ActionType} from "@ant-design/pro-components";
|
||||
import {FC, forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState} from "react";
|
||||
import {Link, useNavigate, useParams} from "react-router-dom";
|
||||
import {useParams} from "react-router-dom";
|
||||
import {App, Form,TreeSelect} from "antd";
|
||||
import {useBreadcrumb} from "@common/contexts/BreadcrumbContext.tsx";
|
||||
import {useFetch} from "@common/hooks/http.ts";
|
||||
import { RouterParams } from "@core/components/aoplatform/RenderRoutes.tsx";
|
||||
import {BasicResponse, COLUMNS_TITLE, DELETE_TIPS, PLACEHOLDER, RESPONSE_TIPS, STATUS_CODE, VALIDATE_MESSAGE} from "@common/const/const.tsx";
|
||||
@@ -18,7 +17,6 @@ import { checkAccess } from "@common/utils/permission.ts";
|
||||
import { $t } from "@common/locales/index.ts";
|
||||
|
||||
const AiServiceInsideSubscriber:FC = ()=>{
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const { modal,message } = App.useApp()
|
||||
const {fetchData} = useFetch()
|
||||
const {serviceId, teamId} = useParams<RouterParams>()
|
||||
@@ -26,7 +24,6 @@ const AiServiceInsideSubscriber:FC = ()=>{
|
||||
const pageListRef = useRef<ActionType>(null);
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<SimpleMemberItem[]>([])
|
||||
const {accessData,state} = useGlobalContext()
|
||||
const navigator = useNavigate()
|
||||
const getAiServiceSubscriber = ()=>{
|
||||
return fetchData<BasicResponse<{subscribers:AiServiceSubscriberTableListItem[]}>>('service/subscribers',{method:'GET',eoParams:{service:serviceId,team:teamId},eoTransformKeys:['apply_time']}).then(response=>{
|
||||
const {code,data,msg} = response
|
||||
@@ -120,15 +117,6 @@ const AiServiceInsideSubscriber:FC = ()=>{
|
||||
]
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title:$t('订阅方管理')
|
||||
}
|
||||
])
|
||||
getMemberList()
|
||||
manualReloadTable()
|
||||
}, [serviceId]);
|
||||
|
||||
@@ -6,33 +6,21 @@ import { LoadingOutlined } from '@ant-design/icons'
|
||||
import EmptySVG from '@common/assets/empty.svg'
|
||||
import { $t } from '@common/locales/index.ts'
|
||||
import ApiDocument from '@common/components/aoplatform/ApiDocument.tsx'
|
||||
import { useNavigate, useParams } from 'react-router-dom'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { RouterParams } from '@core/components/aoplatform/RenderRoutes.tsx'
|
||||
import {
|
||||
AiServiceInsideApiDocumentHandle,
|
||||
AiServiceInsideApiDocumentProps,
|
||||
AiServiceApiDetail
|
||||
} from '@core/const/ai-service/type.ts'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext'
|
||||
|
||||
const AiServiceInsideApiDocument = forwardRef<AiServiceInsideApiDocumentHandle, AiServiceInsideApiDocumentProps>(() => {
|
||||
const { serviceId, teamId } = useParams<RouterParams>()
|
||||
const { fetchData } = useFetch()
|
||||
const [apiDetail, setApiDetail] = useState<AiServiceApiDetail>()
|
||||
const [loading, setLoading] = useState<boolean>(false)
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const navigator = useNavigate()
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('API 文档')
|
||||
}
|
||||
])
|
||||
getApiDetail()
|
||||
}, [])
|
||||
|
||||
|
||||
@@ -291,19 +291,6 @@ const AiServiceInsideRouterCreate = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title:$t('API'),
|
||||
onClick: () => navigator(backUrl)
|
||||
},
|
||||
{
|
||||
title: routeId ? $t('编辑 API') : $t('添加 API')
|
||||
}
|
||||
])
|
||||
!routeId && aiServiceInfo?.provider && getDefaultModelConfig()
|
||||
}, [aiServiceInfo])
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import PageList, { PageProColumns } from '@common/components/aoplatform/PageList
|
||||
import TableBtnWithPermission from '@common/components/aoplatform/TableBtnWithPermission.tsx'
|
||||
import { BasicResponse, COLUMNS_TITLE, DELETE_TIPS, RESPONSE_TIPS, STATUS_CODE } from '@common/const/const.tsx'
|
||||
import { SimpleMemberItem } from '@common/const/type.ts'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext.tsx'
|
||||
import { useGlobalContext } from '@common/contexts/GlobalStateContext.tsx'
|
||||
import { useFetch } from '@common/hooks/http.ts'
|
||||
import { $t } from '@common/locales/index.ts'
|
||||
@@ -17,7 +16,6 @@ import { Link, useNavigate, useParams } from 'react-router-dom'
|
||||
|
||||
const AiServiceInsideRouterList: FC = () => {
|
||||
const [searchWord, setSearchWord] = useState<string>('')
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const { modal, message } = App.useApp()
|
||||
const [tableListDataSource, setTableListDataSource] = useState<AiServiceRouterTableListItem[]>([])
|
||||
const [tableHttpReload, setTableHttpReload] = useState(true)
|
||||
@@ -162,17 +160,6 @@ const AiServiceInsideRouterList: FC = () => {
|
||||
getMemberList()
|
||||
manualReloadTable()
|
||||
}, [serviceId])
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('路由')
|
||||
}
|
||||
])
|
||||
}, [state.language])
|
||||
|
||||
const columns = useMemo(() => {
|
||||
return [...AI_SERVICE_ROUTER_TABLE_COLUMNS].map((x) => {
|
||||
|
||||
@@ -3,7 +3,6 @@ import {ActionType} from "@ant-design/pro-components";
|
||||
import {FC, useEffect, useMemo, useRef, useState} from "react";
|
||||
import {Link, useLocation, useNavigate, useParams} from "react-router-dom";
|
||||
import PageList, { PageProColumns } from "@common/components/aoplatform/PageList.tsx";
|
||||
import {useBreadcrumb} from "@common/contexts/BreadcrumbContext.tsx";
|
||||
import {App, Button} from "antd";
|
||||
import {
|
||||
SUBSCRIBE_APPROVAL_INNER_DONE_TABLE_COLUMN,
|
||||
@@ -26,7 +25,6 @@ import { SubscribeApprovalInfoType } from "@common/const/approval/type.tsx";
|
||||
import { $t } from "@common/locales";
|
||||
|
||||
const AiServiceInsideApprovalList:FC = ()=>{
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const { modal,message } = App.useApp()
|
||||
const {serviceId, teamId} = useParams<RouterParams>();
|
||||
const [init, setInit] = useState<boolean>(true)
|
||||
@@ -40,7 +38,6 @@ const AiServiceInsideApprovalList:FC = ()=>{
|
||||
const [approvalBtnLoading,setApprovalBtnLoading] = useState<boolean>(false)
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<SimpleMemberItem[]>([])
|
||||
const {accessData,state} = useGlobalContext()
|
||||
const navigator = useNavigate()
|
||||
|
||||
const openModal = async (type:'approval'|'view',entity:SubscribeApprovalTableListItem)=>{
|
||||
message.loading($t(RESPONSE_TIPS.loading))
|
||||
@@ -142,15 +139,6 @@ const AiServiceInsideApprovalList:FC = ()=>{
|
||||
}, [query]);
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title:$t('订阅审核')
|
||||
}
|
||||
])
|
||||
getMemberList()
|
||||
manualReloadTable()
|
||||
}, [serviceId]);
|
||||
|
||||
@@ -2,13 +2,11 @@
|
||||
import { Tabs } from "antd"
|
||||
import { useState, useEffect, FC, useMemo } from "react"
|
||||
import { Link, Outlet, useLocation, useNavigate } from "react-router-dom"
|
||||
import { useBreadcrumb } from "@common/contexts/BreadcrumbContext"
|
||||
import { SYSTEM_PUBLISH_TAB_ITEMS } from "../../../const/system/const"
|
||||
import { $t } from "@common/locales"
|
||||
import { useGlobalContext } from "@common/contexts/GlobalStateContext"
|
||||
|
||||
const AiServiceInsidePublic:FC = ()=>{
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const query =new URLSearchParams(useLocation().search)
|
||||
const location = useLocation()
|
||||
const currentUrl = location.pathname
|
||||
@@ -25,18 +23,6 @@ const AiServiceInsidePublic:FC = ()=>{
|
||||
setPageStatus(Number(query.get('status') ||0) as 0|1)
|
||||
}, [currentUrl]);
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigateTo('/service/list')
|
||||
},
|
||||
{
|
||||
title:$t('发布')
|
||||
}
|
||||
])
|
||||
}, []);
|
||||
|
||||
const tabItems = useMemo(()=>SYSTEM_PUBLISH_TAB_ITEMS?.map((x)=>({...x, label:$t(x.label as string) })),[state.language])
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -9,7 +9,6 @@ import { PUBLISH_APPROVAL_RECORD_INNER_TABLE_COLUMN, PUBLISH_APPROVAL_VERSION_IN
|
||||
import { BasicResponse, COLUMNS_TITLE, DELETE_TIPS, RESPONSE_TIPS, STATUS_CODE } from "@common/const/const";
|
||||
import { SimpleMemberItem } from "@common/const/type.ts";
|
||||
import { MemberTableListItem } from "../../../const/member/type";
|
||||
import { useBreadcrumb } from "@common/contexts/BreadcrumbContext";
|
||||
import { useFetch } from "@common/hooks/http";
|
||||
import WithPermission from "@common/components/aoplatform/WithPermission";
|
||||
import { AiServicePublishReleaseItem } from "../../../const/system/type";
|
||||
@@ -23,7 +22,6 @@ import { DrawerWithFooter } from "@common/components/aoplatform/DrawerWithFooter
|
||||
import { $t } from "@common/locales";
|
||||
|
||||
const AiServiceInsidePublicList:FC = ()=>{
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const { modal,message } = App.useApp()
|
||||
const pageListRef = useRef<ActionType>(null);
|
||||
const [tableHttpReload, setTableHttpReload] = useState(true);
|
||||
@@ -45,7 +43,6 @@ const AiServiceInsidePublicList:FC = ()=>{
|
||||
const [drawerData, setDrawerData] = useState<PublishTableListItem|PublishVersionTableListItem >({} as PublishTableListItem)
|
||||
const [drawerOkTitle, setDrawerOkTitle] = useState<string>('确认')
|
||||
const [isOkToPublish, setIsOkToPublish] = useState<boolean>(false)
|
||||
const navigator = useNavigate()
|
||||
const getAiServicePublishList = (params?: ParamsType & {
|
||||
pageSize?: number | undefined;
|
||||
current?: number | undefined;
|
||||
@@ -351,15 +348,6 @@ const AiServiceInsidePublicList:FC = ()=>{
|
||||
]
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('发布')
|
||||
}
|
||||
])
|
||||
getMemberList()
|
||||
manualReloadTable()
|
||||
}, [serviceId]);
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext'
|
||||
import { useEffect } from 'react'
|
||||
import { Outlet, useLocation, useNavigate } from 'react-router-dom'
|
||||
import { $t } from '@common/locales'
|
||||
|
||||
export default function ServicePolicyLayout() {
|
||||
const location = useLocation()
|
||||
const pathName = location.pathname
|
||||
const navigator = useNavigate()
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
useEffect(() => {
|
||||
const tmpPath = pathName.split('/')
|
||||
if (tmpPath[tmpPath.length - 1] === 'servicepolicy') {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('服务策略')
|
||||
}
|
||||
])
|
||||
navigator('datamasking/list')
|
||||
}
|
||||
}, [pathName])
|
||||
|
||||
@@ -80,19 +80,6 @@ const DataMaskingConfig = forwardRef<DataMaskingConfigHandle>((_,ref) => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title:$t('服务策略'),
|
||||
onClick: () => navigator(serviceId ? `/service/${teamId}/aiInside/${serviceId}/servicepolicy` : '')
|
||||
},
|
||||
{
|
||||
title: policyId !== undefined ? $t('编辑服务策略') : $t('添加服务策略')
|
||||
}
|
||||
])
|
||||
if (policyId !== undefined) {
|
||||
setOnEdit(true);
|
||||
getPolicyInfo();
|
||||
|
||||
@@ -2,7 +2,6 @@ import { LoadingOutlined } from '@ant-design/icons'
|
||||
import WithPermission from '@common/components/aoplatform/WithPermission.tsx'
|
||||
import { BasicResponse, DELETE_TIPS, PLACEHOLDER, RESPONSE_TIPS, STATUS_CODE } from '@common/const/const.tsx'
|
||||
import { EntityItem, MemberItem, SimpleTeamItem } from '@common/const/type.ts'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext.tsx'
|
||||
import { useGlobalContext } from '@common/contexts/GlobalStateContext.tsx'
|
||||
import { useFetch } from '@common/hooks/http.ts'
|
||||
import { $t } from '@common/locales/index.ts'
|
||||
@@ -49,7 +48,6 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_, ref) => {
|
||||
const { fetchData } = useFetch()
|
||||
const [teamOptionList, setTeamOptionList] = useState<DefaultOptionType[]>()
|
||||
const navigate = useNavigate()
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const { setSystemInfo } = useSystemContext()
|
||||
const [showClassify, setShowClassify] = useState<boolean>(true)
|
||||
const [showAI, setShowAI] = useState<boolean>(false)
|
||||
@@ -355,15 +353,6 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_, ref) => {
|
||||
if (serviceId !== undefined) {
|
||||
setOnEdit(true)
|
||||
getSystemInfo()
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigate('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('设置')
|
||||
}
|
||||
])
|
||||
} else {
|
||||
getProviderOptionList()
|
||||
setOnEdit(false)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import WithPermission from '@common/components/aoplatform/WithPermission.tsx'
|
||||
import { BasicResponse, RESPONSE_TIPS, STATUS_CODE } from '@common/const/const.tsx'
|
||||
import { EntityItem } from '@common/const/type.ts'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext'
|
||||
import { useFetch } from '@common/hooks/http.ts'
|
||||
import { $t } from '@common/locales'
|
||||
import { RouterParams } from '@core/components/aoplatform/RenderRoutes'
|
||||
@@ -10,7 +9,7 @@ import { App, Button } from 'antd'
|
||||
import hljs from 'highlight.js'
|
||||
import 'highlight.js/styles/default.css'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useNavigate, useParams } from 'react-router-dom'
|
||||
import { useParams } from 'react-router-dom'
|
||||
const ServiceInsideDocument = () => {
|
||||
const { message } = App.useApp()
|
||||
const [updater, setUpdater] = useState<string>()
|
||||
@@ -19,8 +18,6 @@ const ServiceInsideDocument = () => {
|
||||
const [doc, setDoc] = useState<string>()
|
||||
const { fetchData } = useFetch()
|
||||
const { serviceId, teamId } = useParams<RouterParams>()
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const navigator = useNavigate()
|
||||
const save = () => {
|
||||
fetchData<
|
||||
BasicResponse<{
|
||||
@@ -88,15 +85,6 @@ const ServiceInsideDocument = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('使用说明')
|
||||
}
|
||||
])
|
||||
getServiceDoc()
|
||||
}, [])
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import { Link, Outlet, useLocation, useNavigate, useParams } from 'react-router-
|
||||
import { SystemConfigFieldType } from '../../const/system/type.ts'
|
||||
import { useSystemContext } from '../../contexts/SystemContext.tsx'
|
||||
import ServiceInfoCard from '@common/components/aoplatform/serviceInfoCard.tsx'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext.tsx'
|
||||
|
||||
const SystemInsidePage: FC = () => {
|
||||
const { message } = App.useApp()
|
||||
@@ -27,6 +28,7 @@ const SystemInsidePage: FC = () => {
|
||||
const [activeMenu, setActiveMenu] = useState<string>()
|
||||
const navigateTo = useNavigate()
|
||||
const [showMenu, setShowMenu] = useState<boolean>(false)
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
|
||||
const getSystemInfo = () => {
|
||||
fetchData<BasicResponse<{ service: SystemConfigFieldType }>>('service/info', {
|
||||
@@ -76,7 +78,7 @@ const SystemInsidePage: FC = () => {
|
||||
'team.service.router.view'
|
||||
),
|
||||
getItem(
|
||||
<Link to="./api">{$t('API 文档')}</Link>,
|
||||
<Link to="./api">{$t('API 路由文档')}</Link>,
|
||||
'api',
|
||||
undefined,
|
||||
undefined,
|
||||
@@ -217,10 +219,19 @@ const SystemInsidePage: FC = () => {
|
||||
}, [accessData])
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigateTo('/service/list')
|
||||
},
|
||||
{
|
||||
title: systemInfo?.name || ''
|
||||
}
|
||||
])
|
||||
if (activeMenu && serviceId === currentUrl.split('/')[currentUrl.split('/').length - 1]) {
|
||||
navigateTo(`/service/${teamId}/inside/${serviceId}/${activeMenu}`)
|
||||
}
|
||||
}, [activeMenu])
|
||||
}, [activeMenu, systemInfo, state.language])
|
||||
|
||||
useEffect(() => {
|
||||
serviceId && getSystemInfo()
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
STATUS_CODE
|
||||
} from '@common/const/const.tsx'
|
||||
import { SimpleMemberItem } from '@common/const/type.ts'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext.tsx'
|
||||
import { useGlobalContext } from '@common/contexts/GlobalStateContext.tsx'
|
||||
import { useFetch } from '@common/hooks/http.ts'
|
||||
import { $t } from '@common/locales/index.ts'
|
||||
@@ -20,7 +19,7 @@ import { RouterParams } from '@core/components/aoplatform/RenderRoutes.tsx'
|
||||
import { App, Form, TreeSelect } from 'antd'
|
||||
import { DefaultOptionType } from 'antd/es/cascader'
|
||||
import { FC, forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'
|
||||
import { Link, useNavigate, useParams } from 'react-router-dom'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { SYSTEM_SUBSCRIBER_TABLE_COLUMNS } from '../../const/system/const.tsx'
|
||||
import {
|
||||
SimpleSystemItem,
|
||||
@@ -31,7 +30,6 @@ import {
|
||||
} from '../../const/system/type.ts'
|
||||
|
||||
const SystemInsideSubscriber: FC = () => {
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const { modal, message } = App.useApp()
|
||||
const { fetchData } = useFetch()
|
||||
const { serviceId, teamId } = useParams<RouterParams>()
|
||||
@@ -39,7 +37,6 @@ const SystemInsideSubscriber: FC = () => {
|
||||
const pageListRef = useRef<ActionType>(null)
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<SimpleMemberItem[]>([])
|
||||
const { accessData, state } = useGlobalContext()
|
||||
const navigator = useNavigate()
|
||||
const getSystemSubscriber = () => {
|
||||
return fetchData<BasicResponse<{ subscribers: SystemSubscriberTableListItem[] }>>(
|
||||
'service/subscribers',
|
||||
@@ -162,15 +159,6 @@ const SystemInsideSubscriber: FC = () => {
|
||||
]
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('订阅方管理')
|
||||
}
|
||||
])
|
||||
getMemberList()
|
||||
manualReloadTable()
|
||||
}, [serviceId])
|
||||
|
||||
@@ -2,7 +2,6 @@ import { ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons'
|
||||
import G6, { EdgeConfig, Graph, NodeConfig } from '@antv/g6'
|
||||
import { BasicResponse, RESPONSE_TIPS, STATUS_CODE } from '@common/const/const'
|
||||
import { EntityItem } from '@common/const/type'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext'
|
||||
import { useFetch } from '@common/hooks/http'
|
||||
import { $t } from '@common/locales'
|
||||
import { getNodeSpacing } from '@common/utils/systemRunning'
|
||||
@@ -10,7 +9,7 @@ import { RouterParams } from '@core/components/aoplatform/RenderRoutes'
|
||||
import { App, Button } from 'antd'
|
||||
import { debounce } from 'lodash-es'
|
||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { Link, useParams } from 'react-router-dom'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { RELATIVE_PICTURE_NODE_FONTSIZE } from '../../const/system-running/const'
|
||||
import { GraphData } from '../../const/system-running/type'
|
||||
import { SYSTEM_TOPOLOGY_NODE_TYPE_COLOR_MAP } from '../../const/system/const'
|
||||
@@ -26,9 +25,7 @@ export default function SystemTopology() {
|
||||
const [graph, setGraph] = useState<Graph | null>(null)
|
||||
const { fetchData } = useFetch()
|
||||
const { systemInfo } = useSystemContext()
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const [zoomNum, setZoomNum] = useState<number>(1)
|
||||
const navigate = useNavigate()
|
||||
|
||||
|
||||
const getNodeData = () => {
|
||||
@@ -105,15 +102,6 @@ export default function SystemTopology() {
|
||||
|
||||
useEffect(() => {
|
||||
getNodeData()
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigate('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('调用拓扑图')
|
||||
}
|
||||
])
|
||||
}, [serviceId])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -9,13 +9,12 @@ import { $t } from '@common/locales/index.ts'
|
||||
import { RouterParams } from '@core/components/aoplatform/RenderRoutes.tsx'
|
||||
import { Button, Empty, Spin, Upload, message } from 'antd'
|
||||
import { forwardRef, useEffect, useState } from 'react'
|
||||
import { useNavigate, useParams } from 'react-router-dom'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import {
|
||||
SystemApiDetail,
|
||||
SystemInsideApiDocumentHandle,
|
||||
SystemInsideApiDocumentProps
|
||||
} from '../../../const/system/type.ts'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext.tsx'
|
||||
|
||||
const SystemInsideApiDocument = forwardRef<
|
||||
SystemInsideApiDocumentHandle,
|
||||
@@ -26,18 +25,7 @@ const SystemInsideApiDocument = forwardRef<
|
||||
const [apiDetail, setApiDetail] = useState<SystemApiDetail>()
|
||||
const [loading, setLoading] = useState<boolean>(false)
|
||||
const [showEditor, setShowEditor] = useState<boolean>(false)
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const navigator = useNavigate()
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('API 文档')
|
||||
}
|
||||
])
|
||||
getApiDetail()
|
||||
}, [])
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ import {
|
||||
SystemInsideRouterCreateHandle,
|
||||
SystemInsideRouterCreateProps
|
||||
} from '../../../const/system/type.ts'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext.tsx'
|
||||
|
||||
const SystemInsideRouterCreate = forwardRef<SystemInsideRouterCreateHandle, SystemInsideRouterCreateProps>(
|
||||
(props, ref) => {
|
||||
@@ -39,14 +38,12 @@ const SystemInsideRouterCreate = forwardRef<SystemInsideRouterCreateHandle, Syst
|
||||
const { state } = useGlobalContext()
|
||||
const { apiPrefix, prefixForce } = useSystemContext()
|
||||
const navigator = useNavigate()
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
|
||||
|
||||
const onFinish = () => {
|
||||
return Promise.all([proxyRef.current?.validate?.(), form.validateFields()]).then(([, formValue]) => {
|
||||
const body = {
|
||||
...formValue,
|
||||
path: `${prefixForce ? apiPrefix + '/' : ''}${formValue.path.trim()}${formValue.pathMatch === 'prefix' ? '/*' : ''}`,
|
||||
path: `${prefixForce ? apiPrefix + (!formValue.path?.trim() ? '': '/') : ''}${(formValue.path?.trim() || '')}${formValue.pathMatch === 'prefix' ? '/*' : ''}`,
|
||||
proxy: {
|
||||
...formValue.proxy,
|
||||
path: formValue.proxy.path
|
||||
@@ -147,19 +144,6 @@ const SystemInsideRouterCreate = forwardRef<SystemInsideRouterCreateHandle, Syst
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title:$t('API'),
|
||||
onClick: () => navigator(`/service/${teamId}/inside/${serviceId}/route`)
|
||||
},
|
||||
{
|
||||
title: routeId ? $t('编辑 API') : $t('添加 API')
|
||||
}
|
||||
])
|
||||
if (routeId) {
|
||||
getRouterConfig()
|
||||
} else {
|
||||
@@ -253,6 +237,14 @@ const SystemInsideRouterCreate = forwardRef<SystemInsideRouterCreateHandle, Syst
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
<Form.Item<SystemApiProxyFieldType>
|
||||
className="flex-1"
|
||||
label={$t('路由名称')}
|
||||
name="name"
|
||||
rules={[{ required: true, whitespace: true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<SystemApiProxyFieldType> label={$t('请求协议')} name="protocols" rules={[{ required: true }]}>
|
||||
<Select
|
||||
|
||||
@@ -3,7 +3,6 @@ import PageList, { PageProColumns } from '@common/components/aoplatform/PageList
|
||||
import TableBtnWithPermission from '@common/components/aoplatform/TableBtnWithPermission.tsx'
|
||||
import { BasicResponse, COLUMNS_TITLE, DELETE_TIPS, RESPONSE_TIPS, STATUS_CODE } from '@common/const/const.tsx'
|
||||
import { SimpleMemberItem } from '@common/const/type.ts'
|
||||
import { useBreadcrumb } from '@common/contexts/BreadcrumbContext.tsx'
|
||||
import { useGlobalContext } from '@common/contexts/GlobalStateContext.tsx'
|
||||
import { useFetch } from '@common/hooks/http.ts'
|
||||
import { $t } from '@common/locales/index.ts'
|
||||
@@ -11,13 +10,12 @@ import { checkAccess } from '@common/utils/permission.ts'
|
||||
import { RouterParams } from '@core/components/aoplatform/RenderRoutes.tsx'
|
||||
import { App, Divider, Typography } from 'antd'
|
||||
import { FC, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { Link, useNavigate, useParams } from 'react-router-dom'
|
||||
import { useNavigate, useParams } from 'react-router-dom'
|
||||
import { SYSTEM_API_TABLE_COLUMNS } from '../../../const/system/const.tsx'
|
||||
import { SystemApiTableListItem } from '../../../const/system/type.ts'
|
||||
|
||||
const SystemInsideRouterList: FC = () => {
|
||||
const [searchWord, setSearchWord] = useState<string>('')
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const { modal, message } = App.useApp()
|
||||
const [tableListDataSource, setTableListDataSource] = useState<SystemApiTableListItem[]>([])
|
||||
const [tableHttpReload, setTableHttpReload] = useState(true)
|
||||
@@ -162,17 +160,6 @@ const SystemInsideRouterList: FC = () => {
|
||||
getMemberList()
|
||||
manualReloadTable()
|
||||
}, [serviceId])
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('路由')
|
||||
}
|
||||
])
|
||||
}, [state.language])
|
||||
|
||||
const columns = useMemo(() => {
|
||||
return [...SYSTEM_API_TABLE_COLUMNS].map((x) => {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
import {ActionType} from "@ant-design/pro-components";
|
||||
import {FC, useEffect, useMemo, useRef, useState} from "react";
|
||||
import {Link, useLocation, useNavigate, useParams} from "react-router-dom";
|
||||
import { useLocation, useParams} from "react-router-dom";
|
||||
import PageList, { PageProColumns } from "@common/components/aoplatform/PageList.tsx";
|
||||
import {useBreadcrumb} from "@common/contexts/BreadcrumbContext.tsx";
|
||||
import {App, Button} from "antd";
|
||||
import {
|
||||
SUBSCRIBE_APPROVAL_INNER_DONE_TABLE_COLUMN,
|
||||
@@ -26,7 +25,6 @@ import { SubscribeApprovalInfoType } from "@common/const/approval/type.tsx";
|
||||
import { $t } from "@common/locales";
|
||||
|
||||
const SystemInsideApprovalList:FC = ()=>{
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const { modal,message } = App.useApp()
|
||||
const {serviceId, teamId} = useParams<RouterParams>();
|
||||
const [init, setInit] = useState<boolean>(true)
|
||||
@@ -40,7 +38,6 @@ const SystemInsideApprovalList:FC = ()=>{
|
||||
const [approvalBtnLoading,setApprovalBtnLoading] = useState<boolean>(false)
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<SimpleMemberItem[]>([])
|
||||
const {accessData,state} = useGlobalContext()
|
||||
const navigator = useNavigate()
|
||||
|
||||
const openModal = async (type:'approval'|'view',entity:SubscribeApprovalTableListItem)=>{
|
||||
message.loading($t(RESPONSE_TIPS.loading))
|
||||
@@ -142,15 +139,6 @@ const SystemInsideApprovalList:FC = ()=>{
|
||||
}, [query]);
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigator('/service/list')
|
||||
},
|
||||
{
|
||||
title:$t('订阅审核')
|
||||
}
|
||||
])
|
||||
getMemberList()
|
||||
manualReloadTable()
|
||||
}, [serviceId]);
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
|
||||
import { Tabs } from "antd"
|
||||
import { useState, useEffect, FC, useMemo } from "react"
|
||||
import { Link, Outlet, useLocation, useNavigate } from "react-router-dom"
|
||||
import { useBreadcrumb } from "@common/contexts/BreadcrumbContext"
|
||||
import { Outlet, useLocation, useNavigate } from "react-router-dom"
|
||||
import { SYSTEM_PUBLISH_TAB_ITEMS } from "../../../const/system/const"
|
||||
import { $t } from "@common/locales"
|
||||
import { useGlobalContext } from "@common/contexts/GlobalStateContext"
|
||||
|
||||
const SystemInsidePublic:FC = ()=>{
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const query =new URLSearchParams(useLocation().search)
|
||||
const location = useLocation()
|
||||
const currentUrl = location.pathname
|
||||
@@ -25,18 +23,6 @@ const SystemInsidePublic:FC = ()=>{
|
||||
setPageStatus(Number(query.get('status') ||0) as 0|1)
|
||||
}, [currentUrl]);
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigateTo('/service/list')
|
||||
},
|
||||
{
|
||||
title:$t('发布')
|
||||
}
|
||||
])
|
||||
}, []);
|
||||
|
||||
const tabItems = useMemo(()=>SYSTEM_PUBLISH_TAB_ITEMS?.map((x)=>({...x, label:$t(x.label as string) })),[state.language])
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { ActionType, ParamsType } from "@ant-design/pro-components";
|
||||
import { App, Button, Divider } from "antd";
|
||||
import { useState, useRef, useEffect, useMemo, FC } from "react";
|
||||
import { useParams, Link, useLocation, useNavigate } from "react-router-dom";
|
||||
import { useParams, useLocation } from "react-router-dom";
|
||||
import PageList, { PageProColumns } from "@common/components/aoplatform/PageList";
|
||||
import { PublishApprovalModalContent } from "@common/components/aoplatform/PublishApprovalModalContent";
|
||||
import { PUBLISH_APPROVAL_RECORD_INNER_TABLE_COLUMN, PUBLISH_APPROVAL_VERSION_INNER_TABLE_COLUMN, PublishApplyStatusEnum, PublishStatusEnum, PublishTableStatusColorClass } from "@common/const/approval/const";
|
||||
import { BasicResponse, COLUMNS_TITLE, DELETE_TIPS, RESPONSE_TIPS, STATUS_CODE } from "@common/const/const";
|
||||
import { RouterParams, SimpleMemberItem } from "@common/const/type.ts";
|
||||
import { MemberTableListItem } from "../../../const/member/type";
|
||||
import { useBreadcrumb } from "@common/contexts/BreadcrumbContext";
|
||||
import { useFetch } from "@common/hooks/http";
|
||||
import WithPermission from "@common/components/aoplatform/WithPermission";
|
||||
import { SystemPublishReleaseItem } from "../../../const/system/type";
|
||||
@@ -22,7 +21,6 @@ import { DrawerWithFooter } from "@common/components/aoplatform/DrawerWithFooter
|
||||
import { $t } from "@common/locales";
|
||||
|
||||
const SystemInsidePublicList:FC = ()=>{
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const { modal,message } = App.useApp()
|
||||
const pageListRef = useRef<ActionType>(null);
|
||||
const [tableHttpReload, setTableHttpReload] = useState(true);
|
||||
@@ -44,7 +42,6 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
const [drawerData, setDrawerData] = useState<PublishTableListItem|PublishVersionTableListItem >({} as PublishTableListItem)
|
||||
const [drawerOkTitle, setDrawerOkTitle] = useState<string>('确认')
|
||||
const [isOkToPublish, setIsOkToPublish] = useState<boolean>(false)
|
||||
const navigateTo = useNavigate()
|
||||
const getSystemPublishList = (params?: ParamsType & {
|
||||
pageSize?: number | undefined;
|
||||
current?: number | undefined;
|
||||
@@ -350,15 +347,6 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
]
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigateTo('/service/list')
|
||||
},
|
||||
{
|
||||
title:$t('发布')
|
||||
}
|
||||
])
|
||||
getMemberList()
|
||||
manualReloadTable()
|
||||
}, [serviceId]);
|
||||
|
||||
@@ -8,11 +8,10 @@ import EditableTable from "@common/components/aoplatform/EditableTable.tsx";
|
||||
import EditableTableWithModal from "@common/components/aoplatform/EditableTableWithModal.tsx";
|
||||
import WithPermission from "@common/components/aoplatform/WithPermission.tsx";
|
||||
import { UPSTREAM_TYPE_OPTIONS, SYSTEM_UPSTREAM_GLOBAL_CONFIG_TABLE_COLUMNS, schemeOptions, UPSTREAM_BALANCE_OPTIONS, UPSTREAM_PASS_HOST_OPTIONS, PROXY_HEADER_CONFIG, UPSTREAM_PROXY_HEADER_TYPE_OPTIONS } from "../../../const/system/const.tsx";
|
||||
import { Link, useNavigate, useParams } from "react-router-dom";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { RouterParams } from "@core/components/aoplatform/RenderRoutes.tsx";
|
||||
import { BasicResponse, PLACEHOLDER, RESPONSE_TIPS, STATUS_CODE, VALIDATE_MESSAGE } from "@common/const/const.tsx";
|
||||
import { useFetch } from "@common/hooks/http.ts";
|
||||
import { useBreadcrumb } from "@common/contexts/BreadcrumbContext.tsx";
|
||||
import { $t } from "@common/locales/index.ts";
|
||||
import { useGlobalContext } from "@common/contexts/GlobalStateContext.tsx";
|
||||
|
||||
@@ -33,10 +32,8 @@ const SystemInsideUpstreamContent= forwardRef<SystemInsideUpstreamContentHandle>
|
||||
const {fetchData} = useFetch()
|
||||
const [, forceUpdate] = useState<unknown>(null);
|
||||
const [formShowHost, setFormShowHost] = useState<boolean>(false);
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const [form] = Form.useForm();
|
||||
const {state} = useGlobalContext()
|
||||
const navigate = useNavigate()
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
save:()=>formRef.current?.save()
|
||||
@@ -109,16 +106,7 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
setBreadcrumb([
|
||||
{
|
||||
title: $t('服务'),
|
||||
onClick: () => navigate('/service/list')
|
||||
},
|
||||
{
|
||||
title: $t('上游')
|
||||
}])
|
||||
|
||||
getUpstreamInfo();
|
||||
getUpstreamInfo();
|
||||
}, [serviceId]);
|
||||
|
||||
const typeOptions = useMemo(()=>UPSTREAM_TYPE_OPTIONS.map(x=>({...x, label:$t(x.label)})),[state.language])
|
||||
|
||||
Reference in New Issue
Block a user