diff --git a/frontend/packages/common/src/locales/scan/newJson/en-GB.json b/frontend/packages/common/src/locales/scan/newJson/en-GB.json index 2c63c085..f33c6e33 100644 --- a/frontend/packages/common/src/locales/scan/newJson/en-GB.json +++ b/frontend/packages/common/src/locales/scan/newJson/en-GB.json @@ -1,2 +1,3 @@ { + "K4758140d": "路由列表" } diff --git a/frontend/packages/common/src/locales/scan/newJson/zh-CN.json b/frontend/packages/common/src/locales/scan/newJson/zh-CN.json index f3239c9a..f33c6e33 100644 --- a/frontend/packages/common/src/locales/scan/newJson/zh-CN.json +++ b/frontend/packages/common/src/locales/scan/newJson/zh-CN.json @@ -1,5 +1,3 @@ { - "K71753476": "是否放行", - "K597435c5": "监控", - "Kde9d6e8e": "开启拦截后,网关会拦截所有该路径的请求,相当于防火墙禁用了特定路径的访问。" + "K4758140d": "路由列表" } diff --git a/frontend/packages/core/src/pages/system/publish/SystemInsidePublishOnline.tsx b/frontend/packages/core/src/pages/system/publish/SystemInsidePublishOnline.tsx index 20575f44..0287a8b2 100644 --- a/frontend/packages/core/src/pages/system/publish/SystemInsidePublishOnline.tsx +++ b/frontend/packages/core/src/pages/system/publish/SystemInsidePublishOnline.tsx @@ -1,10 +1,13 @@ -import { App, Table } from "antd"; +import { App, Table, Tooltip } from "antd"; import { SYSTEM_PUBLISH_ONLINE_COLUMNS } from "../../../const/system/const"; -import { useEffect, useState } from "react"; +import { useEffect, useMemo, useState } from "react"; import { useFetch } from "@common/hooks/http"; -import { BasicResponse, RESPONSE_TIPS, STATUS_CODE } from "@common/const/const"; +import { BasicResponse, RESPONSE_TIPS, STATUS_CODE, STATUS_COLOR } from "@common/const/const"; import { EntityItem } from "@common/const/type"; +import { LoadingOutlined } from "@ant-design/icons"; +import { $t } from "@common/locales"; +import { useGlobalContext } from "@common/contexts/GlobalStateContext"; type SystemInsidePublishOnlineProps = { serviceId:string @@ -23,6 +26,7 @@ export default function SystemInsidePublishOnline(props:SystemInsidePublishOnlin const [dataSource, setDataSource] = useState<[]>() const {fetchData} = useFetch() const [isStopped, setIsStopped] = useState(false); + const { state } = useGlobalContext() const getOnlineStatus = ()=>{ fetchData>('service/publish/status',{method:'GET',eoParams:{service:serviceId,team:teamId, id}, eoTransformKeys:['publish_status_list']}).then(response=>{ @@ -55,11 +59,28 @@ export default function SystemInsidePublishOnline(props:SystemInsidePublishOnlin }; }, [isStopped]); + + const translatedPublishColumns = useMemo(()=>SYSTEM_PUBLISH_ONLINE_COLUMNS.map((x)=>{ + if(x.dataIndex === 'status'){ + return {...x,title:$t(x.title), + render:(_:unknown,entity:SystemInsidePublishOnlineItems)=>{ + switch(entity.status){ + case 'done': + return {$t('成功')} + case 'error': + return {$t('失败')} {entity.error} + default: + return + } + }} + } + }),[state.language]) + return ( { useEffect(()=>{ if(!service) return setServiceName(service?.name) - setApiDocument(service.apiDoc) + setApiDocument(service?.apiDoc) },[service]) useEffect(() => { @@ -41,7 +41,7 @@ const ServiceHubApiDocument = ({service}:{service:ServiceDetailType})=>{ - { closeIcon={false} > - + */} ) }