diff --git a/console/src/main/resources/static/console-fe/src/locales/en-US.js b/console/src/main/resources/static/console-fe/src/locales/en-US.js
index 11f2b92f8..067563e1a 100644
--- a/console/src/main/resources/static/console-fe/src/locales/en-US.js
+++ b/console/src/main/resources/static/console-fe/src/locales/en-US.js
@@ -39,8 +39,93 @@ const I18N_CONF = {
namespace: 'Namespace',
},
NameSpace: {
+ namespace: 'Namespaces',
prompt: 'Notice',
namespaceDetails: 'Namespace details',
+ namespaceName: 'Name',
+ namespaceID: 'ID:',
+ configuration: 'Number of Configurations',
+ description: 'Description',
+ removeNamespace: 'Remove the namespace',
+ confirmDelete: 'Sure you want to delete the following namespaces?',
+ configurationManagement: 'Configurations',
+ removeSuccess: 'Remove the namespace success',
+ deletedSuccessfully: 'Deleted successfully',
+ deletedFailure: 'Delete failed',
+ namespaceDelete: 'Delete',
+ details: 'Details',
+ edit: 'Edit',
+ namespacePublic: 'public(to retain control)',
+ pubNoData: 'No results found.',
+ namespaceAdd: 'Create Namespace',
+ namespaceNames: 'Namespaces',
+ namespaceNumber: 'Namespace ID',
+ namespaceOperation: 'Actions',
+ },
+ ServiceList: {
+ serviceList: 'Service List',
+ serviceName: 'Service Name',
+ serviceNamePlaceholder: 'Enter Service Name',
+ query: 'Search',
+ pubNoData: 'No results found.',
+ columnServiceName: 'Service Name',
+ columnClusterCount: 'Cluster Count',
+ columnIpCount: 'Instance Count',
+ columnHealthyInstanceCount: 'Healthy Instance Count',
+ operation: 'Operation',
+ detail: 'Details',
+ deleteAction: 'Delete',
+ prompt: 'Confirm',
+ promptDelete: 'Do you want to delete the service?',
+ create: 'Create Service',
+ },
+ EditClusterDialog: {
+ updateCluster: 'Update Cluster',
+ checkType: 'Check Type',
+ checkPort: 'Check Port',
+ useIpPortCheck: 'Use port of IP',
+ checkPath: 'Check Path',
+ checkHeaders: 'Check Headers',
+ metadata: 'Metadata',
+ },
+ ServiceDetail: {
+ serviceDetails: 'Service Details',
+ back: 'Back',
+ editCluster: 'Edit Cluster',
+ cluster: 'Cluster',
+ metadata: 'Metadata',
+ healthCheckPattern: 'Health check pattern',
+ protectThreshold: 'Protect Threshold',
+ serviceName: 'Service Name',
+ editService: 'Edit Service',
+ },
+ EditServiceDialog: {
+ createService: 'Create Service',
+ updateService: 'Edit Service',
+ serviceName: 'Service Name',
+ metadata: 'Metadata',
+ protectThreshold: 'Protect Threshold',
+ healthCheckPattern: 'Health check pattern',
+ healthCheckPatternService: 'Service',
+ healthCheckPatternClient: 'Client',
+ healthCheckPatternNone: 'None',
+ },
+ InstanceTable: {
+ operation: 'Operation',
+ port: 'Port',
+ weight: 'Weight',
+ healthy: 'Healthy',
+ metadata: 'Metadata',
+ editor: 'Edit',
+ offline: 'Offline',
+ online: 'Online',
+ },
+ EditInstanceDialog: {
+ port: 'Port',
+ weight: 'Weight',
+ metadata: 'Metadata',
+ updateInstance: 'Update Instance',
+ whetherOnline: 'Whether Online',
},
};
export default I18N_CONF;
diff --git a/console/src/main/resources/static/console-fe/src/locales/zh-CN.js b/console/src/main/resources/static/console-fe/src/locales/zh-CN.js
index d52e021e4..b7bca6d65 100644
--- a/console/src/main/resources/static/console-fe/src/locales/zh-CN.js
+++ b/console/src/main/resources/static/console-fe/src/locales/zh-CN.js
@@ -39,8 +39,93 @@ const I18N_CONF = {
namespace: '命名空间',
},
NameSpace: {
+ namespace: '命名空间',
prompt: '提示',
namespaceDetails: '命名空间详情',
+ namespaceName: '命名空间名称',
+ namespaceID: '命名空间ID',
+ configuration: '配置数',
+ description: '描述',
+ removeNamespace: '删除命名空间',
+ confirmDelete: '确定要删除以下命名空间吗?',
+ configurationManagement: '配置列表',
+ removeSuccess: '删除命名空间成功',
+ deletedSuccessfully: '删除成功',
+ deletedFailure: '删除失败',
+ namespaceDelete: '删除',
+ details: '详情',
+ edit: '编辑',
+ namespacePublic: 'public(保留控件)',
+ pubNoData: '没有数据',
+ namespaceAdd: '新建命名空间',
+ namespaceNames: '命名空间名称',
+ namespaceNumber: '命名空间ID',
+ namespaceOperation: '操作',
+ },
+ ServiceList: {
+ serviceList: '服务列表',
+ serviceName: '服务名称',
+ serviceNamePlaceholder: '请输入服务名称',
+ query: '查询',
+ pubNoData: '没有数据',
+ columnServiceName: '服务名',
+ columnClusterCount: '集群数目',
+ columnIpCount: '实例数',
+ columnHealthyInstanceCount: '健康实例数',
+ operation: '操作',
+ detail: '详情',
+ deleteAction: '删除',
+ prompt: '提示',
+ promptDelete: '确定要删除当前服务吗?',
+ create: '创建服务',
+ },
+ EditClusterDialog: {
+ updateCluster: '更新集群',
+ checkType: '检查类型',
+ checkPort: '检查端口',
+ useIpPortCheck: '使用IP端口检查',
+ checkPath: '检查路径',
+ checkHeaders: '检查头',
+ metadata: '元数据',
+ },
+ ServiceDetail: {
+ serviceDetails: '服务详情',
+ back: '返回',
+ editCluster: '集群配置',
+ cluster: '集群',
+ metadata: '元数据',
+ healthCheckPattern: '健康检查模式',
+ protectThreshold: '保护阀值',
+ serviceName: '服务名',
+ editService: '编辑服务',
+ },
+ EditServiceDialog: {
+ createService: '创建服务',
+ updateService: '更新服务',
+ serviceName: '服务名',
+ metadata: '元数据',
+ protectThreshold: '保护阀值',
+ healthCheckPattern: '健康检查模式',
+ healthCheckPatternService: '服务端',
+ healthCheckPatternClient: '客户端',
+ healthCheckPatternNone: '禁止',
+ },
+ InstanceTable: {
+ operation: '操作',
+ port: '端口',
+ weight: '权重',
+ healthy: '健康状态',
+ metadata: '元数据',
+ editor: '编辑',
+ offline: '下线',
+ online: '上线',
+ },
+ EditInstanceDialog: {
+ port: '端口',
+ weight: '权重',
+ metadata: '元数据',
+ updateInstance: '编辑实例',
+ whetherOnline: '是否上线',
},
};
export default I18N_CONF;
diff --git a/console/src/main/resources/static/console-fe/src/pages/NameSpace/NameSpace.js b/console/src/main/resources/static/console-fe/src/pages/NameSpace/NameSpace.js
index 2c2dae9f9..7a719facf 100644
--- a/console/src/main/resources/static/console-fe/src/pages/NameSpace/NameSpace.js
+++ b/console/src/main/resources/static/console-fe/src/pages/NameSpace/NameSpace.js
@@ -17,12 +17,10 @@ import RegionGroup from '../../components/RegionGroup';
import DeleteDialog from '../../components/DeleteDialog';
import NewNameSpace from '../../components/NewNameSpace';
import EditorNameSpace from '../../components/EditorNameSpace';
-import { getParams, setParams, request, aliwareIntl } from '../../globalLib';
-import { connect } from 'react-redux';
+import { getParams, setParams, request } from '../../globalLib';
import './index.scss';
-@connect(state => ({ ...state.locale }))
@ConfigProvider.config
class NameSpace extends React.Component {
static displayName = 'NameSpace';
@@ -44,7 +42,6 @@ class NameSpace extends React.Component {
const { locale = {} } = this.props;
const { prompt } = locale;
const self = this;
- // let serverId = getParams('serverId') || 'center';
self.openLoading();
setTimeout(() => {
request({
@@ -104,7 +101,7 @@ class NameSpace extends React.Component {
detailNamespace(record) {
const { locale = {} } = this.props;
- const { namespaceDetails } = locale;
+ const { namespaceDetails, namespaceName, namespaceID, configuration, description } = locale;
const { namespace } = record; // 获取ak,sk
request({
url: `v1/console/namespaces?show=all&namespaceId=${namespace}`,
@@ -121,29 +118,21 @@ class NameSpace extends React.Component {
-
- {aliwareIntl.get('nacos.page.namespace.namespace_name')}
-
+ {`${namespaceName}:`}
{res.namespaceShowName}
-
- {aliwareIntl.get('nacos.page.namespace.namespace_ID')}
-
+ {`${namespaceID}:`}
{res.namespace}
-
- {aliwareIntl.get('com.alibaba.nacos.page.namespace.configuration')}
-
+ {`${configuration}:`}
{res.configCount} / {res.quota}
-
- {aliwareIntl.get('nacos.page.configdetail.Description')}
-
+ {`${description}:`}
{res.namespaceDesc}
@@ -159,31 +148,32 @@ class NameSpace extends React.Component {
}
removeNamespace(record) {
- // let serverId = getParams('serverId') || 'center';
+ const { locale = {} } = this.props;
+ const {
+ removeNamespace,
+ confirmDelete,
+ namespaceName,
+ namespaceID,
+ configurationManagement,
+ removeSuccess,
+ deletedSuccessfully,
+ deletedFailure,
+ } = locale;
Dialog.confirm({
- title: aliwareIntl.get('nacos.page.namespace.remove_the_namespace'),
+ title: removeNamespace,
content: (
-
- {aliwareIntl.get(
- 'nacos.page.namespace.sure_you_want_to_delete_the_following_namespaces?'
- )}
-
+
{confirmDelete}
-
- {aliwareIntl.get('nacos.page.namespace.namespace_name')}
-
+ {`${namespaceName}:`}
{record.namespaceShowName}
-
- {aliwareIntl.get('nacos.page.namespace.namespace_ID')}
-
+ {`${namespaceID}:`}
{record.namespace}
),
- language: aliwareIntl.currentLanguageCode || 'zh-cn',
onOk: () => {
const url = `v1/console/namespaces?namespaceId=${record.namespace}`;
request({
@@ -191,27 +181,16 @@ class NameSpace extends React.Component {
type: 'delete',
success: res => {
const _payload = {};
- _payload.title = aliwareIntl.get(
- 'com.alibaba.nacos.page.configurationManagement.configuration_management'
- );
+ _payload.title = configurationManagement;
if (res === true) {
const urlnamespace = getParams('namespace');
if (record.namespace === urlnamespace) {
setParams('namespace', this.state.defaultNamespace);
}
- Dialog.confirm({
- language: aliwareIntl.currentLanguageCode || 'zh-cn',
- content: aliwareIntl.get('nacos.page.namespace._Remove_the_namespace_success'),
- title: aliwareIntl.get('nacos.page.namespace.deleted_successfully'),
- });
+ Dialog.confirm({ content: removeSuccess, title: deletedSuccessfully });
} else {
- Dialog.confirm({
- language: aliwareIntl.currentLanguageCode || 'zh-cn',
- content: res.message,
- title: '删除失败',
- });
+ Dialog.confirm({ content: res.message, title: deletedFailure });
}
-
this.getNameSpaces();
},
});
@@ -245,33 +224,31 @@ class NameSpace extends React.Component {
}
renderOption(value, index, record) {
+ const { locale = {} } = this.props;
+ const { namespaceDelete, details, edit } = locale;
let _delinfo = (
- {aliwareIntl.get('com.alibaba.nacos.page.namespace.delete')}
+ {namespaceDelete}
);
if (record.type === 1 || record.type === 0) {
_delinfo = (
- {aliwareIntl.get('com.alibaba.nacos.page.namespace.delete')}
+ {namespaceDelete}
);
}
const _detailinfo = (
- {aliwareIntl.get('nacos.page.namespace.details')}
+ {details}
);
- let _editinfo = (
-
- {aliwareIntl.get('com.alibaba.nacos.page.namespace.edit')}
-
- );
+ let _editinfo =
{edit};
if (record.type === 0 || record.type === 1) {
_editinfo = (
- {aliwareIntl.get('com.alibaba.nacos.page.namespace.edit')}
+ {edit}
);
}
@@ -289,9 +266,11 @@ class NameSpace extends React.Component {
}
renderName(value, index, record) {
+ const { locale = {} } = this.props;
+ const { namespacePublic } = locale;
let name = record.namespaceShowName;
if (record.type === 0) {
- name = aliwareIntl.get('com.alibaba.nacos.page.namespace.public');
+ name = namespacePublic;
}
return
{name}
;
}
@@ -305,14 +284,19 @@ class NameSpace extends React.Component {
}
render() {
- const pubnodedata = aliwareIntl.get('pubnodata');
-
- const locale = {
- empty: pubnodedata,
- };
+ const { locale = {} } = this.props;
+ const {
+ pubNoData,
+ namespace,
+ namespaceAdd,
+ namespaceNames,
+ namespaceNumber,
+ configuration,
+ namespaceOperation,
+ } = locale;
return (
-
+
- {aliwareIntl.get('com.alibaba.nacos.page.namespace.add')}
+ {namespaceAdd}
-
+
+
-
@@ -362,8 +339,8 @@ class NameSpace extends React.Component {
-
-
+
+
diff --git a/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceDetail/EditClusterDialog.js b/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceDetail/EditClusterDialog.js
index 82785d369..40d4ee98c 100644
--- a/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceDetail/EditClusterDialog.js
+++ b/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceDetail/EditClusterDialog.js
@@ -13,10 +13,13 @@
import React from 'react';
import { request } from '../../../globalLib';
-import { Dialog, Form, Input, Switch, Select, Message } from '@alifd/next';
-import { I18N, DIALOG_FORM_LAYOUT } from './constant';
+import { Dialog, Form, Input, Switch, Select, Message, ConfigProvider } from '@alifd/next';
+import { DIALOG_FORM_LAYOUT } from './constant';
+@ConfigProvider.config
class EditClusterDialog extends React.Component {
+ static displayName = 'EditClusterDialog';
+
constructor(props) {
super(props);
this.state = {
@@ -85,6 +88,8 @@ class EditClusterDialog extends React.Component {
}
render() {
+ const { locale = {} } = this.props;
+ const { updateCluster, checkType, checkPort, useIpPortCheck, checkPath, checkHeaders } = locale;
const { editCluster = {}, editClusterDialogVisible } = this.state;
const {
healthChecker = {},
@@ -100,14 +105,14 @@ class EditClusterDialog extends React.Component {
return (