From 12224fca31847c22d0bb2f684f0516efdc9b38b2 Mon Sep 17 00:00:00 2001 From: tianweiweiliang <875658254@qq.com> Date: Tue, 9 Jul 2024 03:14:21 +0000 Subject: [PATCH 01/11] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tianweiweiliang <875658254@qq.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 24b4a698..4595d3b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tone-front", - "version": "1.18.0", + "version": "1.19.0", "private": true, "description": "Tone front", "scripts": { -- Gitee From 1fc74e17c88bf82cc4ef3674f53375ddc24608cd Mon Sep 17 00:00:00 2001 From: tianweiweiliang <875658254@qq.com> Date: Tue, 9 Jul 2024 13:47:16 +0800 Subject: [PATCH 02/11] =?UTF-8?q?fix:=20=E5=86=85=E7=BD=91=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=BB=E3=80=81=E8=A2=AB=E5=8A=A8=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeviceManage/CloudManage/AddMachinePubilc/index.tsx | 6 ++++-- src/pages/WorkSpace/DeviceManage/locales/en-US.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pages/WorkSpace/DeviceManage/CloudManage/AddMachinePubilc/index.tsx b/src/pages/WorkSpace/DeviceManage/CloudManage/AddMachinePubilc/index.tsx index d9d1a663..168ba723 100644 --- a/src/pages/WorkSpace/DeviceManage/CloudManage/AddMachinePubilc/index.tsx +++ b/src/pages/WorkSpace/DeviceManage/CloudManage/AddMachinePubilc/index.tsx @@ -1117,7 +1117,7 @@ const NewMachine: React.FC = (props) => { - {!is_instance && BUILD_APP_ENV === 'openanolis' && + {!is_instance && BUILD_APP_ENV !== 'opensource' && = (props) => { rules={[{ required: false, message: formatMessage({ id: 'please.select' }) }]} > - + {BUILD_APP_ENV === 'openanolis' && + + } diff --git a/src/pages/WorkSpace/DeviceManage/locales/en-US.ts b/src/pages/WorkSpace/DeviceManage/locales/en-US.ts index c2ddbdf8..31c912fa 100644 --- a/src/pages/WorkSpace/DeviceManage/locales/en-US.ts +++ b/src/pages/WorkSpace/DeviceManage/locales/en-US.ts @@ -155,8 +155,8 @@ export default { 'device.extended.fields': 'Extended Fields', 'device.aliyun.params': 'Alibaba Cloud openAPI parameters', 'device.toneagent.working.mode': 'Toneagent working mode', - 'device.active.mode': 'Active mode', - 'device.passive.mode': 'Passive mode', + 'device.active.mode': 'Active', + 'device.passive.mode': 'Passive', 'device.tips': 'Tips', 'device.delete.config': 'Are you sure you want to delete the configuration ({data})?', 'device.delete.instance': 'Are you sure you want to delete the instance({data})?', -- Gitee From c6cbae7c1f69d1bc1b00a2c37e9896117a557ea0 Mon Sep 17 00:00:00 2001 From: tianweiweiliang <875658254@qq.com> Date: Tue, 9 Jul 2024 14:17:22 +0800 Subject: [PATCH 03/11] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=8F=82=E6=95=B0=E8=A6=81=E4=BF=9D=E7=95=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Header/components/JobModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Header/components/JobModal.tsx b/src/components/Header/components/JobModal.tsx index a159523b..ac027f7c 100644 --- a/src/components/Header/components/JobModal.tsx +++ b/src/components/Header/components/JobModal.tsx @@ -15,7 +15,7 @@ const JobTemplateModal: React.FC> = (props) => { const dataSourceCopy = props.getData(jobTemplates) return ( - + Date: Tue, 16 Jul 2024 16:28:31 +0800 Subject: [PATCH 04/11] =?UTF-8?q?fix:=20=E6=96=B0=E5=A2=9Enodejs20?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81=E4=BB=A5=E5=BA=94=E5=AF=B9node16?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E6=94=AF=E6=8C=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abc.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/abc.json b/abc.json index 06a1bce2..f340190a 100644 --- a/abc.json +++ b/abc.json @@ -3,11 +3,12 @@ "type": "command", "command": { "cmd": [ + "export NODE_OPTIONS=--openssl-legacy-provider", "pnpm install", "pnpm build", "mv ./dist $BUILD_DEST" ] } }, - "nodeVersion": 16 -} \ No newline at end of file + "nodeVersion": 20 +} -- Gitee From bff8c126549d3286e2ebedb948bc0d930856a0e4 Mon Sep 17 00:00:00 2001 From: wulibaibao <13366578180@163.com> Date: Tue, 16 Jul 2024 17:12:32 +0800 Subject: [PATCH 05/11] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=86=99?= =?UTF-8?q?=E6=B3=95=E5=AF=B9node16=E4=BB=A5=E4=B8=8A=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abc.json | 7 +------ package.json | 12 ++++++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/abc.json b/abc.json index f340190a..5d13b0f4 100644 --- a/abc.json +++ b/abc.json @@ -2,12 +2,7 @@ "assets": { "type": "command", "command": { - "cmd": [ - "export NODE_OPTIONS=--openssl-legacy-provider", - "pnpm install", - "pnpm build", - "mv ./dist $BUILD_DEST" - ] + "cmd": ["pnpm install", "pnpm build", "mv ./dist $BUILD_DEST"] } }, "nodeVersion": 20 diff --git a/package.json b/package.json index 4595d3b1..44bb0a4a 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "private": true, "description": "Tone front", "scripts": { - "start": "cross-env BUILD_APP_ENV=\"opensource\" PORT=8888 umi dev", - "build": "cross-env BUILD_APP_ENV=\"opensource\" umi build", - "start:openanolis": "cross-env PORT=8888 BUILD_APP_ENV=\"openanolis\" umi dev", - "build:openanolis": "cross-env BUILD_APP_ENV=\"openanolis\" umi build", - "start:tone": "cross-env BUILD_APP_ENV= PORT=8888 umi dev", - "build:tone": "cross-env BUILD_APP_ENV= PORT=8888 umi build", + "start": "cross-env NODE_OPTIONS=--openssl-legacy-provider BUILD_APP_ENV=\"opensource\" PORT=8888 umi dev", + "build": "cross-env NODE_OPTIONS=--openssl-legacy-provider BUILD_APP_ENV=\"opensource\" umi build", + "start:openanolis": "cross-env NODE_OPTIONS=--openssl-legacy-provider PORT=8888 BUILD_APP_ENV=\"openanolis\" umi dev", + "build:openanolis": "cross-env NODE_OPTIONS=--openssl-legacy-provider BUILD_APP_ENV=\"openanolis\" umi build", + "start:tone": "cross-env NODE_OPTIONS=--openssl-legacy-provider BUILD_APP_ENV= PORT=8888 umi dev", + "build:tone": "cross-env NODE_OPTIONS=--openssl-legacy-provider BUILD_APP_ENV= PORT=8888 umi build", "analyze": "cross-env ANALYZE=1 umi build", "deploy": "npm run site && npm run gh-pages", "dev": "npm run start:dev", -- Gitee From 729328a73acf1c4daea3588c2cce84403dbf49f5 Mon Sep 17 00:00:00 2001 From: tianweiweiliang <875658254@qq.com> Date: Fri, 2 Aug 2024 13:37:46 +0800 Subject: [PATCH 06/11] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=89=93?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abc.json b/abc.json index 06a1bce2..546a0fd3 100644 --- a/abc.json +++ b/abc.json @@ -4,7 +4,7 @@ "command": { "cmd": [ "pnpm install", - "pnpm build", + "pnpm build:tone", "mv ./dist $BUILD_DEST" ] } -- Gitee From 729f99486b8d5ca3ec2bd9a95eae4bf6ab2029aa Mon Sep 17 00:00:00 2001 From: tianweiweiliang <875658254@qq.com> Date: Fri, 2 Aug 2024 15:24:14 +0800 Subject: [PATCH 07/11] =?UTF-8?q?fix:=20=E6=8A=A5=E5=91=8A=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestAnalysis/AnalysisResult/index.tsx | 3 ++ .../WorkSpace/TestReport/NewReport/hooks.ts | 40 +++++++++++-------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/pages/WorkSpace/TestAnalysis/AnalysisResult/index.tsx b/src/pages/WorkSpace/TestAnalysis/AnalysisResult/index.tsx index fc97b55c..bbe8569c 100644 --- a/src/pages/WorkSpace/TestAnalysis/AnalysisResult/index.tsx +++ b/src/pages/WorkSpace/TestAnalysis/AnalysisResult/index.tsx @@ -47,6 +47,7 @@ const Report: React.FC = () => { // 请求对比数据 const queryCompareForm = async () => { const data = await queryForm({ form_id }) + console.log('对比数据:', data) if (data.code == 200) { if (!data?.data) return setTestDataParam(data?.data.testDataParam) @@ -193,6 +194,8 @@ const Report: React.FC = () => { } const creatReportCallback = (reportData: any) => { // suiteData:已选的 + console.log('对比数据--testDataParam:', testDataParam) + history.push({ pathname: `/ws/${ws_id}/test_create_report`, state: { diff --git a/src/pages/WorkSpace/TestReport/NewReport/hooks.ts b/src/pages/WorkSpace/TestReport/NewReport/hooks.ts index 05deedef..de9f5fa5 100644 --- a/src/pages/WorkSpace/TestReport/NewReport/hooks.ts +++ b/src/pages/WorkSpace/TestReport/NewReport/hooks.ts @@ -69,6 +69,7 @@ export const CreatePageData = (props: any) => { const handleData = async (data: any) => { setLoading(true) + console.log('testDataParam:', data) const { perf_suite_dic, func_suite_dic } = data let perfArr: any = [] let funcArr: any = [] @@ -80,25 +81,32 @@ export const CreatePageData = (props: any) => { } let resLen: any = [] resLen = perfArr.concat(funcArr) + console.log('resLen:', resLen) setSuiteLen(resLen.length) - resLen.map((item: any, i: number) => queryCompareResultFn(item) - .then(res => { - if (res.code === 200) { - setLoading(false) - if (res.data.test_type === 'functional') { - compareResult.func_data_result = compareResult.func_data_result.concat(res.data) + try { + resLen.map((item: any, i: number) => queryCompareResultFn(item) + .then(res => { + if (res.code === 200) { + setLoading(false) + if (res.data.test_type === 'functional') { + compareResult.func_data_result = compareResult.func_data_result.concat(res.data) + } + if (res.data.test_type === 'performance') { + compareResult.perf_data_result = compareResult.perf_data_result.concat(res.data) + } } - if (res.data.test_type === 'performance') { - compareResult.perf_data_result = compareResult.perf_data_result.concat(res.data) + setCompareResult({ ...compareResult }) + if (res.code !== 200) { + message.error(res.msg) + return } - } - setCompareResult({ ...compareResult }) - if (res.code !== 200) { - message.error(res.msg) - return - } - }) - ) + }) + ) + } catch (error) { + setLoading(false) + } finally { + setLoading(false) + } } useEffect(() => { -- Gitee From d57dfcc49f39082062ee1cce0c0de69cfafa7de7 Mon Sep 17 00:00:00 2001 From: tianweiweiliang <875658254@qq.com> Date: Fri, 2 Aug 2024 17:36:37 +0800 Subject: [PATCH 08/11] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E5=AF=B9?= =?UTF-8?q?=E7=A9=BA=E5=AF=B9=E8=B1=A1=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.tsx | 2 +- src/components/Header/components/HeaderDropdown.tsx | 2 +- src/utils/hooks.tsx | 2 +- src/wrappers/WorkspaceAuth.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index 39700ab2..095287b8 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -101,7 +101,7 @@ export async function getInitialState(): Promise { redirectErrorPage(401) return baseAppState } - const ws: any = await enterWsAndGetList(ws_id) + const ws: any = await enterWsAndGetList(ws_id) || {} if (ws?.first_entry) { history.push(`/ws/${ws_id}/workspace/initSuccess`) } diff --git a/src/components/Header/components/HeaderDropdown.tsx b/src/components/Header/components/HeaderDropdown.tsx index 40e90da7..9bf4a31a 100644 --- a/src/components/Header/components/HeaderDropdown.tsx +++ b/src/components/Header/components/HeaderDropdown.tsx @@ -93,7 +93,7 @@ export const HearderDropdown: React.FC = (props) => { const current = React.useMemo(() => { if (!wsList) return {} - const [workspace] = wsList?.data?.filter(({ id }: any) => id === ws_id) + const [workspace] = (wsList?.data || [])?.filter(({ id }: any) => id === ws_id) // wsList?.data?.filter(({ id }: any) => id === ws_id) if (workspace) return workspace return {} }, [wsList, ws_id]) diff --git a/src/utils/hooks.tsx b/src/utils/hooks.tsx index 61198b72..d06795f8 100644 --- a/src/utils/hooks.tsx +++ b/src/utils/hooks.tsx @@ -10,7 +10,7 @@ const { document, location }: any = window export const enterWsAndGetList = async (ws_id: any) => { try { - const { data } = await enterWorkspaceHistroy({ ws_id }) + const { data } = await enterWorkspaceHistroy({ ws_id }) || {} const { code, ...historyWorkspaces } = await queryWorkspaceHistory({ page_num: 1, page_size: 20, diff --git a/src/wrappers/WorkspaceAuth.tsx b/src/wrappers/WorkspaceAuth.tsx index 32da761a..af06f33e 100644 --- a/src/wrappers/WorkspaceAuth.tsx +++ b/src/wrappers/WorkspaceAuth.tsx @@ -29,7 +29,7 @@ export default (props: any) => { /* 切换ws请求记录历史接口 */ /* getHistoryFetcher() */ - const ws = await enterWsAndGetList(ws_id) + const ws = await enterWsAndGetList(ws_id) || {} setInitialState((p: any) => ({ ...p, ...ws, -- Gitee From 2ff1aa69b76153c2eeac7678859cc2427df89080 Mon Sep 17 00:00:00 2001 From: tianweiweiliang <875658254@qq.com> Date: Fri, 2 Aug 2024 15:26:54 +0800 Subject: [PATCH 09/11] =?UTF-8?q?fix:=20=E7=94=A8=E6=88=B7=E8=A7=92?= =?UTF-8?q?=E8=89=B2=EF=BC=8C=E8=A7=92=E8=89=B2=E5=88=97=E8=A1=A8=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=BC=BA=E5=A4=B1=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SystemConf/UserManagement/components/RoleSelect/index.tsx | 4 +--- src/pages/WorkSpace/TestAnalysis/AnalysisResult/index.tsx | 3 --- src/pages/WorkSpace/TestReport/NewReport/hooks.ts | 2 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/pages/SystemConf/UserManagement/components/RoleSelect/index.tsx b/src/pages/SystemConf/UserManagement/components/RoleSelect/index.tsx index 16baefef..171c64d1 100644 --- a/src/pages/SystemConf/UserManagement/components/RoleSelect/index.tsx +++ b/src/pages/SystemConf/UserManagement/components/RoleSelect/index.tsx @@ -26,11 +26,9 @@ const RoleSelect: React.FC<{ row: any, select: any[], handleChange: (val: number } useEffect(() => { - setSelectValue(row.role_list.map((item: any) => (item.id))[0]) + setSelectValue(row?.role_list?.map((item: any) => (item.id))[0]) }, [row.role_list]) - // console.log('selectValue:', selectValue) - return (
diff --git a/src/pages/WorkSpace/TestAnalysis/AnalysisResult/index.tsx b/src/pages/WorkSpace/TestAnalysis/AnalysisResult/index.tsx index bbe8569c..fc97b55c 100644 --- a/src/pages/WorkSpace/TestAnalysis/AnalysisResult/index.tsx +++ b/src/pages/WorkSpace/TestAnalysis/AnalysisResult/index.tsx @@ -47,7 +47,6 @@ const Report: React.FC = () => { // 请求对比数据 const queryCompareForm = async () => { const data = await queryForm({ form_id }) - console.log('对比数据:', data) if (data.code == 200) { if (!data?.data) return setTestDataParam(data?.data.testDataParam) @@ -194,8 +193,6 @@ const Report: React.FC = () => { } const creatReportCallback = (reportData: any) => { // suiteData:已选的 - console.log('对比数据--testDataParam:', testDataParam) - history.push({ pathname: `/ws/${ws_id}/test_create_report`, state: { diff --git a/src/pages/WorkSpace/TestReport/NewReport/hooks.ts b/src/pages/WorkSpace/TestReport/NewReport/hooks.ts index de9f5fa5..befa9fd4 100644 --- a/src/pages/WorkSpace/TestReport/NewReport/hooks.ts +++ b/src/pages/WorkSpace/TestReport/NewReport/hooks.ts @@ -69,7 +69,6 @@ export const CreatePageData = (props: any) => { const handleData = async (data: any) => { setLoading(true) - console.log('testDataParam:', data) const { perf_suite_dic, func_suite_dic } = data let perfArr: any = [] let funcArr: any = [] @@ -81,7 +80,6 @@ export const CreatePageData = (props: any) => { } let resLen: any = [] resLen = perfArr.concat(funcArr) - console.log('resLen:', resLen) setSuiteLen(resLen.length) try { resLen.map((item: any, i: number) => queryCompareResultFn(item) -- Gitee From 9e681fb400bc1dc9fa6c88f39c3143b415fa8961 Mon Sep 17 00:00:00 2001 From: tianweiweiliang <875658254@qq.com> Date: Thu, 22 Aug 2024 10:48:57 +0800 Subject: [PATCH 10/11] =?UTF-8?q?fix:=20=E4=BA=91=E4=B8=8A=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E9=9B=86=E7=BE=A4=E6=B7=BB=E5=8A=A0=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E9=9B=86=E7=BE=A4=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CloudManage/Aligroup/index.tsx | 40 +++++++++++++++++-- .../GroupManage/Cluster/index.tsx | 32 ++++++++++++++- .../WorkSpace/DeviceManage/locales/en-US.ts | 3 ++ .../WorkSpace/DeviceManage/locales/zh-CN.ts | 3 ++ 4 files changed, 74 insertions(+), 4 deletions(-) diff --git a/src/pages/WorkSpace/DeviceManage/CloudManage/Aligroup/index.tsx b/src/pages/WorkSpace/DeviceManage/CloudManage/Aligroup/index.tsx index 65f3beaf..99fa988d 100644 --- a/src/pages/WorkSpace/DeviceManage/CloudManage/Aligroup/index.tsx +++ b/src/pages/WorkSpace/DeviceManage/CloudManage/Aligroup/index.tsx @@ -14,10 +14,11 @@ import SelectTags from '@/components/Public/SelectTags'; import Highlighter from 'react-highlight-words'; import AddCluster from './AddGroup' import { FilterFilled } from '@ant-design/icons'; -import { useParams, useIntl, FormattedMessage, useLocation, history } from 'umi'; +import { useParams, useIntl, FormattedMessage, useLocation, history, getLocale } from 'umi'; import { useClientSize } from '@/utils/hooks'; import { AccessTootip, handlePageNum, requestCodeMessage, saveRefenerceData, useStateRef } from '@/utils/utils'; import { Access, useAccess } from 'umi' +import SelectRadio from '@/components/Public/SelectRadio'; import Log from '@/components/Public/Log'; import OverflowList from '@/components/TagOverflow/index'; import CommonPagination from '@/components/CommonPagination'; @@ -35,6 +36,7 @@ interface AligroupParams { page_num?: number, page_size?: number, name?: string, + is_temporary?: boolean, owner?: any, tags?: any, description?: string, @@ -45,6 +47,7 @@ const Aligroup: React.ForwardRefRenderFunction = (props) => { const { tab } = props const { query } = useLocation() as any const { formatMessage } = useIntl() + const enLocale = getLocale() === 'en-US' const { ws_id }: any = useParams() const [form] = Form.useForm(); const access = useAccess(); @@ -85,8 +88,11 @@ const Aligroup: React.ForwardRefRenderFunction = (props) => { const getList = async ($params: any = {}) => { setLoading(true) const data: any = await querysCluster({ ...$params }) - history.replace(`/ws/${ws_id}/device/cloud?${stringify({ ...$params, is_instance: $params.is_instance ? 1 : 0 })}`) - data && setSource(data) + if (data.code === 200) { + history.replace(`/ws/${ws_id}/device/cloud?${stringify({ ...$params, is_instance: $params.is_instance ? 1 : 0 })}`) + console.log('data:', data) + data && setSource(data) + } setLoading(false) }; const totalCurrent = useStateRef(source) @@ -175,6 +181,18 @@ const Aligroup: React.ForwardRefRenderFunction = (props) => { filterIcon: () => , }) + const radioFilterCommonFields = (dataIndex: string, list: any[]) => ({ + filterIcon: () => , + filterDropdown: ({ confirm }: any) => ( + setParams({ ...params, [dataIndex]: val, page_num: 1 })} + /> + ), + }) + const columns: any = [ { title: , @@ -192,6 +210,22 @@ const Aligroup: React.ForwardRefRenderFunction = (props) => { ) }, + { + title: , + ...radioFilterCommonFields("is_temporary", [ + { id: false, name: formatMessage({ id: 'cluster' }) }, + { id: true, name: formatMessage({ id: 'device.temporary.cluster' }) }, + ]), + dataIndex: 'is_temporary', + width: enLocale ? 170 : 150, + ellipsis: { + showTitle: false + }, + render: (_: any, row: any) => { + const text = _ ? formatMessage({ id: 'device.temporary.cluster' }): formatMessage({ id: 'cluster' }) + return {row.hasOwnProperty('is_temporary') ? text: '-'} + } + }, { title: 'Owner', dataIndex: 'owner_name', diff --git a/src/pages/WorkSpace/DeviceManage/GroupManage/Cluster/index.tsx b/src/pages/WorkSpace/DeviceManage/GroupManage/Cluster/index.tsx index fcd16df3..66d82497 100644 --- a/src/pages/WorkSpace/DeviceManage/GroupManage/Cluster/index.tsx +++ b/src/pages/WorkSpace/DeviceManage/GroupManage/Cluster/index.tsx @@ -1,6 +1,6 @@ import { useState, useCallback, useRef, forwardRef, useImperativeHandle } from 'react' import styles from './index.less' -import { useIntl, FormattedMessage, useParams } from 'umi' +import { useIntl, FormattedMessage, useParams, getLocale } from 'umi' import { Layout, Button, Space, Tag, message, Typography, Spin, Modal, Table } from 'antd' import { deleteServerGroup, queryServerDel } from '../services' import { CaretRightFilled, FilterFilled, ExclamationCircleOutlined } from '@ant-design/icons' @@ -15,6 +15,7 @@ import CommonPagination from '@/components/CommonPagination' import { usePageInit } from './hooks' import { requestCodeMessage, AccessTootip, saveRefenerceData } from '@/utils/utils'; import { Access, useAccess } from 'umi'; +import SelectRadio from '@/components/Public/SelectRadio'; import OverflowList from '@/components/TagOverflow/index' import { ColumnEllipsisText } from '@/components/ColumnComponents' import { v4 as uuid } from 'uuid' @@ -26,6 +27,7 @@ import DelConfirmModal from "@/pages/WorkSpace/DeviceManage/components/DelConfir */ const Cluster = (props: any, ref: any) => { const { formatMessage } = useIntl() + const enLocale = getLocale() === 'en-US' const { ws_id } = useParams() as any const access = useAccess(); const { loading, dataSource, params, setParams, setRefresh } = usePageInit() @@ -101,6 +103,18 @@ const Cluster = (props: any, ref: any) => { }, [] ) + const radioFilterCommonFields = (dataIndex: string, list: any[]) => ({ + filterIcon: () => , + filterDropdown: ({ confirm }: any) => ( + setParams({ ...params, [dataIndex]: val, page_num: 1 })} + /> + ), + }) + const columns: any = [ { title: , @@ -111,6 +125,22 @@ const Cluster = (props: any, ref: any) => { setParams({ ...params, page_num: 1, name })} /> ) }, + { + title: , + ...radioFilterCommonFields("is_temporary", [ + { id: false, name: formatMessage({ id: 'cluster' }) }, + { id: true, name: formatMessage({ id: 'device.temporary.cluster' }) }, + ]), + dataIndex: 'is_temporary', + width: enLocale ? 170 : 150, + ellipsis: { + showTitle: false + }, + render: (_: any, row: any) => { + const text = _ ? formatMessage({ id: 'device.temporary.cluster' }): formatMessage({ id: 'cluster' }) + return {row.hasOwnProperty('is_temporary') ? text: '-'} + } + }, { title: 'Owner', width: 150, diff --git a/src/pages/WorkSpace/DeviceManage/locales/en-US.ts b/src/pages/WorkSpace/DeviceManage/locales/en-US.ts index 31c912fa..4b0ac650 100644 --- a/src/pages/WorkSpace/DeviceManage/locales/en-US.ts +++ b/src/pages/WorkSpace/DeviceManage/locales/en-US.ts @@ -109,6 +109,9 @@ export default { 'device.cluster.name.s': 'Cluster Name', 'device.cluster.name.s.message': 'Cluster name cannot be empty.', 'device.cluster.name.s.existed': 'Cluster name already exists', + 'device.cluster/temporary.cluster': 'Cluster/Temporary Cluster', + // '集群': '集群', + 'device.temporary.cluster': 'Temporary Cluster', 'please.select.owner': 'Please select Owner', 'device.cluster.delete.tips': 'The cluster has been configured with an existing template. After deleting the server, the corresponding test server configuration will be automatically changed to random. Please delete it carefully.', 'device.is_single': 'Is it from the stand-alone pool?', diff --git a/src/pages/WorkSpace/DeviceManage/locales/zh-CN.ts b/src/pages/WorkSpace/DeviceManage/locales/zh-CN.ts index 67f94df1..e4495041 100644 --- a/src/pages/WorkSpace/DeviceManage/locales/zh-CN.ts +++ b/src/pages/WorkSpace/DeviceManage/locales/zh-CN.ts @@ -109,6 +109,9 @@ export default { 'device.cluster.name.s': '集群名称', 'device.cluster.name.s.message': '集群名称不能为空', 'device.cluster.name.s.existed': '集群名称已存在', + 'device.cluster/temporary.cluster': '集群/临时集群', + // '集群': '集群', + 'device.temporary.cluster': '临时集群', 'please.select.owner': '请选择Owner', 'device.cluster.delete.tips': '已有模板配置了该集群,删除机器后对应的测试机配置会自动改为随机,请谨慎删除!!', 'device.is_single': '是否是单机池', -- Gitee From 942654b52e91f47ed37d624dcf9c330f9c67cdca Mon Sep 17 00:00:00 2001 From: tianweiweiliang <875658254@qq.com> Date: Thu, 22 Aug 2024 13:44:46 +0800 Subject: [PATCH 11/11] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WorkSpace/DeviceManage/CloudManage/Aligroup/index.tsx | 8 ++++---- .../WorkSpace/DeviceManage/GroupManage/Cluster/index.tsx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pages/WorkSpace/DeviceManage/CloudManage/Aligroup/index.tsx b/src/pages/WorkSpace/DeviceManage/CloudManage/Aligroup/index.tsx index 99fa988d..bdd2a30f 100644 --- a/src/pages/WorkSpace/DeviceManage/CloudManage/Aligroup/index.tsx +++ b/src/pages/WorkSpace/DeviceManage/CloudManage/Aligroup/index.tsx @@ -36,7 +36,7 @@ interface AligroupParams { page_num?: number, page_size?: number, name?: string, - is_temporary?: boolean, + is_temporary?: string, owner?: any, tags?: any, description?: string, @@ -182,7 +182,7 @@ const Aligroup: React.ForwardRefRenderFunction = (props) => { }) const radioFilterCommonFields = (dataIndex: string, list: any[]) => ({ - filterIcon: () => , + filterIcon: () => , filterDropdown: ({ confirm }: any) => ( = (props) => { { title: , ...radioFilterCommonFields("is_temporary", [ - { id: false, name: formatMessage({ id: 'cluster' }) }, - { id: true, name: formatMessage({ id: 'device.temporary.cluster' }) }, + { id: 0, name: formatMessage({ id: 'cluster' }) }, + { id: 1, name: formatMessage({ id: 'device.temporary.cluster' }) }, ]), dataIndex: 'is_temporary', width: enLocale ? 170 : 150, diff --git a/src/pages/WorkSpace/DeviceManage/GroupManage/Cluster/index.tsx b/src/pages/WorkSpace/DeviceManage/GroupManage/Cluster/index.tsx index 66d82497..fd90623a 100644 --- a/src/pages/WorkSpace/DeviceManage/GroupManage/Cluster/index.tsx +++ b/src/pages/WorkSpace/DeviceManage/GroupManage/Cluster/index.tsx @@ -104,7 +104,7 @@ const Cluster = (props: any, ref: any) => { ) const radioFilterCommonFields = (dataIndex: string, list: any[]) => ({ - filterIcon: () => , + filterIcon: () => , filterDropdown: ({ confirm }: any) => ( { { title: , ...radioFilterCommonFields("is_temporary", [ - { id: false, name: formatMessage({ id: 'cluster' }) }, - { id: true, name: formatMessage({ id: 'device.temporary.cluster' }) }, + { id: 0, name: formatMessage({ id: 'cluster' }) }, + { id: 1, name: formatMessage({ id: 'device.temporary.cluster' }) }, ]), dataIndex: 'is_temporary', width: enLocale ? 170 : 150, -- Gitee