From 49bc50dbeafacf2e36bd76e52c4f6a834fc827d8 Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Tue, 9 Aug 2022 15:31:32 +0800 Subject: [PATCH] fix: remove Chinese in the svgs/comments 1. remove Chinese in the svgs/comments 2. convert Chinese to English for some svgs/comments Change-Id: I2927a87ef4db060ae385e0d3f1a54d658f1fd200 --- config/webpack.dev.js | 2 +- config/webpack.e2e.js | 2 +- config/webpack.prod.js | 8 +------ src/asset/image/admin-image.svg | 8 +++---- src/asset/image/admin-instance.svg | 6 ++--- src/asset/image/admin-network.svg | 8 +++---- src/asset/image/admin-router.svg | 8 +++---- src/asset/image/admin-security-group.svg | 13 +++++------ src/asset/image/admin-volume.svg | 13 +++++------ src/asset/image/lock.svg | 6 ++--- src/asset/image/logo-extend.svg | 3 +-- src/asset/image/logo-small.svg | 18 +++++++-------- src/asset/image/overview-instance.svg | 13 +++++------ src/asset/image/overview-network.svg | 12 +++++----- src/asset/image/overview-router.svg | 16 +++++++------- src/asset/image/overview-volume.svg | 19 ++++++++-------- src/asset/image/unlock.svg | 10 ++++----- .../FormItem/MemberAllocator/index.jsx | 1 - .../PrometheusChart/CircleWithRightLegend.jsx | 2 +- .../PrometheusChart/component/BaseContent.jsx | 2 +- src/components/PrometheusChart/utils/index.js | 4 ++-- src/components/PrometheusChart/utils/utils.js | 16 +++++++------- src/components/QuotaChart/Ring.jsx | 1 - .../Tables/Base/ItemActionButtons/index.jsx | 2 +- .../Base/PrimaryActionButtons/index.jsx | 2 +- src/components/VisibleObserver/index.jsx | 2 +- src/containers/List/index.jsx | 5 ++++- src/core/i18n.js | 2 +- .../Instance/actions/AssociateFip.jsx | 2 +- .../Instance/actions/ModifyTags.jsx | 6 ++--- .../containers/Project/actions/ModifyTags.jsx | 6 ++--- .../UserGroup/actions/DomainPermission.jsx | 2 +- .../UserGroup/actions/SystemPermission.jsx | 2 +- .../OtherService/components/Mysql/index.jsx | 2 +- .../containers/StorageCluster/RenderTabs.jsx | 4 ++-- .../Detail/PortForwarding/actions/Edit.jsx | 2 +- .../FloatingIp/actions/Associate.jsx | 2 +- .../actions/StepCreate/BaseStep/index.jsx | 2 +- .../Network/actions/CreateNetwork.jsx | 1 - .../network/containers/Topology/index.jsx | 15 +++++-------- src/resources/neutron/floatingip.js | 22 +++++++++---------- src/resources/neutron/port.jsx | 8 +++---- src/resources/neutron/router.jsx | 8 +++---- src/stores/neutron/network.js | 2 +- src/stores/nova/hypervisor.js | 2 +- src/utils/index.js | 2 +- src/utils/validate.js | 8 +++---- 47 files changed, 144 insertions(+), 158 deletions(-) diff --git a/config/webpack.dev.js b/config/webpack.dev.js index 88b8a804..d31ca812 100644 --- a/config/webpack.dev.js +++ b/config/webpack.dev.js @@ -170,7 +170,7 @@ module.exports = (env) => { // browser: "Google Chrome", // }), new webpack.DefinePlugin({ - // 为项目注入环境变量 + // Inject environment variables for the project 'process.env.API': JSON.stringify(API), }), new HtmlWebPackPlugin({ diff --git a/config/webpack.e2e.js b/config/webpack.e2e.js index da53a5b9..4578d129 100644 --- a/config/webpack.e2e.js +++ b/config/webpack.e2e.js @@ -130,7 +130,7 @@ module.exports = (env) => { }, plugins: [ new webpack.DefinePlugin({ - // 为项目注入环境变量 + // Inject environment variables for the project 'process.env.API': JSON.stringify(API), }), new HtmlWebPackPlugin({ diff --git a/config/webpack.prod.js b/config/webpack.prod.js index 1068a942..aabf38f0 100644 --- a/config/webpack.prod.js +++ b/config/webpack.prod.js @@ -118,14 +118,8 @@ module.exports = (env) => { ], }, plugins: [ - // 热更新没必要。 - // new webpack.HotModuleReplacementPlugin(), - // new OpenBrowserPlugin({ - // url: 'http://localhost:8080', - // browser: "Google Chrome", - // }), new webpack.DefinePlugin({ - // 为项目注入环境变量 + // Inject environment variables for the project 'process.env.API': JSON.stringify(API), }), new HtmlWebPackPlugin({ diff --git a/src/asset/image/admin-image.svg b/src/asset/image/admin-image.svg index bee2f70f..e4b56517 100644 --- a/src/asset/image/admin-image.svg +++ b/src/asset/image/admin-image.svg @@ -1,11 +1,11 @@ SliceCopy - - - + + + - + diff --git a/src/asset/image/admin-instance.svg b/src/asset/image/admin-instance.svg index c2040b86..ca0131c7 100644 --- a/src/asset/image/admin-instance.svg +++ b/src/asset/image/admin-instance.svg @@ -1,7 +1,7 @@ - 形状 - - + instance + + \ No newline at end of file diff --git a/src/asset/image/admin-network.svg b/src/asset/image/admin-network.svg index a28c68f0..02a0e52a 100644 --- a/src/asset/image/admin-network.svg +++ b/src/asset/image/admin-network.svg @@ -1,11 +1,11 @@ wangluo-2 - - - + + + - + diff --git a/src/asset/image/admin-router.svg b/src/asset/image/admin-router.svg index 8810cdc7..8280c1b9 100644 --- a/src/asset/image/admin-router.svg +++ b/src/asset/image/admin-router.svg @@ -1,11 +1,11 @@ luyouqi - - - + + + - + diff --git a/src/asset/image/admin-security-group.svg b/src/asset/image/admin-security-group.svg index ed7e020d..9e3165d1 100644 --- a/src/asset/image/admin-security-group.svg +++ b/src/asset/image/admin-security-group.svg @@ -1,13 +1,12 @@ - 编组 32 - - - - + + + + - - + + diff --git a/src/asset/image/admin-volume.svg b/src/asset/image/admin-volume.svg index c071285a..a757107c 100644 --- a/src/asset/image/admin-volume.svg +++ b/src/asset/image/admin-volume.svg @@ -1,12 +1,11 @@ - 编组 38 - - - - - - + + + + + + diff --git a/src/asset/image/lock.svg b/src/asset/image/lock.svg index 736dde5c..160be368 100644 --- a/src/asset/image/lock.svg +++ b/src/asset/image/lock.svg @@ -1,10 +1,10 @@ lock - + - - + + \ No newline at end of file diff --git a/src/asset/image/logo-extend.svg b/src/asset/image/logo-extend.svg index a94f7312..c6f6e49c 100644 --- a/src/asset/image/logo-extend.svg +++ b/src/asset/image/logo-extend.svg @@ -1,4 +1,4 @@ - + - 编组 diff --git a/src/asset/image/logo-small.svg b/src/asset/image/logo-small.svg index c555b8f6..763663ef 100644 --- a/src/asset/image/logo-small.svg +++ b/src/asset/image/logo-small.svg @@ -1,15 +1,15 @@ - logo-浅色 - - - + logo + + +
- {/* 转化为毫秒 */} + {/* convert to milliseconds */} {formatUsedTime(get(data, '[0].y', 0) * 1000)}
), diff --git a/src/pages/monitor/containers/StorageCluster/RenderTabs.jsx b/src/pages/monitor/containers/StorageCluster/RenderTabs.jsx index 39840a79..b30c6305 100644 --- a/src/pages/monitor/containers/StorageCluster/RenderTabs.jsx +++ b/src/pages/monitor/containers/StorageCluster/RenderTabs.jsx @@ -75,8 +75,8 @@ const RenderTabs = () => { const itemIndex = newData.findIndex( (p) => p[primaryKey] === metric[primaryKey] ); - // 特殊处理计算表达式没有metric.__name__的情况, - // 此处usage是details的第3个查询表达式,所以判断index===3, 两个Tab放一起处理了,都放在第3个。 + // Special handling of expressions that do not have metric.__name__ + // Usage is the third query expression of details, so it is determined that index===3. The other two tabs are processed together // console.log(metric.__name__); if (index === 3) { newData[itemIndex].usage = parseFloat( diff --git a/src/pages/network/containers/FloatingIp/Detail/PortForwarding/actions/Edit.jsx b/src/pages/network/containers/FloatingIp/Detail/PortForwarding/actions/Edit.jsx index cff2a00b..23c8267c 100644 --- a/src/pages/network/containers/FloatingIp/Detail/PortForwarding/actions/Edit.jsx +++ b/src/pages/network/containers/FloatingIp/Detail/PortForwarding/actions/Edit.jsx @@ -277,7 +277,7 @@ export class Edit extends ModalAction { const internal_port_id = formData.virtual_adapter.selectedRows[0].id; const { internal_port } = this.item; const { alreadyUsedPorts } = this.state; - // 判断是否本FIP已经绑定了本虚拟网卡的本端口 + // check whether the port has been used const flag = alreadyUsedPorts.some( (pf) => pf.internal_port !== internal_port && diff --git a/src/pages/network/containers/FloatingIp/actions/Associate.jsx b/src/pages/network/containers/FloatingIp/actions/Associate.jsx index 13a4d927..5d661f5a 100644 --- a/src/pages/network/containers/FloatingIp/actions/Associate.jsx +++ b/src/pages/network/containers/FloatingIp/actions/Associate.jsx @@ -132,7 +132,7 @@ export class Associate extends ModalAction { }); } const { id } = data.selectedRows[0]; - // 获取云主机所有的interface + // Get all the interfaces of the instance const instanceInterfaces = await globalServerStore.fetchInterfaceList({ id, }); diff --git a/src/pages/network/containers/LoadBalancers/LoadBalancerInstance/actions/StepCreate/BaseStep/index.jsx b/src/pages/network/containers/LoadBalancers/LoadBalancerInstance/actions/StepCreate/BaseStep/index.jsx index e2295b9e..f248e378 100644 --- a/src/pages/network/containers/LoadBalancers/LoadBalancerInstance/actions/StepCreate/BaseStep/index.jsx +++ b/src/pages/network/containers/LoadBalancers/LoadBalancerInstance/actions/StepCreate/BaseStep/index.jsx @@ -55,7 +55,7 @@ export class BaseStep extends Base { () => { // Reset owned subnets after change owned network const { network_id } = this.state; - // 如果是分步表单的前进后退触发的change,没有old_network_id则不会触发刷新 + // The change triggered by the forward and backward step of the form will not trigger the refresh without old_network_id if (old_network_id && old_network_id !== network_id) { this.formRef.current.setFieldsValue({ vip_address: undefined, diff --git a/src/pages/network/containers/Network/actions/CreateNetwork.jsx b/src/pages/network/containers/Network/actions/CreateNetwork.jsx index 62eaaaf2..d036ef47 100644 --- a/src/pages/network/containers/Network/actions/CreateNetwork.jsx +++ b/src/pages/network/containers/Network/actions/CreateNetwork.jsx @@ -557,7 +557,6 @@ export class CreateNetwork extends ModalAction { { name: 'cidr', label: t('CIDR'), - // TODO 子网掩码待完善 type: 'input', placeholder: isIpv4 ? '192.168.0.0/24' : '1001:1001::/64', required: create_subnet, diff --git a/src/pages/network/containers/Topology/index.jsx b/src/pages/network/containers/Topology/index.jsx index a81d45df..60b65915 100644 --- a/src/pages/network/containers/Topology/index.jsx +++ b/src/pages/network/containers/Topology/index.jsx @@ -68,7 +68,7 @@ export class Topology extends React.Component { } bindEvents = () => { - // 监听node上面mouse事件mouseleave + // listen for the mouse enter event on the node graph.on('node:mouseenter', (evt) => { const { item } = evt; const { nodeType } = item._cfg.model; @@ -127,7 +127,6 @@ export class Topology extends React.Component { const nodeXY = []; routers.forEach((router, index) => { const { id, external_gateway_info, subnets, name } = router; - // TODO: 起始位置 const routerX = parseFloat( ((width / 10) * index + (width / 20) * 3).toFixed(0) ); @@ -272,7 +271,7 @@ export class Topology extends React.Component { type: 'rect', // x: width / 2, // y: 150, - size: [width - 40, 30], // Combo 的最小大小 + size: [width - 40, 30], // mininimum size of Combo style: { // fill: combosBackground[combosIndex % colorNum], fill: combosBackground[0], @@ -298,7 +297,6 @@ export class Topology extends React.Component { const nodeXY = []; servers.forEach((server, index) => { const { fixed_addresses, fixed_networks } = server; - // TODO: 起始位置 let insX = parseFloat(((width / 10) * 2).toFixed(0)); let insY = null; // const subnetNum = fixed_ip_address.length; @@ -537,7 +535,7 @@ export class Topology extends React.Component { const width = document.getElementById('container').scrollWidth; - // 渲染图所需数据 + // data required for rendering let data = { nodes: [ { @@ -547,7 +545,7 @@ export class Topology extends React.Component { img: image, type: 'image', size: 56, - // 裁剪图片配置 + // crop picture configuration clipCfg: { show: false, type: 'circle', @@ -624,7 +622,7 @@ export class Topology extends React.Component { // }); } - // 初始化G6图 + // initialize the G6 graph if (graph) { graph.clear(); graph.destroy(); @@ -635,7 +633,7 @@ export class Topology extends React.Component { width: width + extendWidth, height: Y, nodeStateStyles: { - // 鼠标 hover 上节点,即 hover 状态为 true 时的样式 + // the style for hover hover: { lineWidth: 3, }, @@ -701,7 +699,6 @@ export class Topology extends React.Component { width: updateWidth, height: Y, nodeStateStyles: { - // 鼠标 hover 上节点,即 hover 状态为 true 时的样式 hover: { lineWidth: 3, }, diff --git a/src/resources/neutron/floatingip.js b/src/resources/neutron/floatingip.js index b2749186..957c3f0f 100644 --- a/src/resources/neutron/floatingip.js +++ b/src/resources/neutron/floatingip.js @@ -39,7 +39,7 @@ export const resourceType = { export const transitionStatuses = ['PENDING']; /** - * 通过port和router信息,构建subnet_id => router_id的映射关系 + * Make a mapping between subnet_id => router_id based on the port and router information * @param portsWithFixedIPs * @param routerIdWithExternalNetworkInfo * @param shouldHaveExternalGateway @@ -51,7 +51,7 @@ export function getSubnetToRouter( shouldHaveExternalGateway = true ) { const canReachSubnetIdsWithRouterId = []; - // 将有子网的信息保存下来,建立router_id => subnet_id的映射 + // Save the information of all subnets and create a mapping of router_id => subnet_id portsWithFixedIPs.forEach((type) => { type.forEach((port) => { const router = routerIdWithExternalNetworkInfo.find((r) => { @@ -123,7 +123,7 @@ export async function saveAndBuildPromisesFromInterfaces(interfaces) { const port_id = i.port_id || i.id; const mac_address = i.mac_addr || i.mac_address || ''; const network_id = i.net_id || i.network_id; - // 保存interface的子网信息 + // Save the subnet information of the interface i.fixed_ips.forEach((fixed_ip) => { instanceIPs.push({ // params before '||' used for build self, after is used for list by backend @@ -152,13 +152,13 @@ export async function getReasonForExternalNetworkPortOrAlreadyBindFip( floatingIPPromises ) { const ret = [...interfaces]; - // 获取网络名称 + // get the network names const networkDetails = await Promise.all(networkPromises); networkDetails.forEach((network, index) => { ret[index].network_name = network.name; // ret[index]['router:external'] = network['router:external']; }); - // 提供判断是否为外部网络的网卡 + // check whether it is the port of the external network const externalNetworks = await globalNetworkStore.pureFetchList({ 'router:external': true, }); @@ -175,7 +175,7 @@ export async function getReasonForExternalNetworkPortOrAlreadyBindFip( } }); - // 提供判断是否已经绑定了浮动ip + // check whether a FIP has been bound const floatingIPs = await Promise.all(floatingIPPromises); floatingIPs.forEach((floatingip, index) => { ret[index].floatingIP = @@ -194,7 +194,7 @@ export async function getReasonForExternalNetworkPortOrAlreadyBindFip( */ export async function getFipsFromRouterId(router) { const { routerIdWithExternalNetworkInfo } = this.state; - // 从路由id获取路由的external_network_id + // get the external_network_id of the route from the current router const info = routerIdWithExternalNetworkInfo.find( (i) => i.id === router.router_id ); @@ -202,13 +202,13 @@ export async function getFipsFromRouterId(router) { return []; } const external_network_id = info.external_gateway_info.network_id; - // 获取所有network_id === 从路由id获取路由的external_network_id的浮动ip + // get all the FIPs of the external network which connected to the current router const fips = await globalFloatingIpsStore.pureFetchList({ floating_network_id: external_network_id, status: 'DOWN', project_id: this.currentProjectId, }); - // 获取外部网络的名称 + // get the external network's name const external_network_info = await globalNetworkStore.fetchDetail({ id: external_network_id, }); @@ -235,8 +235,8 @@ export async function handleFixedIPChange(e) { } const item = e.selectedRows[0]; const totalFips = []; - // 考虑单subnet连接多个路由,并且路由开启了不同的公网网关。 - // 从interface的子网获取到子网所在路由的id + // Consider that one subnet can connect to multi routes, and the routes can open diffent external gateways. + // Get the id of the route where the subnet is located from the subnet of the interface const routerIds = canReachSubnetIdsWithRouterId.filter( (i) => i.subnet_id === item.subnet_id ); diff --git a/src/resources/neutron/port.jsx b/src/resources/neutron/port.jsx index ca1640b0..6541b3e7 100644 --- a/src/resources/neutron/port.jsx +++ b/src/resources/neutron/port.jsx @@ -50,19 +50,19 @@ export function getPortsAndReasons( let available = true; let reason = ''; const name = it.fixed_ip_address; - // ipv6不可绑定浮动ip + // IPv6 cannot bind to floating ip if (!isIPv4(name)) { reason = `${t('It is IPv6 type.')}`; available = false; - // 外部网络 + // external network } else if (it['router:external']) { reason = t('Is external network port'); available = false; - // 绑定过浮动ip了 + // already has FIP } else if (it.floatingIP) { reason = `${t('Is associate to floating ip: ')} ${it.floatingIP}`; available = false; - // 所有浮动ip均不可达的子网 + // subnet unreachable by all FIPs } else if ( canReachSubnetIdsWithRouterId.findIndex( (item) => item.subnet_id === it.subnet_id diff --git a/src/resources/neutron/router.jsx b/src/resources/neutron/router.jsx index ca879758..4eed1a32 100644 --- a/src/resources/neutron/router.jsx +++ b/src/resources/neutron/router.jsx @@ -139,7 +139,7 @@ export async function getLinkedRouterIdsByFip(project_id, item) { } /** - * 获取当前项目下所有的subnet=>router的映射 + * Get all subnet=>router mappings under the current project * @param project_id * @returns {Promise<[]>} */ @@ -147,8 +147,8 @@ export async function getCanReachSubnetIdsWithRouterId( project_id, routerFilterFunc ) { - // 获取所有路由器的id和external_gateway_info - // 并保存router_id => external_network_id的映射 + // get the router's id and external gateway + // make a map: router_id => external_network_id let routerIdWithExternalNetworkInfo = await getRoutersWithIDAndExtInfo( project_id ); @@ -157,7 +157,7 @@ export async function getCanReachSubnetIdsWithRouterId( routerIdWithExternalNetworkInfo.filter(routerFilterFunc); } const portsWithFixedIPs = await getPortsWithFixedIPs(); - // 获取所有路由器所绑定的子网的Gateway info => 即获取所有路由器绑定的子网IP + // Get the gateways of the subnets bound to the routers, can get the subnet IPs bound to the routers. const canReachSubnetIdsWithRouterId = getSubnetToRouter( portsWithFixedIPs, routerIdWithExternalNetworkInfo diff --git a/src/stores/neutron/network.js b/src/stores/neutron/network.js index 751e883c..159be8e7 100644 --- a/src/stores/neutron/network.js +++ b/src/stores/neutron/network.js @@ -167,7 +167,7 @@ export class NetworkStore extends Base { projectName: projectDetail.name, }; - // 处理使用IP数量,只有管理员或者当前网络所有者才能查看 + // Only the administrator or the current network owner can view the number of IP addresses used if (isAdminPage || currentProjectId === originData.project_id) { const used = await this.ipClient.show(id); this.detail = { diff --git a/src/stores/nova/hypervisor.js b/src/stores/nova/hypervisor.js index 2ecf25b9..1518d220 100644 --- a/src/stores/nova/hypervisor.js +++ b/src/stores/nova/hypervisor.js @@ -103,7 +103,7 @@ export class HypervisorStore extends Base { const provider = (resource_providers || []).filter((it) => it.uuid !== id); const promiseArr = [this.providerClient.inventories.list(id)]; if (provider.length) { - // 如果有provider,说明有VGPU + // If there is a provider, the VGPU is available promiseArr.push( this.providerClient.inventories.list(provider[0].uuid), this.providerClient.usages.list(provider[0].uuid) diff --git a/src/utils/index.js b/src/utils/index.js index 8db15838..c23abe24 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -214,7 +214,7 @@ export const getYesNoList = () => [ ]; /** - * 生成一个从 start 到 end 的连续数组,左闭右开, + * Create a contiguous array from start to end, closed on the left and open on the right * @param start * @param end */ diff --git a/src/utils/validate.js b/src/utils/validate.js index 3caa7f03..d071071b 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -170,11 +170,11 @@ const isIpInRangeAll = (ipStr, start, end) => { const compareIpv6 = (ip1, ip2) => { const ip1s = ip1.split(':'); const ip2s = ip2.split(':'); - // 循环比较对应的项 + // loop to compare the corresponding items for (let i = 0; i < ip1s.length; i++) { if (ip1s[i] === '') { if (ip2s[i] === '') { - // 对应的项都位空,往下比较 + // The corresponding items are all empty, compare next // eslint-disable-next-line no-continue continue; } else { @@ -183,7 +183,7 @@ const compareIpv6 = (ip1, ip2) => { } else if (ip2s[i] === '') { return 1; } else { - // 确定对应的项不位空,讲字符串转换位整数进行比较 + // make sure the corresponding item is not empty, convert the string to an integer for comparison const value1 = parseInt(ip1s[i], 16); const value2 = parseInt(ip2s[i], 16); if (value1 > value2) { @@ -196,7 +196,7 @@ const compareIpv6 = (ip1, ip2) => { continue; } } - // 循环结束,表示两个串表示的地址相同 + // the loop ends, indicating that both strings represent the same address return 0; };