mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-14 20:41:15 +08:00
@@ -141,7 +141,7 @@ const themeToken = {
|
||||
setUserInfo(data.profile)
|
||||
dispatch({type:'UPDATE_USERDATA',userData:data.profile})
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -157,10 +157,10 @@ const themeToken = {
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
dispatch({type:'LOGOUT'})
|
||||
resetAccess()
|
||||
// message.success(msg || RESPONSE_TIPS.logoutSuccess)
|
||||
// message.success(msg || $t(RESPONSE_TIPS.logoutSuccess))
|
||||
navigate('/login')
|
||||
}else{
|
||||
message.error(msg ||RESPONSE_TIPS.error)
|
||||
message.error(msg ||$t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { EditableProTable } from "@ant-design/pro-components";
|
||||
import { Button } from "antd";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
import { v4 as uuidv4} from 'uuid';
|
||||
import WithPermission from "./WithPermission";
|
||||
import { PageProColumns } from "./PageList";
|
||||
import { Icon } from "@iconify/react/dist/iconify.js";
|
||||
import TableBtnWithPermission from "./TableBtnWithPermission";
|
||||
import { $t } from "@common/locales";
|
||||
import { useGlobalContext } from "@common/contexts/GlobalStateContext";
|
||||
|
||||
interface EditableTableProps<T> {
|
||||
configFields: PageProColumns<T>[];
|
||||
@@ -26,10 +25,8 @@ const EditableTable = <T extends { _id: string }>({
|
||||
className,
|
||||
extendsId,
|
||||
}: EditableTableProps<T>) => {
|
||||
// const [form] = Form.useForm<FormInstance>();
|
||||
// const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
const [configurations, setConfigurations] = useState<(T | {_id:string})[]>(value ||[{_id:'1234'}]);
|
||||
// const [editingConfig, setEditingConfig] = useState<T | null>(null);
|
||||
const {state} = useGlobalContext()
|
||||
|
||||
const [editableKeys, setEditableRowKeys] = useState<React.Key[]>(() =>
|
||||
value?.map((item) => item._id) || ['1234']
|
||||
@@ -43,10 +40,12 @@ const EditableTable = <T extends { _id: string }>({
|
||||
return value
|
||||
}
|
||||
|
||||
const translatedColumns = useMemo(()=>configFields.map((x)=>({...x, title:$t(x.title as string)})),[state.language,configFields])
|
||||
|
||||
return (
|
||||
<EditableProTable<T>
|
||||
className={className}
|
||||
columns={configFields}
|
||||
columns={translatedColumns}
|
||||
rowKey="_id"
|
||||
value={configurations as T[]}
|
||||
size="small"
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
import {useEffect, useState} from 'react';
|
||||
import {useEffect, useMemo, useState} from 'react';
|
||||
import { Button, Modal, Form, Table, FormInstance, TableProps, Divider } from 'antd';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { ColumnsType } from 'antd/es/table';
|
||||
import WithPermission from './WithPermission';
|
||||
import { $t } from '@common/locales';
|
||||
import { COLUMNS_TITLE, VALIDATE_MESSAGE } from '@common/const/const';
|
||||
import { useGlobalContext } from '@common/contexts/GlobalStateContext';
|
||||
import TableBtnWithPermission from './TableBtnWithPermission';
|
||||
|
||||
export interface ConfigField<T> {
|
||||
title: string;
|
||||
key: keyof T;
|
||||
component: React.ReactNode;
|
||||
renderText?: (value: unknown, record: T) => React.ReactNode;
|
||||
renderText?: (value: unknown, record: T) => string;
|
||||
required?: boolean;
|
||||
ellipsis?:boolean
|
||||
}
|
||||
@@ -36,6 +38,7 @@ const EditableTableWithModal = <T extends { _id?: string }>({
|
||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
const [configurations, setConfigurations] = useState<T[]>(value ||[]);
|
||||
const [editingConfig, setEditingConfig] = useState<T | null>(null);
|
||||
const {state} = useGlobalContext()
|
||||
|
||||
const showModal = (config?: T) => {
|
||||
if (config) {
|
||||
@@ -83,35 +86,37 @@ const EditableTableWithModal = <T extends { _id?: string }>({
|
||||
setConfigurations(value?.map((x)=>x._id ? x : {...x,_id:uuidv4()}) || []);
|
||||
}, [value]);
|
||||
|
||||
const columns: ColumnsType<T> = configFields.map(({ title, key, renderText }) => ({
|
||||
title,
|
||||
dataIndex: key as string,
|
||||
key: key as string,
|
||||
render: renderText ? (value, record) => renderText(value, record) : undefined,
|
||||
ellipsis:true
|
||||
}));
|
||||
const columns = useMemo(()=>[
|
||||
...configFields.map(({ title, key, renderText }) => ({
|
||||
title:$t(title),
|
||||
dataIndex: key as string,
|
||||
key: key as string,
|
||||
render: renderText ? (value, record) => $t(renderText(value, record)) : undefined,
|
||||
ellipsis:true
|
||||
})),
|
||||
...(disabled ? []:[{
|
||||
title: COLUMNS_TITLE.operate,
|
||||
key: 'action',
|
||||
btnNums:2,
|
||||
render: (_: unknown, record: T) => (
|
||||
<>
|
||||
<div className="flex items-center">
|
||||
<TableBtnWithPermission key="add" disabled={disabled} btnType="edit" onClick={()=>{showModal(record)}} btnTitle='编辑'/>
|
||||
<Divider key="div1" type="vertical" />
|
||||
<TableBtnWithPermission key="delete" disabled={disabled} btnType="delete" onClick={()=>{handleDelete(record._id || '')}} btnTitle='删除'/>
|
||||
</div>
|
||||
</>
|
||||
),
|
||||
}] )
|
||||
],[state.language, disabled, configFields])
|
||||
|
||||
!disabled && columns.push({
|
||||
title: COLUMNS_TITLE.operate,
|
||||
key: 'action',
|
||||
btnNums:2,
|
||||
render: (_: unknown, record: T) => (
|
||||
<>
|
||||
<div className="flex items-center">
|
||||
<Button key="edit" disabled={disabled} onClick={()=>{showModal(record)}} className={`h-[22px] border-none p-0 flex items-center bg-transparent`}>编辑</Button>
|
||||
<Divider key="div1" type="vertical" />
|
||||
<Button key="delete" disabled={disabled} onClick={()=>{handleDelete(record._id || '')}} className={`h-[22px] border-none p-0 flex items-center bg-transparent`} >删除</Button>
|
||||
</div>
|
||||
</>
|
||||
),
|
||||
});
|
||||
|
||||
const formItems = configFields.map(({ title,key, component, required }) => {
|
||||
return (
|
||||
<Form.Item
|
||||
label={title as string}
|
||||
label={$t(title as string)}
|
||||
name={key as string}
|
||||
rules={[{ required, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{ required}]}
|
||||
>
|
||||
{component}
|
||||
</Form.Item>
|
||||
|
||||
+56
-21
@@ -1,12 +1,13 @@
|
||||
import {App, Col, Form, Input, Row, Table} from "antd";
|
||||
import {forwardRef, useEffect, useImperativeHandle} from "react";
|
||||
import {App, Col, Form, Input, Row, Table, Tooltip} from "antd";
|
||||
import {forwardRef, useEffect, useImperativeHandle, useMemo} from "react";
|
||||
import {PublishApprovalInfoType, PublishApprovalModalHandle, PublishApprovalModalProps, PublishVersionTableListItem} from "@common/const/approval/type.tsx";
|
||||
import {useFetch} from "@common/hooks/http.ts";
|
||||
import {BasicResponse, FORM_ERROR_TIPS, PLACEHOLDER, RESPONSE_TIPS, STATUS_CODE, VALIDATE_MESSAGE} from "@common/const/const.tsx";
|
||||
import WithPermission from "@common/components/aoplatform/WithPermission.tsx";
|
||||
import { SYSTEM_PUBLISH_ONLINE_COLUMNS } from "@core/const/system/const.tsx";
|
||||
import { $t } from "@common/locales";
|
||||
import { ApprovalApiColumns, ApprovalUpstreamColumns } from "@common/const/approval/const";
|
||||
import { ApprovalApiColumns, ApprovalStatusColorClass, ApprovalUpstreamColumns, ChangeTypeEnum } from "@common/const/approval/const";
|
||||
import { useGlobalContext } from "@common/contexts/GlobalStateContext";
|
||||
|
||||
|
||||
export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle,PublishApprovalModalProps>((props, ref) => {
|
||||
@@ -14,6 +15,7 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
|
||||
const { type,data,insideSystem = false,serviceId, teamId} = props
|
||||
const [form] = Form.useForm();
|
||||
const {fetchData} = useFetch()
|
||||
const {state} = useGlobalContext()
|
||||
|
||||
const save:(operate:'pass'|'refuse')=>Promise<boolean | string> = (operate)=>{
|
||||
if(type === 'view'){
|
||||
@@ -22,19 +24,19 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
|
||||
return form.validateFields().then((value)=>{
|
||||
if(operate === 'refuse' && form.getFieldValue('opinion') === '' ){
|
||||
form.setFields([{
|
||||
name:'opinion',errors:[FORM_ERROR_TIPS.refuseOpinion]
|
||||
name:'opinion',errors:[$t(FORM_ERROR_TIPS.refuseOpinion)]
|
||||
}])
|
||||
form.scrollToField('opinion')
|
||||
return Promise.reject(RESPONSE_TIPS.refuseOpinion)
|
||||
return Promise.reject($t(RESPONSE_TIPS.refuseOpinion))
|
||||
}
|
||||
return fetchData<BasicResponse<null>>(`service/publish/${operate === 'pass' ? 'accept' : 'refuse'}`,{method: 'PUT',eoBody:({comments:value.opinion}), eoParams:{id:data!.id, project:serviceId},eoTransformKeys:['versionRemark']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
return Promise.resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
return Promise.reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return Promise.reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> Promise.reject(errorInfo))
|
||||
}).catch((err)=> {form.scrollToField(err.errorFields[0].name[0]); return Promise.reject(err)})
|
||||
@@ -48,11 +50,11 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
|
||||
notSave ? 'service/publish/apply' : 'service/publish/release/do',{method: 'POST',eoBody:body, eoParams:{service:serviceId, team:teamId},eoTransformKeys:['versionRemark']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(response)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -65,11 +67,11 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
|
||||
fetchData<BasicResponse<null>>('service/publish/execute',{method: 'PUT', eoParams:{project:serviceId,id:(data as PublishVersionTableListItem).flowId},eoTransformKeys:['versionRemark']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -87,6 +89,39 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
|
||||
form.setFieldsValue({ opinion:'',...data})
|
||||
},[])
|
||||
|
||||
const translatedUpstreamColumns = useMemo(()=>ApprovalUpstreamColumns.map((x)=>({
|
||||
...x,
|
||||
...(x.dataIndex === 'type' ? {valueEnum:{
|
||||
'static':{
|
||||
text:$t('静态上游')
|
||||
}
|
||||
}}:{}),
|
||||
...(x.dataIndex === 'change' ? {
|
||||
render:(_,entity)=>(
|
||||
<Tooltip placement="top" title={entity.change === 'error' ? $t('该 API 缺失(0)(1)(2)请先补充',[entity.proxyStatus == 1 && $t('转发信息,'),entity.docStatus == 1 && $t('文档信息,'),entity.upstreamStatus == 1 && $t('上游信息,')]):''}>
|
||||
<span className={`${ApprovalStatusColorClass[entity.change as keyof typeof ApprovalStatusColorClass]} truncate block`}>{$t(ChangeTypeEnum[entity.change as (keyof typeof ChangeTypeEnum)] || '-')}
|
||||
{entity.change === 'error' ?$t('该 API 缺失(0)(1)(2)请先补充',[entity.proxyStatus == 1 && $t('转发信息,'),entity.docStatus == 1 && $t('文档信息,'),entity.upstreamStatus == 1 && $t('上游信息,')]):''}</span>
|
||||
</Tooltip>)
|
||||
}:{}),
|
||||
title: typeof x.title === 'string' ? $t(x.title) : x.title,
|
||||
})),[state.language])
|
||||
|
||||
|
||||
const translatedApiColumns = useMemo(()=>ApprovalApiColumns.map((x)=>({
|
||||
...x,
|
||||
...(x.dataIndex === 'change' ? {
|
||||
render:(_,entity)=>(
|
||||
<Tooltip placement="top" title={entity.change === 'error' ?$t('该 API 缺失(0)(1)(2)请先补充',[entity.proxyStatus == 1 && $t('转发信息,'),entity.docStatus == 1 && $t('文档信息,'),entity.upstreamStatus == 1 && $t('上游信息,')]):''}>
|
||||
<span className={`${ApprovalStatusColorClass[entity.change as keyof typeof ApprovalStatusColorClass]} truncate block`}>
|
||||
{$t(ChangeTypeEnum[entity.change as (keyof typeof ChangeTypeEnum)] || '-')}
|
||||
{entity.change === 'error' ?$t('该 API 缺失(0)(1)(2)请先补充',[entity.proxyStatus == 1 && $t('转发信息,'),entity.docStatus == 1 && $t('文档信息,'),entity.upstreamStatus == 1 && $t('上游信息,')]):''}
|
||||
</span>
|
||||
</Tooltip>)
|
||||
}:{}
|
||||
),
|
||||
title: typeof x.title === 'string' ? $t(x.title) : x.title,
|
||||
})),[state.language])
|
||||
|
||||
return (
|
||||
<>
|
||||
{!insideSystem && <>
|
||||
@@ -129,23 +164,23 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
|
||||
<Form.Item
|
||||
label={$t("版本号")}
|
||||
name="version"
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" disabled={type !== 'add'} placeholder={PLACEHOLDER.input} />
|
||||
<Input className="w-INPUT_NORMAL" disabled={type !== 'add'} placeholder={$t(PLACEHOLDER.input)} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={$t("版本说明")}
|
||||
name="versionRemark"
|
||||
>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" disabled={type !== 'add' && type !== 'publish'} placeholder={PLACEHOLDER.input} />
|
||||
<Input.TextArea className="w-INPUT_NORMAL" disabled={type !== 'add' && type !== 'publish'} placeholder={$t(PLACEHOLDER.input)} />
|
||||
</Form.Item>
|
||||
</>
|
||||
}
|
||||
<Row className="mt-mbase pb-[8px] h-[32px] font-bold" ><span >{$t('API 列表')}:</span></Row>
|
||||
<Row className="mb-mbase ">
|
||||
<Table
|
||||
columns={ApprovalApiColumns}
|
||||
columns={translatedApiColumns}
|
||||
bordered={true}
|
||||
rowKey="id"
|
||||
size="small"
|
||||
@@ -156,7 +191,7 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
|
||||
<Row className="mb-mbase ">
|
||||
<Table
|
||||
bordered={true}
|
||||
columns={ApprovalUpstreamColumns}
|
||||
columns={translatedUpstreamColumns}
|
||||
size="small"
|
||||
rowKey="id"
|
||||
dataSource={data.diffs?.upstreams || []}
|
||||
@@ -166,7 +201,7 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
|
||||
label={$t("备注")}
|
||||
name="remark"
|
||||
>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" disabled={type !== 'add' && type !== 'publish'} placeholder={PLACEHOLDER.input} />
|
||||
<Input.TextArea className="w-INPUT_NORMAL" disabled={type !== 'add' && type !== 'publish'} placeholder={$t(PLACEHOLDER.input)} />
|
||||
</Form.Item>
|
||||
{/*
|
||||
{type !== 'add' && type !== 'publish' && <Form.Item
|
||||
@@ -174,7 +209,7 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
|
||||
name="opinion"
|
||||
extra="选择拒绝时,审批意见为必填"
|
||||
>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input} onChange={()=>{ form.setFields([
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)} onChange={()=>{ form.setFields([
|
||||
{
|
||||
name: 'opinion',
|
||||
errors: [], // 设置为空数组来移除错误信息
|
||||
|
||||
+7
-7
@@ -39,20 +39,20 @@ export const SubscribeApprovalModalContent = forwardRef<SubscribeApprovalModalHa
|
||||
form.validateFields().then((value)=>{
|
||||
if(operate === 'refuse' && form.getFieldValue('opinion') === ''){
|
||||
form.setFields([{
|
||||
name:'opinion',errors:[FORM_ERROR_TIPS.refuseOpinion]
|
||||
name:'opinion',errors:[$t(FORM_ERROR_TIPS.refuseOpinion)]
|
||||
}])
|
||||
form.scrollToField('opinion')
|
||||
reject(RESPONSE_TIPS.refuseOpinion)
|
||||
reject($t(RESPONSE_TIPS.refuseOpinion))
|
||||
return
|
||||
}
|
||||
fetchData<BasicResponse<null>>(`${inSystem?'service/':''}approval/subscribe`,{method: 'POST',eoBody:({opinion:value.opinion,operate}), eoParams:(inSystem ? {apply:data!.id, team:teamId} : {id:data!.id,team:teamId})}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -99,9 +99,9 @@ export const SubscribeApprovalModalContent = forwardRef<SubscribeApprovalModalHa
|
||||
<Form.Item<FieldType>
|
||||
label={$t("审核意见")}
|
||||
name="opinion"
|
||||
extra={FORM_ERROR_TIPS.refuseOpinion}
|
||||
extra={$t(FORM_ERROR_TIPS.refuseOpinion)}
|
||||
>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input} onChange={()=>{ form.setFields([
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)} onChange={()=>{ form.setFields([
|
||||
{
|
||||
name: 'opinion',
|
||||
errors: [], // 设置为空数组来移除错误信息
|
||||
|
||||
+8
-8
@@ -167,7 +167,7 @@ export const IntelligentPluginConfig = forwardRef<IntelligentPluginConfigHandle
|
||||
},
|
||||
'x-component': 'Input',
|
||||
'x-component-props': {
|
||||
placeholder: PLACEHOLDER.specialStartWithAlphabet,
|
||||
placeholder: $t(PLACEHOLDER.specialStartWithAlphabet),
|
||||
},
|
||||
'x-disabled': type === 'edit'
|
||||
},
|
||||
@@ -183,7 +183,7 @@ export const IntelligentPluginConfig = forwardRef<IntelligentPluginConfigHandle
|
||||
},
|
||||
'x-component': 'Input',
|
||||
'x-component-props': {
|
||||
placeholder: PLACEHOLDER.input,
|
||||
placeholder: $t(PLACEHOLDER.input),
|
||||
}
|
||||
},
|
||||
driver: {
|
||||
@@ -214,7 +214,7 @@ export const IntelligentPluginConfig = forwardRef<IntelligentPluginConfigHandle
|
||||
},
|
||||
'x-component': 'Input.TextArea',
|
||||
'x-component-props': {
|
||||
placeholder: PLACEHOLDER.input,
|
||||
placeholder: $t(PLACEHOLDER.input),
|
||||
}
|
||||
},
|
||||
config: {
|
||||
@@ -236,11 +236,11 @@ export const IntelligentPluginConfig = forwardRef<IntelligentPluginConfigHandle
|
||||
fetchData<BasicResponse<null>>(type === 'add'?`dynamic/${moduleId}`:`dynamic/${moduleId}/config`,{method:type === 'add'? 'POST' : 'PUT',eoBody:form.values, eoParams:{...(type !== 'add' && {id:initFormValue.id})}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo:unknown)=> reject(errorInfo))
|
||||
@@ -260,8 +260,8 @@ export const IntelligentPluginConfig = forwardRef<IntelligentPluginConfigHandle
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
resolve(data[skill]?.map((x:{name:string,title:string})=>{return{label:x.title, value:x.name}}) || [])
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
+10
-10
@@ -183,7 +183,7 @@ export default function IntelligentPluginList(){
|
||||
setRenderSchema(resp.data.render)
|
||||
return Promise.resolve(resp.data.render)
|
||||
}
|
||||
return Promise.reject(resp.msg || RESPONSE_TIPS.error)
|
||||
return Promise.reject(resp.msg || $t(RESPONSE_TIPS.error))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -218,11 +218,11 @@ export default function IntelligentPluginList(){
|
||||
fetchData<BasicResponse<null>>(`dynamic/${moduleId}/batch`,{method:'DELETE',eoParams:{ids:JSON.stringify([entity!.id])}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -244,7 +244,7 @@ export default function IntelligentPluginList(){
|
||||
}
|
||||
setCurDetail(data.info)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).finally(()=>setDrawerLoading(false))
|
||||
break;
|
||||
@@ -259,25 +259,25 @@ export default function IntelligentPluginList(){
|
||||
let content:string|React.ReactNode = ''
|
||||
switch (type){
|
||||
case 'publish':{
|
||||
message.loading(RESPONSE_TIPS.operating)
|
||||
message.loading($t(RESPONSE_TIPS.operating))
|
||||
await fetchData<BasicResponse<DynamicPublish>>(`dynamic/${moduleId}/${entity!.status === $t('已发布') ? 'offline':'online'}`, {
|
||||
method: 'PUT',
|
||||
eoParams:{id:entity!.id},
|
||||
}).then(response => {
|
||||
const {code, msg} = response
|
||||
if (code === STATUS_CODE.SUCCESS) {
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
return Promise.resolve(true)
|
||||
} else {
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
return Promise.reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return Promise.reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> Promise.reject(errorInfo))
|
||||
message.destroy()
|
||||
return;}
|
||||
case 'delete':
|
||||
title='删除'
|
||||
content=<span>{DELETE_TIPS.default}</span>
|
||||
content=<span>{$t(DELETE_TIPS.default)}</span>
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import { Cascader } from 'antd';
|
||||
import CODE_LANG from '@common/const/code/const';
|
||||
import type { DefaultOptionType } from 'antd/es/cascader';
|
||||
@@ -13,6 +13,7 @@ import {Codebox} from "@common/components/postcat//api/Codebox";
|
||||
import {Collapse} from "@common/components/postcat/api/Collapse";
|
||||
import {Box} from "@mui/material";
|
||||
import { $t } from '@common/locales';
|
||||
import { useGlobalContext } from '@common/contexts/GlobalStateContext';
|
||||
|
||||
type CodeSnippetCompoType = {
|
||||
title:string
|
||||
@@ -36,6 +37,7 @@ type CodeSnippetCompoType = {
|
||||
let isMultipart: boolean = false
|
||||
|
||||
export default function CodeSnippetCompo({title,api, extraTitle, extraContent, minLines=15}: CodeSnippetCompoType) {
|
||||
const {state } = useGlobalContext()
|
||||
// const [tokenState ] = useTokenBasicInfo()
|
||||
const pretreatmentRequestInfo = (apiDoc: ApiDetail) =>{
|
||||
isMultipart = false
|
||||
@@ -190,13 +192,14 @@ type CodeSnippetCompoType = {
|
||||
const [placeholderTxt, setPlaceholderTxt] = useState($t('搜索编程语言...'))
|
||||
const [selectItemTxt, setSelectItemTxt ] = useState('')
|
||||
|
||||
const codeLangOptions = useMemo(()=>CODE_LANG.map(x=>({...x, label:$t(x.label as string)})),[state.language])
|
||||
return (
|
||||
|
||||
<Collapse title={title}>
|
||||
<Box width="100%">
|
||||
<>
|
||||
<Codebox extraContent={<><span className="ml-[12px]">{$t('编程语言')}:</span><Cascader
|
||||
options={CODE_LANG}
|
||||
options={codeLangOptions}
|
||||
onChange={(value,record) => onChange(value as unknown as number[],record)}
|
||||
placeholder={placeholderTxt}
|
||||
value={lang} // 当前的值
|
||||
|
||||
@@ -202,7 +202,7 @@ export default function ApiEdit({apiInfo,editorRef,loaded,serviceId, teamId}:{ap
|
||||
getData:()=>description
|
||||
}))
|
||||
return (
|
||||
<Input.TextArea className="w-full border-none" value={description} onChange={(e)=>setDescription(e.target.value)} placeholder={PLACEHOLDER.input}/>
|
||||
<Input.TextArea className="w-full border-none" value={description} onChange={(e)=>setDescription(e.target.value)} placeholder={$t(PLACEHOLDER.input)}/>
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ export const Codebox = memo((props: CodeboxProps) => {
|
||||
const copyCode = async (): Promise<void> => {
|
||||
if (editorRef.current) {
|
||||
await navigator.clipboard.writeText(editorRef.current.getValue())
|
||||
message.success(RESPONSE_TIPS.copySuccess)
|
||||
message.success($t(RESPONSE_TIPS.copySuccess))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import { ApprovalTableListItem, PublishTableListItem } from "./type";
|
||||
import { Tooltip } from "antd";
|
||||
import { $t } from "@common/locales";
|
||||
import { PageProColumns } from "@common/components/aoplatform/PageList";
|
||||
|
||||
|
||||
export const TODO_LIST_COLUMN_NOT_INCLUDE_KEY:string[] = ['status','approver','approvalTime']
|
||||
|
||||
export const SUBSCRIBE_APPROVAL_TABLE_COLUMN : PageProColumns<ApprovalTableListItem>[] = [
|
||||
{
|
||||
title:$t('申请时间'),
|
||||
title:('申请时间'),
|
||||
dataIndex: 'applyTime',
|
||||
ellipsis:true,
|
||||
width:182,
|
||||
@@ -18,44 +15,44 @@ export const SUBSCRIBE_APPROVAL_TABLE_COLUMN : PageProColumns<ApprovalTableListI
|
||||
},
|
||||
},
|
||||
{
|
||||
title:$t('申请方-应用'),
|
||||
title:('申请方-应用'),
|
||||
dataIndex: ['application','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('申请服务'),
|
||||
title:('申请服务'),
|
||||
dataIndex: ['service','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('服务所属系统'),
|
||||
title:('服务所属系统'),
|
||||
dataIndex: ['service','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('服务所属团队'),
|
||||
title:('服务所属团队'),
|
||||
dataIndex: ['team','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('审批状态'),
|
||||
title:('审批状态'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'text',
|
||||
},
|
||||
{
|
||||
title:$t('申请人'),
|
||||
title:('申请人'),
|
||||
dataIndex: ['applier','name'],
|
||||
ellipsis: true,
|
||||
width:88,
|
||||
},
|
||||
{
|
||||
title:$t('审批人'),
|
||||
title:('审批人'),
|
||||
dataIndex: ['approver','name'],
|
||||
ellipsis: true,
|
||||
width:88
|
||||
},
|
||||
{
|
||||
title:$t('审批时间'),
|
||||
title:('审批时间'),
|
||||
dataIndex: 'approvalTime',
|
||||
ellipsis: true,
|
||||
// sorter: true,,
|
||||
@@ -68,7 +65,7 @@ export const SUBSCRIBE_APPROVAL_TABLE_COLUMN : PageProColumns<ApprovalTableListI
|
||||
|
||||
export const SUBSCRIBE_APPROVAL_INNER_TODO_TABLE_COLUMN : PageProColumns<SubscribeApprovalTableListItem>[] = [
|
||||
{
|
||||
title:$t('申请时间'),
|
||||
title:('申请时间'),
|
||||
dataIndex: 'applyTime',
|
||||
// sorter: true,
|
||||
ellipsis:true,
|
||||
@@ -79,13 +76,13 @@ export const SUBSCRIBE_APPROVAL_INNER_TODO_TABLE_COLUMN : PageProColumns<Subscri
|
||||
},
|
||||
},
|
||||
{
|
||||
title:$t('申请方-应用'),
|
||||
title:('申请方-应用'),
|
||||
dataIndex: ['application','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
// title:$t('申请人',
|
||||
title: <Tooltip title={$t("申请人")} >{$t('申请人')}</Tooltip>,
|
||||
// title:('申请人',
|
||||
title: ('申请人'),
|
||||
dataIndex: ['applier','name'],
|
||||
ellipsis: true,
|
||||
filters: true,
|
||||
@@ -94,7 +91,7 @@ export const SUBSCRIBE_APPROVAL_INNER_TODO_TABLE_COLUMN : PageProColumns<Subscri
|
||||
filterSearch: true
|
||||
},
|
||||
{
|
||||
title:$t('申请服务'),
|
||||
title:('申请服务'),
|
||||
dataIndex: ['service','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
@@ -103,7 +100,7 @@ export const SUBSCRIBE_APPROVAL_INNER_TODO_TABLE_COLUMN : PageProColumns<Subscri
|
||||
|
||||
export const SUBSCRIBE_APPROVAL_INNER_DONE_TABLE_COLUMN : PageProColumns<SubscribeApprovalTableListItem>[] = [
|
||||
{
|
||||
title:$t('申请时间'),
|
||||
title:('申请时间'),
|
||||
dataIndex: 'applyTime',
|
||||
// sorter: true,
|
||||
ellipsis:true,
|
||||
@@ -114,13 +111,13 @@ export const SUBSCRIBE_APPROVAL_INNER_DONE_TABLE_COLUMN : PageProColumns<Subscri
|
||||
},
|
||||
},
|
||||
{
|
||||
title:$t('申请方-应用'),
|
||||
title:('申请方-应用'),
|
||||
dataIndex: ['application','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
// title:$t('申请人',
|
||||
title: <Tooltip title={$t("申请人")} >{$t('申请人')}</Tooltip>,
|
||||
// title:('申请人',
|
||||
title: ('申请人'),
|
||||
dataIndex: ['applier','name'],
|
||||
ellipsis: true,
|
||||
filters: true,
|
||||
@@ -129,24 +126,20 @@ export const SUBSCRIBE_APPROVAL_INNER_DONE_TABLE_COLUMN : PageProColumns<Subscri
|
||||
filterSearch: true,
|
||||
},
|
||||
{
|
||||
title:$t('申请服务'),
|
||||
title:('申请服务'),
|
||||
dataIndex: ['service','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('审批状态'),
|
||||
title:('审批状态'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'select',
|
||||
ellipsis: true,
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueEnum: new Map([
|
||||
[0, <span className="text-status_fail">{$t('拒绝')}</span>],
|
||||
[2,<span className="text-status_success">{$t('通过')}</span>],
|
||||
]),
|
||||
},
|
||||
{
|
||||
title:$t('审批人'),
|
||||
title:('审批人'),
|
||||
dataIndex: ['approver','name'],
|
||||
ellipsis: true,
|
||||
width:88,
|
||||
@@ -156,7 +149,7 @@ export const SUBSCRIBE_APPROVAL_INNER_DONE_TABLE_COLUMN : PageProColumns<Subscri
|
||||
filterSearch: true,
|
||||
},
|
||||
{
|
||||
title:$t('审批时间'),
|
||||
title:('审批时间'),
|
||||
dataIndex: 'approvalTime',
|
||||
ellipsis: true,
|
||||
// sorter: true,,
|
||||
@@ -181,16 +174,16 @@ export type SubscribeApprovalTableListItem = {
|
||||
|
||||
|
||||
export const PublishApplyStatusEnum = {
|
||||
'accept': $t("审批完成"),
|
||||
'apply': $t("发布审批中"),
|
||||
'running': $t("在线"),
|
||||
'none': $t("-"),
|
||||
'refuse': $t("已拒绝"),
|
||||
'accept': ("审批完成"),
|
||||
'apply': ("发布审批中"),
|
||||
'running': ("在线"),
|
||||
'none': ("-"),
|
||||
'refuse': ("已拒绝"),
|
||||
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
||||
'close' : $t('-'),
|
||||
'stop' : $t('中止'),
|
||||
'error' : $t('发布异常'),
|
||||
'publishing' : $t('发布中')
|
||||
'close' : ('-'),
|
||||
'stop' : ('中止'),
|
||||
'error' : ('发布异常'),
|
||||
'publishing' : ('发布中')
|
||||
}
|
||||
|
||||
|
||||
@@ -221,88 +214,71 @@ export const ApprovalStatusColorClass = {
|
||||
|
||||
export const ApprovalApiColumns = [
|
||||
{
|
||||
title:$t('API 名称'),
|
||||
title:('API 名称'),
|
||||
dataIndex:'name',
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('请求方式'),
|
||||
title:('请求方式'),
|
||||
dataIndex:'method',
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('路径'),
|
||||
title:('路径'),
|
||||
dataIndex:'path',
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('类型'),
|
||||
title:('类型'),
|
||||
dataIndex:'change',
|
||||
render:(_,entity)=>(
|
||||
<Tooltip placement="top" title={entity.change === 'error' ?$t('该 API 缺失(0)(1)(2)请先补充',[entity.proxyStatus == 1 && $t('转发信息,'),entity.docStatus == 1 && $t('文档信息,'),entity.upstreamStatus == 1 && $t('上游信息,')]):''}>
|
||||
<span className={`${ApprovalStatusColorClass[entity.change as keyof typeof ApprovalStatusColorClass]} truncate block`}>
|
||||
{ChangeTypeEnum[entity.change as (keyof typeof ChangeTypeEnum)] || '-'}
|
||||
{entity.change === 'error' ?$t('该 API 缺失(0)(1)(2)请先补充',[entity.proxyStatus == 1 && $t('转发信息,'),entity.docStatus == 1 && $t('文档信息,'),entity.upstreamStatus == 1 && $t('上游信息,')]):''}
|
||||
</span>
|
||||
</Tooltip>)
|
||||
|
||||
}
|
||||
]
|
||||
|
||||
export const ApprovalUpstreamColumns = [
|
||||
{
|
||||
title:$t('上游类型'),
|
||||
title:('上游类型'),
|
||||
dataIndex:'type',
|
||||
ellipsis:true,
|
||||
valueEnum:{
|
||||
'static':{
|
||||
text:$t('静态上游')
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title:$t('地址'),
|
||||
title:('地址'),
|
||||
dataIndex:'addr',
|
||||
render:(text:string[])=>(<>{text.join(',')}</>),
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('类型'),
|
||||
dataIndex:'change',
|
||||
render:(_,entity)=>(
|
||||
<Tooltip placement="top" title={entity.change === 'error' ? $t('该 API 缺失(0)(1)(2)请先补充',[entity.proxyStatus == 1 && $t('转发信息,'),entity.docStatus == 1 && $t('文档信息,'),entity.upstreamStatus == 1 && $t('上游信息,')]):''}>
|
||||
<span className={`${ApprovalStatusColorClass[entity.change as keyof typeof ApprovalStatusColorClass]} truncate block`}>{ChangeTypeEnum[entity.change as (keyof typeof ChangeTypeEnum)] || '-'}
|
||||
{entity.change === 'error' ?$t('该 API 缺失(0)(1)(2)请先补充',[entity.proxyStatus == 1 && $t('转发信息,'),entity.docStatus == 1 && $t('文档信息,'),entity.upstreamStatus == 1 && $t('上游信息,')]):''}</span>
|
||||
</Tooltip>)
|
||||
title:('类型'),
|
||||
dataIndex:'change'
|
||||
}
|
||||
]
|
||||
|
||||
const PublishStatusEnum = {
|
||||
'apply': $t('待审批'),
|
||||
'accept' : $t('审批通过'),
|
||||
'done' : $t('已发布'),
|
||||
'stop': $t('发布终止'),
|
||||
'close': $t('已关闭'),
|
||||
'refuse' : $t('已拒绝'),
|
||||
'error' : $t('发布异常'),
|
||||
'publishing' : $t('发布中')
|
||||
export const PublishStatusEnum = {
|
||||
'apply': ('待审批'),
|
||||
'accept' : ('审批通过'),
|
||||
'done' : ('已发布'),
|
||||
'stop': ('发布终止'),
|
||||
'close': ('已关闭'),
|
||||
'refuse' : ('已拒绝'),
|
||||
'error' : ('发布异常'),
|
||||
'publishing' : ('发布中')
|
||||
}
|
||||
|
||||
export const PUBLISH_APPROVAL_VERSION_INNER_TABLE_COLUMN : PageProColumns<PublishTableListItem>[] = [
|
||||
{
|
||||
title:$t('发布版本'),
|
||||
title:('发布版本'),
|
||||
dataIndex: 'version',
|
||||
ellipsis:true,
|
||||
width:160,
|
||||
fixed:'left'
|
||||
},
|
||||
{
|
||||
title:$t('版本说明'),
|
||||
title:('版本说明'),
|
||||
dataIndex: 'remark',
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('创建版本时间'),
|
||||
title:('创建版本时间'),
|
||||
dataIndex: 'createTime',
|
||||
ellipsis:true,
|
||||
sorter: (a,b)=> {
|
||||
@@ -310,24 +286,15 @@ export const PUBLISH_APPROVAL_VERSION_INNER_TABLE_COLUMN : PageProColumns<Publis
|
||||
},
|
||||
},
|
||||
{
|
||||
title:$t('版本状态'),
|
||||
title:('版本状态'),
|
||||
dataIndex: 'status',
|
||||
ellipsis:true,
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueType: 'select',
|
||||
valueEnum:new Map([
|
||||
['accept',<span className={PublishTableStatusColorClass.accept}>{PublishApplyStatusEnum.accept || '-'}</span>],
|
||||
['apply',<span className={PublishTableStatusColorClass.apply}>{PublishApplyStatusEnum.apply || '-'}</span>],
|
||||
['running',<span className={PublishTableStatusColorClass.running}>{PublishApplyStatusEnum.running || '-'}</span>],
|
||||
['none',<span className={PublishTableStatusColorClass.none}>{PublishApplyStatusEnum.none || '-'}</span>],
|
||||
['refuse',<span className={PublishTableStatusColorClass.refuse}>{PublishApplyStatusEnum.refuse || '-'}</span>],
|
||||
['publishing',<span className={PublishTableStatusColorClass.publishing}>{PublishApplyStatusEnum.publishing || '-'}</span>],
|
||||
['error',<span className={PublishTableStatusColorClass.error}>{PublishApplyStatusEnum.error || '-'}</span>],
|
||||
])
|
||||
valueType: 'select'
|
||||
},
|
||||
{
|
||||
title:$t('创建人'),
|
||||
title:('创建人'),
|
||||
dataIndex: ['creator','name'],
|
||||
ellipsis: true,
|
||||
width:88,
|
||||
@@ -340,50 +307,40 @@ export const PUBLISH_APPROVAL_VERSION_INNER_TABLE_COLUMN : PageProColumns<Publis
|
||||
|
||||
export const PUBLISH_APPROVAL_RECORD_INNER_TABLE_COLUMN : PageProColumns<PublishTableListItem>[] = [
|
||||
{
|
||||
title:$t('申请时间'),
|
||||
title:('申请时间'),
|
||||
dataIndex: 'applyTime',
|
||||
ellipsis:true,
|
||||
width:182,
|
||||
fixed:'left',
|
||||
},
|
||||
{
|
||||
title:$t('审核时间'),
|
||||
title:('审核时间'),
|
||||
dataIndex: 'approveTime',
|
||||
ellipsis:true,
|
||||
width:182,
|
||||
},
|
||||
{
|
||||
title:$t('版本号'),
|
||||
title:('版本号'),
|
||||
dataIndex: 'version',
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('版本说明'),
|
||||
title:('版本说明'),
|
||||
dataIndex: 'remark',
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('发布状态'),
|
||||
title:('发布状态'),
|
||||
dataIndex: 'status',
|
||||
ellipsis:true,
|
||||
valueEnum:new Map([
|
||||
['apply',<span className={PublishTableStatusColorClass.apply}>{PublishStatusEnum.apply || '-'}</span>],
|
||||
['accept',<span className={PublishTableStatusColorClass.accept}>{PublishStatusEnum.accept || '-'}</span>],
|
||||
['done',<span className={PublishTableStatusColorClass.done}>{PublishStatusEnum.done || '-'}</span>],
|
||||
['stop',<span className={PublishTableStatusColorClass.stop}>{PublishStatusEnum.stop || '-'}</span>],
|
||||
['close',<span className={PublishTableStatusColorClass.close}>{PublishStatusEnum.close || '-'}</span>],
|
||||
['refuse',<span className={PublishTableStatusColorClass.refuse}>{PublishStatusEnum.refuse || '-'}</span>],
|
||||
['publishing',<span className={PublishTableStatusColorClass.publishing}>{PublishStatusEnum.publishing || '-'}</span>],
|
||||
['error',<span className={PublishTableStatusColorClass.error}>{PublishStatusEnum.error || '-'}</span>],
|
||||
])
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('备注'),
|
||||
title:('备注'),
|
||||
dataIndex: 'comments',
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('申请人'),
|
||||
title:('申请人'),
|
||||
dataIndex: ['applicant','name'],
|
||||
ellipsis: true,
|
||||
width:88,
|
||||
@@ -393,7 +350,7 @@ export const PUBLISH_APPROVAL_RECORD_INNER_TABLE_COLUMN : PageProColumns<Publish
|
||||
filterSearch: true,
|
||||
},
|
||||
{
|
||||
title:$t('审批人'),
|
||||
title:('审批人'),
|
||||
dataIndex: ['approver','name'],
|
||||
ellipsis: true,
|
||||
width:88,
|
||||
@@ -406,7 +363,7 @@ export const PUBLISH_APPROVAL_RECORD_INNER_TABLE_COLUMN : PageProColumns<Publish
|
||||
|
||||
export const PUBLISH_APPROVAL_TABLE_COLUMN : PageProColumns<ApprovalTableListItem>[] = [
|
||||
{
|
||||
title:$t('申请时间'),
|
||||
title:('申请时间'),
|
||||
dataIndex: 'applyTime',
|
||||
ellipsis:true,
|
||||
width:182,
|
||||
@@ -416,17 +373,17 @@ export const PUBLISH_APPROVAL_TABLE_COLUMN : PageProColumns<ApprovalTableListIte
|
||||
},
|
||||
},
|
||||
{
|
||||
title:$t('申请系统'),
|
||||
title:('申请系统'),
|
||||
dataIndex: ['service','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('所属团队'),
|
||||
title:('所属团队'),
|
||||
dataIndex: ['team','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:$t('审批状态'),
|
||||
title:('审批状态'),
|
||||
dataIndex: 'status',
|
||||
ellipsis:{
|
||||
showTitle:true
|
||||
@@ -436,7 +393,7 @@ export const PUBLISH_APPROVAL_TABLE_COLUMN : PageProColumns<ApprovalTableListIte
|
||||
valueType: 'select',
|
||||
},
|
||||
{
|
||||
title:$t('申请人'),
|
||||
title:('申请人'),
|
||||
dataIndex: ['applier','name'],
|
||||
ellipsis: true,
|
||||
width:88,
|
||||
@@ -446,7 +403,7 @@ export const PUBLISH_APPROVAL_TABLE_COLUMN : PageProColumns<ApprovalTableListIte
|
||||
filterSearch: true,
|
||||
},
|
||||
{
|
||||
title:$t('审批人'),
|
||||
title:('审批人'),
|
||||
dataIndex: ['approver','name'],
|
||||
ellipsis: true,
|
||||
width:88,
|
||||
@@ -456,7 +413,7 @@ export const PUBLISH_APPROVAL_TABLE_COLUMN : PageProColumns<ApprovalTableListIte
|
||||
filterSearch: true,
|
||||
},
|
||||
{
|
||||
title:$t('审批时间'),
|
||||
title:('审批时间'),
|
||||
dataIndex: 'approvalTime',
|
||||
// sorter: true,
|
||||
ellipsis:true,
|
||||
@@ -469,40 +426,31 @@ export const PUBLISH_APPROVAL_TABLE_COLUMN : PageProColumns<ApprovalTableListIte
|
||||
];
|
||||
|
||||
export const ChangeTypeEnum = {
|
||||
'new': $t('新增'),
|
||||
'update': $t('变更'),
|
||||
'delete' : $t('删除'),
|
||||
'none' : $t('无变更'),
|
||||
'error' : $t('缺失字段')
|
||||
'new': ('新增'),
|
||||
'update': ('变更'),
|
||||
'delete' : ('删除'),
|
||||
'none' : ('无变更'),
|
||||
'error' : ('缺失字段')
|
||||
}
|
||||
// export const APPROVAL_I18NEXT_FOR_ENUM = {
|
||||
// [SubscribeEnum.Rejected]:$t('驳回'),
|
||||
// [SubscribeEnum.Reviewing]:$t('审核中'),
|
||||
// [SubscribeEnum.Subscribed]:$t('已订阅'),
|
||||
// [SubscribeEnum.Unsubscribed]:$t('取消订阅'),
|
||||
// [SubscribeEnum.CancelRequest]:$t('取消申请'),
|
||||
// [SubscribeFromEnum.manual]:$t('手动添加'),
|
||||
// [SubscribeFromEnum.subscribe]:$t('订阅申请'),
|
||||
// }
|
||||
|
||||
|
||||
export const SubscribeApprovalList = [
|
||||
{
|
||||
title:$t('申请方应用'),key:'application'
|
||||
title:('申请方应用'),key:'application'
|
||||
},
|
||||
{
|
||||
title:$t('申请方所属团队'),key:'applyTeam'
|
||||
title:('申请方所属团队'),key:'applyTeam'
|
||||
},
|
||||
{
|
||||
title:$t('申请人'),key:'applier'
|
||||
title:('申请人'),key:'applier'
|
||||
},
|
||||
{
|
||||
title:$t('申请时间'),key:'applyTime'
|
||||
title:('申请时间'),key:'applyTime'
|
||||
},
|
||||
{
|
||||
title:$t('申请服务'),key:'service'
|
||||
title:('申请服务'),key:'service'
|
||||
},
|
||||
{
|
||||
title:$t('服务所属团队'),key:'team'
|
||||
title:('服务所属团队'),key:'team'
|
||||
}
|
||||
]
|
||||
@@ -110,6 +110,7 @@ export type PublishApprovalModalProps = {
|
||||
serviceId:string
|
||||
teamId:string
|
||||
clusterPublishStatus?:SystemInsidePublishOnlineItems[]
|
||||
|
||||
}
|
||||
|
||||
export type PublishApprovalModalHandle = {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { $t } from "@common/locales"
|
||||
|
||||
const CODE_LANG = [
|
||||
{
|
||||
@@ -70,7 +69,7 @@ const CODE_LANG = [
|
||||
]
|
||||
},
|
||||
{
|
||||
label: $t('微信小程序'),
|
||||
label: '微信小程序',
|
||||
value: 21
|
||||
},
|
||||
// {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { $t } from "@common/locales"
|
||||
|
||||
export type BasicResponse<T> = {
|
||||
code:number
|
||||
@@ -36,36 +35,36 @@ export const routerKeyMap = new Map<string, string[]|string>([
|
||||
}
|
||||
|
||||
export const VALIDATE_MESSAGE = {
|
||||
required: $t('必填项'),
|
||||
email:$t('不是有效邮箱地址')
|
||||
required: ('必填项'),
|
||||
email:('不是有效邮箱地址')
|
||||
}
|
||||
|
||||
export const PLACEHOLDER = {
|
||||
input:$t('请输入'),
|
||||
select:$t('请选择'),
|
||||
startWithAlphabet:$t('英文数字下划线任意一种,首字母必须为英文'),
|
||||
specialStartWithAlphabet:$t('支持字母开头、英文数字中横线下划线组合')
|
||||
input:('请输入'),
|
||||
select:('请选择'),
|
||||
startWithAlphabet:('英文数字下划线任意一种,首字母必须为英文'),
|
||||
specialStartWithAlphabet:('支持字母开头、英文数字中横线下划线组合')
|
||||
}
|
||||
|
||||
export const FORM_ERROR_TIPS = {
|
||||
refuseOpinion: $t('选择拒绝时,审批意见为必填'),
|
||||
clusterTest:$t('无法连接集群,请检查集群地址是否正确或防火墙配置'),
|
||||
refuseOpinion: ('选择拒绝时,审批意见为必填'),
|
||||
clusterTest:('无法连接集群,请检查集群地址是否正确或防火墙配置'),
|
||||
|
||||
}
|
||||
|
||||
export const RESPONSE_TIPS = {
|
||||
success: $t('操作成功'),
|
||||
error: $t('操作失败'),
|
||||
operating:$t('正在操作'),
|
||||
loading:$t('正在加载数据'),
|
||||
dataError:$t('获取数据失败'),
|
||||
loginSuccess: $t('登录成功'),
|
||||
logoutSuccess:$t('退出成功,将跳转至登录页'),
|
||||
refuseOpinion: $t('未填写审核意见'),
|
||||
copySuccess:$t('复制成功'),
|
||||
copyError:$t('复制失败,请手动复制')
|
||||
success: ('操作成功'),
|
||||
error: ('操作失败'),
|
||||
operating:('正在操作'),
|
||||
loading:('正在加载数据'),
|
||||
dataError:('获取数据失败'),
|
||||
loginSuccess: ('登录成功'),
|
||||
logoutSuccess:('退出成功,将跳转至登录页'),
|
||||
refuseOpinion: ('未填写审核意见'),
|
||||
copySuccess:('复制成功'),
|
||||
copyError:('复制失败,请手动复制')
|
||||
}
|
||||
|
||||
export const DELETE_TIPS = {
|
||||
default:$t('该数据删除后将无法找回,请确认是否删除?')
|
||||
default:('该数据删除后将无法找回,请确认是否删除?')
|
||||
}
|
||||
@@ -128,8 +128,8 @@ export const GlobalProvider: FC<{children:ReactNode}> = ({ children }) => {
|
||||
resolve(data.response)
|
||||
getGlobalAccessPromise = null
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(data.msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(data.msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
)
|
||||
@@ -143,7 +143,7 @@ export const GlobalProvider: FC<{children:ReactNode}> = ({ children }) => {
|
||||
setAccessData(prevData => new Map(prevData).set('team', data.access))
|
||||
setTeamDataFlushed(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ const useCopyToClipboard = () => {
|
||||
const copyToClipboard = (text: string) => {
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
navigator.clipboard.writeText(text)?.then(() => {
|
||||
message.success(RESPONSE_TIPS.copySuccess)
|
||||
message.success($t(RESPONSE_TIPS.copySuccess))
|
||||
setIsCopied(true)
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -29,7 +29,7 @@ const useCopyToClipboard = () => {
|
||||
textArea.select();
|
||||
new Promise<void>((resolve, reject) => {
|
||||
if(document.execCommand('copy')) {
|
||||
message.success(RESPONSE_TIPS.copySuccess)
|
||||
message.success($t(RESPONSE_TIPS.copySuccess))
|
||||
setIsCopied(true)
|
||||
resolve()
|
||||
} else {
|
||||
|
||||
@@ -12,5 +12,7 @@
|
||||
"K27924db": "应用管理员",
|
||||
"K8dc5c723": "驱动名称",
|
||||
"K9919285b": "服务类型",
|
||||
"Kf14d159b": "次",
|
||||
"K753e8aeb": "次/秒",
|
||||
"K396e56ab": "报文量"
|
||||
}
|
||||
|
||||
@@ -12,5 +12,7 @@
|
||||
"K27924db": "应用管理员",
|
||||
"K8dc5c723": "驱动名称",
|
||||
"K9919285b": "服务类型",
|
||||
"Kf14d159b": "次",
|
||||
"K753e8aeb": "次/秒",
|
||||
"K396e56ab": "报文量"
|
||||
}
|
||||
|
||||
@@ -1 +1,602 @@
|
||||
{}
|
||||
{
|
||||
"Kc0e5ef9f": "工作空间",
|
||||
"K3863c722": "我的",
|
||||
"K4de11e23": "首页",
|
||||
"Kfe93ef35": "应用",
|
||||
"Kb58e0c3f": "服务",
|
||||
"Kc9e489f5": "团队",
|
||||
"K61c89f5f": "API 市场",
|
||||
"K16d71239": "仪表盘",
|
||||
"K714c192d": "运行视图",
|
||||
"Kd57dfe97": "系统拓扑图",
|
||||
"K3fe97dcc": "系统设置",
|
||||
"K67ef3525": "组织",
|
||||
"K74aef1ad": "成员",
|
||||
"Kf644225f": "角色",
|
||||
"K958da71f": "服务分类管理",
|
||||
"Kf270ca55": "运维与集成",
|
||||
"Ke93d36ed": "集群",
|
||||
"K9708a557": "监控报表",
|
||||
"K481e8a05": "证书",
|
||||
"Kca53edd0": "日志",
|
||||
"Kb283e720": "资源",
|
||||
"K631d646f": "Open API",
|
||||
"K6535ff9c": "账号设置",
|
||||
"Kf15499b4": "退出登录",
|
||||
"Kabbd6e6": "文档",
|
||||
"K1196b104": "APIPark - 企业API数据开放平台",
|
||||
"K1f42de3": "HTTP 状态码",
|
||||
"K4770dff4": "系统状态码",
|
||||
"Kf89e58f1": "描述",
|
||||
"K9e53c664": "提交",
|
||||
"Kf8e7294c": "上一步",
|
||||
"Ka0451c97": "取消",
|
||||
"Kb1dedda3": "关闭",
|
||||
"Kb2fc7600": "添加配置",
|
||||
"K4e07217d": "编辑配置",
|
||||
"K4ea968fe": "编辑(0)",
|
||||
"Ka7aaaeb": "添加(0)",
|
||||
"Kaff78ecf": "请输入Key",
|
||||
"K65d46535": "请输入Value",
|
||||
"Kc14b2ea3": "返回",
|
||||
"K11d3633a": "ID",
|
||||
"Kbff43de3": "名称",
|
||||
"K16ca79ef": "Driver",
|
||||
"K7a369eef": "已发布",
|
||||
"Kcfa1a4d2": "下线",
|
||||
"K771dc3b7": "上线",
|
||||
"K530f5951": "查看",
|
||||
"Kecbd7449": "删除",
|
||||
"K1cbe2507": "确认",
|
||||
"K48325b6": "搜索(0)名称",
|
||||
"Ka1d885c1": "添加",
|
||||
"Kad207008": "编辑",
|
||||
"Ke4b7722": "简体中文",
|
||||
"Kd185073d": "English",
|
||||
"K1ff96ff": "申请系统",
|
||||
"K9bf855d6": "所属团队",
|
||||
"K11b994ed": "申请人",
|
||||
"K939baba7": "申请时间",
|
||||
"Kdab2e63b": "版本号",
|
||||
"K8b29c460": "版本说明",
|
||||
"K36a72ad1": "API 列表",
|
||||
"K54e44357": "上游列表",
|
||||
"Kb8e8e6f5": "备注",
|
||||
"K1ab0ae5b": "申请原因",
|
||||
"K53c00c3c": "审核意见",
|
||||
"K7edf331d": "时间",
|
||||
"Kef45b208": "1小时",
|
||||
"K9dbf22b8": "24小时",
|
||||
"K820fbfab": "3天",
|
||||
"Kd6d28fc": "7天",
|
||||
"K3d7465f7": "文件日志",
|
||||
"Kc87167a0": "HTTP日志",
|
||||
"K80ef19d3": "Kafka文件日志",
|
||||
"K398cc3c5": "NSQ文件日志",
|
||||
"K2bcdb54": "Syslog文件日志",
|
||||
"K23fda291": "暂无操作权限,请联系管理员分配。",
|
||||
"K4618cb0a": "微信小程序",
|
||||
"Ka854f511": "获取文件,需填路径",
|
||||
"Kaa11a695": "暂不支持生成非 HTTPS 或非 HTTP 协议的代码示例",
|
||||
"Kbe46924e": "搜索编程语言...",
|
||||
"Ke8e4f258": "编程语言",
|
||||
"K29c07a47": "成功示例",
|
||||
"K1f5c814d": "失败示例",
|
||||
"K4ef022d7": "默认 text/html;charset=UTF-8",
|
||||
"Kd061b5bf": "暂未填写示例",
|
||||
"Kc14cec33": "Binary",
|
||||
"K48b4d9e3": "请求头部",
|
||||
"Kcd347eaf": "请求体",
|
||||
"K9e100bfe": "Query 参数",
|
||||
"K3e9f12fd": "REST 参数",
|
||||
"K2bfa290c": "API Request Editor",
|
||||
"Kb36d111a": "返回头部",
|
||||
"K980bde79": "返回值",
|
||||
"Kb04d201a": "更多设置",
|
||||
"Kee74f5b4": "添加子参数",
|
||||
"Kc7d3106c": "向下添加行",
|
||||
"Keaabd222": "标签",
|
||||
"K8ad2c50e": "参数名",
|
||||
"K67d68dd1": "类型",
|
||||
"K29245f47": "必需",
|
||||
"Ke32cbcd3": "示例",
|
||||
"Kc13936c6": "输入 URL 或 cURL",
|
||||
"Ka1ede006": "HTTP",
|
||||
"K152ac44e": "参数位置",
|
||||
"K1660ae72": "匹配类型",
|
||||
"K91ced765": "参数值",
|
||||
"K5b265628": "操作类型",
|
||||
"K1826982d": "新增或修改",
|
||||
"Kd65b55f5": "匹配参数值",
|
||||
"K15f35bf2": "转发上游路径",
|
||||
"K79dec0dd": "请求超时时间",
|
||||
"K7d465645": "绑定上游服务",
|
||||
"K63a6404d": "重试时间",
|
||||
"K47740727": "转发上游请求头",
|
||||
"K2b605d42": "More",
|
||||
"K1df9fbd5": "导入",
|
||||
"K5e85df18": "导入格式",
|
||||
"K9eaf7885": "全量替换",
|
||||
"Kf8c3a80b": "在末端插入",
|
||||
"Kd96b2d7d": "增量更新",
|
||||
"Kf2fc08eb": "请求头",
|
||||
"Ka45f1d8": "Rest 参数",
|
||||
"K94bb113a": "大小",
|
||||
"K359919b5": "另存为文件",
|
||||
"K38bf1b90": "响应",
|
||||
"K59f4186e": "响应头",
|
||||
"K5f1e23fd": "正文",
|
||||
"Kf404ef7d": "发送(Enter)",
|
||||
"K2dbfd648": "中止",
|
||||
"Kacabc771": "秒",
|
||||
"K13ae6a93": "复制",
|
||||
"Ke54a14a3": "格式化",
|
||||
"K43934f6d": "搜索",
|
||||
"K741decac": "替代",
|
||||
"Kd507abff": "确定",
|
||||
"Kca2d1624": "The (0) must not be negative.",
|
||||
"K792b255a": "The (0) must be greater than or equal to the (1).",
|
||||
"Kf0bed26d": "值枚举",
|
||||
"K633a03ca": "枚举",
|
||||
"Kd2766caf": "最小长度",
|
||||
"Kd6d52485": "最大长度",
|
||||
"Kea15f66c": "最小值",
|
||||
"K1af340ff": "最大值",
|
||||
"K68691e16": "将文件拖拽至此处上传,或点击选择文件上传",
|
||||
"Kcec46ae": "上传文件",
|
||||
"K760fb044": "已选择文件",
|
||||
"Kea2bdee0": "请填写接口名称",
|
||||
"K49053438": "详细说明",
|
||||
"K148f6fa4": "高级匹配",
|
||||
"K3ae4c789": "转发配置",
|
||||
"K2f4d0a37": "请求参数",
|
||||
"Kde2d6dbd": "返回示例",
|
||||
"K70e6069c": "测试 API",
|
||||
"Ke4603448": "请求 Header",
|
||||
"K89fd86b3": "请求 Body",
|
||||
"K8747e3c4": "请求示例代码",
|
||||
"K8613e6e7": "响应示例",
|
||||
"Kab1c2159": "响应 Header",
|
||||
"Kd2be51d1": "响应 Body",
|
||||
"K831aa6c0": "申请方-应用",
|
||||
"K58ca9485": "申请服务",
|
||||
"K283f55b4": "服务所属系统",
|
||||
"Kd60d204": "服务所属团队",
|
||||
"K3a9a3b75": "审批状态",
|
||||
"K4f57b2de": "审批人",
|
||||
"K31dabc6b": "审批时间",
|
||||
"K8582af3f": "拒绝",
|
||||
"K54e27f57": "通过",
|
||||
"K7eeca185": "审批完成",
|
||||
"Kd4061161": "发布审批中",
|
||||
"K823bfe63": "在线",
|
||||
"K97ddb3f8": "-",
|
||||
"Kc9315fa1": "已拒绝",
|
||||
"K3fbe7511": "发布异常",
|
||||
"Ke64e695c": "发布中",
|
||||
"K17f93984": "API 名称",
|
||||
"K1365fe45": "请求方式",
|
||||
"Kc380335f": "路径",
|
||||
"K4ee62e8": "该 API 缺失(0)(1)(2)请先补充",
|
||||
"K385591f3": "转发信息,",
|
||||
"K68415c14": "文档信息,",
|
||||
"K133b75e9": "上游信息,",
|
||||
"Kad98e030": "上游类型",
|
||||
"Kdeed8399": "静态上游",
|
||||
"K78b1ca25": "地址",
|
||||
"K6208054": "待审批",
|
||||
"K1be7f021": "审批通过",
|
||||
"K677a4959": "发布终止",
|
||||
"Kfd6d2d3d": "已关闭",
|
||||
"K9d7e880a": "发布版本",
|
||||
"K855135f": "创建版本时间",
|
||||
"Kcbf39b82": "版本状态",
|
||||
"K339d15b5": "创建人",
|
||||
"K7194cea2": "审核时间",
|
||||
"K69827c60": "发布状态",
|
||||
"K1644b775": "新增",
|
||||
"K4fdf4dcc": "变更",
|
||||
"K33d66e26": "无变更",
|
||||
"K9b70c007": "缺失字段",
|
||||
"Kd85208a3": "驳回",
|
||||
"K8adf7f8b": "审核中",
|
||||
"Kad6aa439": "已订阅",
|
||||
"K3118fdb0": "取消订阅",
|
||||
"K9a68443b": "取消申请",
|
||||
"K18307d56": "手动添加",
|
||||
"K705fe9f5": "订阅申请",
|
||||
"Kbc96ebec": "申请方应用",
|
||||
"K1f89176d": "申请方所属团队",
|
||||
"Kfe731dfc": "操作",
|
||||
"K71661ee8": "必填项",
|
||||
"Kcbee3f8": "不是有效邮箱地址",
|
||||
"K442cfba1": "请输入",
|
||||
"K3bb646e4": "请选择",
|
||||
"Ka4ecfa40": "英文数字下划线任意一种,首字母必须为英文",
|
||||
"K39686a7f": "支持字母开头、英文数字中横线下划线组合",
|
||||
"K4d6a0190": "选择拒绝时,审批意见为必填",
|
||||
"K37318b68": "无法连接集群,请检查集群地址是否正确或防火墙配置",
|
||||
"K7f0c746d": "操作成功",
|
||||
"K6a365d01": "操作失败",
|
||||
"K978062b6": "正在操作",
|
||||
"Kca7bd6d4": "正在加载数据",
|
||||
"K3c93b77e": "获取数据失败",
|
||||
"Ke108c369": "登录成功",
|
||||
"K9168d3e": "退出成功,将跳转至登录页",
|
||||
"K2f8a7ab7": "未填写审核意见",
|
||||
"Kb858d78a": "复制成功",
|
||||
"K26e85d15": "复制失败,请手动复制",
|
||||
"K5cfdd950": "该数据删除后将无法找回,请确认是否删除?",
|
||||
"K2a3f24ac": "默认工作表",
|
||||
"K7e1ab4b0": "至",
|
||||
"Kf1b166e7": "详情",
|
||||
"K28555332": "暂不支持带有双斜杠//的url",
|
||||
"Keb9fcdad": "用户名",
|
||||
"Kc654b275": "邮箱",
|
||||
"Kbe2ecc69": "部门",
|
||||
"K759fb403": "状态",
|
||||
"K52c8a730": "启用",
|
||||
"K718c9310": "禁用",
|
||||
"K2c5882be": "绑定域名",
|
||||
"K1cc07937": "过期日期",
|
||||
"K8b7c2592": "更新者",
|
||||
"Keefda53d": "更新时间",
|
||||
"K9f3db3ca": "集群名称",
|
||||
"Ke7487049": "集群 ID",
|
||||
"Kb660ffe8": "节点名称",
|
||||
"Kf12b3034": "管理地址",
|
||||
"K867e6faf": "服务地址",
|
||||
"K37348a5e": "集群同步地址",
|
||||
"K151d2bb7": "环境名称",
|
||||
"Kfa744afd": "集群数量",
|
||||
"K23a3bd72": "异常",
|
||||
"Ke039b9b5": "正常",
|
||||
"K5c123bad": "角色名称",
|
||||
"K76036e25": "HTTP 请求头",
|
||||
"K8d4cbf50": "Cookie",
|
||||
"K44607e3f": "全等匹配",
|
||||
"Kc287500a": "前缀匹配",
|
||||
"Kfc0b1147": "后缀匹配",
|
||||
"Ka4a92043": "子串匹配",
|
||||
"K30b2e44f": "非等匹配",
|
||||
"Kb1587991": "空值匹配",
|
||||
"K1e97dbd8": "存在匹配",
|
||||
"Kc8ee3e62": "不存在匹配",
|
||||
"K87c5a801": "区分大小写的正则匹配",
|
||||
"K95f062f1": "不区分大小写的正则匹配",
|
||||
"Kfbd230a5": "任意匹配",
|
||||
"K413b9869": "服务名称",
|
||||
"K1e84ad04": "服务 ID",
|
||||
"K72b0c0b3": "API 数量",
|
||||
"Kf7200cd9": "负责人",
|
||||
"Kefaf9956": "创建时间",
|
||||
"K98db2cb9": "申请状态",
|
||||
"Ke792d01c": "所属服务",
|
||||
"K61b62ace": "来源",
|
||||
"Ke63767cf": "添加时间",
|
||||
"K3a67ea90": "订阅方",
|
||||
"K442937c4": "订阅时间",
|
||||
"K34111022": "协议/方法",
|
||||
"K62d10724": "URL",
|
||||
"Ka9481f95": "创建者",
|
||||
"Kf88d56fd": "上游 ID",
|
||||
"K11a92fb2": "更新人",
|
||||
"K2c2bc64f": "动态服务发现",
|
||||
"Kc9a2a716": "HTTPS",
|
||||
"Ka7f8266f": "带权轮询",
|
||||
"Kd17edabd": "IP Hash",
|
||||
"Kaeba0229": "透传客户端请求 Host",
|
||||
"K6d7e2fd0": "使用上游服务 Host",
|
||||
"K31332633": "重写 Host",
|
||||
"Ke65db976": "权重",
|
||||
"Kf966b12d": "内部服务:可通过网关访问,但不展示在服务广场",
|
||||
"Kfc939e49": "公开服务:可通过网关访问,展示在服务广场,可被其他应用订阅",
|
||||
"Ke96ccf45": " ",
|
||||
"K5582ac8": "请求路径",
|
||||
"K92485dd1": "所有 API",
|
||||
"Ke64e43a": "隐藏鉴权信息",
|
||||
"K1a78e6f0": "过期时间",
|
||||
"K40bbb0a3": "服务ID",
|
||||
"K9919285b": "服务类型",
|
||||
"K63938137": "公开服务",
|
||||
"Kfb20a12": "内部服务",
|
||||
"Kedd64e4d": "停用",
|
||||
"Ka29b346f": "地址(IP 端口或域名)",
|
||||
"K63b1e0dc": "权重(0-999)",
|
||||
"K74ab00a3": "已审批",
|
||||
"Kea996156": "发布申请记录",
|
||||
"Kbea7d266": "所属系统",
|
||||
"Ka36c13cc": "调用系统名称",
|
||||
"Kd78d73a7": "调用服务名称",
|
||||
"K73c144eb": "当前系统名称",
|
||||
"K285bd65e": "被调用服务名称",
|
||||
"K5cbab635": "被调用系统名称",
|
||||
"K93c2696e": "上线结果",
|
||||
"K43fcaf94": "成功",
|
||||
"Kc71c6a9": "上线失败",
|
||||
"K56c686f8": "失败",
|
||||
"K3ba29a85": "API",
|
||||
"Kda8d5ea1": "上游",
|
||||
"Kdefa9caa": "使用说明",
|
||||
"K36856e71": "发布",
|
||||
"K6382bbfd": "订阅管理",
|
||||
"K2eef4e4": "订阅审批",
|
||||
"Ka97bd9e5": "订阅方管理",
|
||||
"K5974bf24": "管理",
|
||||
"K3fa5c4c3": "调用拓扑图",
|
||||
"Kb5c7b82d": "设置",
|
||||
"K2472615e": "服务数量",
|
||||
"Kc02aa5f1": "API数量",
|
||||
"Ke08ff808": "添加日期",
|
||||
"Kd7d84192": "姓名",
|
||||
"Kc88e03b6": "团队角色",
|
||||
"Kdf35c48c": "所有成员",
|
||||
"K3818f03d": "审批",
|
||||
"K56b4254f": "发布申请",
|
||||
"Kd518ba3e": "Hello!欢迎使用 APIPark",
|
||||
"Ke66e4182": "你能通过 APIPark 快速在企业内部构建 API 开放门户/市场,享受极致的转发性能、API 可观测、服务治理、多租户管理、订阅审批流程等诸多好处。",
|
||||
"Kedd41c18": "如果你喜欢我们的产品,欢迎给我们 Star 或提供产品反馈意见。",
|
||||
"Kef02fd87": "快速入门",
|
||||
"K43a3b38d": "我们提供了一些任务来帮你快速了解 APIPark",
|
||||
"Kc8239422": "团队中包含了人员、应用和服务,不同团队之间的应用和服务数据是隔离的,可用于管理企业内部不同的部门/项目组/团队。",
|
||||
"Kd5be0cd7": "服务内包含一组 API,并且可以发布到 API 市场被其他团队使用。",
|
||||
"K4ea67613": "应用是申请服务和调用 API 的身份,可以在 API 市场申请调用服务,并且每个应用拥有独立的 API 访问鉴权。",
|
||||
"Ka4748416": "检索服务和 API",
|
||||
"K383e17e5": "你可以在 API 市场中查看所有公开的服务。",
|
||||
"K8f7808e6": "订阅服务",
|
||||
"Kb0755523": "如果需要调用某个服务的 API,需要先订阅该服务,并且等待提供服务的团队审批后才可发起 API 请求。",
|
||||
"Kd28a1aa5": "审批订阅申请",
|
||||
"K4472e361": "提供服务的团队可以审批来自其他团队的订阅申请,审批通过后的应用才可发起 API请求。",
|
||||
"K297d8563": "仪表盘中提供了多种统计图表,帮助我们了解 API 的运行情况。",
|
||||
"K48f7e21f": "了解更多功能",
|
||||
"Ka3626c8c": "隐藏快速入门",
|
||||
"Kd2c1a316": "登录",
|
||||
"Kf076f63c": "请输入账号",
|
||||
"K80a560a1": "账号",
|
||||
"K25c895d5": "请输入密码",
|
||||
"K551b0348": "密码",
|
||||
"K192b3e38": "访客模式",
|
||||
"K91aa4801": "您可通过访客模式查看所有页面和功能,但是无法编辑数据。访客模式仅用于了解产品功能,您可以在正式产品中关闭该功能。",
|
||||
"K480045ce": "Version (0)-(1)",
|
||||
"Kadee8e49": "日志配置",
|
||||
"K3453272": "APIPark 提供详尽的 API 调用日志,帮助企业监控、分析和审计 API 的运行状况。",
|
||||
"K33c76dbc": "部门名称",
|
||||
"K84829ca9": "父部门 ID",
|
||||
"K4d7fc74b": "子部门名称",
|
||||
"Ka16e6c44": "未激活、已禁用的成员无法加入到部门",
|
||||
"Ked03ba97": "请选择成员需要新加入的部门",
|
||||
"K5e237e06": "name",
|
||||
"K184d3473": "添加账号",
|
||||
"K1ecb35f2": "编辑成员信息",
|
||||
"Ke6f00b44": "加入部门",
|
||||
"K501cb1e7": "确定删除成员?此操作无法恢复,确认操作?",
|
||||
"Kf20863b5": "成员与部门",
|
||||
"K5f27a546": "输入用户名、邮箱查找成员",
|
||||
"K26c698bb": "添加部门",
|
||||
"Kb9cf2a7d": "添加子部门",
|
||||
"Kc83551f5": "重命名",
|
||||
"K3f1077c9": "设置成员和对应的角色,成员只能够看到权限范围内的功能和数据。",
|
||||
"Kdce62a6": "搜索部门",
|
||||
"K8ef69ee2": "密钥",
|
||||
"Kba3507d6": "上传密钥",
|
||||
"K93ac0f23": "密钥文件的后缀名一般为 .key 的文件内容",
|
||||
"K7cdd1331": "上传证书",
|
||||
"K6d91905d": "证书文件的后缀名一般为 .crt 或 .pem 的文件内容",
|
||||
"Kd0f6ded7": "添加证书",
|
||||
"Ke5732d60": "修改证书",
|
||||
"K3ca07a70": "证书管理",
|
||||
"Kdb927f83": "通过为 API 服务配置和管理 SSL 证书,企业可以加密数据传输,防止敏感信息被窃取或篡改。",
|
||||
"K877985b7": "修改配置",
|
||||
"Kdf66a675": "设置访问 API 的集群,让 API 在分布式环境中稳定运行,并且能够根据业务需求进行灵活扩展和优化。",
|
||||
"Kaf074220": "未配置",
|
||||
"K5878440c": "集群地址",
|
||||
"K5e9022f8": "下一步",
|
||||
"Kdbafd6f9": "设置监控报表的数据来源,设置完成之后即可获得详细的API调用统计图表。",
|
||||
"K1358acf": "统计图表",
|
||||
"K8fa58214": "数据源",
|
||||
"K62dabdf6": "地址(IP:端口)",
|
||||
"K2db12335": "组织(Organization)",
|
||||
"K8e7a0f80": "资源配置",
|
||||
"Kabfe9512": "保存",
|
||||
"K95c3fd8b": "设置角色的权限范围。",
|
||||
"K138facd3": "系统级别角色",
|
||||
"K6eac768d": "添加角色",
|
||||
"Kb9c2cf02": "团队级别角色",
|
||||
"Kb4ceecea": "添加子分类",
|
||||
"K67479e88": "修改分类名称",
|
||||
"K2bc75e2c": "添加分类",
|
||||
"Kab4aab44": "重命名分类",
|
||||
"K8e0e6977": "设置服务可选择的分类,方便团队成员快速找到API。",
|
||||
"Ke595a20a": "分类名称",
|
||||
"K9679728f": "父分类 ID",
|
||||
"K9b2d08fd": "子分类名称",
|
||||
"Kf14e76e5": "副本",
|
||||
"K2e050340": "API 基础信息",
|
||||
"K90f3c02f": "转发规则设置",
|
||||
"K6ea8d549": "编辑文档",
|
||||
"Kff5c18ac": "最后编辑人",
|
||||
"K2eb99415": "转发规则",
|
||||
"Ke93388fd": "编辑 API",
|
||||
"K1b1ae3b0": "复制 API",
|
||||
"K84aabfd4": "添加 API",
|
||||
"K6a662463": "输入名称、URL 查找 API",
|
||||
"K59bc6280": "API 详情",
|
||||
"K2a16c93b": "单位:ms,最小值:1",
|
||||
"K469e475a": "重试次数",
|
||||
"Kd568e15c": "发布结果",
|
||||
"K35f990b0": "查看详情",
|
||||
"Kdbc1f6cb": "申请发布",
|
||||
"Kb6860a3f": "回滚",
|
||||
"Ka3494f4b": "请确认是否回滚?",
|
||||
"Kb397a99f": "撤销申请",
|
||||
"K7d401c0f": "请确认是否撤销申请?",
|
||||
"Ke1b79b93": "终止发布",
|
||||
"Ka2449180": "请确认是否终止发布?",
|
||||
"K2cb02f38": "新建版本",
|
||||
"Ka9c08390": "只允许上传PNG、JPG或SVG格式的图片",
|
||||
"Kcf756b7a": "API 调用前缀",
|
||||
"K43d101a": "选填,作为服务内所有API的前缀,比如host/{service_name}/{api_path},一旦保存无法修改",
|
||||
"Kdc840242": "图标",
|
||||
"K427a5bd5": "仅支持 .png .jpg .jpeg .svg 格式的图片文件, 大于 1KB 的文件将被压缩",
|
||||
"K44bc352d": "Logo",
|
||||
"Kf52a584d": "所属服务分类",
|
||||
"K72b21be5": "设置服务展示在服务市场中的哪个分类下",
|
||||
"Kde6bae17": "删除服务",
|
||||
"K885ea699": "删除操作不可恢复,请谨慎操作!",
|
||||
"K617f34f1": "最近一次更新者",
|
||||
"K6ebca204": "最近一次更新时间",
|
||||
"K39ab0358": "新增订阅方",
|
||||
"K2d6658ed": "添加服务",
|
||||
"K7b8f623f": "输入名称、ID、所属团队、负责人查找服务",
|
||||
"Kdd9b5008": "后端默认使用的IP地址",
|
||||
"K6bc47edb": "请求协议",
|
||||
"Kc9acdb25": "负载均衡",
|
||||
"K632dba5c": "转发 Host",
|
||||
"Kc1f08a63": "重写域名",
|
||||
"K628f6851": "超时时间",
|
||||
"Kaff62621": "超时重试次数",
|
||||
"Kc41ca30e": "调用频率限制",
|
||||
"K813e1c0a": "团队名称",
|
||||
"K692f5aa6": "团队 ID",
|
||||
"K5de0bc2": "团队 ID(team_id)可用于检索团队,一旦保存无法修改。",
|
||||
"Ka63dd985": "团队负责人",
|
||||
"Ka6bcd272": "负责人对团队内的团队、服务、成员有管理权限",
|
||||
"Ka2012bdd": "删除团队",
|
||||
"Kbde1f3d": "服务数据清除后,方可删除",
|
||||
"K395acc14": "移除成员",
|
||||
"Kec46a57f": "添加成员",
|
||||
"K48724410": "输入姓名查找",
|
||||
"Kb9052305": "搜索用户名、邮箱",
|
||||
"K5ece3bac": "设置团队和成员,然后你可以在团队内创建服务和应用、订阅API,成员只能看到所属团队内的服务和应用。",
|
||||
"K510cdd27": "添加团队",
|
||||
"K9244ae14": "输入名称、ID、负责人查找团队",
|
||||
"Kc7b24b4b": "配置团队",
|
||||
"Kecb51e2c": "旧密码",
|
||||
"K8266bcf2": "新密码",
|
||||
"Ka9aef039": "确认密码",
|
||||
"Kcf42dcda": "两次密码不一致",
|
||||
"Kf876a42d": "修改密码",
|
||||
"K8ed884f": "管理个人账号",
|
||||
"K9be8e1d7": "API调用统计",
|
||||
"K521ab28e": "选择服务",
|
||||
"Kcc8265e1": "选择API",
|
||||
"K8aefc1e4": "请输入请求路径进行搜索",
|
||||
"K50d471b2": "重置",
|
||||
"Kee8ae330": "查询",
|
||||
"Ka2c794a2": "导出",
|
||||
"Kaf70c3b": "退出全屏",
|
||||
"Kd22841a4": "(0)调用详情",
|
||||
"K1512e983": "应用调用统计",
|
||||
"Kb4d2007f": "请选择应用",
|
||||
"K8c7f2d2e": "调用趋势",
|
||||
"K657c3452": "(0)-(1)调用趋势",
|
||||
"Kc04efb87": "调用量统计",
|
||||
"Keb98266e": "加入总体数据对比",
|
||||
"K18c2ed46": "(0)调用量",
|
||||
"Kc3741830": "(0)调用成功率",
|
||||
"Ka6aa5863": "请求总数",
|
||||
"K9eaef42": "请求成功率",
|
||||
"K7082a4af": "转发总数",
|
||||
"K1ce386fb": "转发成功率",
|
||||
"K87d6877e": "4xx",
|
||||
"K4c8a54db": "5xx",
|
||||
"Kd566283e": "调用总体趋势",
|
||||
"Kd23a0be6": "请求报文量",
|
||||
"Kec3e8361": "响应报文量",
|
||||
"Ke6250744": "4XX",
|
||||
"K2d79d4e1": "5XX",
|
||||
"Kcf6553c6": "服务调用统计",
|
||||
"Kffcfe375": "请选择服务",
|
||||
"Ka65f739c": "调用详情",
|
||||
"K89b7ac79": "API 请求量 Top10",
|
||||
"Kc0915603": "应用调用量 Top10",
|
||||
"Kf90b54": "服务被调用量 Top10",
|
||||
"Kfb26388": "暂无请求统计数据",
|
||||
"Kc8cbd8f8": "请求统计",
|
||||
"K8dece48": "暂无转发统计数据",
|
||||
"K1ee32434": "转发统计",
|
||||
"Kcd125e4d": "暂无调用量统计数据",
|
||||
"Kaa114e8b": "暂无报文量统计数据",
|
||||
"K3ad84406": "报文量统计",
|
||||
"K19a3ebe0": "请求成功数",
|
||||
"Kcaa8259": "转发成功数",
|
||||
"K888f038f": "失败状态码数",
|
||||
"K42d2bef2": "平均响应时间(ms)",
|
||||
"K9197c994": "最大响应时间(ms)",
|
||||
"K7c2f3fee": "最小响应时间(ms)",
|
||||
"K3d85ea54": "平均请求流量(KB)",
|
||||
"Keec09d32": "最大请求流量(KB)",
|
||||
"K3786b48": "最小请求流量(KB)",
|
||||
"K5168eb63": "应用名称",
|
||||
"K546e46f": "应用 ID",
|
||||
"K4a1a14": "监控总览",
|
||||
"K69741ea7": "服务被调用统计",
|
||||
"K9c8d9933": "API 调用统计",
|
||||
"K28cf9613": "每分钟",
|
||||
"K18f25019": "每5分钟",
|
||||
"Kf00f01ca": "每小时",
|
||||
"Kfcda87fc": "每天",
|
||||
"K29ec75dc": "每周",
|
||||
"K145e4941": "亿",
|
||||
"Ke6a935d": "万",
|
||||
"K8f7abcab": "次",
|
||||
"K146477a8": "服务标签",
|
||||
"K4de0af74": "服务分类",
|
||||
"Kcce1af60": "订阅的服务",
|
||||
"Kb6e9328f": "访问授权",
|
||||
"Kb7e869a4": "应用管理",
|
||||
"Kd59290a2": "搜索分类或标签",
|
||||
"K6b75bdbc": "暂无API数据",
|
||||
"Kd8a7a689": "搜索或选择应用",
|
||||
"K4b15d6f5": "申请理由",
|
||||
"Kb71b5a13": "鉴权类型",
|
||||
"K4d1465ee": "Iss",
|
||||
"K5dcd7ed8": "签名算法",
|
||||
"K5b0eedd3": "Secret",
|
||||
"K44f4ffe1": "RSA 公钥",
|
||||
"Kc5ecd7d9": "用户名 JsonPath",
|
||||
"K417d85cf": "校验字段",
|
||||
"K3b82fe1d": "是否 Base64 加密",
|
||||
"K49b5f4a3": "AK",
|
||||
"K31418470": "SK",
|
||||
"Kbfeb5297": "APIKey",
|
||||
"K95764d1d": "删除应用",
|
||||
"K217cb125": "鉴权详情",
|
||||
"K2bb63eca": "添加鉴权",
|
||||
"Kd74d69b7": "编辑鉴权",
|
||||
"K9cbe1e0": "修改",
|
||||
"Kd23d1716": "添加授权",
|
||||
"K9dfa2c97": "永不过期",
|
||||
"Kfa920c0": "到期时间",
|
||||
"Kbeb4e991": "审批详情",
|
||||
"Ked811bb1": "请确认是否取消订阅?",
|
||||
"K50c39a62": "取消订阅申请",
|
||||
"K1856c229": "请确认是否取消订阅申请?",
|
||||
"K66ea2f0": "搜索服务",
|
||||
"Kfeb2559b": "审批中",
|
||||
"Ka2b6d281": "API 文档",
|
||||
"K667bbbe7": "添加应用",
|
||||
"Ka4b45550": "暂无服务描述",
|
||||
"K3c7b175f": "订阅的服务数量:已通过 (0) 个,申请中 (1) 个",
|
||||
"K850b4b2d": "状态码",
|
||||
"Kbe3e9335": "退出测试",
|
||||
"K370a3eb2": "服务市场",
|
||||
"Kf7ec36d": "服务详情",
|
||||
"K59cdbec3": "介绍",
|
||||
"K4aa9ed2c": "申请",
|
||||
"K6c060779": "服务信息",
|
||||
"K8723422e": "接入应用",
|
||||
"Kb97544cb": "供应方",
|
||||
"Kb32f0afe": "分类",
|
||||
"K81634069": "版本",
|
||||
"K96a2f1c8": "无标签",
|
||||
"K93d5a66e": "接入应用数量",
|
||||
"K3e770a75": "鉴权 Token",
|
||||
"K96059c69": "关联标签",
|
||||
"K32263abd": "添加 Open API",
|
||||
"K7829bb78": "配置 Open API",
|
||||
"Kcdf76005": "Open API",
|
||||
"Ke2601944": "调用服务",
|
||||
"K8504bca8": "放大",
|
||||
"K693c1b41": "缩小"
|
||||
}
|
||||
@@ -7,11 +7,12 @@ import { StyleProvider } from '@ant-design/cssinjs';
|
||||
import zhCN from 'antd/locale/zh_CN';
|
||||
import enUS from 'antd/locale/en_US';
|
||||
import useInitializeMonaco from "@common/hooks/useInitializeMonaco";
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import 'dayjs/locale/zh-cn';
|
||||
import dayjs from 'dayjs';
|
||||
import { useGlobalContext } from '@common/contexts/GlobalStateContext';
|
||||
import i18next from 'i18next';
|
||||
import { $t } from '@common/locales';
|
||||
|
||||
type Locale = ConfigProviderProps['locale'];
|
||||
|
||||
@@ -150,13 +151,18 @@ function App() {
|
||||
setLocal(state.language === 'cn' ? zhCN : enUS);
|
||||
},[state.language])
|
||||
|
||||
const validateMessages = useMemo(()=>({
|
||||
required: $t('必填项'),
|
||||
email:$t('不是有效邮箱地址')}
|
||||
),[state.language])
|
||||
|
||||
return (
|
||||
<StyleProvider hashPriority={"high"}>
|
||||
<ConfigProvider
|
||||
locale={locale}
|
||||
wave={{disabled:true}}
|
||||
theme={antdComponentThemeToken}>
|
||||
theme={antdComponentThemeToken}
|
||||
form={{validateMessages }}>
|
||||
<BreadcrumbProvider>
|
||||
<RenderRoutes />
|
||||
</BreadcrumbProvider>
|
||||
|
||||
@@ -43,9 +43,5 @@ export const MEMBER_TABLE_COLUMNS: PageProColumns<MemberTableListItem>[] = [
|
||||
valueType: 'select',
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueEnum:new Map([
|
||||
[true,<span className="text-status_success">{('启用')}</span>],
|
||||
[false,<span className="text-status_fail">{('禁用')}</span>],
|
||||
])
|
||||
}
|
||||
];
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ColumnType } from "antd/es/table";
|
||||
import CopyAddrList from "@common/components/aoplatform/CopyAddrList";
|
||||
|
||||
import { PageProColumns } from "@common/components/aoplatform/PageList";
|
||||
import { $t } from "@common/locales";
|
||||
|
||||
|
||||
export const PARTITION_CERT_TABLE_COLUMNS: PageProColumns<PartitionCertTableListItem>[] = [
|
||||
@@ -55,88 +56,6 @@ export const PARTITION_CERT_TABLE_COLUMNS: PageProColumns<PartitionCertTableList
|
||||
},
|
||||
];
|
||||
|
||||
export const PARTITION_CLUSTER_TABLE_COLUMNS : PageProColumns<PartitionClusterTableListItem>[] = [
|
||||
{
|
||||
title:('集群名称'),
|
||||
dataIndex: 'name',
|
||||
ellipsis:true,
|
||||
width:160,
|
||||
fixed:'left',
|
||||
sorter: (a,b)=> {
|
||||
return a.name.localeCompare(b.name)
|
||||
},
|
||||
},
|
||||
{
|
||||
title:('集群 ID'),
|
||||
dataIndex: 'id',
|
||||
width: 140,
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:('状态'),
|
||||
dataIndex: 'status',
|
||||
ellipsis:true,
|
||||
valueType: 'select',
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueEnum: new Map([
|
||||
[0, <span className="text-status_fail">异常</span>],
|
||||
[1,<span className="text-status_success">正常</span>],
|
||||
])
|
||||
},
|
||||
{
|
||||
title: ('描述'),
|
||||
dataIndex: 'description',
|
||||
ellipsis:true
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
export const PARTITION_CLUSTER_NODE_COLUMNS: PageProColumns<PartitionClusterNodeTableListItem>[] = [
|
||||
{
|
||||
title:('节点名称'),
|
||||
dataIndex: 'name',
|
||||
ellipsis:true,
|
||||
fixed:'left',
|
||||
sorter: (a,b)=> {
|
||||
return a.name.localeCompare(b.name)
|
||||
},
|
||||
},
|
||||
{
|
||||
title:('管理地址'),
|
||||
dataIndex: 'managerAddress',
|
||||
ellipsis:true,
|
||||
width:200,
|
||||
render:(_,entity)=>(<CopyAddrList keyName="managerAddress" addrItem={entity} />)
|
||||
},
|
||||
{
|
||||
title:('服务地址'),
|
||||
dataIndex: 'serviceAddress',
|
||||
ellipsis:true,
|
||||
width:230,
|
||||
render:(_,entity)=>(<CopyAddrList keyName="serviceAddress" addrItem={entity} />)
|
||||
},
|
||||
{
|
||||
title:('集群同步地址'),
|
||||
dataIndex: 'peerAddress',
|
||||
ellipsis:true,
|
||||
width:230,
|
||||
render:(_,entity)=>(<CopyAddrList keyName="peerAddress" addrItem={entity} />)
|
||||
},
|
||||
{
|
||||
title:('状态'),
|
||||
dataIndex: 'status',
|
||||
ellipsis:true,
|
||||
width:86,
|
||||
valueType: 'select',
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueEnum: new Map([
|
||||
[0, <span className="text-status_fail">异常</span>],
|
||||
[1,<span className="text-status_success">正常</span>],
|
||||
])
|
||||
},
|
||||
];
|
||||
|
||||
export const NODE_MODAL_COLUMNS:ColumnType<PartitionClusterNodeModalTableListItem>[] = [
|
||||
{title:('名称'), dataIndex:'name',width:200,
|
||||
|
||||
@@ -12,6 +12,7 @@ import dayjs from 'dayjs';
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import { PageProColumns } from "@common/components/aoplatform/PageList";
|
||||
import { $t } from "@common/locales";
|
||||
|
||||
export enum SubscribeEnum{
|
||||
Rejected = 0,
|
||||
@@ -141,83 +142,6 @@ export const SYSTEM_TABLE_COLUMNS: PageProColumns<SystemTableListItem>[] = [
|
||||
}
|
||||
];
|
||||
|
||||
export const SYSTEM_SUBSERVICE_TABLE_COLUMNS: PageProColumns<SystemSubServiceTableListItem>[] = [
|
||||
{
|
||||
title:('服务名称'),
|
||||
dataIndex: ['service','name'],
|
||||
ellipsis:true,
|
||||
width:160,
|
||||
fixed:'left',
|
||||
sorter: (a,b)=> {
|
||||
return a.service.name.localeCompare(b.service.name)
|
||||
},
|
||||
},
|
||||
{
|
||||
title:('服务 ID'),
|
||||
dataIndex: ['service','name'],
|
||||
width: 140,
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:('申请状态'),
|
||||
dataIndex: 'applyStatus',
|
||||
ellipsis:{
|
||||
showTitle:true
|
||||
},
|
||||
width:80,
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueType: 'select',
|
||||
valueEnum:new Map([
|
||||
[0,<span className={SubscribeStatusColor[0]}>{('驳回')}</span>],
|
||||
[1,<span className={SubscribeStatusColor[1]}>{('审核中')}</span>],
|
||||
[2,<span className={SubscribeStatusColor[2]}>{('已订阅')}</span>],
|
||||
[3,<span className={SubscribeStatusColor[3]}>{('取消订阅')}</span>],
|
||||
[4,<span className={SubscribeStatusColor[4]}>{('取消申请')}</span>],
|
||||
])
|
||||
},
|
||||
{
|
||||
title:('所属服务'),
|
||||
dataIndex: ['project','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:('所属团队'),
|
||||
dataIndex: ['team','name'],
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:('申请人'),
|
||||
dataIndex: ['applier','name'],
|
||||
ellipsis: true,
|
||||
width:88,
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueType: 'select',
|
||||
filterSearch: true,
|
||||
},
|
||||
{
|
||||
title:('来源'),
|
||||
dataIndex: 'from',
|
||||
ellipsis: true,
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueType: 'select',
|
||||
valueEnum:new Map([
|
||||
[0,<span>{('手动添加')}</span>],
|
||||
[1,<span>{('订阅申请')}</span>],
|
||||
])
|
||||
},
|
||||
{
|
||||
title:('添加时间'),
|
||||
dataIndex: 'createTime',
|
||||
ellipsis:true,
|
||||
width:182,
|
||||
sorter: (a,b)=> {
|
||||
return a.createTime.localeCompare(b.createTime)
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
export const SYSTEM_SUBSCRIBER_TABLE_COLUMNS: PageProColumns<SystemSubscriberTableListItem>[] = [
|
||||
@@ -254,10 +178,6 @@ export const SYSTEM_SUBSCRIBER_TABLE_COLUMNS: PageProColumns<SystemSubscriberTab
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueType: 'select',
|
||||
valueEnum:new Map([
|
||||
[0,<span>{('手动添加')}</span>],
|
||||
[1,<span>{('订阅申请')}</span>],
|
||||
])
|
||||
},
|
||||
{
|
||||
title:('订阅时间'),
|
||||
@@ -318,7 +238,7 @@ export const MATCH_CONFIG:ConfigField<MatchItem>[] = [
|
||||
return { label:value, value:key}
|
||||
})}/>,
|
||||
renderText: (value:keyof typeof MatchPositionEnum) => {
|
||||
return (<>{MatchPositionEnum[value]}</>)
|
||||
return MatchPositionEnum[value]
|
||||
},
|
||||
required: true,
|
||||
ellipsis:true
|
||||
@@ -326,7 +246,7 @@ export const MATCH_CONFIG:ConfigField<MatchItem>[] = [
|
||||
title:('参数名'),
|
||||
key: 'key',
|
||||
component: <Input className="w-INPUT_NORMAL" />,
|
||||
renderText: (value: unknown) => <>{value}</>,
|
||||
renderText: (value: unknown) => value,
|
||||
required: true
|
||||
}, {
|
||||
title:('匹配类型'),
|
||||
@@ -335,7 +255,7 @@ export const MATCH_CONFIG:ConfigField<MatchItem>[] = [
|
||||
return { label:value, value:key}
|
||||
})}/>,
|
||||
renderText: (value:keyof typeof MatchTypeEnum) => {
|
||||
return (<>{MatchTypeEnum[value]}</>)
|
||||
return MatchTypeEnum[value]
|
||||
},
|
||||
required: true
|
||||
}, {
|
||||
@@ -343,7 +263,7 @@ export const MATCH_CONFIG:ConfigField<MatchItem>[] = [
|
||||
key: 'pattern',
|
||||
component: <Input className="w-INPUT_NORMAL"/>,
|
||||
renderText: (value: string) => {
|
||||
return (<>{value}</>)
|
||||
return value
|
||||
},
|
||||
required: true
|
||||
}
|
||||
@@ -465,7 +385,7 @@ export const UpstreamDriverEnum = {
|
||||
'discoveries':('动态服务发现'),
|
||||
}
|
||||
|
||||
export const typeOptions = [
|
||||
export const UPSTREAM_TYPE_OPTIONS = [
|
||||
{ label: ('静态上游'), value: 'static' },
|
||||
// { label: ('动态服务发现', value: 'discoveries' },
|
||||
];
|
||||
@@ -474,18 +394,18 @@ export const schemeOptions = [
|
||||
{ label:('HTTPS'), value:'HTTPS'},
|
||||
{ label:('HTTP'), value:'HTTP'},
|
||||
]
|
||||
export const balanceOptions = [
|
||||
export const UPSTREAM_BALANCE_OPTIONS = [
|
||||
{ label: ('带权轮询'), value: 'round-robin' },
|
||||
{ label: ('IP Hash'), value: 'ip-hash' },
|
||||
];
|
||||
|
||||
export const passHostOptions = [
|
||||
export const UPSTREAM_PASS_HOST_OPTIONS = [
|
||||
{ label:('透传客户端请求 Host'), value:'pass'},
|
||||
{ label:('使用上游服务 Host'), value:'node'},
|
||||
{ label:('重写 Host'), value:'rewrite'},
|
||||
]
|
||||
|
||||
export const proxyHeaderTypeOptions =[
|
||||
export const UPSTREAM_PROXY_HEADER_TYPE_OPTIONS =[
|
||||
{label:('新增或修改'), value: 'ADD' },
|
||||
{ label: ('删除'), value: 'DELETE' }
|
||||
]
|
||||
@@ -494,9 +414,8 @@ export const PROXY_HEADER_CONFIG:ConfigField<ProxyHeaderItem>[] = [
|
||||
{
|
||||
title:('操作类型'),
|
||||
key: 'optType',
|
||||
component: <Select className="w-INPUT_NORMAL" options={proxyHeaderTypeOptions}/>,
|
||||
renderText: (value: string) => {
|
||||
return (<>{value === 'ADD' ? ('新增或修改'):('删除')}</>)
|
||||
return value === 'ADD' ? ('新增或修改'):('删除')
|
||||
},
|
||||
required: true
|
||||
}, {
|
||||
@@ -504,7 +423,7 @@ export const PROXY_HEADER_CONFIG:ConfigField<ProxyHeaderItem>[] = [
|
||||
key: 'key',
|
||||
component: <Input className="w-INPUT_NORMAL"/>,
|
||||
renderText: (value: string) => {
|
||||
return (<>{value}</>)
|
||||
return value
|
||||
},
|
||||
required: true
|
||||
}, {
|
||||
@@ -512,7 +431,7 @@ export const PROXY_HEADER_CONFIG:ConfigField<ProxyHeaderItem>[] = [
|
||||
key: 'value',
|
||||
component: <Input className="w-INPUT_NORMAL" />,
|
||||
renderText: (value: string) => {
|
||||
return (<>{value}</>)
|
||||
return value
|
||||
},
|
||||
required: true
|
||||
}
|
||||
@@ -529,7 +448,7 @@ export const NODE_CONFIG:ConfigField<NodeItem>[] = [
|
||||
key: 'address',
|
||||
component: <Input className="w-INPUT_NORMAL" />,
|
||||
renderText: (value: string) => {
|
||||
return (<>{value}</>)
|
||||
return value
|
||||
},
|
||||
required: true
|
||||
}, {
|
||||
@@ -537,13 +456,13 @@ export const NODE_CONFIG:ConfigField<NodeItem>[] = [
|
||||
key: 'weight',
|
||||
component: <InputNumber className="w-INPUT_NORMAL"/>,
|
||||
renderText: (value: string) => {
|
||||
return (<>{value}</>)
|
||||
return value
|
||||
},
|
||||
required: true
|
||||
}
|
||||
]
|
||||
|
||||
export const visualizations = [
|
||||
export const SERVICE_VISUALIZATION_OPTIONS = [
|
||||
{label:('内部服务:可通过网关访问,但不展示在服务广场'),value:'inner'},
|
||||
{label:('公开服务:可通过网关访问,展示在服务广场,可被其他应用订阅'),value:'public'}];
|
||||
|
||||
@@ -594,162 +513,6 @@ export const apiModalColumn:ColumnsType<SimpleApiItem> = [
|
||||
]
|
||||
|
||||
|
||||
export const SYSTEM_AUTHORITY_TABLE_COLUMNS: PageProColumns<SystemAuthorityTableListItem>[] = [
|
||||
{
|
||||
title:('名称'),
|
||||
dataIndex: 'name',
|
||||
ellipsis:true,
|
||||
width:160,
|
||||
fixed:'left',
|
||||
sorter: (a,b)=> {
|
||||
return a.name.localeCompare(b.name)
|
||||
},
|
||||
},
|
||||
{
|
||||
title:('类型'),
|
||||
dataIndex: 'driver',
|
||||
ellipsis:true,
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueType: 'select',
|
||||
valueEnum:{
|
||||
basic:{
|
||||
text:'Basic'
|
||||
},
|
||||
apikey:{
|
||||
text:'Apikey'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title:('隐藏鉴权信息'),
|
||||
dataIndex: 'hideCredential',
|
||||
ellipsis:{
|
||||
showTitle:true
|
||||
},
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueType: 'select',
|
||||
valueEnum:new Map([
|
||||
[true,<span>是</span>],
|
||||
[false,<span>否</span>],
|
||||
])
|
||||
},
|
||||
{
|
||||
title:('过期时间'),
|
||||
dataIndex: 'expireTime',
|
||||
ellipsis:true,
|
||||
width:182,
|
||||
render:(_: React.ReactNode, entity: SystemAuthorityTableListItem) => (
|
||||
<span className={entity.expireTime !== 0 && dayjs().valueOf() - (entity.expireTime * 1000) > 0 ? 'text-status_fail' : ''}>{entity.expireTime === 0 ? '永不过期' :dayjs(entity.expireTime * 1000).format('YYYY-MM-DD hh:mm:ss')}</span>
|
||||
),
|
||||
sorter: (a,b)=> {
|
||||
return a.expireTime - b.expireTime
|
||||
},
|
||||
},
|
||||
{
|
||||
title:('更新者'),
|
||||
dataIndex: ['updater','name'],
|
||||
ellipsis: true,
|
||||
width:88,
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueType: 'select',
|
||||
filterSearch: true,
|
||||
},
|
||||
{
|
||||
title:('创建时间'),
|
||||
key: 'createTime',
|
||||
dataIndex: 'createTime',
|
||||
width:182,
|
||||
ellipsis:true,
|
||||
sorter: (a,b)=> {
|
||||
return a.createTime.localeCompare(b.createTime)
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
export const SYSTEM_MYSERVICE_TABLE_COLUMNS: PageProColumns<MyServiceTableListItem>[] = [
|
||||
{
|
||||
title:('服务名称'),
|
||||
dataIndex: 'name',
|
||||
ellipsis:true,
|
||||
width:160,
|
||||
fixed:'left',
|
||||
sorter: (a,b)=> {
|
||||
return a.name.localeCompare(b.name)
|
||||
},
|
||||
},
|
||||
{
|
||||
title:('服务ID'),
|
||||
dataIndex: 'id',
|
||||
width: 140,
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title:('服务类型'),
|
||||
dataIndex: 'serviceType',
|
||||
ellipsis:{
|
||||
showTitle:true
|
||||
},
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueType: 'select',
|
||||
valueEnum:{
|
||||
'public':{
|
||||
text:('公开服务')
|
||||
},
|
||||
'inner':{
|
||||
text:('内部服务')
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title:('API 数量'),
|
||||
dataIndex: 'apiNum',
|
||||
sorter: (a,b)=> {
|
||||
return a.apiNum - b.apiNum
|
||||
},
|
||||
},
|
||||
{
|
||||
title:('状态'),
|
||||
dataIndex: 'status',
|
||||
ellipsis:{
|
||||
showTitle:true
|
||||
},
|
||||
filters: true,
|
||||
onFilter: true,
|
||||
valueType: 'select',
|
||||
valueEnum:{
|
||||
'on':<span className="text-status_success">{('启用')}</span> ,
|
||||
'off':<span className="text-status_fail">{('停用')}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
title:('更新时间'),
|
||||
key: 'updateTime',
|
||||
dataIndex: 'updateTime',
|
||||
ellipsis:true,
|
||||
width:182,
|
||||
sorter: (a,b)=> {
|
||||
return a.updateTime.localeCompare(b.updateTime)
|
||||
},
|
||||
},
|
||||
{
|
||||
title:('创建时间'),
|
||||
key: 'createTime',
|
||||
dataIndex: 'createTime',
|
||||
width:182,
|
||||
ellipsis:true,
|
||||
sorter: (a,b)=> {
|
||||
return a.createTime.localeCompare(b.createTime)
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
|
||||
export const SYSTEM_UPSTREAM_GLOBAL_CONFIG_TABLE_COLUMNS: PageProColumns<GlobalNodeItem & {_id:string}>[] = [
|
||||
{
|
||||
title:('地址(IP 端口或域名)'),
|
||||
@@ -761,8 +524,7 @@ export const SYSTEM_UPSTREAM_GLOBAL_CONFIG_TABLE_COLUMNS: PageProColumns<GlobalN
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
whitespace: true,
|
||||
message: VALIDATE_MESSAGE.required,
|
||||
whitespace: true
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -65,7 +65,7 @@ const Login:FC = ()=> {
|
||||
|
||||
if (code === STATUS_CODE.SUCCESS) {
|
||||
dispatch({type:'LOGIN'})
|
||||
// message.success(RESPONSE_TIPS.loginSuccess);
|
||||
// message.success($t(RESPONSE_TIPS.loginSuccess));
|
||||
const callbackUrl = new URLSearchParams(window.location.search).get('callbackUrl');
|
||||
if (callbackUrl && callbackUrl !== 'null') {
|
||||
navigate(callbackUrl);
|
||||
@@ -102,7 +102,7 @@ const Login:FC = ()=> {
|
||||
return (
|
||||
<div className="h-full w-full flex flex-col bg-[#f5f7fa] items-center overflow-auto min-h-[490px]">
|
||||
<div className="w-full text-right pr-[40px]"><LanguageSetting mode="dark"/></div>
|
||||
<div className="w-[410px] mx-auto">
|
||||
<div className="w-[410px] mx-auto flex-1 flex flex-col items-center justify-center" >
|
||||
<div className="mx-auto">
|
||||
<span className="flex items-center justify-center">
|
||||
<img
|
||||
|
||||
@@ -56,11 +56,11 @@ export default function ApprovalList({pageType,pageStatus}:{pageType:'subscribe'
|
||||
const {code,data,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setTableListDataSource(data.approvals)
|
||||
!init && message.success(msg || RESPONSE_TIPS.success)
|
||||
!init && message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
setInit((prev)=>prev ? false : prev)
|
||||
return {data:data.approvals, success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -77,7 +77,7 @@ export default function ApprovalList({pageType,pageStatus}:{pageType:'subscribe'
|
||||
}, [pageType,pageStatus]);
|
||||
|
||||
const openModal = async(type:'approval'|'view',entity:ApprovalTableListItem)=>{
|
||||
message.loading(RESPONSE_TIPS.loading)
|
||||
message.loading($t(RESPONSE_TIPS.loading))
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{approval:PublishApprovalInfoType|SubscribeApprovalInfoType}>>(`approval/${pageType}`,{method:'GET',eoParams:{id:entity!.id},eoTransformKeys:['apply_project','apply_team','apply_time','approval_time']})
|
||||
message.destroy()
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
@@ -116,7 +116,7 @@ export default function ApprovalList({pageType,pageStatus}:{pageType:'subscribe'
|
||||
},
|
||||
})
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ export default function ApprovalList({pageType,pageStatus}:{pageType:'subscribe'
|
||||
})
|
||||
setMemberValueEnum(tmpValueEnum)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ export default function Guide(){
|
||||
</div>}
|
||||
showBorder={false}
|
||||
scrollPage={false}
|
||||
contentClassName=" pr-PAGE_INSIDE_X pb-PAGE_INSIDE_B"
|
||||
contentClassName=" w-full pr-PAGE_INSIDE_X pb-PAGE_INSIDE_B"
|
||||
>
|
||||
{showGuide &&
|
||||
<Collapse
|
||||
|
||||
@@ -31,8 +31,8 @@ const LogSettings = ()=>{
|
||||
}
|
||||
return Promise.resolve(data.dynamics)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
return Promise.reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return Promise.reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
||||
}
|
||||
return new Promise((resolve, reject)=>{
|
||||
if(!url || !method){
|
||||
reject(RESPONSE_TIPS.error)
|
||||
reject($t(RESPONSE_TIPS.error))
|
||||
return
|
||||
}
|
||||
form.validateFields().then((value)=>{
|
||||
@@ -50,11 +50,11 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
||||
}),eoTransformKeys:['departmentIds']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -72,7 +72,7 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setDepartmentList([{...data.departments,disabled:true}])
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
})
|
||||
@@ -114,18 +114,18 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
||||
label={$t("ID")}
|
||||
name="id"
|
||||
hidden
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
}
|
||||
{(type === 'addDep' || type === 'rename') &&
|
||||
<Form.Item<MemberDropdownModalFieldType>
|
||||
label={$t("部门名称")}
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>}
|
||||
|
||||
{type === 'addChild' &&<>
|
||||
@@ -133,17 +133,17 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
||||
label={$t("父部门 ID")}
|
||||
name="parent"
|
||||
hidden
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<MemberDropdownModalFieldType>
|
||||
label={$t("子部门名称")}
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
</>
|
||||
}
|
||||
@@ -152,16 +152,16 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
||||
<Form.Item<MemberDropdownModalFieldType>
|
||||
label={$t("用户名")}
|
||||
name="name"
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
<Form.Item<MemberDropdownModalFieldType>
|
||||
label={$t("邮箱")}
|
||||
name="email"
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required,whitespace:true },{type:"email",message: VALIDATE_MESSAGE.email}]}
|
||||
rules={[{required: true,whitespace:true },{type:"email",message: $t(VALIDATE_MESSAGE.email)}]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" disabled={type ==='editMember'} placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" disabled={type ==='editMember'} placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
<Form.Item<MemberDropdownModalFieldType>
|
||||
label={$t("部门")}
|
||||
@@ -173,7 +173,7 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
||||
fieldNames={{label:'name',value:'id',children:'children'}}
|
||||
showSearch
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
placeholder={PLACEHOLDER.select}
|
||||
placeholder={$t(PLACEHOLDER.select)}
|
||||
allowClear
|
||||
treeDefaultExpandAll
|
||||
treeData={departmentList}
|
||||
|
||||
@@ -22,6 +22,7 @@ import { checkAccess } from "@common/utils/permission.ts";
|
||||
import { PERMISSION_DEFINITION } from "@common/const/permissions.ts";
|
||||
import { EntityItem } from "@common/const/type.ts";
|
||||
import { $t } from "@common/locales/index.ts";
|
||||
import { DefaultOptionType } from "antd/es/cascader/index";
|
||||
|
||||
const AddToDepartment = forwardRef<AddToDepartmentHandle,AddToDepartmentProps>((props,ref)=>{
|
||||
const {selectedUserIds} = props
|
||||
@@ -35,11 +36,11 @@ const AddToDepartment = forwardRef<AddToDepartmentHandle,AddToDepartmentProps>((
|
||||
fetchData<BasicResponse<null>>('user/department/member',{method:'POST',eoBody:({userIds:selectedUserIds,departmentIds:selectedKeys}),eoTransformKeys:['departmentIds','userIds']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -64,7 +65,7 @@ const AddToDepartment = forwardRef<AddToDepartmentHandle,AddToDepartmentProps>((
|
||||
children:data.departments.children.filter((x)=>x.id !== 'unknown' && x.id !== 'disable')}])
|
||||
setExpandedKeys([newId])
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
})
|
||||
@@ -120,7 +121,7 @@ const MemberList = ()=>{
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
|
||||
const [departmentValueEnum,setDepartmentValueEnum] = useState<ColumnFilterItem[] >([])
|
||||
const {accessData,state} = useGlobalContext()
|
||||
const [columns,setColumns] = useState<PageProColumns<MemberTableListItem>[]>([])
|
||||
const [roleSelectableList, setRoleSelectableList] = useState<DefaultOptionType[]>([])
|
||||
|
||||
const operation:PageProColumns<MemberTableListItem>[] =[
|
||||
{
|
||||
@@ -151,7 +152,7 @@ const MemberList = ()=>{
|
||||
setInit((prev)=>prev ? false : prev)
|
||||
return {data:data.members, success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -207,11 +208,11 @@ const MemberList = ()=>{
|
||||
fetchData<BasicResponse<null>>(url,{method,eoTransformKeys:['user_ids','userIds'],eoParams:params,eoBody:(body)}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})}
|
||||
@@ -299,7 +300,7 @@ const MemberList = ()=>{
|
||||
const tmpValueEnum:ColumnFilterItem[] = [{text:data.department.name, value:data.department.id,children:handleDepartmentListToFilter(data.department.children)}]
|
||||
setDepartmentValueEnum(tmpValueEnum)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,11 +310,11 @@ const MemberList = ()=>{
|
||||
fetchData<BasicResponse<null>>(`account/role`, {method: 'PUT',eoBody:({roles:value, users:[entity.id]})}).then(response => {
|
||||
const {code, msg} = response
|
||||
if (code === STATUS_CODE.SUCCESS) {
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
} else {
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -323,38 +324,45 @@ const MemberList = ()=>{
|
||||
fetchData<BasicResponse<{roles:Array<{id:string,name:string}>}>>('simple/roles', {method: 'GET', eoParams: {group:'system'}}).then(response => {
|
||||
const {code, data,msg} = response
|
||||
if (code === STATUS_CODE.SUCCESS) {
|
||||
const newCol = [...MEMBER_TABLE_COLUMNS]
|
||||
for(const col of newCol){
|
||||
if(col.dataIndex === 'roles'){
|
||||
col.render = (_,entity)=>(
|
||||
<WithPermission access="system.organization.member.edit">
|
||||
<Select
|
||||
className="w-full"
|
||||
mode="multiple"
|
||||
value={entity.roles?.map((x:EntityItem)=>x.id)}
|
||||
options={data.roles?.map((x:{id:string,name:string})=>({label:$t(x.name), value:x.id}))}
|
||||
onChange={(value)=>{
|
||||
changeMemberInfo(value,entity ).then((res)=>{
|
||||
if(res) manualReloadTable()
|
||||
})
|
||||
}}
|
||||
/>
|
||||
</WithPermission>
|
||||
)
|
||||
col.filters = data.roles?.map((x:{id:string,name:string})=>({text:x.name, value:x.id}))
|
||||
col.onFilter = (value: unknown, record:MemberTableListItem) =>{
|
||||
return record.roles ? record.roles?.map((x)=>x.id).indexOf(value as string) !== -1 : false;}
|
||||
}
|
||||
}
|
||||
setColumns(newCol)
|
||||
setRoleSelectableList(data.roles)
|
||||
|
||||
return
|
||||
} else {
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const translatedCol = useMemo(()=>columns?.map(x=>({...x, title:typeof x.title === 'string' ? $t(x.title as string) : x.title})), [columns, state.language])
|
||||
useEffect(()=>{
|
||||
console.log(roleSelectableList,roleSelectableList?.map((x:{id:string,name:string})=>({label:$t(x.name), value:x.id})) )
|
||||
},[state.language,roleSelectableList])
|
||||
const translatedCol = useMemo(
|
||||
()=> MEMBER_TABLE_COLUMNS.map((x)=>({...x, ...(x.dataIndex === 'roles' ? {
|
||||
render:(_,entity)=>(
|
||||
<WithPermission access="system.organization.member.edit">
|
||||
<Select
|
||||
className="w-full"
|
||||
mode="multiple"
|
||||
value={entity.roles?.map((x:EntityItem)=>x.id)}
|
||||
options={roleSelectableList?.map((x:{id:string,name:string})=>({label:$t(x.name), value:x.id}))}
|
||||
onChange={(value)=>{
|
||||
changeMemberInfo(value,entity ).then((res)=>{
|
||||
if(res) manualReloadTable()
|
||||
})
|
||||
}}
|
||||
/>
|
||||
</WithPermission>
|
||||
),
|
||||
filters : roleSelectableList?.map((x:{id:string,name:string})=>({text:$t(x.name), value:x.id})),
|
||||
onFilter : (value: unknown, record:MemberTableListItem) =>{
|
||||
return record.roles ? record.roles?.map((x)=>x.id).indexOf(value as string) !== -1 : false;}
|
||||
}:{}), ...(typeof x.title === 'string' ? { title:$t(x.title as string) } : {}),
|
||||
...(x.dataIndex === 'enable' ? {
|
||||
valueEnum:new Map([
|
||||
[true,<span className="text-status_success">{$t('启用')}</span>],
|
||||
[false,<span className="text-status_fail">{$t('禁用')}</span>],
|
||||
])} : {})}))
|
||||
, [ state.language,roleSelectableList])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -23,10 +23,8 @@ import { $t } from "@common/locales/index.ts";
|
||||
const MemberPage = ()=>{
|
||||
const [searchWord, setSearchWord] = useState<string>('')
|
||||
const { modal,message } = App.useApp()
|
||||
// const [confirmLoading, setConfirmLoading] = useState(false);
|
||||
const navigate = useNavigate()
|
||||
const [departmentList, setDepartmentList] = useState<DepartmentListItem[]>([])
|
||||
// const [modalDepartmentList, setModalDepartmentList] = useState<DepartmentListItem[]>([])
|
||||
const {fetchData} = useFetch()
|
||||
const AddDepRef = useRef<MemberDropdownModalHandle>(null)
|
||||
const AddChildRef = useRef<MemberDropdownModalHandle>(null)
|
||||
@@ -36,7 +34,7 @@ const MemberPage = ()=>{
|
||||
const [expandedKeys, setExpandedKeys] = useState<string[]>([])
|
||||
const { memberGroupId } = useParams<RouterParams>();
|
||||
const [selectedDepartmentId, setSelectedDepartmentId] = useState<string>('-1')
|
||||
const {accessData} = useGlobalContext()
|
||||
const {accessData,state} = useGlobalContext()
|
||||
const [refreshMemberCount, setRefreshMemberCount] = useState<number>(0)
|
||||
const onSearchWordChange = (e:string)=>{
|
||||
setSearchWord(e || '')
|
||||
@@ -47,11 +45,11 @@ const MemberPage = ()=>{
|
||||
fetchData<BasicResponse<null>>('user/department',{method:'DELETE',eoParams:{id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -209,7 +207,7 @@ const MemberPage = ()=>{
|
||||
};
|
||||
});
|
||||
return loop(departmentList);
|
||||
}, [departmentList,searchWord]);
|
||||
}, [departmentList,searchWord,state.language]);
|
||||
|
||||
const getDepartmentList = ()=>{
|
||||
fetchData<BasicResponse<{departments:DepartmentListItem[]}>>('user/departments',{method:'GET'}).then(response=>{
|
||||
@@ -217,7 +215,7 @@ const MemberPage = ()=>{
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setDepartmentList([data.departments])
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -24,11 +24,11 @@ export const AddDepModal = forwardRef<MemberDropdownModalHandle,MemberDropdownMo
|
||||
}),eoTransformKeys:['departmentIds']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -60,17 +60,17 @@ export const AddDepModal = forwardRef<MemberDropdownModalHandle,MemberDropdownMo
|
||||
label={$t("父部门 ID")}
|
||||
name="parent"
|
||||
hidden
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>}
|
||||
|
||||
<Form.Item<MemberDropdownModalFieldType>
|
||||
label={[type === 'addChild' ? $t('子部门名称') : $t('部门名称')]}
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
|
||||
@@ -19,11 +19,11 @@ const AddToDepartmentModal = forwardRef<AddToDepartmentHandle,AddToDepartmentPro
|
||||
fetchData<BasicResponse<null>>('user/department/member',{method:'POST',eoBody:({userIds:selectedUserIds,departmentIds:selectedKeys}),eoTransformKeys:['departmentIds','userIds']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -48,7 +48,7 @@ const AddToDepartmentModal = forwardRef<AddToDepartmentHandle,AddToDepartmentPro
|
||||
children:data.departments.children.filter((x)=>x.id !== 'unknown' && x.id !== 'disable')}])
|
||||
setExpandedKeys([newId])
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -26,11 +26,11 @@ export const EditMemberModal = forwardRef<MemberDropdownModalHandle,MemberDropdo
|
||||
}),eoTransformKeys:['departmentIds']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -48,7 +48,7 @@ export const EditMemberModal = forwardRef<MemberDropdownModalHandle,MemberDropdo
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setDepartmentList([{...data.departments,children:data.departments.children?.filter((x)=>['unknown','disable'].indexOf(x.id) === -1),disabled:true}])
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
})
|
||||
@@ -81,16 +81,16 @@ export const EditMemberModal = forwardRef<MemberDropdownModalHandle,MemberDropdo
|
||||
<Form.Item<MemberDropdownModalFieldType>
|
||||
label={$t("用户名")}
|
||||
name="name"
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
<Form.Item<MemberDropdownModalFieldType>
|
||||
label={$t("邮箱")}
|
||||
name="email"
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required,whitespace:true },{type:"email",message: VALIDATE_MESSAGE.email}]}
|
||||
rules={[{required: true,whitespace:true },{type:"email",message: $t(VALIDATE_MESSAGE.email)}]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" disabled={type ==='editMember'} placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" disabled={type ==='editMember'} placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
<Form.Item<MemberDropdownModalFieldType>
|
||||
label={$t("部门")}
|
||||
@@ -102,7 +102,7 @@ export const EditMemberModal = forwardRef<MemberDropdownModalHandle,MemberDropdo
|
||||
fieldNames={{label:'name',value:'id',children:'children'}}
|
||||
showSearch
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
placeholder={PLACEHOLDER.input}
|
||||
placeholder={$t(PLACEHOLDER.input)}
|
||||
allowClear
|
||||
treeDefaultExpandAll
|
||||
treeData={departmentList}
|
||||
|
||||
@@ -23,11 +23,11 @@ export const RenameDepModal = forwardRef<MemberDropdownModalHandle,MemberDropdow
|
||||
}),eoParams: {id:entity!.id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -55,16 +55,16 @@ export const RenameDepModal = forwardRef<MemberDropdownModalHandle,MemberDropdow
|
||||
label={$t("ID")}
|
||||
name="id"
|
||||
hidden
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder="ID"/>
|
||||
</Form.Item>
|
||||
<Form.Item<MemberDropdownModalFieldType>
|
||||
label={$t("部门名称")}
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</WithPermission>)
|
||||
|
||||
@@ -57,32 +57,32 @@ export type DashboardSettingEditProps = {
|
||||
<Form.Item<PartitionDashboardConfigFieldType>
|
||||
label="数据源类型"
|
||||
name="driver"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Select className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.select} options={[...DASHBOARD_SETTING_DRIVER_OPTION_LIST]}/>
|
||||
<Select className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.select)} options={[...DASHBOARD_SETTING_DRIVER_OPTION_LIST]}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<PartitionDashboardConfigFieldType>
|
||||
label="数据源地址"
|
||||
name={['config','addr']}
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<PartitionDashboardConfigFieldType>
|
||||
label="Organization"
|
||||
name={['config','org']}
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<PartitionDashboardConfigFieldType>
|
||||
label="鉴权 Token"
|
||||
name={['config','token']}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<div className="flex gap-btnbase">
|
||||
|
||||
@@ -34,11 +34,11 @@ const CertConfigModal = forwardRef<PartitionCertConfigHandle,PartitionCertConfig
|
||||
fetchData<BasicResponse<null>>('certificate',{method:type === 'add'? 'POST' : 'PUT',eoBody:(body), eoParams:type === 'add' ? {}:{id:entity!.id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -72,7 +72,7 @@ const CertConfigModal = forwardRef<PartitionCertConfigHandle,PartitionCertConfig
|
||||
label={$t("密钥")}
|
||||
name="key"
|
||||
className="mb-0 bg-transparent p-0 border-none rounded-none"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Upload maxCount={1} showUploadList={false} beforeUpload={(file)=>{
|
||||
const reader = new FileReader();
|
||||
@@ -108,7 +108,7 @@ const CertConfigModal = forwardRef<PartitionCertConfigHandle,PartitionCertConfig
|
||||
label={$t("证书")}
|
||||
name="pem"
|
||||
className="mb-0 bg-transparent p-0 border-none rounded-none"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Upload maxCount={1} showUploadList={false} beforeUpload={(file)=>{
|
||||
const reader = new FileReader();
|
||||
@@ -158,7 +158,7 @@ const PartitionInsideCert:FC = ()=>{
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
return {data:data.certificates, success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -171,11 +171,11 @@ const PartitionInsideCert:FC = ()=>{
|
||||
fetchData<BasicResponse<null>>('certificate',{method:'DELETE',eoParams:{id:entity.id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -191,19 +191,19 @@ const PartitionInsideCert:FC = ()=>{
|
||||
break;
|
||||
case 'edit':{
|
||||
title=$t('修改证书')
|
||||
message.loading(RESPONSE_TIPS.loading)
|
||||
message.loading($t(RESPONSE_TIPS.loading))
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{cert:{key:string, pem:string}}>>('certificate',{method:'GET',eoParams:{id:entity!.id}})
|
||||
message.destroy()
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
content= <CertConfigModal ref={editRef} type="edit" entity={{...data.cert,id:entity!.id}}/>
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return
|
||||
}
|
||||
break;}
|
||||
case 'delete':
|
||||
title=$t('删除')
|
||||
content=DELETE_TIPS.default
|
||||
content=$t(DELETE_TIPS.default)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ const PartitionInsideCert:FC = ()=>{
|
||||
})
|
||||
setMemberValueEnum(tmpValueEnum)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ const PartitionInsideCluster:FC = ()=> {
|
||||
data.nodes && data.nodes.length > 0 && setNodeData(data.nodes[0])
|
||||
setShowStatus('view')
|
||||
} else {
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch(() => {
|
||||
return {data: [], success: false}
|
||||
|
||||
@@ -26,11 +26,11 @@ export const ClusterNodeModal = forwardRef<NodeModalHandle, NodeModalPropsType>(
|
||||
fetchData<BasicResponse<{ nodes: PartitionClusterNodeTableListItem[] }>>('cluster/check', {method: 'POST', eoBody: (value),eoTransformKeys:['manager_address','service_address','peer_address']}).then(response => {
|
||||
const {code,data, msg} = response
|
||||
if (code === STATUS_CODE.SUCCESS) {
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
setDataSource(data.nodes)
|
||||
changeStatus('preview')
|
||||
} else {
|
||||
message.error(msg ||FORM_ERROR_TIPS.clusterTest)
|
||||
message.error(msg || $t(FORM_ERROR_TIPS.clusterTest))
|
||||
setAddressError('error')
|
||||
|
||||
}
|
||||
@@ -44,10 +44,10 @@ export const ClusterNodeModal = forwardRef<NodeModalHandle, NodeModalPropsType>(
|
||||
fetchData<BasicResponse<null>>('cluster/reset',{method:'PUT' ,eoBody:({managerAddress:form.getFieldValue('address')}), eoTransformKeys:['managerAddress']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
getClusterInfo()
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=>
|
||||
console.warn(errorInfo))
|
||||
@@ -78,9 +78,9 @@ export const ClusterNodeModal = forwardRef<NodeModalHandle, NodeModalPropsType>(
|
||||
name="address"
|
||||
className="mb-0"
|
||||
validateStatus={addressError}
|
||||
help={addressError ? form.getFieldValue('address')? FORM_ERROR_TIPS.clusterTest : VALIDATE_MESSAGE.required : ''}
|
||||
help={addressError ? form.getFieldValue('address')? $t(FORM_ERROR_TIPS.clusterTest) : $t($t(VALIDATE_MESSAGE.required)) : ''}
|
||||
>
|
||||
<Input placeholder={PLACEHOLDER.input} onPressEnter={()=>test()} onChange={(e)=>setAddressError(e.target?.value ? '' : 'error')}/>
|
||||
<Input placeholder={$t(PLACEHOLDER.input)} onPressEnter={()=>test()} onChange={(e)=>setAddressError(e.target?.value ? '' : 'error')}/>
|
||||
</Form.Item> : dataSource && ClusterConfigPreview(dataSource?.[0] as unknown as PartitionClusterNodeTableListItem)}
|
||||
|
||||
<div className="flex gap-btnbase mt-[20px]">
|
||||
|
||||
@@ -26,7 +26,7 @@ const PartitionInsideDashboardSetting:FC = ()=> {
|
||||
data?.info?.driver && setData(data.info)
|
||||
setShowStatus('view')
|
||||
} else {
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch(() => {
|
||||
return {data: [], success: false}
|
||||
|
||||
@@ -32,7 +32,7 @@ const LogSettings = ()=>{
|
||||
navigateTo(`/resourcesettings/template/${data.dynamics[0].name}`)
|
||||
}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).finally(()=>setLoading(false))
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ const RoleConfig = ()=>{
|
||||
generateDependenciesMap(newPermits)
|
||||
setPermissionTemplate(newPermits)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -164,8 +164,8 @@ const RoleConfig = ()=>{
|
||||
form.setFieldsValue({name:data.role.name,permits:data.role.permit})
|
||||
return Promise.resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
return Promise.reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return Promise.reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errInfo)=>Promise.reject(errInfo))
|
||||
}
|
||||
@@ -184,11 +184,11 @@ const RoleConfig = ()=>{
|
||||
return fetchData<BasicResponse<null>>(`${roleType}/role`,{method:roleId === undefined? 'POST' : 'PUT',eoBody:({...body}),...(roleId !== undefined?{eoParams:{role:roleId}}:{})}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
return Promise.resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
return Promise.reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return Promise.reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errInfo)=>Promise.reject(errInfo))
|
||||
};
|
||||
@@ -213,9 +213,9 @@ const RoleConfig = ()=>{
|
||||
<Form.Item
|
||||
className=" m-btnbase mr-PAGE_INSIDE_X"
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="permits"
|
||||
|
||||
@@ -47,7 +47,7 @@ const RoleList = ()=>{
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
return {data:data.roles?.map((x:RoleTableListItem)=>({...x,name:$t(x.name)})), success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -60,11 +60,11 @@ const RoleList = ()=>{
|
||||
fetchData<BasicResponse<null>>(`manage/role`,{method:'DELETE',eoParams:{id:entity.id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -87,7 +87,7 @@ const RoleList = ()=>{
|
||||
switch (type){
|
||||
case 'delete':
|
||||
title=$t('删除')
|
||||
content=DELETE_TIPS.default
|
||||
content=$t(DELETE_TIPS.default)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ export default function ServiceCategory(){
|
||||
break;
|
||||
case 'delete':
|
||||
title=$t('删除')
|
||||
content=DELETE_TIPS.default
|
||||
content=$t(DELETE_TIPS.default)
|
||||
break;
|
||||
}
|
||||
modal.confirm({
|
||||
@@ -205,11 +205,11 @@ export default function ServiceCategory(){
|
||||
fetchData<BasicResponse<null>>('catalogue',{method:'DELETE',eoParams:{catalogue:entity.id},}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -223,7 +223,7 @@ export default function ServiceCategory(){
|
||||
getCategoryList()
|
||||
}else{
|
||||
setGData(cateData)
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch(()=>{setGData(cateData)}).finally(()=>{setLoading(false)})
|
||||
}
|
||||
@@ -236,7 +236,7 @@ export default function ServiceCategory(){
|
||||
setGData(data.catalogues)
|
||||
setCateData(data.catalogues)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).finally(()=>{setLoading(false)})
|
||||
}
|
||||
|
||||
@@ -26,18 +26,18 @@ export const ServiceHubCategoryConfig = forwardRef<ServiceHubCategoryConfigHandl
|
||||
}
|
||||
return new Promise((resolve, reject)=>{
|
||||
if(!url || !method){
|
||||
reject(RESPONSE_TIPS.error)
|
||||
reject($t(RESPONSE_TIPS.error))
|
||||
return
|
||||
}
|
||||
form.validateFields().then((value)=>{
|
||||
fetchData<BasicResponse<null>>(url,{method,eoBody:(value), eoParams:{ ...(type === 'renameCate' ? {catalogue:value.id} :undefined)}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -83,18 +83,18 @@ export const ServiceHubCategoryConfig = forwardRef<ServiceHubCategoryConfigHandl
|
||||
label={$t("ID")}
|
||||
name="id"
|
||||
hidden
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
}
|
||||
{(type === 'addCate' || type === 'renameCate') &&
|
||||
<Form.Item<ServiceHubCategoryConfigFieldType>
|
||||
label={$t("分类名称")}
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required ,whitespace:true }]}
|
||||
rules={[{ required: true ,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>}
|
||||
|
||||
{type === 'addChildCate' &&<>
|
||||
@@ -102,17 +102,17 @@ export const ServiceHubCategoryConfig = forwardRef<ServiceHubCategoryConfigHandl
|
||||
label={$t("父分类 ID")}
|
||||
name="parent"
|
||||
hidden
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<ServiceHubCategoryConfigFieldType>
|
||||
label={$t("子分类名称")}
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required ,whitespace:true }]}
|
||||
rules={[{ required: true ,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
</>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import {forwardRef, useEffect, useImperativeHandle, useState} from "react";
|
||||
import {forwardRef, useEffect, useImperativeHandle, useMemo, useState} from "react";
|
||||
import {App, Button, Form, Input, Radio, Row, Select, TreeSelect, Upload} from "antd";
|
||||
import { Link, useNavigate, useParams} from "react-router-dom";
|
||||
import {RouterParams} from "@core/components/aoplatform/RenderRoutes.tsx";
|
||||
@@ -13,7 +13,7 @@ import { validateUrlSlash } from "@common/utils/validate.ts";
|
||||
import { compressImage, normFile } from "@common/utils/uploadPic.ts";
|
||||
import { useBreadcrumb } from "@common/contexts/BreadcrumbContext.tsx";
|
||||
import { useSystemContext } from "../../contexts/SystemContext.tsx";
|
||||
import { visualizations } from "@core/const/system/const.tsx";
|
||||
import { SERVICE_VISUALIZATION_OPTIONS } from "@core/const/system/const.tsx";
|
||||
import { RcFile, UploadChangeParam, UploadFile, UploadProps } from "antd/es/upload/interface";
|
||||
import { LoadingOutlined } from "@ant-design/icons";
|
||||
import { getImgBase64 } from "@common/utils/dataTransfer.ts";
|
||||
@@ -40,7 +40,7 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
const [tagOptionList, setTagOptionList] = useState<DefaultOptionType[]>([])
|
||||
const [serviceClassifyOptionList, setServiceClassifyOptionList] = useState<DefaultOptionType[]>()
|
||||
const [uploadLoading, setUploadLoading] = useState<boolean>(false)
|
||||
const {checkPermission,accessInit, getGlobalAccessData} = useGlobalContext()
|
||||
const {checkPermission,accessInit, getGlobalAccessData,state} = useGlobalContext()
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
save:onFinish
|
||||
@@ -105,11 +105,12 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
setServiceClassifyOptionList(data.catalogues)
|
||||
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 获取表单默认值
|
||||
const getSystemInfo = () => {
|
||||
fetchData<BasicResponse<{ service: SystemConfigFieldType }>>('service/info',{method:'GET',eoParams:{team:teamId, service:serviceId},eoTransformKeys:['team_id','service_type']}).then(response=>{
|
||||
@@ -134,7 +135,7 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
setShowClassify(data.service.serviceType === 'public')
|
||||
},0)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
};
|
||||
@@ -144,12 +145,12 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
return fetchData<BasicResponse<{service:{id:string}}>>(serviceId === undefined? 'team/service':'service/info',{method:serviceId === undefined? 'POST' : 'PUT',eoParams: {...(serviceId === undefined ? {team:value.team} :{service:serviceId,team:teamId})},eoBody:({...value,prefix:value.prefix?.trim()}), eoTransformKeys:['serviceType']},).then(response=>{
|
||||
const {code,data,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
setSystemInfo(data.service)
|
||||
return Promise.resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
return Promise.reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return Promise.reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=>{
|
||||
return Promise.reject(errorInfo)
|
||||
@@ -168,7 +169,7 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
label:x.name, value:x.id
|
||||
}}))
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -177,10 +178,10 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
fetchData<BasicResponse<null>>('team/service',{method:'DELETE',eoParams:{team:teamId,service:serviceId}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
navigate(`/service/list`)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -218,7 +219,7 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
const deleteSystemModal = async ()=>{
|
||||
modal.confirm({
|
||||
title:$t('删除'),
|
||||
content:DELETE_TIPS.default,
|
||||
content:$t(DELETE_TIPS.default),
|
||||
onOk:()=> {
|
||||
return deleteSystem()
|
||||
},
|
||||
@@ -233,6 +234,8 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
})
|
||||
}
|
||||
|
||||
const visualizationOptions = useMemo(()=>SERVICE_VISUALIZATION_OPTIONS.map((x)=>({...x, label:$t(x.label)})),[state.language])
|
||||
|
||||
return (
|
||||
<>
|
||||
<WithPermission access={onEdit ? 'team.service.service.edit' :''}>
|
||||
@@ -250,17 +253,17 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
<Form.Item<SystemConfigFieldType>
|
||||
label={$t("服务名称")}
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required ,whitespace:true }]}
|
||||
rules={[{ required: true ,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<SystemConfigFieldType>
|
||||
label={$t("服务ID")}
|
||||
name="id"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required ,whitespace:true }]}
|
||||
rules={[{ required: true ,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" disabled={onEdit} placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" disabled={onEdit} placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<SystemConfigFieldType>
|
||||
@@ -272,7 +275,7 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
validator: validateUrlSlash,
|
||||
}]}
|
||||
>
|
||||
<Input prefix={onEdit ? '' : '/'} className="w-INPUT_NORMAL" disabled={onEdit} placeholder={PLACEHOLDER.input}/>
|
||||
<Input prefix={onEdit ? '' : '/'} className="w-INPUT_NORMAL" disabled={onEdit} placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<SystemConfigFieldType>
|
||||
@@ -300,7 +303,7 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
label={$t("描述")}
|
||||
name="description"
|
||||
>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<SystemConfigFieldType>
|
||||
@@ -313,9 +316,9 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
{!onEdit && <Form.Item<SystemConfigFieldType>
|
||||
label={$t("所属团队")}
|
||||
name="team"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Select className="w-INPUT_NORMAL" disabled={onEdit} placeholder={PLACEHOLDER.input} options={teamOptionList} >
|
||||
<Select className="w-INPUT_NORMAL" disabled={onEdit} placeholder={$t(PLACEHOLDER.input)} options={teamOptionList} >
|
||||
</Select>
|
||||
</Form.Item>}
|
||||
|
||||
@@ -327,7 +330,7 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
<Select
|
||||
className="w-INPUT_NORMAL"
|
||||
mode="tags"
|
||||
placeholder={PLACEHOLDER.select}
|
||||
placeholder={$t(PLACEHOLDER.select)}
|
||||
options={tagOptionList}>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
@@ -335,9 +338,9 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
<Form.Item<SystemConfigFieldType>
|
||||
label={$t("服务类型")}
|
||||
name="serviceType"
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{required: true}]}
|
||||
>
|
||||
<Radio.Group className="flex flex-col" options={visualizations} onChange={(e)=>{setShowClassify(e.target.value === 'public')}} />
|
||||
<Radio.Group className="flex flex-col" options={visualizationOptions} onChange={(e)=>{setShowClassify(e.target.value === 'public')}} />
|
||||
</Form.Item>
|
||||
|
||||
{showClassify &&
|
||||
@@ -345,14 +348,14 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
||||
label={$t("所属服务分类")}
|
||||
name="catalogue"
|
||||
extra={$t("设置服务展示在服务市场中的哪个分类下")}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{required: true}]}
|
||||
>
|
||||
<TreeSelect
|
||||
className="w-INPUT_NORMAL"
|
||||
fieldNames={{label:'name',value:'id',children:'children'}}
|
||||
showSearch
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
placeholder={PLACEHOLDER.select}
|
||||
placeholder={$t(PLACEHOLDER.select)}
|
||||
allowClear
|
||||
treeDefaultExpandAll
|
||||
treeData={serviceClassifyOptionList}
|
||||
|
||||
@@ -23,10 +23,10 @@ const ServiceInsideDocument = ()=>{
|
||||
fetchData<BasicResponse<{service:{ id:string,name:string,updater:string,updateTime:string, doc:string} }>>('service/doc',{method:'PUT',eoBody:({doc:doc}) ,eoParams:{service:serviceId,team:teamId},eoTransformKeys:['update_time']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
getServiceDoc()
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -56,7 +56,7 @@ const ServiceInsideDocument = ()=>{
|
||||
setUpdateTime(data.doc.updater.id === '' ? '-' : data.doc.updateTime)
|
||||
setInitDoc(data.doc.doc)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ const SystemInsidePage:FC = ()=> {
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setSystemInfo(data.service)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -48,7 +48,7 @@ const SystemInsidePage:FC = ()=> {
|
||||
setApiPrefix(data.prefix)
|
||||
setPrefixForce(data.force)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ const SystemInsideSubscriber:FC = ()=>{
|
||||
const {serviceId, teamId} = useParams<RouterParams>()
|
||||
const addRef = useRef<SystemSubscriberConfigHandle>(null)
|
||||
const pageListRef = useRef<ActionType>(null);
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<{[k:string]:{text:string}}>({})
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<SimpleMemberItem[]>([])
|
||||
const {accessData,state} = useGlobalContext()
|
||||
const getSystemSubscriber = ()=>{
|
||||
return fetchData<BasicResponse<{subscribers:SystemSubscriberTableListItem[]}>>('service/subscribers',{method:'GET',eoParams:{service:serviceId,team:teamId},eoTransformKeys:['apply_time']}).then(response=>{
|
||||
@@ -32,7 +32,7 @@ const SystemInsideSubscriber:FC = ()=>{
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
return {data:data.subscribers, success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -41,16 +41,12 @@ const SystemInsideSubscriber:FC = ()=>{
|
||||
}
|
||||
|
||||
const getMemberList = async ()=>{
|
||||
setMemberValueEnum({})
|
||||
setMemberValueEnum([])
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{ members: SimpleMemberItem[] }>>('simple/member',{method:'GET'})
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
const tmpValueEnum:{[k:string]:{text:string}} = {}
|
||||
data.members?.forEach((x:SimpleMemberItem)=>{
|
||||
tmpValueEnum[x.name] = {text:x.name}
|
||||
})
|
||||
setMemberValueEnum(tmpValueEnum)
|
||||
setMemberValueEnum(data.members)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,11 +59,11 @@ const SystemInsideSubscriber:FC = ()=>{
|
||||
fetchData<BasicResponse<null>>('service/subscriber',{method:'DELETE',eoParams:{application:entity!.id,service:entity!.service.id,team:teamId}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -83,7 +79,7 @@ const SystemInsideSubscriber:FC = ()=>{
|
||||
break;
|
||||
case 'delete':
|
||||
title=$t('删除')
|
||||
content=DELETE_TIPS.default
|
||||
content=$t(DELETE_TIPS.default)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -136,7 +132,24 @@ const SystemInsideSubscriber:FC = ()=>{
|
||||
}, [serviceId]);
|
||||
|
||||
const columns = useMemo(()=>{
|
||||
return SYSTEM_SUBSCRIBER_TABLE_COLUMNS.map(x=>{if(x.filters &&((x.dataIndex as string[])?.indexOf('applier') !== -1 || (x.dataIndex as string[])?.indexOf('approver') !== -1) ){x.valueEnum = memberValueEnum} return {...x,title:typeof x.title === 'string' ? $t(x.title as string) : x.title}})
|
||||
return [...SYSTEM_SUBSCRIBER_TABLE_COLUMNS].map(x=>{
|
||||
if(x.filters &&((x.dataIndex as string[])?.indexOf('applier') !== -1 || (x.dataIndex as string[])?.indexOf('approver') !== -1) ){
|
||||
const tmpValueEnum:{[k:string]:{text:string}} = {}
|
||||
memberValueEnum?.forEach((x:SimpleMemberItem)=>{
|
||||
tmpValueEnum[x.name] = {text:x.name}
|
||||
})
|
||||
x.valueEnum = tmpValueEnum
|
||||
}
|
||||
if(x.dataIndex === 'from'){
|
||||
x.valueEnum = new Map([
|
||||
[0,<span>{$t('手动添加')}</span>],
|
||||
[1,<span>{$t('订阅申请')}</span>],
|
||||
])
|
||||
}
|
||||
return {
|
||||
...x,title:typeof x.title === 'string' ? $t(x.title as string) : x.title}
|
||||
}
|
||||
)
|
||||
},[memberValueEnum,state.language])
|
||||
|
||||
return (
|
||||
@@ -169,11 +182,11 @@ export const SystemSubscriberConfig = forwardRef<SystemSubscriberConfigHandle,Sy
|
||||
fetchData<BasicResponse<null>>('service/subscriber',{method:'POST',eoBody:({...value}), eoParams:{service:serviceId,team:teamId}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -216,7 +229,7 @@ export const SystemSubscriberConfig = forwardRef<SystemSubscriberConfigHandle,Sy
|
||||
});
|
||||
setSystemOptionList(Array.from(teamMap.values()))
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -239,13 +252,13 @@ export const SystemSubscriberConfig = forwardRef<SystemSubscriberConfigHandle,Sy
|
||||
<Form.Item<SystemSubscriberConfigFieldType>
|
||||
label={$t("订阅方")}
|
||||
name="application"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<TreeSelect
|
||||
className="w-INPUT_NORMAL"
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
treeData={systemOptionList}
|
||||
placeholder={PLACEHOLDER.input}
|
||||
placeholder={$t(PLACEHOLDER.input)}
|
||||
treeDefaultExpandAll
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
@@ -52,7 +52,7 @@ const SystemList:FC = ()=>{
|
||||
setTableHttpReload(false)
|
||||
return {data:data.services, success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -77,7 +77,7 @@ const SystemList:FC = ()=>{
|
||||
})
|
||||
setTeamList(tmpValueEnum)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
})
|
||||
@@ -98,7 +98,7 @@ const SystemList:FC = ()=>{
|
||||
})
|
||||
setMemberValueEnum(tmpValueEnum)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export default function SystemTopology() {
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setGraphData(transformData({...data,currentSystem:{id:serviceId,name:systemInfo?.name || ''}}))
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@ const SystemInsideApiCreate = forwardRef<SystemInsideApiCreateHandle,SystemInsid
|
||||
return fetchData<BasicResponse<{api:SystemApiProxyFieldType}>>('service/api',{method:'POST',eoBody:(body), eoParams: {service:serviceId,team:teamId},eoTransformKeys:['matchType']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
return Promise.resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
return Promise.reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return Promise.reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch(errInfo=>Promise.reject(errInfo))
|
||||
})
|
||||
@@ -40,11 +40,11 @@ const SystemInsideApiCreate = forwardRef<SystemInsideApiCreateHandle,SystemInsid
|
||||
fetchData<BasicResponse<{api:SystemApiProxyFieldType}>>('service/api/copy',{method:'POST',eoParams:{service:serviceId,team:teamId, api:entity!.id},eoBody:({...value,path:value.path.trim()})}).then(response=>{
|
||||
const {code,data,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
return resolve(data.api.id)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
return reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -92,24 +92,24 @@ const SystemInsideApiCreate = forwardRef<SystemInsideApiCreateHandle,SystemInsid
|
||||
<Form.Item<SystemApiProxyFieldType>
|
||||
label={$t("API 名称")}
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required ,whitespace:true }]}
|
||||
rules={[{ required: true ,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<SystemApiProxyFieldType>
|
||||
label={$t("描述")}
|
||||
name="description"
|
||||
>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<SystemApiProxyFieldType>
|
||||
label={$t("请求方式")}
|
||||
name="method"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Select className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.select} options={HTTP_METHOD.map((method:string)=>{
|
||||
<Select className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.select)} options={HTTP_METHOD.map((method:string)=>{
|
||||
return { label:method, value:method}
|
||||
})}>
|
||||
</Select>
|
||||
@@ -118,14 +118,14 @@ const SystemInsideApiCreate = forwardRef<SystemInsideApiCreateHandle,SystemInsid
|
||||
<Form.Item<SystemApiProxyFieldType>
|
||||
label={$t("请求路径")}
|
||||
name="path"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true },
|
||||
rules={[{ required: true,whitespace:true },
|
||||
{
|
||||
validator: validateUrlSlash,
|
||||
}]}
|
||||
className={styles['form-input-group']}
|
||||
>
|
||||
<Input prefix={(prefixForce ? `${apiPrefix}/` :"/")} className="w-INPUT_NORMAL"
|
||||
placeholder={PLACEHOLDER.input}/>
|
||||
placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<SystemApiProxyFieldType>
|
||||
|
||||
@@ -41,7 +41,7 @@ const SystemInsideApiDetail = (props:SystemInsideApiDetailProps)=>{
|
||||
}
|
||||
setApiDetail(newApiDetail)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).finally(()=>{setLoading(false)})
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ const SystemInsideApiDocument = forwardRef<SystemInsideApiDocumentHandle,SystemI
|
||||
setApiDetail(data.api)
|
||||
setLoaded(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).finally(()=>{setLoading(false)})
|
||||
}
|
||||
@@ -43,11 +43,11 @@ const SystemInsideApiDocument = forwardRef<SystemInsideApiDocumentHandle,SystemI
|
||||
return fetchData<BasicResponse<{id:string}>>('service/api',{method:'PUT',eoParams:{service:serviceId,team:teamId,api:apiId},eoBody:(res.apiInfo)}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
return Promise.resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
return Promise.reject(msg|| RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return Promise.reject(msg|| $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch(errInfo => Promise.reject(errInfo))
|
||||
})
|
||||
|
||||
@@ -32,7 +32,7 @@ const SystemInsideApiList:FC = ()=>{
|
||||
const pageListRef = useRef<ActionType>(null);
|
||||
const copyRef = useRef<SystemInsideApiCreateHandle>(null)
|
||||
const {apiPrefix, prefixForce} = useSystemContext()
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<{[k:string]:{text:string}}>({})
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<SimpleMemberItem[]>([])
|
||||
const {accessData,state} = useGlobalContext()
|
||||
const [drawerType,setDrawerType]= useState<'add'|'edit'|'view'|'upstream'|undefined>()
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -60,7 +60,7 @@ const SystemInsideApiList:FC = ()=>{
|
||||
setTableHttpReload(false)
|
||||
return {data:data.apis, success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -73,11 +73,11 @@ const SystemInsideApiList:FC = ()=>{
|
||||
fetchData<BasicResponse<null>>('service/api',{method:'DELETE',eoParams:{service:serviceId,team:teamId, api:entity!.id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -89,19 +89,19 @@ const SystemInsideApiList:FC = ()=>{
|
||||
switch (type){
|
||||
case 'copy':{
|
||||
title=$t('复制 API')
|
||||
message.loading(RESPONSE_TIPS.loading)
|
||||
message.loading($t(RESPONSE_TIPS.loading))
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{api:SystemApiSimpleFieldType}>>('service/api/detail/simple',{method:'GET',eoParams:{service:serviceId,team:teamId, api:entity!.id}})
|
||||
message.destroy()
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
content=<SystemInsideApiCreate ref={copyRef} type={type} entity={{...data.api, path:(data.api.path?.startsWith('/')? data.api.path.substring(1): data.api.path),serviceId:serviceId}} serviceId={serviceId!} teamId={teamId!} modalApiPrefix={apiPrefix} modalPrefixForce={prefixForce}/>
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return
|
||||
}
|
||||
break;}
|
||||
case 'delete':
|
||||
title=$t('删除')
|
||||
content=DELETE_TIPS.default
|
||||
content=$t(DELETE_TIPS.default)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -154,16 +154,12 @@ const SystemInsideApiList:FC = ()=>{
|
||||
};
|
||||
|
||||
const getMemberList = async ()=>{
|
||||
setMemberValueEnum({})
|
||||
setMemberValueEnum([])
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{ members: SimpleMemberItem[] }>>('simple/member',{method:'GET'})
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
const tmpValueEnum:{[k:string]:{text:string}} = {}
|
||||
data.members?.forEach((x:SimpleMemberItem)=>{
|
||||
tmpValueEnum[x.name] = {text:x.name}
|
||||
})
|
||||
setMemberValueEnum(tmpValueEnum)
|
||||
setMemberValueEnum(data.members)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +189,15 @@ const SystemInsideApiList:FC = ()=>{
|
||||
};
|
||||
|
||||
const columns = useMemo(()=>{
|
||||
return SYSTEM_API_TABLE_COLUMNS.map(x=>{if(x.filters &&((x.dataIndex as string[])?.indexOf('creator') !== -1) ){x.valueEnum = memberValueEnum} return {...x,title:typeof x.title === 'string' ? $t(x.title as string) : x.title}})
|
||||
return [...SYSTEM_API_TABLE_COLUMNS].map(x=>{
|
||||
if(x.filters &&((x.dataIndex as string[])?.indexOf('creator') !== -1) ){
|
||||
const tmpValueEnum:{[k:string]:{text:string}} = {}
|
||||
memberValueEnum?.forEach((x:SimpleMemberItem)=>{
|
||||
tmpValueEnum[x.name] = {text:x.name}
|
||||
})
|
||||
x.valueEnum = tmpValueEnum
|
||||
}
|
||||
return {...x,title:typeof x.title === 'string' ? $t(x.title as string) : x.title}})
|
||||
},[memberValueEnum,state.language])
|
||||
|
||||
const handlerSubmit:() => Promise<string | boolean>|undefined= ()=>{
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
|
||||
import { Form, Input, InputNumber } from "antd";
|
||||
import { forwardRef, useEffect, useImperativeHandle } from "react"
|
||||
import { Form, Input, InputNumber, Select } from "antd";
|
||||
import { forwardRef, useEffect, useImperativeHandle, useMemo } from "react"
|
||||
import EditableTableWithModal from "@common/components/aoplatform/EditableTableWithModal";
|
||||
import { PROXY_HEADER_CONFIG } from "../../../const/system/const";
|
||||
import { PROXY_HEADER_CONFIG, UPSTREAM_PROXY_HEADER_TYPE_OPTIONS } from "../../../const/system/const";
|
||||
import { SystemApiProxyType, ProxyHeaderItem, SystemInsideApiProxyHandle, SystemInsideApiProxyProps } from "../../../const/system/type";
|
||||
import { PLACEHOLDER, VALIDATE_MESSAGE } from "@common/const/const";
|
||||
import { $t } from "@common/locales";
|
||||
import { useGlobalContext } from "@common/contexts/GlobalStateContext";
|
||||
|
||||
const SystemInsideApiProxy = forwardRef<SystemInsideApiProxyHandle,SystemInsideApiProxyProps>((props,ref)=>{
|
||||
const {value, onChange, className,initProxyValue} = props
|
||||
|
||||
const {state} = useGlobalContext()
|
||||
const [form] = Form.useForm();
|
||||
|
||||
useEffect(()=>{
|
||||
@@ -26,6 +27,14 @@ const SystemInsideApiProxy = forwardRef<SystemInsideApiProxyHandle,SystemInsideA
|
||||
form.setFieldsValue(value)
|
||||
}, [value,form]);
|
||||
|
||||
const ProxyHeadeerConfig = useMemo(()=>PROXY_HEADER_CONFIG.map((x)=>({
|
||||
...x,
|
||||
...(x.key === 'optType' ? {
|
||||
component: <Select className="w-INPUT_NORMAL" options={UPSTREAM_PROXY_HEADER_TYPE_OPTIONS.map((x)=>({...x, label:$t(x.label)}))}/>
|
||||
} : {})
|
||||
}))
|
||||
,[state.language])
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form
|
||||
@@ -42,24 +51,24 @@ const SystemInsideApiProxy = forwardRef<SystemInsideApiProxyHandle,SystemInsideA
|
||||
label={$t("转发上游路径")}
|
||||
name={'path'}
|
||||
>
|
||||
<Input prefix="/" className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input prefix="/" className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<SystemApiProxyType>
|
||||
label={$t("请求超时时间")}
|
||||
name={'timeout'}
|
||||
extra={$t("单位:ms,最小值:1")}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{required: true}]}
|
||||
>
|
||||
<InputNumber className="w-INPUT_NORMAL"min={1} placeholder={PLACEHOLDER.input} />
|
||||
<InputNumber className="w-INPUT_NORMAL"min={1} placeholder={$t(PLACEHOLDER.input)} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<SystemApiProxyType>
|
||||
label={$t("重试次数")}
|
||||
name={'retry'}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{required: true}]}
|
||||
>
|
||||
<InputNumber className="w-INPUT_NORMAL" min={0} placeholder={PLACEHOLDER.input} />
|
||||
<InputNumber className="w-INPUT_NORMAL" min={0} placeholder={$t(PLACEHOLDER.input)} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<SystemApiProxyType>
|
||||
@@ -67,7 +76,7 @@ const SystemInsideApiProxy = forwardRef<SystemInsideApiProxyHandle,SystemInsideA
|
||||
name={'headers'}
|
||||
>
|
||||
<EditableTableWithModal<ProxyHeaderItem & {_id:string}>
|
||||
configFields={PROXY_HEADER_CONFIG}
|
||||
configFields={ProxyHeadeerConfig}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
import {Tabs} from "antd";
|
||||
import {Outlet, useLocation, useNavigate} from "react-router-dom";
|
||||
import './SystemInsideApproval.module.css'
|
||||
import {FC, useEffect, useState} from "react";
|
||||
import {FC, useEffect, useMemo, useState} from "react";
|
||||
import { SYSTEM_INSIDE_APPROVAL_TAB_ITEMS } from "../../../const/system/const";
|
||||
import { useGlobalContext } from "@common/contexts/GlobalStateContext";
|
||||
import { $t } from "@common/locales";
|
||||
|
||||
|
||||
const SystemInsideApproval:FC = ()=>{
|
||||
@@ -12,6 +14,7 @@ const SystemInsideApproval:FC = ()=>{
|
||||
const query =new URLSearchParams(useLocation().search)
|
||||
const currentUrl = location.pathname
|
||||
const [pageStatus,setPageStatus] = useState<0|1>(Number(query.get('status') ||0) as 0|1)
|
||||
const {state} = useGlobalContext()
|
||||
const onChange = (key: string) => {
|
||||
setPageStatus(Number(key) as 0|1)
|
||||
navigateTo(`${currentUrl}?status=${key}`);
|
||||
@@ -20,10 +23,11 @@ const SystemInsideApproval:FC = ()=>{
|
||||
useEffect(() => {
|
||||
setPageStatus(Number(query.get('status') ||0) as 0|1)
|
||||
}, [currentUrl]);
|
||||
const tabItems = useMemo(()=>SYSTEM_INSIDE_APPROVAL_TAB_ITEMS?.map((x)=>({...x, label:$t(x.label as string) })),[state.language])
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tabs defaultActiveKey={pageStatus.toString()} size="small" className="h-auto bg-MAIN_BG" tabBarStyle={{paddingLeft:'10px'}} tabBarGutter={20} items={SYSTEM_INSIDE_APPROVAL_TAB_ITEMS} onChange={onChange} destroyInactiveTabPane={true}/>
|
||||
<Tabs defaultActiveKey={pageStatus.toString()} size="small" className="h-auto bg-MAIN_BG" tabBarStyle={{paddingLeft:'10px'}} tabBarGutter={20} items={tabItems} onChange={onChange} destroyInactiveTabPane={true}/>
|
||||
<Outlet />
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -38,11 +38,11 @@ const SystemInsideApprovalList:FC = ()=>{
|
||||
const [pageStatus,setPageStatus] = useState<0|1>(Number(query.get('status') ||0) as 0|1)
|
||||
const subscribeRef = useRef<SubscribeApprovalModalHandle>(null)
|
||||
const [approvalBtnLoading,setApprovalBtnLoading] = useState<boolean>(false)
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<{[k:string]:{text:string}}>({})
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<SimpleMemberItem[]>([])
|
||||
const {accessData,state} = useGlobalContext()
|
||||
|
||||
const openModal = async (type:'approval'|'view',entity:SubscribeApprovalTableListItem)=>{
|
||||
message.loading(RESPONSE_TIPS.loading)
|
||||
message.loading($t(RESPONSE_TIPS.loading))
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{approval:SubscribeApprovalInfoType}>>('service/approval/subscribe',{method:'GET',eoParams:{apply:entity!.id, service:serviceId,team:teamId},eoTransformKeys:['apply_project','apply_team','apply_time','approval_time']})
|
||||
message.destroy()
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
@@ -78,7 +78,7 @@ const SystemInsideApprovalList:FC = ()=>{
|
||||
},
|
||||
})
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ const SystemInsideApprovalList:FC = ()=>{
|
||||
setInit((prev)=>prev ? false : prev)
|
||||
return {data:data.approvals, success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -122,16 +122,12 @@ const SystemInsideApprovalList:FC = ()=>{
|
||||
}
|
||||
|
||||
const getMemberList = async ()=>{
|
||||
setMemberValueEnum({})
|
||||
setMemberValueEnum([])
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{ members: SimpleMemberItem[] }>>('simple/member',{method:'GET'})
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
const tmpValueEnum:{[k:string]:{text:string}} = {}
|
||||
data.members?.forEach((x:SimpleMemberItem)=>{
|
||||
tmpValueEnum[x.name] = {text:x.name}
|
||||
})
|
||||
setMemberValueEnum(tmpValueEnum)
|
||||
setMemberValueEnum(data.members)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,9 +160,25 @@ const SystemInsideApprovalList:FC = ()=>{
|
||||
|
||||
|
||||
const columns = useMemo(()=>{
|
||||
const newCol = [...(!(query.get('status'))? SUBSCRIBE_APPROVAL_INNER_TODO_TABLE_COLUMN:SUBSCRIBE_APPROVAL_INNER_DONE_TABLE_COLUMN)]
|
||||
const filteredCol = pageStatus === 0 ? newCol.filter((x)=>TODO_LIST_COLUMN_NOT_INCLUDE_KEY.indexOf(x.dataIndex as string) === -1): newCol
|
||||
return filteredCol.map(x=>{if(x.filters &&((x.dataIndex as string[])?.indexOf('applier') !== -1 || (x.dataIndex as string[])?.indexOf('approver') !== -1) ){x.valueEnum = memberValueEnum} return {...x,title: typeof x.title === 'string' ? $t(x.title as string) : x.title}})
|
||||
const newColumns = [...(!(query.get('status'))? SUBSCRIBE_APPROVAL_INNER_TODO_TABLE_COLUMN:SUBSCRIBE_APPROVAL_INNER_DONE_TABLE_COLUMN)]
|
||||
const filteredCol = pageStatus === 0 ? newColumns.filter((x)=>TODO_LIST_COLUMN_NOT_INCLUDE_KEY.indexOf(x.dataIndex as string) === -1): newColumns
|
||||
return filteredCol.map(x=>{
|
||||
if(x.filters &&((x.dataIndex as string[])?.indexOf('applier') !== -1 || (x.dataIndex as string[])?.indexOf('approver') !== -1) ){
|
||||
const tmpValueEnum :Record<string,{text:string}>= {}
|
||||
console.log(memberValueEnum)
|
||||
memberValueEnum?.forEach((x:SimpleMemberItem)=>{
|
||||
tmpValueEnum[x.name] = {text:$t(x.name)}
|
||||
})
|
||||
x.valueEnum = tmpValueEnum
|
||||
}
|
||||
if(x.dataIndex === 'status'){
|
||||
x.valueEnum = new Map([
|
||||
[0, <span className="text-status_fail">{$t('拒绝')}</span>],
|
||||
[2,<span className="text-status_success">{$t('通过')}</span>],
|
||||
])
|
||||
}
|
||||
|
||||
return {...x,title: typeof x.title === 'string' ? $t(x.title as string) : x.title}})
|
||||
},[pageStatus,memberValueEnum,state.language])
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
import { Tabs } from "antd"
|
||||
import { useState, useEffect, FC } from "react"
|
||||
import { Link, Outlet, useLocation, useNavigate, useParams } from "react-router-dom"
|
||||
import { useState, useEffect, FC, useMemo } from "react"
|
||||
import { Link, Outlet, useLocation, useNavigate } from "react-router-dom"
|
||||
import { useBreadcrumb } from "@common/contexts/BreadcrumbContext"
|
||||
import { RouterParams } from "@core/components/aoplatform/RenderRoutes"
|
||||
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()
|
||||
@@ -14,7 +14,7 @@ const SystemInsidePublic:FC = ()=>{
|
||||
const currentUrl = location.pathname
|
||||
const [pageStatus,setPageStatus] = useState<0|1>(Number(query.get('status') ||0) as 0|1)
|
||||
const navigateTo = useNavigate()
|
||||
const { teamId} = useParams<RouterParams>();
|
||||
const { state } = useGlobalContext()
|
||||
|
||||
const onChange = (key: string) => {
|
||||
setPageStatus(Number(key) as 0|1)
|
||||
@@ -35,10 +35,11 @@ const SystemInsidePublic:FC = ()=>{
|
||||
}
|
||||
])
|
||||
}, []);
|
||||
|
||||
|
||||
const tabItems = useMemo(()=>SYSTEM_PUBLISH_TAB_ITEMS?.map((x)=>({...x, label:$t(x.label as string) })),[state.language])
|
||||
return (
|
||||
<>
|
||||
<Tabs defaultActiveKey={pageStatus.toString()} size="small" className="h-auto bg-MAIN_BG" tabBarStyle={{paddingLeft:'10px'}} tabBarGutter={20} items={SYSTEM_PUBLISH_TAB_ITEMS} onChange={onChange} destroyInactiveTabPane={true}/>
|
||||
<Tabs defaultActiveKey={pageStatus.toString()} size="small" className="h-auto bg-MAIN_BG" tabBarStyle={{paddingLeft:'10px'}} tabBarGutter={20} items={tabItems} onChange={onChange} destroyInactiveTabPane={true}/>
|
||||
<Outlet />
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useParams, Link, useLocation } from "react-router-dom";
|
||||
import PageList, { PageProColumns } from "@common/components/aoplatform/PageList";
|
||||
import { PublishApprovalModalContent } from "@common/components/aoplatform/PublishApprovalModalContent";
|
||||
import { RouterParams } from "@core/components/aoplatform/RenderRoutes";
|
||||
import { PUBLISH_APPROVAL_RECORD_INNER_TABLE_COLUMN, PUBLISH_APPROVAL_VERSION_INNER_TABLE_COLUMN } from "@common/const/approval/const";
|
||||
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 { SimpleMemberItem } from "@common/const/type.ts";
|
||||
import { MemberTableListItem } from "../../../const/member/type";
|
||||
@@ -37,7 +37,7 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
const [pageType, setPageType] = useState<'insideSystem'|'global'>('insideSystem')
|
||||
const query =new URLSearchParams(useLocation().search)
|
||||
const currLocation = useLocation().pathname
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<{[k:string]:{text:string}}>({})
|
||||
const [memberValueEnum, setMemberValueEnum] = useState<SimpleMemberItem[]>([])
|
||||
const {accessData,state} = useGlobalContext()
|
||||
const [drawerTitle, setDrawerTitle] = useState<string>('')
|
||||
const [drawerType, setDrawerType] = useState<'approval'|'view'|'add'|'publish'|'online'>('view')
|
||||
@@ -67,7 +67,7 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
setInit((prev)=>prev ? false : prev)
|
||||
return {data:finalRes, success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
setInit((prev)=>prev ? false : prev)
|
||||
return {data:[], success:false}
|
||||
}
|
||||
@@ -100,11 +100,11 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
fetchData<BasicResponse<null>>(url,{method,eoParams:params}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})}
|
||||
@@ -134,7 +134,7 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
setIsOkToPublish(false)
|
||||
switch (type) {
|
||||
case 'view':{
|
||||
message.loading(RESPONSE_TIPS.loading);
|
||||
message.loading($t(RESPONSE_TIPS.loading));
|
||||
const viewPublish:boolean = pageStatus !== 0 || ((entity as PublishVersionTableListItem)?.status && (entity as PublishVersionTableListItem)?.status !== 'none')
|
||||
const { code, data, msg } = await fetchData<BasicResponse<{ publish: PublishApprovalInfoType } | { release:SystemPublishReleaseItem}>>(
|
||||
viewPublish ? 'service/publish':'service/release',
|
||||
@@ -145,13 +145,13 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
setDrawerTitle($t('查看详情'))
|
||||
setDrawerType(type)
|
||||
setDrawerData(viewPublish ? data.publish : data.release)} else {
|
||||
message.error(msg || RESPONSE_TIPS.error);
|
||||
message.error(msg || $t(RESPONSE_TIPS.error));
|
||||
return
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'online':{
|
||||
message.loading(RESPONSE_TIPS.loading);
|
||||
message.loading($t(RESPONSE_TIPS.loading));
|
||||
const { code, data, msg } = await fetchData<BasicResponse<{ publish: PublishApprovalInfoType }>>(
|
||||
'service/publish',
|
||||
{ method: 'GET', eoParams:{ id: (entity as PublishVersionTableListItem)?.flowId,service:serviceId,team:teamId },eoTransformKeys:['version_remark'] }
|
||||
@@ -163,13 +163,13 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
setDrawerOkTitle($t('上线'))
|
||||
setDrawerData({...data.publish, flowId:(entity as PublishVersionTableListItem)?.flowId})
|
||||
} else {
|
||||
message.error(msg || RESPONSE_TIPS.error);
|
||||
message.error(msg || $t(RESPONSE_TIPS.error));
|
||||
return
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'approval':{
|
||||
message.loading(RESPONSE_TIPS.loading);
|
||||
message.loading($t(RESPONSE_TIPS.loading));
|
||||
const { code, data, msg } = await fetchData<BasicResponse<{ publish: PublishApprovalInfoType }>>(
|
||||
'service/publish',
|
||||
{ method: 'GET', eoParams:{ id: (entity as PublishVersionTableListItem)?.flowId,service:serviceId,team:teamId },eoTransformKeys:['version_remark'] }
|
||||
@@ -181,14 +181,14 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
setDrawerData(data.publish)
|
||||
setDrawerOkTitle($t('通过'))
|
||||
} else {
|
||||
message.error(msg || RESPONSE_TIPS.error);
|
||||
message.error(msg || $t(RESPONSE_TIPS.error));
|
||||
return
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'publish':
|
||||
case 'add':{
|
||||
message.loading(RESPONSE_TIPS.loading);
|
||||
message.loading($t(RESPONSE_TIPS.loading));
|
||||
const { code, data, msg } = await fetchData<BasicResponse<{ diffs: PublishApprovalInfoType }>>(
|
||||
'service/publish/check',
|
||||
{ method: 'GET', eoParams:{service:serviceId,team:teamId, ...(type === 'publish' ?{ release:entity?.id }:{})},eoTransformKeys:['version_remark'] }
|
||||
@@ -201,7 +201,7 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
setDrawerOkTitle($t('确认'))
|
||||
setIsOkToPublish(data.isOk??true)
|
||||
} else {
|
||||
message.error(msg || RESPONSE_TIPS.error);
|
||||
message.error(msg || $t(RESPONSE_TIPS.error));
|
||||
return
|
||||
}
|
||||
break;
|
||||
@@ -217,7 +217,7 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
switch (type) {
|
||||
case 'delete':
|
||||
title = $t('删除');
|
||||
content = DELETE_TIPS.default;
|
||||
content = $t(DELETE_TIPS.default);
|
||||
break;
|
||||
case 'rollback':
|
||||
title = $t('回滚');
|
||||
@@ -364,21 +364,49 @@ const SystemInsidePublicList:FC = ()=>{
|
||||
|
||||
|
||||
const getMemberList = async ()=>{
|
||||
setMemberValueEnum({})
|
||||
setMemberValueEnum([])
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{ members: SimpleMemberItem[] }>>('simple/member',{method:'GET'})
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
const tmpValueEnum:{[k:string]:{text:string}} = {}
|
||||
data.members?.forEach((x:SimpleMemberItem)=>{
|
||||
tmpValueEnum[x.name] = {text:x.name}
|
||||
})
|
||||
setMemberValueEnum(tmpValueEnum)
|
||||
setMemberValueEnum(data.members)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}
|
||||
|
||||
const columns = useMemo(()=>{
|
||||
return ((pageType === 'insideSystem' || pageStatus === 0 ) ? PUBLISH_APPROVAL_VERSION_INNER_TABLE_COLUMN:PUBLISH_APPROVAL_RECORD_INNER_TABLE_COLUMN).map(x=>{if(x.filters &&(x.dataIndex as string[])?.indexOf('creator') !== -1){x.valueEnum = memberValueEnum} return {...x,title:typeof x.title === 'string' ? $t(x.title as string) : x.title}})
|
||||
return ((pageType === 'insideSystem' || pageStatus === 0 ) ?
|
||||
PUBLISH_APPROVAL_VERSION_INNER_TABLE_COLUMN
|
||||
:PUBLISH_APPROVAL_RECORD_INNER_TABLE_COLUMN)
|
||||
.map(x=>{
|
||||
if(x.filters &&(x.dataIndex as string[])?.indexOf('creator') !== -1){
|
||||
const tmpValueEnum:{[k:string]:{text:string}} = {}
|
||||
memberValueEnum?.forEach((x:SimpleMemberItem)=>{
|
||||
tmpValueEnum[x.name] = {text:$t(x.name)}
|
||||
})
|
||||
x.valueEnum = tmpValueEnum
|
||||
}
|
||||
if(x.dataIndex === 'status'){
|
||||
x.valueEnum = (pageType === 'insideSystem' || pageStatus === 0 ) ? new Map([
|
||||
['apply',<span className={PublishTableStatusColorClass.apply}>{$t(PublishApplyStatusEnum.apply || '-')}</span>],
|
||||
['running',<span className={PublishTableStatusColorClass.running}>{$t(PublishApplyStatusEnum.running || '-')}</span>],
|
||||
['none',<span className={PublishTableStatusColorClass.none}>{$t(PublishApplyStatusEnum.none || '-')}</span>],
|
||||
['refuse',<span className={PublishTableStatusColorClass.refuse}>{$t(PublishApplyStatusEnum.refuse || '-')}</span>],
|
||||
['publishing',<span className={PublishTableStatusColorClass.publishing}>{$t(PublishApplyStatusEnum.publishing || '-')}</span>],
|
||||
['error',<span className={PublishTableStatusColorClass.error}>{$t(PublishApplyStatusEnum.error || '-')}</span>],
|
||||
]) : new Map([
|
||||
['apply',<span className={PublishTableStatusColorClass.apply}>{$t(PublishStatusEnum.apply || '-')}</span>],
|
||||
['accept',<span className={PublishTableStatusColorClass.accept}>{$t(PublishStatusEnum.accept || '-')}</span>],
|
||||
['done',<span className={PublishTableStatusColorClass.done}>{$t(PublishStatusEnum.done || '-')}</span>],
|
||||
['stop',<span className={PublishTableStatusColorClass.stop}>{$t(PublishStatusEnum.stop || '-')}</span>],
|
||||
['close',<span className={PublishTableStatusColorClass.close}>{$t(PublishStatusEnum.close || '-')}</span>],
|
||||
['refuse',<span className={PublishTableStatusColorClass.refuse}>{$t(PublishStatusEnum.refuse || '-')}</span>],
|
||||
['publishing',<span className={PublishTableStatusColorClass.publishing}>{$t(PublishStatusEnum.publishing || '-')}</span>],
|
||||
['error',<span className={PublishTableStatusColorClass.error}>{$t(PublishStatusEnum.error || '-')}</span>],
|
||||
])
|
||||
}
|
||||
return {...x,title:typeof x.title === 'string' ? $t(x.title as string) : x.title}
|
||||
}
|
||||
)
|
||||
},[pageType, pageStatus, memberValueEnum,state.language])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function SystemInsidePublishOnline(props:SystemInsidePublishOnlin
|
||||
setIsStopped(true)
|
||||
}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> message.error(errorInfo))
|
||||
}
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
|
||||
import { App, Button, Divider, Form, Input, InputNumber, Radio, Select, Spin } from "antd";
|
||||
import {forwardRef, useEffect, useImperativeHandle, useRef, useState} from "react";
|
||||
import {forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState} from "react";
|
||||
import { LoadingOutlined } from "@ant-design/icons";
|
||||
import { GlobalNodeItem, ProxyHeaderItem, ServiceUpstreamFieldType, SystemInsideUpstreamConfigHandle, SystemInsideUpstreamContentHandle } from "../../../const/system/type.ts";
|
||||
import { FormItemProps } from "antd/es/form/index";
|
||||
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 { typeOptions, SYSTEM_UPSTREAM_GLOBAL_CONFIG_TABLE_COLUMNS, schemeOptions, balanceOptions, passHostOptions, PROXY_HEADER_CONFIG } from "../../../const/system/const.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, 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";
|
||||
|
||||
const DEFAULT_FORM_VALUE = {
|
||||
driver:'static',
|
||||
@@ -34,6 +35,7 @@ const SystemInsideUpstreamContent= forwardRef<SystemInsideUpstreamContentHandle>
|
||||
const [formShowHost, setFormShowHost] = useState<boolean>(false);
|
||||
const { setBreadcrumb } = useBreadcrumb()
|
||||
const [form] = Form.useForm();
|
||||
const {state} = useGlobalContext()
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
save:()=>formRef.current?.save()
|
||||
@@ -59,11 +61,11 @@ const SystemInsideUpstreamContent= forwardRef<SystemInsideUpstreamContentHandle>
|
||||
}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
return Promise.resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
return Promise.reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return Promise.reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> {return Promise.reject(errorInfo)})
|
||||
})
|
||||
@@ -80,7 +82,7 @@ const SystemInsideUpstreamContent= forwardRef<SystemInsideUpstreamContentHandle>
|
||||
setFormShowHost(data.upstream.passHost === 'rewrite')
|
||||
},0)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).finally(()=>{
|
||||
setLoading(false)
|
||||
@@ -99,7 +101,7 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
|
||||
if (filteredValue.length > 0) {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject(new Error(VALIDATE_MESSAGE.required));
|
||||
return Promise.reject(new Error($t(VALIDATE_MESSAGE.required)));
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -117,6 +119,19 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
|
||||
getUpstreamInfo();
|
||||
}, [serviceId]);
|
||||
|
||||
const typeOptions = useMemo(()=>UPSTREAM_TYPE_OPTIONS.map(x=>({...x, label:$t(x.label)})),[state.language])
|
||||
const balanceOptions = useMemo(()=>UPSTREAM_BALANCE_OPTIONS.map(x=>({...x, label:$t(x.label)})),[state.language])
|
||||
const passHostOptions = useMemo(()=>UPSTREAM_PASS_HOST_OPTIONS.map(x=>({...x, label:$t(x.label)})),[state.language])
|
||||
|
||||
|
||||
const ProxyHeadeerConfig = useMemo(()=>PROXY_HEADER_CONFIG.map((x)=>({
|
||||
...x,
|
||||
...(x.key === 'optType' ? {
|
||||
component: <Select className="w-INPUT_NORMAL" options={UPSTREAM_PROXY_HEADER_TYPE_OPTIONS.map((x)=>({...x, label:$t(x.label)}))}/>
|
||||
} : {})
|
||||
}))
|
||||
,[state.language])
|
||||
|
||||
return (
|
||||
<Spin indicator={<LoadingOutlined style={{ fontSize: 24 }} spin />} spinning={loading}>
|
||||
<div className={`flex-1 h-full overflow-auto pr-PAGE_INSIDE_X`} >
|
||||
@@ -135,7 +150,7 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
|
||||
<Form.Item<ServiceUpstreamFieldType>
|
||||
label={$t("上游类型")}
|
||||
name="driver"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Radio.Group options={typeOptions} />
|
||||
</Form.Item>
|
||||
@@ -145,7 +160,7 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
|
||||
label={$t("服务地址")}
|
||||
name="nodes"
|
||||
tooltip={$t("后端默认使用的IP地址")}
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required },
|
||||
rules={[{ required: true },
|
||||
...globalConfigNodesRule]}
|
||||
>
|
||||
<EditableTable<GlobalNodeItem & {_id:string}>
|
||||
@@ -156,16 +171,16 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
|
||||
<Form.Item<ServiceUpstreamFieldType>
|
||||
label={$t("请求协议")}
|
||||
name="scheme"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Select className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.select} options={schemeOptions}>
|
||||
<Select className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.select)} options={schemeOptions}>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<ServiceUpstreamFieldType>
|
||||
label={$t("负载均衡")}
|
||||
name="balance"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Radio.Group className="flex flex-col gap-[8px] mt-[5px]" options={balanceOptions} />
|
||||
</Form.Item>
|
||||
@@ -173,18 +188,18 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
|
||||
<Form.Item<ServiceUpstreamFieldType>
|
||||
label={$t("转发 Host")}
|
||||
name="passHost"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Select className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.select} options={passHostOptions} onChange={(val)=>setFormShowHost(val === 'rewrite')}>
|
||||
<Select className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.select)} options={passHostOptions} onChange={(val)=>setFormShowHost(val === 'rewrite')}>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
{formShowHost && <Form.Item<ServiceUpstreamFieldType>
|
||||
label={$t("重写域名")}
|
||||
name="upstreamHost"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
}
|
||||
|
||||
@@ -193,7 +208,7 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
|
||||
<Form.Item<ServiceUpstreamFieldType>
|
||||
label={$t("超时时间")}
|
||||
name="timeout"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<InputNumber className="w-INPUT_NORMAL" min={1} addonAfter={<span className="whitespace-nowrap">ms</span> }/>
|
||||
</Form.Item>
|
||||
@@ -201,17 +216,17 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
|
||||
<Form.Item<ServiceUpstreamFieldType>
|
||||
label={$t("超时重试次数")}
|
||||
name="retry"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<InputNumber className="w-INPUT_NORMAL" min={1} addonAfter={<span>次</span>} />
|
||||
<InputNumber className="w-INPUT_NORMAL" min={1} addonAfter={<span>{$t('次')}</span>} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<ServiceUpstreamFieldType>
|
||||
label={$t("调用频率限制")}
|
||||
name="limitPeerSecond"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<InputNumber className="w-INPUT_NORMAL" min={1} addonAfter={<span className="whitespace-nowrap">次/秒</span> } />
|
||||
<InputNumber className="w-INPUT_NORMAL" min={1} addonAfter={<span className="whitespace-nowrap">{$t('次/秒')}</span> } />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<ServiceUpstreamFieldType>
|
||||
@@ -220,7 +235,7 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
|
||||
className="mb-0"
|
||||
>
|
||||
<EditableTableWithModal<ProxyHeaderItem & {_id:string}>
|
||||
configFields={PROXY_HEADER_CONFIG}
|
||||
configFields={ProxyHeadeerConfig}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
|
||||
@@ -57,12 +57,12 @@ const TeamConfig= forwardRef<TeamConfigHandle,TeamConfigProps>((props,ref) => {
|
||||
return fetchData<BasicResponse<{team:TeamConfigFieldType}>>(pageType === 'manage'?'manager/team' : 'team',{method:onEdit ? 'PUT' : 'POST', eoParams:params,eoBody:(value),eoTransformKeys:['teamId']}).then(response=>{
|
||||
const {code,data,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
setTeamInfo?.(data.team)
|
||||
return Promise.resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
return Promise.reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return Promise.reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=>{
|
||||
return Promise.reject(errorInfo)
|
||||
@@ -78,7 +78,7 @@ const TeamConfig= forwardRef<TeamConfigHandle,TeamConfigProps>((props,ref) => {
|
||||
setCanDelete(data.team.canDelete)
|
||||
setTimeout(()=>{form.setFieldsValue({...data.team})},0)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
};
|
||||
@@ -92,7 +92,7 @@ const TeamConfig= forwardRef<TeamConfigHandle,TeamConfigProps>((props,ref) => {
|
||||
label:x.name, value:x.id
|
||||
}}) || [])
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -102,13 +102,13 @@ const TeamConfig= forwardRef<TeamConfigHandle,TeamConfigProps>((props,ref) => {
|
||||
fetchData<BasicResponse<null>>(`manager/team`,{method:'DELETE',eoParams:{id:form.getFieldValue('id')}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
navigateTo('/team/list')
|
||||
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -150,18 +150,18 @@ const TeamConfig= forwardRef<TeamConfigHandle,TeamConfigProps>((props,ref) => {
|
||||
<Form.Item<TeamConfigFieldType>
|
||||
label={$t("团队名称")}
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<TeamConfigFieldType>
|
||||
label={$t("团队 ID")}
|
||||
name="id"
|
||||
extra={$t("团队 ID(team_id)可用于检索团队,一旦保存无法修改。")}
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" disabled={onEdit} placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" disabled={onEdit} placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
{!onEdit &&
|
||||
@@ -169,9 +169,9 @@ const TeamConfig= forwardRef<TeamConfigHandle,TeamConfigProps>((props,ref) => {
|
||||
label={$t("团队负责人")}
|
||||
name="master"
|
||||
extra={$t("负责人对团队内的团队、服务、成员有管理权限")}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{required: true}]}
|
||||
>
|
||||
<Select className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.select} options={managerOption}>
|
||||
<Select className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.select)} options={managerOption}>
|
||||
</Select>
|
||||
</Form.Item>}
|
||||
|
||||
@@ -180,7 +180,7 @@ const TeamConfig= forwardRef<TeamConfigHandle,TeamConfigProps>((props,ref) => {
|
||||
label={$t("描述")}
|
||||
name="description"
|
||||
>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
{ onEdit &&
|
||||
|
||||
@@ -127,7 +127,7 @@ const TeamInsideMember:FC = ()=>{
|
||||
}
|
||||
return {data:data.members, success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -143,13 +143,13 @@ const TeamInsideMember:FC = ()=>{
|
||||
fetchData<BasicResponse<null>>('team/member',{method:'POST' ,eoBody:({users:memberKeyFromModal}),eoParams:{team:teamId}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
manualReloadTable()
|
||||
cleanModalData()
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo)).finally(()=>setAddMemberBtnLoading(false))
|
||||
})
|
||||
@@ -161,11 +161,11 @@ const TeamInsideMember:FC = ()=>{
|
||||
fetchData<BasicResponse<null>>(`team/member`,{method:'DELETE',eoParams:{team:teamId,user:entity.user.id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -219,11 +219,11 @@ const TeamInsideMember:FC = ()=>{
|
||||
fetchData<BasicResponse<null>>(`team/member/role`, {method: 'PUT',eoBody:({roles:value, users:[entity.user.id]}), eoParams: {team:teamId}}).then(response => {
|
||||
const {code, msg} = response
|
||||
if (code === STATUS_CODE.SUCCESS) {
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
} else {
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -262,7 +262,7 @@ const TeamInsideMember:FC = ()=>{
|
||||
setColumns(newCol)
|
||||
return
|
||||
} else {
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ const TeamInsidePage:FC = ()=> {
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setTeamInfo?.(data.team)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ const TeamList:FC = ()=>{
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
return {data:data.teams, success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -56,11 +56,11 @@ const TeamList:FC = ()=>{
|
||||
fetchData<BasicResponse<null>>(`manager/team`,{method:'DELETE',eoParams:{id:entity.id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -76,7 +76,7 @@ const TeamList:FC = ()=>{
|
||||
})
|
||||
setMemberValueEnum(tmpValueEnum)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,21 +94,21 @@ const TeamList:FC = ()=>{
|
||||
setModalVisible(true)
|
||||
return;}
|
||||
case 'edit':{
|
||||
message.loading(RESPONSE_TIPS.loading)
|
||||
message.loading($t(RESPONSE_TIPS.loading))
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{team:TeamConfigFieldType}>>(`manager/team`,{method:'GET',eoParams:{id:entity!.id}})
|
||||
message.destroy()
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setCurTeam({...data.team,master:data.team.master.id})
|
||||
setModalVisible(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return
|
||||
}
|
||||
setModalType('edit')
|
||||
return;}
|
||||
case 'delete':
|
||||
title=$t('删除')
|
||||
content=DELETE_TIPS.default
|
||||
content=$t(DELETE_TIPS.default)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ const ChangePsw= () => {
|
||||
}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
form.resetFields()
|
||||
}).catch((errorInfo)=> {console.warn(errorInfo)})
|
||||
@@ -51,7 +51,7 @@ const ChangePsw= () => {
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: VALIDATE_MESSAGE.required,
|
||||
|
||||
},
|
||||
]}
|
||||
>
|
||||
@@ -63,7 +63,7 @@ const ChangePsw= () => {
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: VALIDATE_MESSAGE.required,
|
||||
|
||||
},
|
||||
]}
|
||||
>
|
||||
@@ -77,7 +77,7 @@ const ChangePsw= () => {
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: VALIDATE_MESSAGE.required,
|
||||
|
||||
},
|
||||
({ getFieldValue }) => ({
|
||||
validator(_, value) {
|
||||
|
||||
@@ -56,7 +56,7 @@ export default function MonitorApiPage(props:MonitorApiPageProps){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setApiOptionList(data.apis?.map((x:EntityItem)=>({label:x.name, value:x.id})))
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
return setApiOptionList([])
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -70,7 +70,7 @@ export default function MonitorApiPage(props:MonitorApiPageProps){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setProjectOptionList(data.projects?.map((x:EntityItem)=>({label:x.name, value:x.id})))
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
return setProjectOptionList([])
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -113,7 +113,7 @@ export default function MonitorApiPage(props:MonitorApiPageProps){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
exportExcel($t('API调用统计'), [query!.start!, query!.end!], $t('API调用统计'), 'dashboard_api', API_TABLE_GLOBAL_COLUMNS_CONFIG, data.statistics)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
}
|
||||
})
|
||||
};
|
||||
@@ -135,7 +135,7 @@ export default function MonitorApiPage(props:MonitorApiPageProps){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
return {data:data.statistics?.map((x:MonitorApiData)=>{x.proxyRate = Number((x.proxyRate*100).toFixed(2));x.requestRate = Number((x.requestRate*100).toFixed(2));return x}), success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
|
||||
@@ -61,7 +61,7 @@ export default function MonitorAppPage(props:MonitorAppPageProps){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setListOfApps(data.projects?.map((x:EntityItem)=>({label:x.name, value:x.id})))
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
return setListOfApps([])
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -101,7 +101,7 @@ export default function MonitorAppPage(props:MonitorAppPageProps){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
exportExcel($t('应用调用统计'), [query!.start!, query!.end!], $t('应用调用统计'), 'dashboard_application', APPLICATION_TABLE_GLOBAL_COLUMNS_CONFIG, data.statistics)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
}
|
||||
})
|
||||
};
|
||||
@@ -118,7 +118,7 @@ export default function MonitorAppPage(props:MonitorAppPageProps){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
return {data:data.statistics?.map((x:MonitorSubscriberData)=>{x.proxyRate = Number((x.proxyRate*100).toFixed(2));x.requestRate = Number((x.requestRate*100).toFixed(2));return x}), success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
|
||||
@@ -72,7 +72,7 @@ export default function MonitorDetailPage(props:MonitorDetailPageProps){
|
||||
// this.invokeLineRef?.changeLineChart()
|
||||
}else{
|
||||
setInvokeStaticError(true)
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
}
|
||||
}).catch(()=>{setQueryBtnLoading(false)})
|
||||
};
|
||||
@@ -84,7 +84,7 @@ export default function MonitorDetailPage(props:MonitorDetailPageProps){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
return {data:data.statistics?.map((x:(MonitorApiData|MonitorSubscriberData))=>{x.proxyRate = Number((x.proxyRate*100).toFixed(2));x.requestRate = Number((x.requestRate*100).toFixed(2));return x}), success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -113,7 +113,7 @@ export default function MonitorDetailPage(props:MonitorDetailPageProps){
|
||||
setModalVisible(true);
|
||||
}else{
|
||||
setInvokeStaticError(true)
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ export default function MonitorSubPage(props:MonitorSubPageProps){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setListOfProjects(data.projects?.map((x:EntityItem)=>({label:x.name, value:x.id})))
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
return setListOfProjects([])
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -105,7 +105,7 @@ export default function MonitorSubPage(props:MonitorSubPageProps){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
exportExcel($t('服务调用统计'), [query!.start!, query!.end!], $t('服务调用统计'), 'dashboard_service', SERVICE_TABLE_GLOBAL_COLUMNS_CONFIG, data.statistics)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
}
|
||||
})
|
||||
};
|
||||
@@ -122,7 +122,7 @@ export default function MonitorSubPage(props:MonitorSubPageProps){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
return {data:data.statistics?.map((x:MonitorSubscriberData)=>{x.proxyRate = Number((x.proxyRate*100).toFixed(2));x.requestRate = Number((x.requestRate*100).toFixed(2));return x}), success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
|
||||
@@ -129,7 +129,7 @@ const MonitorTotalPage = (props:MonitorTotalPageProps) => {
|
||||
setTotalEmpty(data.requestSummary.total === 0 && data.proxySummary.total === 0)
|
||||
}else{
|
||||
setPieError(true)
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
}
|
||||
}).finally(()=>{
|
||||
dispatch({ type: ACTIONS.REQUEST_COMPLETE, payload: 'getPieData' });
|
||||
@@ -148,7 +148,7 @@ const MonitorTotalPage = (props:MonitorTotalPageProps) => {
|
||||
// this.invokeLineRef?.changeLineChart()
|
||||
}else{
|
||||
setInvokeStaticError(true)
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
}
|
||||
}).finally(()=>{
|
||||
dispatch({ type: ACTIONS.REQUEST_COMPLETE, payload: 'getInvokeData' });
|
||||
@@ -165,7 +165,7 @@ const MonitorTotalPage = (props:MonitorTotalPageProps) => {
|
||||
// this.trafficLineRef?.changeLineChart()
|
||||
}else{
|
||||
setTrafficStaticError(true)
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
}
|
||||
}).finally(()=>{
|
||||
dispatch({ type: ACTIONS.REQUEST_COMPLETE, payload: 'getMessageData' });
|
||||
@@ -180,7 +180,7 @@ const MonitorTotalPage = (props:MonitorTotalPageProps) => {
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
return {data:data.top10.map((x:MonitorApiData | MonitorSubscriberData)=>{x.proxyRate = Number((x.proxyRate*100).toFixed(2));x.requestRate = Number((x.requestRate*100).toFixed(2));return x}), success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.dataError)
|
||||
message.error(msg || $t(RESPONSE_TIPS.dataError))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
|
||||
@@ -23,11 +23,11 @@ export const ApplyServiceModal = forwardRef<ApplyServiceHandle,ApplyServiceProps
|
||||
fetchData<BasicResponse<null>>('catalogue/service/subscribe',{method:'POST',eoParams:{team:entity?.team?.id}, eoBody:({...value,service:entity.id})}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -59,7 +59,7 @@ export const ApplyServiceModal = forwardRef<ApplyServiceHandle,ApplyServiceProps
|
||||
<Form.Item
|
||||
label={$t("应用")}
|
||||
name="applications"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required }]}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Select className="w-INPUT_NORMAL" disabled={reApply} placeholder={$t("搜索或选择应用")} mode="multiple" options={mySystemOptionList?.filter((x)=>x.value !== entity.id)}/>
|
||||
</Form.Item>
|
||||
|
||||
@@ -45,7 +45,7 @@ const ServiceHubDetail = ()=>{
|
||||
setServiceDoc(DOMPurify.sanitize(data.service.document))
|
||||
setActiveKey(data.service.apis.map((x)=>x.id))
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -79,7 +79,7 @@ const ServiceHubDetail = ()=>{
|
||||
label:x.name, value:x.id
|
||||
}}))
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export const ServiceHubGroup = ({children,filterOption,dispatch}:ServiceHubGroup
|
||||
dispatch({type:SERVICE_HUB_LIST_ACTIONS.SET_SELECTED_CATE,payload:[...data.catalogues.map((x:CategorizesType)=>x.id)]})
|
||||
dispatch({type:SERVICE_HUB_LIST_ACTIONS.SET_SELECTED_TAG,payload:[...data.tags.map((x:EntityItem)=>x.id),'empty']})
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ const ServiceHubList:FC = ()=>{
|
||||
dispatch({type:SERVICE_HUB_LIST_ACTIONS.SET_SERVICES,payload: filterServiceList({...filterOption, servicesList:data.services})})
|
||||
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).finally(()=>{ dispatch({type:SERVICE_HUB_LIST_ACTIONS.LIST_LOADING,payload:false})})
|
||||
}
|
||||
|
||||
@@ -29,11 +29,11 @@ export const ApprovalModalContent = forwardRef<SubSubscribeApprovalModalHandle,S
|
||||
fetchData<BasicResponse<null>>('catalogue/service/subscribe',{method: 'POST',eoParams:{team:teamId}, eoBody:({service:data!.service.id, applications:[serviceId], reason:value.reason})}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -76,13 +76,13 @@ export const ApprovalModalContent = forwardRef<SubSubscribeApprovalModalHandle,S
|
||||
label={$t("申请原因")}
|
||||
name="reason"
|
||||
>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" disabled={type === 'view'} placeholder={PLACEHOLDER.input} />
|
||||
<Input.TextArea className="w-INPUT_NORMAL" disabled={type === 'view'} placeholder={$t(PLACEHOLDER.input)} />
|
||||
</Form.Item>
|
||||
<Form.Item<FieldType>
|
||||
label={$t("审核意见")}
|
||||
name="opinion"
|
||||
>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input} disabled={true} />
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)} disabled={true} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</WithPermission>
|
||||
|
||||
+26
-26
@@ -35,11 +35,11 @@ export const ManagementAuthorityConfig = forwardRef<ManagementAuthorityConfigHan
|
||||
fetchData<BasicResponse<null>>('app/authorization',{method:type === 'add'? 'POST' : 'PUT',eoBody:({...value,expireTime:value.expireTime ? value.expireTime.unix() : 0}), eoParams:type === 'add' ? {app:appId,team:teamId}:{authorization:data!.id,app:appId,team:teamId},eoTransformKeys:['hideCredential','expireTime','tokenName','userName']}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -107,27 +107,27 @@ export const ManagementAuthorityConfig = forwardRef<ManagementAuthorityConfigHan
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("名称")}
|
||||
name="name"
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("鉴权类型")}
|
||||
name="driver"
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{required: true}]}
|
||||
>
|
||||
<Select disabled={type === 'edit'} className="w-INPUT_NORMAL" options={[
|
||||
{label:'Basic',value:'basic'},
|
||||
{label:'Jwt',value:'jwt'},
|
||||
{label:'AkSk',value:'aksk'},
|
||||
{label:'Apikey',value:'apikey'}]} onChange={(e)=>onDriverChange(e)} placeholder={PLACEHOLDER.input}/>
|
||||
{label:'Apikey',value:'apikey'}]} onChange={(e)=>onDriverChange(e)} placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="tokenName"
|
||||
label={$t("参数位置")}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" addonBefore={prefixSelector} style={{width: '100%'}}/>
|
||||
</Form.Item>
|
||||
@@ -139,17 +139,17 @@ export const ManagementAuthorityConfig = forwardRef<ManagementAuthorityConfigHan
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("用户名")}
|
||||
name={['config','userName']}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.startWithAlphabet}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.startWithAlphabet)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("密码")}
|
||||
name={['config','password']}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
</>
|
||||
case 'jwt':
|
||||
@@ -157,15 +157,15 @@ export const ManagementAuthorityConfig = forwardRef<ManagementAuthorityConfigHan
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("Iss")}
|
||||
name={['config','iss']}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{required: true}]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("签名算法")}
|
||||
name={['config','algorithm']}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{required: true}]}
|
||||
>
|
||||
<Select className="w-INPUT_NORMAL" options={ALGORITHM_ITEM} onChange={(value)=>{onAlgorithmChange(value)}}/>
|
||||
</Form.Item>
|
||||
@@ -173,30 +173,30 @@ export const ManagementAuthorityConfig = forwardRef<ManagementAuthorityConfigHan
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={ algorithm.includes('HS') ? $t('Secret'):$t('RSA 公钥')}
|
||||
name={algorithm.includes('HS') ? ['config','secret']:['config','publicKey']}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{required: true}]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("用户名")}
|
||||
name={['config','user']}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("用户名 JsonPath")}
|
||||
name={['config','userPath']}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("校验字段")}
|
||||
name={['config','claimsToVerify']}
|
||||
>
|
||||
<Select className="w-INPUT_NORMAL" mode="multiple" options={[{label:'exp',value:'exp'},{label:'nbf',value:'nbf'}]} placeholder={PLACEHOLDER.input}/>
|
||||
<Select className="w-INPUT_NORMAL" mode="multiple" options={[{label:'exp',value:'exp'},{label:'nbf',value:'nbf'}]} placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
{algorithm.includes('HS') && <Form.Item<EditAuthFieldType>
|
||||
@@ -211,17 +211,17 @@ export const ManagementAuthorityConfig = forwardRef<ManagementAuthorityConfigHan
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("AK")}
|
||||
name={['config','ak']}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{required: true}]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("SK")}
|
||||
name={['config','sk']}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required}]}
|
||||
rules={[{required: true}]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
</>
|
||||
case 'apikey':
|
||||
@@ -229,9 +229,9 @@ export const ManagementAuthorityConfig = forwardRef<ManagementAuthorityConfigHan
|
||||
<Form.Item<EditAuthFieldType>
|
||||
label={$t("Apikey")}
|
||||
name={['config','apikey']}
|
||||
rules={[{required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
</>
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@ const ManagementConfig = forwardRef<ManagementConfigHandle,ManagementConfigProps
|
||||
fetchData<BasicResponse<{apps:ManagementConfigFieldType}>>(type === 'add'? 'team/app' : 'app/info',{method:type === 'add'? 'POST' : 'PUT',eoBody:(value), eoParams:type === 'add' ? {team:teamId}:{app:appId,team:teamId}}).then(response=>{
|
||||
const {code,data,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
form.setFieldsValue(data.apps)
|
||||
type === 'edit' && setAppName(data.apps.name)
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -63,7 +63,7 @@ const ManagementConfig = forwardRef<ManagementConfigHandle,ManagementConfigProps
|
||||
setAppName(data.app.name)
|
||||
setTimeout(()=>{form.setFieldsValue({...data.app})},0)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
};
|
||||
@@ -72,7 +72,7 @@ const ManagementConfig = forwardRef<ManagementConfigHandle,ManagementConfigProps
|
||||
setDelBtnLoading(true)
|
||||
modal.confirm({
|
||||
title:$t('删除'),
|
||||
content:DELETE_TIPS.default,
|
||||
content:$t(DELETE_TIPS.default),
|
||||
onOk:()=> {
|
||||
return deleteApplication()
|
||||
},
|
||||
@@ -95,10 +95,10 @@ const ManagementConfig = forwardRef<ManagementConfigHandle,ManagementConfigProps
|
||||
fetchData<BasicResponse<null>>('app',{method:'DELETE',eoParams:{app:appId,team:teamId}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
navigate(`/tenantManagement/list`)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -133,24 +133,24 @@ const ManagementConfig = forwardRef<ManagementConfigHandle,ManagementConfigProps
|
||||
<Form.Item<ManagementConfigFieldType>
|
||||
label={$t("应用名称")}
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<ManagementConfigFieldType>
|
||||
label={$t("应用 ID")}
|
||||
name="id"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required ,whitespace:true }]}
|
||||
rules={[{ required: true ,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input} disabled={type === 'edit'}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)} disabled={type === 'edit'}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={$t("描述")}
|
||||
name="description"
|
||||
>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
{type === 'edit' && <>
|
||||
<Row className="mb-[10px]"
|
||||
|
||||
@@ -31,7 +31,7 @@ export default function ManagementInsideAuth(){
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setAuthList(data.authorizations)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch(() => {
|
||||
return {data:[], success:false}
|
||||
@@ -48,11 +48,11 @@ export default function ManagementInsideAuth(){
|
||||
fetchData<BasicResponse<null>>('app/authorization',{method:'DELETE',eoParams:{authorization:entity!.id,app:appId, team:teamId}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -65,13 +65,13 @@ export default function ManagementInsideAuth(){
|
||||
switch (type){
|
||||
case 'view':{
|
||||
title=$t('鉴权详情')
|
||||
message.loading(RESPONSE_TIPS.loading)
|
||||
message.loading($t(RESPONSE_TIPS.loading))
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{details:{[k:string]:string}}>>('app/authorization/details',{method:'GET',eoParams:{authorization:entity!.id,app:appId, team:teamId}})
|
||||
message.destroy()
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
content=<ManagementAuthorityView entity={data.details}/>
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return
|
||||
}}
|
||||
break;
|
||||
@@ -81,19 +81,19 @@ export default function ManagementInsideAuth(){
|
||||
break;
|
||||
case 'edit':{
|
||||
title=$t('编辑鉴权')
|
||||
message.loading(RESPONSE_TIPS.loading)
|
||||
message.loading($t(RESPONSE_TIPS.loading))
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{authorization:EditAuthFieldType}>>('app/authorization',{method:'GET',eoParams:{authorization:entity!.id,app:appId, team:teamId},eoTransformKeys:['hide_credential','token_name','expire_time','user_name','public_key','user_path','claims_to_verify','signature_is_base64']})
|
||||
message.destroy()
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
content=<ManagementAuthorityConfig ref={editRef} type={type} data={data.authorization} appId={appId!} teamId={teamId!}/>
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return
|
||||
}}
|
||||
break;
|
||||
case 'delete':
|
||||
title=$t('删除')
|
||||
content=DELETE_TIPS.default
|
||||
content=$t(DELETE_TIPS.default)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -32,11 +32,11 @@ export default function ManagementInsideService(){
|
||||
fetchData<BasicResponse<null>>('application/subscription/cancel_apply',{method:'POST',eoParams:{subscription:entity.id!,application:appId!,team:teamId}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -47,11 +47,11 @@ export default function ManagementInsideService(){
|
||||
fetchData<BasicResponse<null>>('application/subscription/cancel',{method:'POST',eoParams:{subscription:entity.id!,application:appId!,team:teamId}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -62,14 +62,14 @@ export default function ManagementInsideService(){
|
||||
let content:string|React.ReactNode = ''
|
||||
switch (type){
|
||||
case 'view':{
|
||||
message.loading(RESPONSE_TIPS.loading)
|
||||
message.loading($t(RESPONSE_TIPS.loading))
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{approval:SubscribeApprovalInfoType}>>('app/subscription/approval',{method:'GET',eoParams:{subscription:entity!.id, app:appId,team:teamId},eoTransformKeys:['apply_project','apply_team','apply_time','approval_time']})
|
||||
message.destroy()
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
title=$t('审批详情')
|
||||
content = <ApprovalModalContent data={data.approval} type={type} systemId={appId}/>;
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return
|
||||
}
|
||||
break;
|
||||
@@ -148,7 +148,7 @@ export default function ManagementInsideService(){
|
||||
setServiceList(data.subscriptions && data.subscriptions.length > 0 ? [...data.subscriptions] : [])
|
||||
// return {data:data.services, success: true,total:data.total}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
// return {data:[], success:false}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -42,7 +42,7 @@ const getServiceList = ()=>{
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
setServiceList([...data.apps,{type:'addNewItem'}])
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).finally(()=>{
|
||||
setServiceLoading(false)
|
||||
@@ -68,7 +68,7 @@ const getServiceList = ()=>{
|
||||
navigateTo(data.teams[0].id)
|
||||
}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).finally(()=>{
|
||||
setPageLoading(false)
|
||||
@@ -93,7 +93,7 @@ const getServiceList = ()=>{
|
||||
// if(code === STATUS_CODE.SUCCESS){
|
||||
// content=<ManagementConfig ref={editManagementRef} type={type} entity={data.app}/>
|
||||
// }else{
|
||||
// message.error(msg || RESPONSE_TIPS.error)
|
||||
// message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
// return
|
||||
// }
|
||||
// break;}
|
||||
|
||||
@@ -34,11 +34,11 @@ export const OpenApiConfig = forwardRef<OpenApiConfigHandle,OpenApiConfigProps>(
|
||||
fetchData<BasicResponse<null>>('external-app',{method:type === 'add'? 'POST' : 'PUT',eoBody:(value), eoParams:type === 'add' ? {}:{id:entity!.id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
@@ -71,24 +71,24 @@ export const OpenApiConfig = forwardRef<OpenApiConfigHandle,OpenApiConfigProps>(
|
||||
<Form.Item<OpenApiConfigFieldType>
|
||||
label={$t("应用名称")}
|
||||
name="name"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required,whitespace:true }]}
|
||||
rules={[{ required: true,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<OpenApiConfigFieldType>
|
||||
label={$t("应用 ID")}
|
||||
name="id"
|
||||
rules={[{ required: true, message: VALIDATE_MESSAGE.required ,whitespace:true }]}
|
||||
rules={[{ required: true ,whitespace:true }]}
|
||||
>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input} disabled={type === 'edit'}/>
|
||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)} disabled={type === 'edit'}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={$t("描述")}
|
||||
name="desc"
|
||||
>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={PLACEHOLDER.input}/>
|
||||
<Input.TextArea className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
|
||||
@@ -65,7 +65,7 @@ export default function OpenApiList(){
|
||||
setTableHttpReload(false)
|
||||
return {data:data.apps, success: true}
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return {data:[], success:false}
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -77,19 +77,19 @@ export default function OpenApiList(){
|
||||
fetchData<BasicResponse<null>>('external-app/token',{method:'PUT',eoParams:{id:entity.id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
manualReloadTable()
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const copyToken = (entity: OpenApiTableListItem)=>{
|
||||
if(copy(entity.token)){
|
||||
message.success(RESPONSE_TIPS.copySuccess)
|
||||
message.success($t(RESPONSE_TIPS.copySuccess))
|
||||
}else{
|
||||
message.error(RESPONSE_TIPS.copyError)
|
||||
message.error($t(RESPONSE_TIPS.copyError))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,11 +103,11 @@ export default function OpenApiList(){
|
||||
fetchData<BasicResponse<null>>('external-app',{method:'DELETE',eoParams:{id:entity!.id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
resolve(true)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
reject(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).catch((errorInfo)=> reject(errorInfo))
|
||||
})
|
||||
@@ -124,19 +124,19 @@ export default function OpenApiList(){
|
||||
break;
|
||||
case 'edit':{
|
||||
title=$t('配置 Open Api')
|
||||
message.loading(RESPONSE_TIPS.loading)
|
||||
message.loading($t(RESPONSE_TIPS.loading))
|
||||
const {code,data,msg} = await fetchData<BasicResponse<{app:OpenApiConfigFieldType}>>('external-app',{method:'GET',eoParams:{id:entity!.id}})
|
||||
message.destroy()
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
content=<OpenApiConfig ref={editOpenApiRef} type={type} entity={data.app}/>
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
return
|
||||
}
|
||||
break;}
|
||||
case 'delete':
|
||||
title=$t('删除')
|
||||
content=DELETE_TIPS.default
|
||||
content=$t(DELETE_TIPS.default)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -165,10 +165,10 @@ export default function OpenApiList(){
|
||||
fetchData<BasicResponse<null>>(`external-app/${enabled ? 'disable' :'enable'}`,{method:'PUT',eoParams:{id:entity.id}}).then(response=>{
|
||||
const {code,msg} = response
|
||||
if(code === STATUS_CODE.SUCCESS){
|
||||
message.success(msg || RESPONSE_TIPS.success)
|
||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||
manualReloadTable()
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -184,7 +184,7 @@ export default function OpenApiList(){
|
||||
})
|
||||
setMemberValueEnum(tmpValueEnum)
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ export default function SystemRunning(){
|
||||
setShowGraph(newGraphData?.nodes?.length > 0)
|
||||
|
||||
}else{
|
||||
message.error(msg || RESPONSE_TIPS.error)
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
}
|
||||
}).finally(()=>setLoading(false))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user